Sequential Quantum Gate Decomposer
v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Base class for the representation of general gate operations. More...
#include <Composite.h>
Public Member Functions | |
void | add_adaptive (int target_qbit, int control_qbit) |
Append a Adaptive gate to the list of gates. More... | |
void | add_adaptive_to_front (int target_qbit, int control_qbit) |
Add a Adaptive gate to the front of the list of gates. More... | |
void | add_ch (int target_qbit, int control_qbit) |
Append a CH gate (i.e. More... | |
void | add_ch_to_front (int target_qbit, int control_qbit) |
Add a CH gate (i.e. More... | |
void | add_child (Gate *child) |
Call to add a child gate to the current gate. More... | |
void | add_cnot (int target_qbit, int control_qbit) |
Append a CNOT gate gate to the list of gates. More... | |
void | add_cnot_to_front (int target_qbit, int control_qbit) |
Add a C_NOT gate gate to the front of the list of gates. More... | |
void | add_composite () |
Append a Composite gate to the list of gates. More... | |
void | add_composite_to_front () |
Add a Composite gate to the front of the list of gates. More... | |
void | add_crot (int target_qbit, int control_qbit, crot_type subtype_in) |
Append a CNOT gate gate to the list of gates. More... | |
void | add_crot_to_front (int target_qbit, int control_qbit, crot_type subtype_in) |
Add a C_NOT gate gate to the front of the list of gates. More... | |
void | add_cry (int target_qbit, int control_qbit) |
Append a CRY gate to the list of gates. More... | |
void | add_cry_to_front (int target_qbit, int control_qbit) |
Add a CRY gate to the front of the list of gates. More... | |
void | add_cz (int target_qbit, int control_qbit) |
Append a CZ gate gate to the list of gates. More... | |
void | add_cz_nu (int target_qbit, int control_qbit) |
Append a CZ_NU gate to the list of gates. More... | |
void | add_cz_nu_to_front (int target_qbit, int control_qbit) |
Add a CZ_NU gate to the front of the list of gates. More... | |
void | add_cz_to_front (int target_qbit, int control_qbit) |
Add a CZ gate gate to the front of the list of gates. More... | |
void | add_gate (Gate *gate) |
Append a general gate to the list of gates. More... | |
void | add_gate_nums (std::map< std::string, int > &gate_nums) |
Call to add the number of the individual gate types in the circuit to the map given in the argument. More... | |
void | add_gate_to_front (Gate *gate) |
Add an gate to the front of the list of gates. More... | |
void | add_gates (std::vector< Gate *> gates_in) |
Append a list of gates to the list of gates. More... | |
void | add_gates_to_front (std::vector< Gate *> gates_in) |
Add an array of gates to the front of the list of gates. More... | |
void | add_h (int target_qbit) |
Append a Hadamard gate to the list of gates. More... | |
void | add_h_to_front (int target_qbit) |
Add a Hadamard gate to the front of the list of gates. More... | |
void | add_on () |
Append a ON gate to the list of gates. More... | |
void | add_on_to_front () |
Add a OUN gate to the front of the list of gates. More... | |
void | add_parent (Gate *parent) |
Call to add a parent gate to the current gate. More... | |
void | add_r (int target_qbit) |
Append a R gate to the list of gates. More... | |
void | add_r_to_front (int target_qbit) |
Add a R gate to the front of the list of gates. More... | |
void | add_rx (int target_qbit) |
Append a RX gate to the list of gates. More... | |
void | add_rx_to_front (int target_qbit) |
Add a RX gate to the front of the list of gates. More... | |
void | add_ry (int target_qbit) |
Append a RY gate to the list of gates. More... | |
void | add_ry_to_front (int target_qbit) |
Add a RY gate to the front of the list of gates. More... | |
void | add_rz (int target_qbit) |
Append a RZ gate to the list of gates. More... | |
void | add_rz_to_front (int target_qbit) |
Add a RZ gate to the front of the list of gates. More... | |
void | add_sx (int target_qbit) |
Append a SX gate to the list of gates. More... | |
void | add_sx_to_front (int target_qbit) |
Add a SX gate to the front of the list of gates. More... | |
void | add_syc (int target_qbit, int control_qbit) |
Append a Sycamore gate (i.e. More... | |
void | add_syc_to_front (int target_qbit, int control_qbit) |
Add a Sycamore gate (i.e. More... | |
void | add_t (int target_qbit) |
Append a T gate to the list of gates. More... | |
void | add_t_to_front (int target_qbit) |
Add a T gate to the front of the list of gates. More... | |
void | add_tdg (int target_qbit) |
Append a Tdg gate to the list of gates. More... | |
void | add_tdg_to_front (int target_qbit) |
Add a Tdg gate to the front of the list of gates. More... | |
void | add_u1 (int target_qbit) |
Append a U1 gate to the list of gates. More... | |
void | add_u1_to_front (int target_qbit) |
Add a U1 gate to the front of the list of gates. More... | |
void | add_u2 (int target_qbit) |
Append a U2 gate to the list of gates. More... | |
void | add_u2_to_front (int target_qbit) |
Add a U2 gate to the front of the list of gates. More... | |
void | add_u3 (int target_qbit) |
Append a U3 gate to the list of gates. More... | |
void | add_u3_to_front (int target_qbit) |
Add a U3 gate to the front of the list of gates. More... | |
void | add_un () |
Append a UN gate to the list of gates. More... | |
void | add_un_to_front () |
Add a UN gate to the front of the list of gates. More... | |
void | add_x (int target_qbit) |
Append a X gate to the list of gates. More... | |
void | add_x_to_front (int target_qbit) |
Add a X gate to the front of the list of gates. More... | |
void | add_y (int target_qbit) |
Append a Y gate to the list of gates. More... | |
void | add_y_to_front (int target_qbit) |
Add a Y gate to the front of the list of gates. More... | |
void | add_z (int target_qbit) |
Append a Z gate to the list of gates. More... | |
void | add_z_to_front (int target_qbit) |
Add a Z gate to the front of the list of gates. More... | |
virtual std::vector< Matrix > | apply_derivate_to (Matrix_real ¶meters_mtx, Matrix &input, int parallel) |
Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters. More... | |
void | apply_from_right (Matrix_real ¶meters, Matrix &input) |
Call to apply the gate on the input array/matrix by input*Gate. More... | |
virtual void | apply_from_right (Matrix &input) |
Call to apply the gate on the input array/matrix by input*Gate. More... | |
void | apply_to (Matrix_real ¶meters, Matrix &input, int parallel) |
Call to apply the gate on the input array/matrix. More... | |
virtual void | apply_to (Matrix &input, int parallel) |
Call to apply the gate on the input array/matrix. More... | |
void | apply_to_list (Matrix_real ¶meters, std::vector< Matrix > &inputs, int parallel) |
Call to apply the gate on the input array/matrix by U3*input. More... | |
virtual void | apply_to_list (std::vector< Matrix > &inputs, int parallel) |
Call to apply the gate on a list of inputs. More... | |
virtual Matrix | calc_one_qubit_u3 (double Theta, double Phi, double Lambda) |
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space. More... | |
virtual Matrix | calc_one_qubit_u3 () |
Calculate the matrix of the constans gates. More... | |
void | clear_children () |
Call to erase data on children. More... | |
void | clear_parents () |
Call to erase data on parents. More... | |
Composite * | clone () |
Call to create a clone of the present class. More... | |
void | combine (Gates_block *op_block) |
Call to append the gates of an gate block to the current block. More... | |
Composite () | |
Default constructor of the class. More... | |
Composite (int qbit_num_in) | |
Constructor of the class. More... | |
bool | contains_adaptive_gate () |
Call to determine, whether the circuit contains daptive gate or not. More... | |
bool | contains_adaptive_gate (int idx) |
Call to determine, whether the sub-circuit at a given position in the circuit contains daptive gate or not. More... | |
Gates_block * | create_remapped_circuit (const std::map< int, int > &qbit_map) |
Call to create a new circuit with remapped qubits. More... | |
Gates_block * | create_remapped_circuit (const std::map< int, int > &qbit_map, const int qbit_num_) |
Call to create a new circuit with remapped qubits. More... | |
void | determine_children (Gate *gate) |
Call to obtain the child gates in the circuit. More... | |
void | determine_parents (Gate *gate) |
Call to obtain the parent gates in the circuit. More... | |
int | extract_gates (Gates_block *op_block) |
Call to extract the gates stored in the class. More... | |
virtual Matrix_real | extract_parameters (Matrix_real ¶meters) |
Call to extract parameters from the parameter array corresponding to the circuit, in which the gate is embedded. More... | |
void | fragment_circuit () |
std::vector< Gate * > | get_children () |
Call to get the children of the current gate. More... | |
int | get_control_qbit () |
Call to get the index of the control qubit. More... | |
Gates_block * | get_flat_circuit () |
Method to generate a flat circuit. More... | |
Gate * | get_gate (int idx) |
Call to get the gates stored in the class. More... | |
int | get_gate_num () |
Call to get the number of gates grouped in the class. More... | |
std::map< std::string, int > | get_gate_nums () |
Call to get the number of the individual gate types in the list of gates. More... | |
std::vector< Gate * > | get_gates () |
Call to get the gates stored in the class. More... | |
std::vector< int > | get_involved_qubits () |
Call to get the qubits involved in the gates stored in the block of gates. More... | |
Matrix | get_matrix (Matrix_real ¶meters) |
Call to retrieve the operation matrix. More... | |
Matrix | get_matrix (Matrix_real ¶meters, int parallel) |
Call to retrieve the operation matrix. More... | |
virtual Matrix | get_matrix () |
Call to retrieve the operation matrix. More... | |
virtual Matrix | get_matrix (int parallel) |
Call to retrieve the operation matrix. More... | |
std::string | get_name () |
Call to get the name label of the gate. More... | |
void | get_parameter_max (Matrix_real &range_max) |
int | get_parameter_num () |
Call to get the number of free parameters. More... | |
int | get_parameter_start_idx () |
Call to get the starting index of the parameters in the parameter array corresponding to the circuit in which the current gate is incorporated. More... | |
std::vector< Gate * > | get_parents () |
Call to get the parents of the current gate. More... | |
int | get_qbit_num () |
Call to get the number of qubits composing the unitary. More... | |
Matrix | get_reduced_density_matrix (Matrix_real ¶meters_mtx, Matrix &input_state, matrix_base< int > &qbit_list_subset) |
Call to evaluate the reduced densiy matrix. More... | |
double | get_second_Renyi_entropy (Matrix_real ¶meters_mtx, Matrix &input_state, matrix_base< int > &qbit_list) |
Call to evaluate the seconf Rényi entropy. More... | |
int | get_target_qbit () |
Call to get the index of the target qubit. More... | |
gate_type | get_type () |
Call to get the type of the operation. More... | |
void | insert_gate (Gate *gate, int idx) |
Call to insert a gate at a given position. More... | |
void | list_gates (const Matrix_real ¶meters, int start_index) |
Call to print the list of gates stored in the block of gates for a specific set of parameters. More... | |
virtual void | parameters_for_calc_one_qubit (double &ThetaOver2, double &Phi, double &Lambda) |
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space. More... | |
void | print (const std::stringstream &sstream, int verbose_level=1) const |
Call to print output messages in the function of the verbosity level. More... | |
void | release_gate (int idx) |
Call to release one gate in the list. More... | |
void | release_gates () |
Call to release the stored gates. More... | |
virtual void | reorder_qubits (std::vector< int > qbit_list) |
Call to reorder the qubits in the matrix of the operation. More... | |
void | reset_dependency_graph () |
Method to reset the dependency graph of the gates in the circuit. More... | |
void | reset_parameter_start_indices () |
Method to reset the parameter start indices of gate operations incorporated in the circuit. More... | |
void | set_children (std::vector< Gate *> &children_) |
Call to set the children of the current gate. More... | |
void | set_control_qbit (int control_qbit_in) |
Call to set the control qubit for the gate operation. More... | |
void | set_debugfile (std::string debugfile) |
Call to set the debugfile name. More... | |
void | set_matrix (Matrix input) |
Call to set the stored matrix in the operation. More... | |
void | set_parameter_start_idx (int start_idx) |
Call to set the starting index of the parameters in the parameter array corresponding to the circuit in which the current gate is incorporated. More... | |
void | set_parents (std::vector< Gate *> &parents_) |
Call to set the parents of the current gate. More... | |
virtual void | set_qbit_num (int qbit_num_in) |
Set the number of qubits spanning the matrix of the operation. More... | |
void | set_target_qbit (int target_qbit_in) |
Call to set the target qubit for the gate operation. More... | |
void | set_verbose (int verbose_in) |
Call to set the verbose attribute. More... | |
virtual | ~Composite () |
Destructor of the class. More... | |
Public Attributes | |
bool | debug |
Logical variable. Set true to write output messages to the 'debug.txt' file. More... | |
std::string | debugfile_name |
String variable. Set the debug file name. More... | |
int | verbose |
Set the verbosity level of the output messages. More... | |
Protected Member Functions | |
void | apply_kernel_from_right (Matrix &u3_1qbit, Matrix &input) |
Call to apply the gate kernel on the input state or unitary from right (no AVX support) More... | |
void | apply_kernel_to (Matrix &u3_1qbit, Matrix &input, bool deriv=false, int parallel=0) |
Call to apply the gate kernel on the input state or unitary with optional AVX support. More... | |
Protected Attributes | |
std::vector< int > | block_end |
std::vector< int > | block_type |
std::vector< Gate * > | children |
list of child gates to be applied after this current gate More... | |
int | control_qbit |
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations. More... | |
int | fragmentation_type |
bool | fragmented |
boolean variable indicating whether the circuit was already partitioned or not More... | |
std::vector< Gate * > | gates |
The list of stored gates. More... | |
std::vector< std::vector< int > > | involved_qbits |
int | layer_num |
number of gate layers More... | |
int | matrix_size |
The size N of the NxN matrix associated with the operations. More... | |
int | max_fusion |
maximal number of qubits in partitions More... | |
std::string | name |
A string labeling the gate operation. More... | |
int | parameter_num |
the number of free parameters of the operation More... | |
int | parameter_start_idx |
the index in the parameter array (corrensponding to the encapsulated circuit) where the gate parameters begin (if gates are placed into a circuit a single parameter array is used to execute the whole circuit) More... | |
Matrix_real | parameters |
Parameters theta, phi, lambda of the U3 gate after the decomposition of the unitary is done. More... | |
std::vector< Gate * > | parents |
list of parent gates to be applied in the circuit prior to this current gate More... | |
int | qbit_num |
number of qubits spanning the matrix of the operation More... | |
int | target_qbit |
The index of the qubit on which the operation acts (target_qbit >= 0) More... | |
gate_type | type |
The type of the operation (see enumeration gate_type) More... | |
Base class for the representation of general gate operations.
Definition at line 47 of file Composite.h.
Composite::Composite | ( | ) |
Default constructor of the class.
Deafult constructor of the class.
Definition at line 35 of file Composite.cpp.
|
virtual |
Destructor of the class.
Definition at line 84 of file Composite.cpp.
Composite::Composite | ( | int | qbit_num_in | ) |
Constructor of the class.
qbit_num_in | The number of qubits spanning the unitaries |
Definition at line 61 of file Composite.cpp.
Append a Adaptive gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1553 of file Gates_block.cpp.
Add a Adaptive gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1568 of file Gates_block.cpp.
Append a CH gate (i.e.
controlled Hadamard gate) gate to the list of gates
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
controlled Hadamard gate) operation to the list of gates
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1414 of file Gates_block.cpp.
Add a CH gate (i.e.
controlled Hadamard gate) gate to the front of the list of gates
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
controlled Hadamard gate) operation to the front of the list of gates
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1431 of file Gates_block.cpp.
|
inherited |
Append a CNOT gate gate to the list of gates.
Append a C_NOT gate operation to the list of gates.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1100 of file Gates_block.cpp.
Add a C_NOT gate gate to the front of the list of gates.
Add a C_NOT gate operation to the front of the list of gates.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1117 of file Gates_block.cpp.
|
inherited |
Append a Composite gate to the list of gates.
Definition at line 1524 of file Gates_block.cpp.
|
inherited |
Add a Composite gate to the front of the list of gates.
Definition at line 1536 of file Gates_block.cpp.
Append a CNOT gate gate to the list of gates.
Append a RY gate to the list of gates.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1006 of file Gates_block.cpp.
|
inherited |
Add a C_NOT gate gate to the front of the list of gates.
Add a RY gate to the front of the list of gates.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1022 of file Gates_block.cpp.
Append a CRY gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 974 of file Gates_block.cpp.
Add a CRY gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 990 of file Gates_block.cpp.
Append a CZ gate gate to the list of gates.
Append a CZ gate operation to the list of gates.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1135 of file Gates_block.cpp.
Append a CZ_NU gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1037 of file Gates_block.cpp.
Add a CZ_NU gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1053 of file Gates_block.cpp.
Add a CZ gate gate to the front of the list of gates.
Add a CZ gate operation to the front of the list of gates.
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1152 of file Gates_block.cpp.
|
inherited |
Append a general gate to the list of gates.
gate | A pointer to a class Gate describing an gate. |
gate | A pointer to a class Gate describing a gate operation. |
Definition at line 1584 of file Gates_block.cpp.
|
inherited |
Call to add the number of the individual gate types in the circuit to the map given in the argument.
A | map<gate_name, gate_count> describing the number of the individual gate types |
Definition at line 1675 of file Gates_block.cpp.
|
inherited |
Add an gate to the front of the list of gates.
Add a gate to the front of the list of gates.
gate | A pointer to a class Gate describing an gate. |
gate | A pointer to a class Gate describing a gate. |
Definition at line 1614 of file Gates_block.cpp.
|
inherited |
Append a list of gates to the list of gates.
gates_in | A list of gate class instances. |
gates_in | A list of operation class instances. |
Definition at line 1445 of file Gates_block.cpp.
|
inherited |
Add an array of gates to the front of the list of gates.
gates_in | A list of gate class instances. |
gates_in | A list of operation class instances. |
Definition at line 1458 of file Gates_block.cpp.
|
inherited |
Append a Hadamard gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1166 of file Gates_block.cpp.
|
inherited |
Add a Hadamard gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1179 of file Gates_block.cpp.
|
inherited |
Append a ON gate to the list of gates.
Definition at line 1498 of file Gates_block.cpp.
|
inherited |
Add a OUN gate to the front of the list of gates.
Add a ON gate to the front of the list of gates.
Definition at line 1510 of file Gates_block.cpp.
|
inherited |
|
inherited |
Append a R gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 914 of file Gates_block.cpp.
|
inherited |
Add a R gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 927 of file Gates_block.cpp.
|
inherited |
Append a RX gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 887 of file Gates_block.cpp.
|
inherited |
Add a RX gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 900 of file Gates_block.cpp.
|
inherited |
Append a RY gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 942 of file Gates_block.cpp.
|
inherited |
Add a RY gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 956 of file Gates_block.cpp.
|
inherited |
Append a RZ gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1069 of file Gates_block.cpp.
|
inherited |
Add a RZ gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1082 of file Gates_block.cpp.
|
inherited |
Append a SX gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1347 of file Gates_block.cpp.
|
inherited |
Add a SX gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1360 of file Gates_block.cpp.
Append a Sycamore gate (i.e.
Append a Sycamore gate operation to the list of gates.
controlled Hadamard gate) gate to the list of gates
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1379 of file Gates_block.cpp.
Add a Sycamore gate (i.e.
Add a Sycamore gate operation to the front of the list of gates.
controlled Hadamard gate) gate to the front of the list of gates
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
control_qbit | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1396 of file Gates_block.cpp.
|
inherited |
Append a T gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1285 of file Gates_block.cpp.
|
inherited |
Add a T gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1298 of file Gates_block.cpp.
|
inherited |
Append a Tdg gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1315 of file Gates_block.cpp.
|
inherited |
Add a Tdg gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1328 of file Gates_block.cpp.
|
inherited |
Append a U1 gate to the list of gates.
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 808 of file Gates_block.cpp.
|
inherited |
Add a U1 gate to the front of the list of gates.
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 821 of file Gates_block.cpp.
|
inherited |
Append a U2 gate to the list of gates.
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 834 of file Gates_block.cpp.
|
inherited |
Add a U2 gate to the front of the list of gates.
target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 847 of file Gates_block.cpp.
|
inherited |
Append a U3 gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Theta | The Theta parameter of the U3 gate |
Phi | The Phi parameter of the U3 gate |
Lambda | The Lambda parameter of the U3 gate |
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 860 of file Gates_block.cpp.
|
inherited |
Add a U3 gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Theta | The Theta parameter of the U3 gate |
Phi | The Phi parameter of the U3 gate |
Lambda | The Lambda parameter of the U3 gate |
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 873 of file Gates_block.cpp.
|
inherited |
Append a UN gate to the list of gates.
Definition at line 1472 of file Gates_block.cpp.
|
inherited |
Add a UN gate to the front of the list of gates.
Definition at line 1484 of file Gates_block.cpp.
|
inherited |
Append a X gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1197 of file Gates_block.cpp.
|
inherited |
Add a X gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1210 of file Gates_block.cpp.
|
inherited |
Append a Y gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1226 of file Gates_block.cpp.
|
inherited |
Add a Y gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1239 of file Gates_block.cpp.
|
inherited |
Append a Z gate to the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1255 of file Gates_block.cpp.
|
inherited |
Add a Z gate to the front of the list of gates.
target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1268 of file Gates_block.cpp.
|
virtualinherited |
Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters.
parameters | An array of the input parameters. |
input | The input array on which the gate is applied |
parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP (NOT IMPLEMENTED YET) and 2 for parallel with TBB (optional) |
Reimplemented from Gate.
Definition at line 705 of file Gates_block.cpp.
|
virtual |
Call to apply the gate on the input array/matrix by input*Gate.
input | The input array on which the gate is applied |
Reimplemented from Gates_block.
Definition at line 183 of file Composite.cpp.
|
virtualinherited |
Call to apply the gate on the input array/matrix by input*Gate.
input | The input array on which the gate is applied |
Reimplemented in SX, H, X, Y, Z, T, Tdg, SYC, CH, CNOT, and CZ.
Definition at line 285 of file Gate.cpp.
Call to apply the gate kernel on the input state or unitary from right (no AVX support)
u3_1qbit | The 2x2 kernel of the gate operation |
input | The input matrix on which the transformation is applied |
deriv | Set true to apply derivate transformation, false otherwise |
Definition at line 613 of file Gate.cpp.
|
protectedinherited |
Call to apply the gate kernel on the input state or unitary with optional AVX support.
u3_1qbit | The 2x2 kernel of the gate operation |
input | The input matrix on which the transformation is applied |
deriv | Set true to apply derivate transformation, false otherwise (optional) |
parallel | Set true to apply parallel kernels, false otherwise (optional) |
parallel | Set 0 for sequential execution (default), 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
u3_1qbit | The 2x2 kernel of the gate operation |
input | The input matrix on which the transformation is applied |
deriv | Set true to apply derivate transformation, false otherwise (optional) |
deriv | Set true to apply parallel kernels, false otherwise (optional) |
parallel | Set 0 for sequential execution (default), 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Definition at line 537 of file Gate.cpp.
|
virtual |
Call to apply the gate on the input array/matrix.
input | The input array on which the gate is applied |
parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Reimplemented from Gates_block.
Definition at line 153 of file Composite.cpp.
Call to apply the gate on the input array/matrix.
input | The input array on which the gate is applied |
parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Reimplemented in SX, H, X, Y, Z, T, Tdg, CH, CZ, SYC, and CNOT.
Definition at line 237 of file Gate.cpp.
|
virtualinherited |
Call to apply the gate on the input array/matrix by U3*input.
parameters | An array of parameters to calculate the matrix of the U3 gate. |
inputs | The input array on which the gate is applied |
parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
parameters | An array of parameters to calculate the matrix of the U3 gate. |
input | The input array on which the gate is applied |
Reimplemented from Gate.
Definition at line 202 of file Gates_block.cpp.
Call to apply the gate on a list of inputs.
inputs | The input array on which the gate is applied |
parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Definition at line 187 of file Gate.cpp.
|
virtualinherited |
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space.
Theta | Real parameter standing for the parameter theta. |
Phi | Real parameter standing for the parameter phi. |
Lambda | Real parameter standing for the parameter lambda. |
ThetaOver2 | Real parameter standing for the parameter theta. |
Phi | Real parameter standing for the parameter phi. |
Lambda | Real parameter standing for the parameter lambda. |
Definition at line 695 of file Gate.cpp.
|
virtualinherited |
|
inherited |
|
inherited |
|
virtual |
Call to create a clone of the present class.
Reimplemented from Gates_block.
Definition at line 279 of file Composite.cpp.
|
inherited |
Call to append the gates of an gate block to the current block.
Call to append the gates of a gate block to the current circuit.
op_block | A pointer to an instance of class Gate_block |
op_block | A pointer to an instance of class Gates_block |
Definition at line 2292 of file Gates_block.cpp.
|
inherited |
Call to determine, whether the circuit contains daptive gate or not.
Definition at line 2423 of file Gates_block.cpp.
Call to determine, whether the sub-circuit at a given position in the circuit contains daptive gate or not.
idx | The position of the gate to be checked. |
Definition at line 2450 of file Gates_block.cpp.
|
inherited |
Call to create a new circuit with remapped qubits.
qbit_map | The map to reorder the qbits in a form of map: {int(initial_qbit): int(remapped_qbit)}. |
Definition at line 2030 of file Gates_block.cpp.
|
inherited |
Call to create a new circuit with remapped qubits.
qbit_map | The map to reorder the qbits in a form of map: {int(initial_qbit): int(remapped_qbit)}. . |
qbit_num | The number of qubits in the remapped circuit |
Definition at line 2044 of file Gates_block.cpp.
|
inherited |
Call to obtain the child gates in the circuit.
A child gate needs to be applied after the given gate. The children gates are stored via the "children" attribute of the gate instance
gate | The gate for which the children are determined. |
Definition at line 2770 of file Gates_block.cpp.
|
inherited |
Call to obtain the parent gates in the circuit.
A parent gate needs to be applied prior to the given gate. The parent gates are stored via the "parents" attribute of the gate instance
gate | The gate for which the parents are determined. |
Definition at line 2724 of file Gates_block.cpp.
|
inherited |
Call to extract the gates stored in the class.
op_block | An instance of Gates_block class in which the gates will be stored. (The current gates will be erased) |
Definition at line 2382 of file Gates_block.cpp.
|
virtualinherited |
Call to extract parameters from the parameter array corresponding to the circuit, in which the gate is embedded.
parameters | The parameter array corresponding to the circuit in which the gate is embedded |
Reimplemented from Gate.
Definition at line 2895 of file Gates_block.cpp.
|
inherited |
Definition at line 398 of file Gates_block.cpp.
|
inherited |
|
inherited |
|
inherited |
Method to generate a flat circuit.
A flat circuit is a circuit does not containing subcircuits: there are no Gates_block instances (containing subcircuits) in the resulting circuit. If the original circuit contains subcircuits, the gates in the subcircuits are directly incorporated in the resulting flat circuit.
Definition at line 2857 of file Gates_block.cpp.
Call to get the gates stored in the class.
Call to get a gate stored in the class.
Definition at line 2278 of file Gates_block.cpp.
|
inherited |
Call to get the number of gates grouped in the class.
Definition at line 1733 of file Gates_block.cpp.
|
inherited |
Call to get the number of the individual gate types in the list of gates.
Definition at line 1707 of file Gates_block.cpp.
|
inherited |
Call to get the gates stored in the class.
(The resulting vector contains borrowed pointers to the gates, so they dont need to be deleted.)
Definition at line 2269 of file Gates_block.cpp.
|
virtualinherited |
Call to get the qubits involved in the gates stored in the block of gates.
Reimplemented from Gate.
Definition at line 2237 of file Gates_block.cpp.
|
virtual |
Call to retrieve the operation matrix.
parallel | Set true to apply parallel kernels, false otherwise |
parameters | An array of parameters to calculate the matrix of the composite gate. |
Reimplemented from Gate.
Definition at line 110 of file Composite.cpp.
|
virtual |
Call to retrieve the operation matrix.
parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
parameters | An array of parameters to calculate the matrix of the composite gate. |
parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Reimplemented from Gate.
Definition at line 124 of file Composite.cpp.
|
virtualinherited |
|
inherited |
|
inherited |
Definition at line 491 of file Gates_block.cpp.
int Composite::get_parameter_num | ( | ) |
Call to get the number of free parameters.
Definition at line 250 of file Composite.cpp.
|
inherited |
|
inherited |
int Composite::get_qbit_num | ( | ) |
Call to get the number of qubits composing the unitary.
Definition at line 270 of file Composite.cpp.
|
inherited |
Call to evaluate the reduced densiy matrix.
parameters | An array of parameters to calculate the entropy |
input_state | The input state on which the gate structure is applied |
qbit_list | Subset of qubits for which the entropy should be calculated. (Should conatin unique elements) Returns with the reduced density matrix. |
Definition at line 2477 of file Gates_block.cpp.
|
inherited |
Call to evaluate the seconf Rényi entropy.
The quantum circuit is applied on an input state input. The entropy is evaluated for the transformed state.
parameters | An array of parameters to calculate the entropy |
input_state | The input state on which the gate structure is applied |
qbit_list | Subset of qubits for which the entropy should be calculated. (Should conatin unique elements) Returns with the calculated entropy |
Definition at line 2654 of file Gates_block.cpp.
|
inherited |
gate_type Composite::get_type | ( | ) |
Call to get the type of the operation.
Definition at line 260 of file Composite.cpp.
Call to insert a gate at a given position.
gate | A pointer to a class Gate describing a gate. |
idx | The position where to insert the gate. |
Definition at line 1647 of file Gates_block.cpp.
|
inherited |
Call to print the list of gates stored in the block of gates for a specific set of parameters.
parameters | The parameters of the gates that should be printed. |
start_index | The ordinal number of the first gate. |
Definition at line 1743 of file Gates_block.cpp.
|
virtualinherited |
Calculate the matrix of a U3 gate gate corresponding to the given parameters acting on a single qbit space.
Set static values for the angles and constans parameters for calculating the matrix of the gates.
Theta | Real parameter standing for the parameter theta. |
Phi | Real parameter standing for the parameter phi. |
Lambda | Real parameter standing for the parameter lambda. |
ThetaOver2 | Real parameter standing for the parameter theta. |
Phi | Real parameter standing for the parameter phi. |
Lambda | Real parameter standing for the parameter lambda. |
|
inherited |
Call to print output messages in the function of the verbosity level.
sstream | The stringstream input to store the output messages. |
verbose_level | Integer input. High level means write more to the standart output, 0 means write nothing. The default value is set to 1. |
Definition at line 55 of file logging.cpp.
|
inherited |
Call to release one gate in the list.
Definition at line 132 of file Gates_block.cpp.
|
inherited |
Call to release the stored gates.
Definition at line 111 of file Gates_block.cpp.
|
virtual |
Call to reorder the qubits in the matrix of the operation.
qbit_list | The reordered list of qubits spanning the matrix |
Reimplemented from Gates_block.
Definition at line 216 of file Composite.cpp.
|
inherited |
Method to reset the dependency graph of the gates in the circuit.
Definition at line 2828 of file Gates_block.cpp.
|
inherited |
Method to reset the parameter start indices of gate operations incorporated in the circuit.
Method reset the parameter start indices of gate operations incorporated in the circuit.
(When a gate is inserted into the circuit at other position than the end.)
Definition at line 2807 of file Gates_block.cpp.
|
inherited |
|
inherited |
|
inherited |
Call to set the debugfile name.
debugfile | String variable. Set the debugfile name. |
Definition at line 95 of file logging.cpp.
|
inherited |
|
inherited |
|
inherited |
|
virtual |
Set the number of qubits spanning the matrix of the operation.
qbit_num_in | The number of qubits spanning the matrix |
Reimplemented from Gates_block.
Definition at line 91 of file Composite.cpp.
|
inherited |
|
inherited |
Call to set the verbose attribute.
verbose_in | Integer variable. Set the number to specify the verbosity level for output messages. |
Definition at line 85 of file logging.cpp.
|
protectedinherited |
Definition at line 59 of file Gates_block.h.
|
protectedinherited |
Definition at line 60 of file Gates_block.h.
|
protectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
protectedinherited |
Definition at line 55 of file Gates_block.h.
|
protectedinherited |
boolean variable indicating whether the circuit was already partitioned or not
Definition at line 54 of file Gates_block.h.
|
protectedinherited |
The list of stored gates.
Definition at line 46 of file Gates_block.h.
|
protectedinherited |
Definition at line 58 of file Gates_block.h.
|
protectedinherited |
number of gate layers
Definition at line 48 of file Gates_block.h.
|
protectedinherited |
|
protectedinherited |
maximal number of qubits in partitions
Definition at line 57 of file Gates_block.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
Parameters theta, phi, lambda of the U3 gate after the decomposition of the unitary is done.
Definition at line 53 of file Composite.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |