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

Classes

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

Functions

def __init__ (self, Hamiltonian, qbit_num, config={}, accelerator_num=0)
 Constructor of the class. More...
 
def apply_to (self, parameters_mtx, state_to_be_transformed)
 
def Generate_Circuit (self, layers, inner_blocks=1)
 Call to generate the circuit ansatz. More...
 
def get_Circuit (self)
 Call to retrieve the incorporated quantum circuit (Squander format) More...
 
def get_Optimized_Parameters (self)
 Call to get the optimized parameters set in numpy array. More...
 
def get_Parameter_Num (self)
 Call to get the number of free parameters in the gate structure used for the decomposition. More...
 
def get_Qbit_Num (self)
 Call to get the number of qubits in the circuit. More...
 
def get_Qiskit_Circuit (self)
 Export the unitary decomposition into Qiskit format. 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 Optimization_Problem (self, parameters)
 Call to evaluate the VQE energy. More...
 
def Optimization_Problem_Grad (self, parameters)
 Call to evaluate the VQE energy. More...
 
def set_Ansatz (self, ansatz_new)
 Call to set the ansatz type. More...
 
def set_Gate_Structure (self, Gate_structure)
 Call to set custom gate structure to used in the decomposition. More...
 
def set_Gate_Structure_from_Binary (self, filename)
 Call to set custom layers to the gate structure that are intended to be used in the decomposition from a binary file created from SQUANDER. More...
 
def set_Initial_State (self, initial_state)
 Call to get the number of free parameters in the gate structure used for the decomposition. More...
 
def set_Optimization_Tolerance (self, tolerance)
 
def set_Optimized_Parameters (self, new_params)
 Call to set the parameters which are used as a starting point in the optimization. More...
 
def set_Optimizer (self, alg)
 Call to set the optimizer used in the VQE process. More...
 
def set_Project_Name (self, project_name)
 Call to set the name of the SQUANDER project. More...
 
def Start_Optimization (self)
 Call to start solving the VQE problem to get the approximation for the ground state. More...
 

Variables

 qbit_num
 

Function Documentation

◆ __init__()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.__init__ (   self,
  Hamiltonian,
  qbit_num,
  config = {},
  accelerator_num = 0 
)

Constructor of the class.

Parameters
UmtxThe unitary matrix to be decomposed.
optimize_layer_numSet 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_guessString indicating the method to guess initial values for the optimalization. Possible values: "zeros" ,"random", "close_to_zero".
Returns
An instance of the class

Definition at line 46 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ apply_to()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.apply_to (   self,
  parameters_mtx,
  state_to_be_transformed 
)

Definition at line 204 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ Generate_Circuit()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.Generate_Circuit (   self,
  layers,
  inner_blocks = 1 
)

Call to generate the circuit ansatz.

Parameters
layersThe number of layers. The depth of the generated circuit is 2*layers+1 (U3-CNOT-U3-CNOT...CNOT)
inner_blocksThe number of U3-CNOT repetition within a single layer

Definition at line 123 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ get_Circuit()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.get_Circuit (   self)

Call to retrieve the incorporated quantum circuit (Squander format)

Returns
Return with a Qiskit compatible quantum circuit.

Definition at line 213 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ get_Optimized_Parameters()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.get_Optimized_Parameters (   self)

Call to get the optimized parameters set in numpy array.

Returns
Returns with the optimized parameters

Definition at line 77 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ get_Parameter_Num()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.get_Parameter_Num (   self)

Call to get the number of free parameters in the gate structure used for the decomposition.

Definition at line 195 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ get_Qbit_Num()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.get_Qbit_Num (   self)

Call to get the number of qubits in the circuit.

Returns
Returns with the number of qubits

Definition at line 188 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ get_Qiskit_Circuit()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.get_Qiskit_Circuit (   self)

Export the unitary decomposition into Qiskit format.

Returns
Return with a Qiskit compatible quantum circuit.

Definition at line 223 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ get_Second_Renyi_Entropy()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.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 147 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ Optimization_Problem()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.Optimization_Problem (   self,
  parameters 
)

Call to evaluate the VQE energy.

Parameters
parametersA float64 numpy array. The number of parameters can be retrieved with method get_Parameter_Num

Definition at line 130 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ Optimization_Problem_Grad()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.Optimization_Problem_Grad (   self,
  parameters 
)

Call to evaluate the VQE energy.

Parameters
parametersA float64 numpy array. The number of parameters can be retrieved with method get_Parameter_Num

Definition at line 137 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ set_Ansatz()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Ansatz (   self,
  ansatz_new 
)

Call to set the ansatz type.

Currently imp

Parameters
ansatz_newString of the ansatz . Possible values: "HEA" (hardware efficient ansatz with U3 and CNOT gates).

Definition at line 115 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ set_Gate_Structure()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Gate_Structure (   self,
  Gate_structure 
)

Call to set custom gate structure to used in the decomposition.

Parameters
Gate_structureAn instance of SQUANDER Circuit

Definition at line 243 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ set_Gate_Structure_from_Binary()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Gate_Structure_from_Binary (   self,
  filename 
)

Call to set custom layers to the gate structure that are intended to be used in the decomposition from a binary file created from SQUANDER.

Parameters
filenameString containing the filename

Definition at line 107 of file qgd_Variational_Quantum_Eigensolver_Base.py.

Here is the call graph for this function:

◆ set_Initial_State()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Initial_State (   self,
  initial_state 
)

Call to get the number of free parameters in the gate structure used for the decomposition.

Definition at line 235 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ set_Optimization_Tolerance()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Optimization_Tolerance (   self,
  tolerance 
)

Definition at line 92 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ set_Optimized_Parameters()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Optimized_Parameters (   self,
  new_params 
)

Call to set the parameters which are used as a starting point in the optimization.

Parameters
Anumpy array containing the parameters. The number of parameters can be retrieved with method get_Parameter_Num

Definition at line 85 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ set_Optimizer()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Optimizer (   self,
  alg 
)

Call to set the optimizer used in the VQE process.

Parameters
optimizerString indicating the optimizer. Possible values: "BFGS" ,"ADAM", "BFGS2", "ADAM_BATCHED", "AGENTS", "COSINE", "AGENTS_COMBINED".

Definition at line 63 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ set_Project_Name()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.set_Project_Name (   self,
  project_name 
)

Call to set the name of the SQUANDER project.

Parameters
project_name_newnew project name

Definition at line 100 of file qgd_Variational_Quantum_Eigensolver_Base.py.

◆ Start_Optimization()

def squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.Start_Optimization (   self)

Call to start solving the VQE problem to get the approximation for the ground state.

Definition at line 69 of file qgd_Variational_Quantum_Eigensolver_Base.py.

Variable Documentation

◆ qbit_num

squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base.qbit_num

Definition at line 57 of file qgd_Variational_Quantum_Eigensolver_Base.py.