Sequential Quantum Gate Decomposer
v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Classes | |
class | qgd_N_Qubit_Decomposition_custom |
A QGD Python interface class for the decomposition of N-qubit unitaries into U3 and CNOT gates. More... | |
Functions | |
def | __init__ (self, Umtx, initial_guess="RANDOM", config={}, accelerator_num=0) |
Constructor of the class. More... | |
def | get_Circuit (self) |
Call to retrieve the incorporated quantum circuit (Squander format) More... | |
def | get_Cirq_Circuit (self) |
Export the unitary decomposition into Qiskit format. More... | |
def | get_Optimized_Parameters (self) |
Call to get the optimized parameters set in numpy array. More... | |
def | get_Qiskit_Circuit (self) |
Export the unitary decomposition into Qiskit format. More... | |
def | import_Qiskit_Circuit (self, qc_in) |
Call to import initial quantum circuit in QISKIT format to be further comporessed. More... | |
def | List_Gates (self) |
Call to print the gates decomposing the initial unitary. More... | |
def | Optimization_Problem (self, parameters=None) |
Call to evaluate the cost function. More... | |
def | Prepare_Gates_To_Export (self) |
Call to prepare the circuit to be exported into Qiskit format. More... | |
def | Reorder_Qubits (self, qbit_list) |
Call to reorder the qubits in the matrix of the gate. More... | |
def | set_Cost_Function_Variant (self, costfnc=0) |
Call to set the optimizer used in the gate synthesis process. More... | |
def | set_Gate_Structure (self, Gate_structure) |
Call to set custom gate structure to used in the decomposition. More... | |
def | set_Optimizer (self, optimizer="BFGS") |
Call to set the optimizer used in the gate synthesis process. More... | |
def | Start_Decomposition (self) |
Wrapper function to call the start_decomposition method of C++ class N_Qubit_Decomposition. More... | |
Variables | |
qbit_num | |
the number of qubits More... | |
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.__init__ | ( | self, | |
Umtx, | |||
initial_guess = "RANDOM" , |
|||
config = {} , |
|||
accelerator_num = 0 |
|||
) |
Constructor of the class.
Umtx | The unitary matrix to be decomposed. |
optimize_layer_num | Set true to optimize the minimum number of operation layers required in the decomposition, or false when the predefined maximal number of layer gates is used (ideal for general unitaries). |
initial_guess | String indicating the method to guess initial values for the optimalization. Possible values: "zeros" ,"random", "close_to_zero". |
Definition at line 46 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.get_Circuit | ( | self | ) |
Call to retrieve the incorporated quantum circuit (Squander format)
Definition at line 89 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.get_Cirq_Circuit | ( | self | ) |
Export the unitary decomposition into Qiskit format.
Definition at line 133 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.get_Optimized_Parameters | ( | self | ) |
Call to get the optimized parameters set in numpy array.
Definition at line 109 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.get_Qiskit_Circuit | ( | self | ) |
Export the unitary decomposition into Qiskit format.
Definition at line 97 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.import_Qiskit_Circuit | ( | self, | |
qc_in | |||
) |
Call to import initial quantum circuit in QISKIT format to be further comporessed.
qc_in | The quantum circuit to be imported |
Definition at line 216 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.List_Gates | ( | self | ) |
Call to print the gates decomposing the initial unitary.
These gates brings the intial matrix into unity.
Definition at line 80 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.Optimization_Problem | ( | self, | |
parameters = None |
|||
) |
Call to evaluate the cost function.
parameters | A float64 numpy array. The number of parameters can be retrieved with method get_Parameter_Num |
Definition at line 116 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.Prepare_Gates_To_Export | ( | self | ) |
Call to prepare the circuit to be exported into Qiskit format.
(parameters and gates gets bound together, gate block structure is converted to plain structure).
Definition at line 242 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.Reorder_Qubits | ( | self, | |
qbit_list | |||
) |
Call to reorder the qubits in the matrix of the gate.
qbit_list | The reordered list of qubits spanning the matrix |
Definition at line 72 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.set_Cost_Function_Variant | ( | self, | |
costfnc = 0 |
|||
) |
Call to set the optimizer used in the gate synthesis process.
costfnc | Variant of the cost function. Input argument 0 stands for FROBENIUS_NORM, 1 for FROBENIUS_NORM_CORRECTION1, 2 for FROBENIUS_NORM_CORRECTION2 |
Definition at line 266 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.set_Gate_Structure | ( | self, | |
Gate_structure | |||
) |
Call to set custom gate structure to used in the decomposition.
Gate_structure | An instance of Gates_Block |
Definition at line 251 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.set_Optimizer | ( | self, | |
optimizer = "BFGS" |
|||
) |
Call to set the optimizer used in the gate synthesis process.
optimizer | String indicating the optimizer. Possible values: "BFGS" ,"ADAM", "BFGS2", "AGENTS", "COSINE", "AGENTS_COMBINED". |
Definition at line 233 of file qgd_N_Qubit_Decomposition_custom.py.
def squander.decomposition.qgd_N_Qubit_Decomposition_custom.Start_Decomposition | ( | self | ) |
Wrapper function to call the start_decomposition method of C++ class N_Qubit_Decomposition.
Definition at line 63 of file qgd_N_Qubit_Decomposition_custom.py.
squander.decomposition.qgd_N_Qubit_Decomposition_custom.qbit_num |
the number of qubits
Definition at line 49 of file qgd_N_Qubit_Decomposition_custom.py.