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()
Release files for ga-vqc 1.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ga_vqc-1.0.14.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ga_vqc-1.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.2 kB
Release files / ga_vqc-1.0.14.tar.gz
| Download URL | ga_vqc-1.0.14.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea7254afc7afa2ff827c463cd1f18d982f0b423af4438d6dec7df97fbabf761b
|
|
BLAKE2b-256 checksum How to use checksums |
0d508570a2d00eadddc24c348a33383762fe5841135e395d327390fb6324a950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Release files / ga_vqc-1.0.14-py3-none-any.whl
| Download URL | ga_vqc-1.0.14-py3-none-any.whl |
|---|---|
| Size | 20.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3bcf05e19b0715242629352c0f51672300544454d1e0e78e1bda97908693710
|
|
BLAKE2b-256 checksum How to use checksums |
4e81e0d43efec61ae6fb9d9fcde1115eeb7144dbdf716a690e1ef6df67943f17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|