This project was built by members of Team #5 at the NTU-Qiskit Hackathon Taiwan 2023 and major maintenanced by Yu-Cheng Chung. This project focuses on performing Quantum State Preparation by utilizing a modification of a genetic algorithm structure.
graph
A(Initialize Population)
F(End)
B[[Evaluate Genes]]
C[[Generate Parents]]
D[Crossover & Mutation]
E[iter += 1]
if2{have gene fidelity<br/> > threshold}
if1{iter < maxiter}
A --> B --> if2
C --> D --> A
if1--> |no| F
if2-->|no| F
if2-->|yes| E--> if1
if1-->|yes| C
graph LR
subgraph Evaluate Genes
subA[/gene/]
subB[optimize]
subC[/depth/]
subD[/fidelity/]
subA---subB-->subC
subB-->subD
end
graph LR
subgraph Generate Parents
sub(entry point)
subC{have more than two<br/>fidelity >= filter}
subD[get 10 or less<br/>smallest depth]
subE[filter -= 0.01]
subG[/smallest genes/]
subH(return)
sub-->subC
subC --> |no|subE -->subC
subC --> |yes|subD -->subG -->subH
end
Generate Gene using the matrix look like below,
Here, (gate, control)
, where:
-
gate
is the index of the gate ingene_gates
. -
control
is the index of the control qubit (if the gate has no control, the control value is ignored).
-
Use basis gate in real computer to generate the circuit: CZ, ID, RZ, SX, X.
-
Use empty gate to reduce depth of the circuit.
-
use high level to generate the circuit: RX, RY, RZ, CX.
-
Add more rule when generate:
-
do not allow same rotate gate continuously.
-
do not allow more than three rotation gate in a rotation chain continnously.
-
- circuit
- probability distribution
- depth v.s. iter
- circuit
- probability distribution
- depth v.s. iter
This project was built using Python 3.8.5. The required packages can be installed using the following command:
pip install -r requirement/requirement.txt
For cuda11.
pip install -r requirement/requirement-cu11.txt
For cuda12.
pip install -r requirement/requirement-cu12.txt