Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Classes | Functions
squander.gates.qgd_Circuit Namespace Reference

Classes

class  qgd_Circuit
 A QGD Python interface class for the Gates_Block. More...
 

Functions

def __init__ (self, qbit_num)
 Constructor of the class. More...
 
def add_adaptive (self, target_qbit, control_qbit)
 
def add_CH (self, target_qbit, control_qbit)
 
def add_Circuit (self, gate)
 
def add_CNOT (self, target_qbit, control_qbit)
 
def add_CROT (self, target_qbit, control_qbit, subtype)
 
def add_CZ (self, target_qbit, control_qbit)
 
def add_Gate (self, qgd_gate)
 
def add_H (self, target_qbit)
 
def add_R (self, target_qbit)
 
def add_RX (self, target_qbit)
 
def add_RY (self, target_qbit)
 
def add_RZ (self, target_qbit)
 
def add_SX (self, target_qbit)
 
def add_SYC (self, target_qbit, control_qbit)
 
def add_T (self, target_qbit)
 
def add_Tdg (self, target_qbit)
 
def add_U1 (self, target_qbit)
 
def add_U2 (self, target_qbit)
 
def add_U3 (self, target_qbit)
 
def add_X (self, target_qbit)
 
def add_Y (self, target_qbit)
 
def add_Z (self, target_qbit)
 
def apply_to (self, parameters_mtx, unitary_mtx, parallel=1)
 
def get_Children (self, gate)
 
def get_Circuit_Depth (self)
 
def get_Gate_Nums (self)
 Call to get statisctics on the gate counts in the circuit. More...
 
def get_Gates (self)
 Call to get the list of gates (or subcircuits) in the circuit. More...
 
def get_Matrix (self, parameters_mtx)
 
def get_Parameter_Num (self)
 
def get_Parameter_Start_Index (self)
 
def get_Parents (self, gate)
 
def get_Qbit_Num (self)
 Call to get the number of qubits in the circuit. More...
 
def get_Qbits (self)
 Call to get the list of qubits involved in the circuit. More...
 
def get_Second_Renyi_Entropy (self, parameters=None, input_state=None, qubit_list=None)
 Call to get the second Rényi entropy. More...
 
def Remap_Qbits (self, qbit_map, qbit_num=None)
 Call to remap the qubits in the circuit. More...
 

Function Documentation

◆ __init__()

def squander.gates.qgd_Circuit.__init__ (   self,
  qbit_num 
)

Constructor of the class.

Parameters
qbit_numthe number of qubits spanning the operations
Returns
An instance of the class

Definition at line 68 of file qgd_Circuit.py.

◆ add_adaptive()

def squander.gates.qgd_Circuit.add_adaptive (   self,
  target_qbit,
  control_qbit 
)

Definition at line 257 of file qgd_Circuit.py.

◆ add_CH()

def squander.gates.qgd_Circuit.add_CH (   self,
  target_qbit,
  control_qbit 
)

Definition at line 175 of file qgd_Circuit.py.

◆ add_Circuit()

def squander.gates.qgd_Circuit.add_Circuit (   self,
  gate 
)

Definition at line 275 of file qgd_Circuit.py.

◆ add_CNOT()

def squander.gates.qgd_Circuit.add_CNOT (   self,
  target_qbit,
  control_qbit 
)

Definition at line 157 of file qgd_Circuit.py.

◆ add_CROT()

def squander.gates.qgd_Circuit.add_CROT (   self,
  target_qbit,
  control_qbit,
  subtype 
)

Definition at line 266 of file qgd_Circuit.py.

◆ add_CZ()

def squander.gates.qgd_Circuit.add_CZ (   self,
  target_qbit,
  control_qbit 
)

Definition at line 166 of file qgd_Circuit.py.

◆ add_Gate()

def squander.gates.qgd_Circuit.add_Gate (   self,
  qgd_gate 
)

Definition at line 486 of file qgd_Circuit.py.

◆ add_H()

def squander.gates.qgd_Circuit.add_H (   self,
  target_qbit 
)

Definition at line 194 of file qgd_Circuit.py.

◆ add_R()

def squander.gates.qgd_Circuit.add_R (   self,
  target_qbit 
)

Definition at line 130 of file qgd_Circuit.py.

◆ add_RX()

def squander.gates.qgd_Circuit.add_RX (   self,
  target_qbit 
)

Definition at line 122 of file qgd_Circuit.py.

◆ add_RY()

def squander.gates.qgd_Circuit.add_RY (   self,
  target_qbit 
)

Definition at line 139 of file qgd_Circuit.py.

◆ add_RZ()

def squander.gates.qgd_Circuit.add_RZ (   self,
  target_qbit 
)

Definition at line 148 of file qgd_Circuit.py.

◆ add_SX()

def squander.gates.qgd_Circuit.add_SX (   self,
  target_qbit 
)

Definition at line 230 of file qgd_Circuit.py.

