Genetic Algorithm for VQC ansatz search.
Project description
GA for VQC Ansatz Search
This is a module to support Variational Quantum Circuits by optimizing the ansatz. The ansatz optimization is performed using a Genetic Algorithm, which can be parallelized with GPUs.
For a detailed example of using this package see the https://github.com/tcoulvert/QAE_4_HEP repository.
Installation
Run the following to install:
$ pip install ga-vqc
Contributors
This module was developed through the Caltech SURF program. Special thanks to my mentor at Caltech.
- Jean-Roch (California Institute of Technology, Pasadena, CA 91125, USA)
Usage
import ga_vqc as gav
## Config (hyperparameters) for GA, see full list in example ##
vqc_main = <'Function that handles running your VQC optimization'>
# Example of allowed optimization gates, see Genepool.py for documentation
gates_dict = {"I": (1, 0), "RX": (1, 1), "CNOT": (2, 0)}
gates_probs = [0.35, 0.35, 0.3]
genepool = gav.Genepool(gates_dict, gates_probs)
vqc_config = {
'num_qubits': 3,
'etc': <'whatever config params your VQC model requires'>
}
ga_output_path = FILEPATH_FOR_GA_OUTPUT
config = gav.Config(vqc_main, vqc_config, genepool, ga_output_path)
# Create the GA with the given hyperparameters
ga = gav.setup(config)
# Evolve the GA and search for the best ansatz
ga.evolve()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ga_vqc-1.0.13.tar.gz.
File metadata
- Download URL: ga_vqc-1.0.13.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/6.6.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e092ab0c04322d268a1cebe69fa87d7ae777f94e86540cabc05cbd7db4bbac3
|
|
| MD5 |
db40cd2317bcd4be9ea0a6c8f16dad02
|
|
| BLAKE2b-256 |
a8ad00a37e9db95dfa5a3ca03af71996b6c72da1bf84cce4e43456564144cbae
|
File details
Details for the file ga_vqc-1.0.13-py3-none-any.whl.
File metadata
- Download URL: ga_vqc-1.0.13-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/6.6.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be4ed91424417ae99b3808636cbecd51793161ab9ccea959e6d1f6c6bb644592
|
|
| MD5 |
bb36745d8e1b2917a1385dd90c423e76
|
|
| BLAKE2b-256 |
5e906d1fd7cb32367b8cbd8443809130a9b2871e00db42b60f45a6430adce4d0
|