Sequential Quantum Gate Decomposer  v1.9.7
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Functions | Variables
example_QX2_general_unitary Namespace Reference

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)
 

Function Documentation

◆ create_custom_gate_structure_QX2()

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.

Variable Documentation

◆ Circuit_ret

example_QX2_general_unitary.Circuit_ret = Circuit( qbit_num )

Definition at line 42 of file example_QX2_general_unitary.py.

◆ decomp

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.

◆ decomposed_matrix

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.

◆ decomposition_error

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.

◆ disentangle_qbit

int example_QX2_general_unitary.disentangle_qbit = qbit_num - 1

[import gates block]

[disentangle_qbit]

Definition at line 46 of file example_QX2_general_unitary.py.

◆ gate_structure

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.

◆ Layer

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.

◆ matrix_size

example_QX2_general_unitary.matrix_size = int(2**qbit_num)

[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.

◆ phase

example_QX2_general_unitary.phase = np.angle(product_matrix[0,0])

Definition at line 173 of file example_QX2_general_unitary.py.

◆ product_matrix

int example_QX2_general_unitary.product_matrix = np.dot(Umtx,decomposed_matrix.conj().T)

Definition at line 172 of file example_QX2_general_unitary.py.

◆ qbit_num

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.

◆ quantum_circuit

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.

◆ reordered_qbits

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.

◆ revert_qbits

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.

◆ Umtx

example_QX2_general_unitary.Umtx = unitary_group.rvs(matrix_size)

Definition at line 110 of file example_QX2_general_unitary.py.