◆ add_SYC()

def squander.gates.qgd_Circuit.add_SYC (   self,
  target_qbit,
  control_qbit 
)

Definition at line 184 of file qgd_Circuit.py.

◆ add_T()

def squander.gates.qgd_Circuit.add_T (   self,
  target_qbit 
)

Definition at line 239 of file qgd_Circuit.py.

◆ add_Tdg()

def squander.gates.qgd_Circuit.add_Tdg (   self,
  target_qbit 
)

Definition at line 248 of file qgd_Circuit.py.

◆ add_U1()

def squander.gates.qgd_Circuit.add_U1 (   self,
  target_qbit 
)

Definition at line 95 of file qgd_Circuit.py.

◆ add_U2()

def squander.gates.qgd_Circuit.add_U2 (   self,
  target_qbit 
)

Definition at line 104 of file qgd_Circuit.py.

◆ add_U3()

def squander.gates.qgd_Circuit.add_U3 (   self,
  target_qbit 
)

Definition at line 113 of file qgd_Circuit.py.

◆ add_X()

def squander.gates.qgd_Circuit.add_X (   self,
  target_qbit 
)

Definition at line 203 of file qgd_Circuit.py.

◆ add_Y()

def squander.gates.qgd_Circuit.add_Y (   self,
  target_qbit 
)

Definition at line 212 of file qgd_Circuit.py.

◆ add_Z()

def squander.gates.qgd_Circuit.add_Z (   self,
  target_qbit 
)

Definition at line 221 of file qgd_Circuit.py.

◆ apply_to()

def squander.gates.qgd_Circuit.apply_to (   self,
  parameters_mtx,
  unitary_mtx,
  parallel = 1 
)

Definition at line 302 of file qgd_Circuit.py.

Here is the caller graph for this function:

◆ get_Children()

def squander.gates.qgd_Circuit.get_Children (   self,
  gate 
)

Definition at line 419 of file qgd_Circuit.py.

◆ get_Circuit_Depth()

def squander.gates.qgd_Circuit.get_Circuit_Depth (   self)

Definition at line 426 of file qgd_Circuit.py.

Here is the call graph for this function:

◆ get_Gate_Nums()

def squander.gates.qgd_Circuit.get_Gate_Nums (   self)

Call to get statisctics on the gate counts in the circuit.

Returns
Returns with the dictionary containing the gate counts

Definition at line 383 of file qgd_Circuit.py.

◆ get_Gates()

def squander.gates.qgd_Circuit.get_Gates (   self)

Call to get the list of gates (or subcircuits) in the circuit.

Returns
Returns with the list of gates

Definition at line 375 of file qgd_Circuit.py.

◆ get_Matrix()

def squander.gates.qgd_Circuit.get_Matrix (   self,
  parameters_mtx 
)

Definition at line 284 of file qgd_Circuit.py.

◆ get_Parameter_Num()

def squander.gates.qgd_Circuit.get_Parameter_Num (   self)

Definition at line 293 of file qgd_Circuit.py.

◆ get_Parameter_Start_Index()

def squander.gates.qgd_Circuit.get_Parameter_Start_Index (   self)

Definition at line 405 of file qgd_Circuit.py.

Here is the caller graph for this function:

◆ get_Parents()

def squander.gates.qgd_Circuit.get_Parents (   self,
  gate 
)

Definition at line 412 of file qgd_Circuit.py.

◆ get_Qbit_Num()

def squander.gates.qgd_Circuit.get_Qbit_Num (   self)

Call to get the number of qubits in the circuit.

Returns
Returns with the number of qubits

Definition at line 359 of file qgd_Circuit.py.

◆ get_Qbits()

def squander.gates.qgd_Circuit.get_Qbits (   self)

Call to get the list of qubits involved in the circuit.

Returns
Returns with the list of qubits

Definition at line 367 of file qgd_Circuit.py.

◆ get_Second_Renyi_Entropy()

def squander.gates.qgd_Circuit.get_Second_Renyi_Entropy (   self,
  parameters = None,
  input_state = None,
  qubit_list = None 
)

Call to get the second Rényi entropy.

Parameters
parametersA float64 numpy array
input_stateA complex array storing the input state. If None |0> is created.
qubit_listA subset of qubits for which the Rényi entropy should be calculated. Returns with the calculated entropy

Definition at line 315 of file qgd_Circuit.py.

◆ Remap_Qbits()

def squander.gates.qgd_Circuit.Remap_Qbits (   self,
  qbit_map,
  qbit_num = None 
)

Call to remap the qubits in the circuit.

Parameters
qbit_mapThe map conatining the qbit map in a form of dict: {int(initial_qbit): int(remapped_qbit)}.
qbit_numThe number of qbits in the remaped circuits (Can be different than in the original circuit)
Returns
Returns with the newly created, remapped circuit

Definition at line 393 of file qgd_Circuit.py.