Registry / ai-ml / ga-vqc

ga-vqc

JSON →
library1.0.14pypypiunverified

GA-VQC provides a genetic algorithm to automatically search for optimal variational quantum circuit (VQC) ansätze for quantum machine learning tasks. Version 1.0.14 is the latest; development appears to be active on GitHub.

pip install ga-vqc
INSTALL
IMPORT
SIG · GA-VQC
G
ga-vqc
ai-mlpythonv1.0.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GenAlg
from gavqc import GenAlg
from ga_vqc import GenAlg
Module name uses lowercase 'gavqc', not hyphen or underscore.
VQCAnsatz
from gavqc import VQCAnsatz
from ga_vqc.ansatz import VQCAnsatz
VQCAnsatz is exported from top-level gavqc.

Minimal example to run genetic algorithm for VQC ansatz search.

from gavqc import GenAlg from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import RealAmplitudes import numpy as np # Example: optimize a simple circuit structure ansatz = RealAmplitudes(2, reps=1) X = np.random.rand(10, 2) y = np.random.randint(0, 2, 10) ga = GenAlg( ansatz=ansatz, X=X, y=y, generations=10, population_size=10, mutation_rate=0.1 ) ga.run() print("Best fitness:", ga.best_fitness) print("Best circuit:", ga.best_circuit)
Debug
Known issues
breakingImport path changed: module name is 'gavqc' (not 'ga_vqc' or 'ga-vqc').
fix
Use 'from gavqc import ...' instead of 'import ga_vqc'.
affects: >=1.0.0
gotchaGenAlg.run() modifies the instance; best circuit stored in GenAlg.best_circuit attribute.
fix
Access results via the GenAlg instance after calling run().
affects: all
deprecatedSupport for Qiskit <0.45 is dropped.
fix
Upgrade to Qiskit 0.45+.
affects: >=1.0.10
Upgrade
Version history
1.0.14latest on PyPI · released Jan 28, 2024
Audit
Dependencies
numpyrequiredNumerical operations
scikit-learnrequiredMachine learning utilities
qiskitrequiredQuantum computing backend
Agent activity
13 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
ga-vqc — pip install ga-vqc · libregistry