Quantum Gate Decomposer  v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
Classes | Functions | Variables
qgd_python.N_Qubit_Decomposition Namespace Reference

Classes

class  N_Qubit_Decomposition
 A QGD Python interface class for the decomposition of N-qubit unitaries into U3 and CNOT gates. More...
 

Functions

def __del__ (self)
 Destructor of the class. More...
 
def get_quantum_circuit (self)
 Export the unitary decomposition into Qiskit format. More...
 
def list_operations (self, start_index=1)
 Lists the operations decomposing the initial unitary. More...
 
def set_identical_blocks (self, identical_blocks)
 Set the number of identical successive blocks during the subdecomposition of the qbit-th qubit. More...
 
def set_iteration_loops (self, iteration_loops)
 Set the number of iteration loops during the subdecomposition of the qbit-th qubit. More...
 
def set_max_layer_num (self, max_layer_num)
 Set the maximal number of layers used in the subdecomposition of the qbit-th qubit. More...
 
def set_optimalization_block (self, optimalization_block)
 Call to set the number of blocks to be optimized in one shot. More...
 
def set_verbose (self, verbose)
 Set the verbosity of the N_Qubit_Decomposition class. More...
 
def start_decomposition (self, finalize_decomposition=True)
 Start the disentanglig process of the least significant two qubit unitary. More...
 

Variables

 _qgd_library = ctypes.cdll.LoadLibrary(library_path)
 The loaded QGD library. More...
 
 argtypes
 
string library_path = '.libs/libqgd.so'
 path to the QGD library More...
 
 restype
 

Function Documentation

◆ __del__()

def qgd_python.N_Qubit_Decomposition.__del__ (   self)

Destructor of the class.

Definition at line 111 of file N_Qubit_Decomposition.py.

◆ get_quantum_circuit()

def qgd_python.N_Qubit_Decomposition.get_quantum_circuit (   self)

Export the unitary decomposition into Qiskit format.

Returns
Return with a Qiskit compatible quantum circuit.

Definition at line 168 of file N_Qubit_Decomposition.py.

◆ list_operations()

def qgd_python.N_Qubit_Decomposition.list_operations (   self,
  start_index = 1 
)

Lists the operations decomposing the initial unitary.

(These operations are the inverse operations of the operations bringing the intial matrix into unity.)

Parameters
start_indexThe index of the first inverse operation

Definition at line 160 of file N_Qubit_Decomposition.py.

◆ set_identical_blocks()

def qgd_python.N_Qubit_Decomposition.set_identical_blocks (   self,
  identical_blocks 
)

Set the number of identical successive blocks during the subdecomposition of the qbit-th qubit.

Parameters
identical_blocksA dictionary {'n': identical_blocks} labeling the number of successive identical layers used in the subdecomposition at the disentangling of the n-th qubit.

Definition at line 150 of file N_Qubit_Decomposition.py.

◆ set_iteration_loops()

def qgd_python.N_Qubit_Decomposition.set_iteration_loops (   self,
  iteration_loops 
)

Set the number of iteration loops during the subdecomposition of the qbit-th qubit.

Parameters
iteration_loopsA dictionary {'n': iteration_loops} labeling the number of iteration loops in each step of the subdecomposition.

Definition at line 140 of file N_Qubit_Decomposition.py.

◆ set_max_layer_num()

def qgd_python.N_Qubit_Decomposition.set_max_layer_num (   self,
  max_layer_num 
)

Set the maximal number of layers used in the subdecomposition of the qbit-th qubit.

Parameters
max_layer_numA dictionary {'n': max_layer_num} labeling the maximal number of the operation layers used in the subdecomposition.

Definition at line 131 of file N_Qubit_Decomposition.py.

◆ set_optimalization_block()

def qgd_python.N_Qubit_Decomposition.set_optimalization_block (   self,
  optimalization_block 
)

Call to set the number of blocks to be optimized in one shot.

Parameters
optimalization_blockThe number of blocks to be optimized in one shot

Definition at line 230 of file N_Qubit_Decomposition.py.

◆ set_verbose()

def qgd_python.N_Qubit_Decomposition.set_verbose (   self,
  verbose 
)

Set the verbosity of the N_Qubit_Decomposition class.

Parameters
verboseSet False to suppress the output messages of the decompostion, or True (deafult) otherwise.

Definition at line 221 of file N_Qubit_Decomposition.py.

◆ start_decomposition()

def qgd_python.N_Qubit_Decomposition.start_decomposition (   self,
  finalize_decomposition = True 
)

Start the disentanglig process of the least significant two qubit unitary.

Parameters
finalize_decompositionOptional logical parameter. If true (default), the decoupled qubits are rotated into state |0> when the disentangling of the qubits is done. Set to False to omit this procedure

Definition at line 122 of file N_Qubit_Decomposition.py.

Variable Documentation

◆ _qgd_library

qgd_python.N_Qubit_Decomposition._qgd_library = ctypes.cdll.LoadLibrary(library_path)
private

The loaded QGD library.

Definition at line 46 of file N_Qubit_Decomposition.py.

◆ argtypes

qgd_python.N_Qubit_Decomposition.argtypes

Definition at line 52 of file N_Qubit_Decomposition.py.

◆ library_path

string qgd_python.N_Qubit_Decomposition.library_path = '.libs/libqgd.so'

path to the QGD library

Definition at line 36 of file N_Qubit_Decomposition.py.

◆ restype

qgd_python.N_Qubit_Decomposition.restype

Definition at line 53 of file N_Qubit_Decomposition.py.