|
Sequential Quantum Gate Decomposer
v1.9.7
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Functions | |
| def | create_custom_gate_structure_QX2 (qbit_num) |
Variables | |
| Circuit_ret = Circuit( qbit_num ) | |
| decomp = N_Qubit_Decomposition( Umtx.conj().T ) | |
| [create umtx] More... | |
| decomposed_matrix = utils.get_unitary_from_qiskit_circuit( quantum_circuit ) | |
| tuple | decomposition_error = (np.real(np.trace(product_matrix)))/2 |
| int | disentangle_qbit = qbit_num - 1 |
| [import gates block] More... | |
| dictionary | gate_structure = { 4: create_custom_gate_structure_QX2(4), 3: create_custom_gate_structure_QX2(3)} |
| [reorder qubits] More... | |
| Layer = Circuit( qbit_num ) | |
| [disentangle_qbit] More... | |
| matrix_size = int(2**qbit_num) | |
| [set number qubits] More... | |
| phase = np.angle(product_matrix[0,0]) | |
| product_matrix = np.dot(Umtx,decomposed_matrix.conj().T) | |
| int | qbit_num = 4 |
| [set number qubits] the number of qubits spanning the unitary More... | |
| quantum_circuit = decomp.get_Qiskit_Circuit() | |
| [revert original labeling] More... | |
| tuple | reordered_qbits = (0,1,3,2) |
| [create decomp class] More... | |
| tuple | revert_qbits = (1,0,2,3) |
| [set gate structure] More... | |
| Umtx = unitary_group.rvs(matrix_size) | |
| def example_QX2_general_unitary.create_custom_gate_structure_QX2 | ( | qbit_num | ) |
This method is called to create custom gate structure for the decomposition on IBM QX2
Definition at line 32 of file example_QX2_general_unitary.py.
| example_QX2_general_unitary.Circuit_ret = Circuit( qbit_num ) |
Definition at line 42 of file example_QX2_general_unitary.py.
| example_QX2_general_unitary.decomp = N_Qubit_Decomposition( Umtx.conj().T ) |
[create umtx]
[create decomp class] creating an instance of the C++ class
Definition at line 115 of file example_QX2_general_unitary.py.
| example_QX2_general_unitary.decomposed_matrix = utils.get_unitary_from_qiskit_circuit( quantum_circuit ) |
Definition at line 171 of file example_QX2_general_unitary.py.
| tuple example_QX2_general_unitary.decomposition_error = (np.real(np.trace(product_matrix)))/2 |
Definition at line 178 of file example_QX2_general_unitary.py.
[import gates block]
[disentangle_qbit]
Definition at line 46 of file example_QX2_general_unitary.py.
| dictionary example_QX2_general_unitary.gate_structure = { 4: create_custom_gate_structure_QX2(4), 3: create_custom_gate_structure_QX2(3)} |
[reorder qubits]
[set gate structure] create custom gate structure
Definition at line 128 of file example_QX2_general_unitary.py.
| example_QX2_general_unitary.Layer = Circuit( qbit_num ) |
[disentangle_qbit]
[create layer] creating an instance of the wrapper class Circuit
Definition at line 55 of file example_QX2_general_unitary.py.
[set number qubits]
[create umtx] determine the soze of the unitary to be decomposed
Definition at line 107 of file example_QX2_general_unitary.py.
| example_QX2_general_unitary.phase = np.angle(product_matrix[0,0]) |
Definition at line 173 of file example_QX2_general_unitary.py.
Definition at line 172 of file example_QX2_general_unitary.py.
| int example_QX2_general_unitary.qbit_num = 4 |
[set number qubits] the number of qubits spanning the unitary
Definition at line 102 of file example_QX2_general_unitary.py.
| example_QX2_general_unitary.quantum_circuit = decomp.get_Qiskit_Circuit() |
[revert original labeling]
[list gates] list the decomposing operations [list gates] [qiskit] get the decomposing operations
Definition at line 165 of file example_QX2_general_unitary.py.
| tuple example_QX2_general_unitary.reordered_qbits = (0,1,3,2) |
[create decomp class]
[reorder qubits] list of reordered qubits (original: (3,2,1,0) )
Definition at line 120 of file example_QX2_general_unitary.py.
| tuple example_QX2_general_unitary.revert_qbits = (1,0,2,3) |
[set gate structure]
[set max layers] set the maximal number of layers in the decomposition [set max layers] [set opt blocks] set the number of block to be optimized in one shot [set opt blocks] [start decomp] starting the decomposition [start decomp] [revert original labeling] list of reordered qubits to revert the initial order
Definition at line 152 of file example_QX2_general_unitary.py.
| example_QX2_general_unitary.Umtx = unitary_group.rvs(matrix_size) |
Definition at line 110 of file example_QX2_general_unitary.py.
1.8.13