|
Sequential Quantum Gate Decomposer
v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Functions | |
| def | normalize_state (state) |
| def | preprocess_qasm_angles |
| def | projectq_import_qasm (filename, eng, initial_state=None) |
| def | purity_analysis () |
| def | state_vector_equivalence (psi, phi) |
| def | test_partitions (max_qubits=4) |
| def | test_simulation (max_qubits=4, random_initial_state=True) |
Variables | |
| int | MAX_GATES_ALLOWED = 1024**2 |
| list | METHOD_NAMES |
| dictionary | SUPPORTED_GATES = {x for n in dir(gate) for x in (getattr(gate, n),) if not n.startswith("_") and issubclass(x, gate.Gate) and n != "Gate"} |
| dictionary | SUPPORTED_GATES_NAMES = {n for n in dir(gate) if not n.startswith("_") and issubclass(getattr(gate, n), gate.Gate) and n != "Gate"} |
| bool | USE_ILP = True |
| def benchmark.normalize_state | ( | state | ) |
| def benchmark.preprocess_qasm_angles | ( | qasm | ) |
| def benchmark.projectq_import_qasm | ( | filename, | |
| eng, | |||
initial_state = None |
|||
| ) |
| def benchmark.purity_analysis | ( | ) |
Run a small symbolic experiment to study âpurityâ and âsparsityâ of control sets.
This routine builds a set of helper functions and 1q/2q/3q gate factories with SymPy,
then:
1) Checks which qubit subsets act as pure/sparse controls for some canonical gates
(e.g., U3 on 1q, CRY on 2q, CCX on 3q).
2) Composes short circuits (e.g., U3 on qubit i followed by CRY(0,1)) and reports
which control subsets remain pure/sparse after composition.
3) Prints the identified âpureâ and âsparsityâ control sets for each experiment.
Notes:
- Endianness is governed by the local variable `little_endian` (default: True).
- `apply_to` operates on full operators (2^n à 2^n), not statevectors.
- Requires SymPy. The helper `apply_to` also uses `itertools.product`.
Args:
None
Returns:
None
Results are printed to stdout; the function is intended as a diagnostic/demo.
Definition at line 33 of file benchmark.py.

| def benchmark.state_vector_equivalence | ( | psi, | |
| phi | |||
| ) |
Checks if two quantum state vectors are equal up to a global phase.
Definition at line 407 of file benchmark.py.

| def benchmark.test_partitions | ( | max_qubits = 4 | ) |
Benchmark partitioning strategies on QASM circuits
Args:
max_qubits: Max qubits per partition
Definition at line 527 of file benchmark.py.

| def benchmark.test_simulation | ( | max_qubits = 4, |
|
random_initial_state = True |
|||
| ) |
Definition at line 419 of file benchmark.py.


| int benchmark.MAX_GATES_ALLOWED = 1024**2 |
Definition at line 14 of file benchmark.py.
| list benchmark.METHOD_NAMES |
Definition at line 16 of file benchmark.py.
| dictionary benchmark.SUPPORTED_GATES = {x for n in dir(gate) for x in (getattr(gate, n),) if not n.startswith("_") and issubclass(x, gate.Gate) and n != "Gate"} |
Definition at line 30 of file benchmark.py.
| dictionary benchmark.SUPPORTED_GATES_NAMES = {n for n in dir(gate) if not n.startswith("_") and issubclass(getattr(gate, n), gate.Gate) and n != "Gate"} |
Definition at line 31 of file benchmark.py.
| bool benchmark.USE_ILP = True |
Definition at line 12 of file benchmark.py.
1.8.13