496 void add_gates( std::vector<Gate*> gates_in );
701 DFEgate_kernel_type* convert_to_DFE_gates_with_derivates(
Matrix_real& parameters_mtx,
int& gatesNum,
int& gateSetNum,
int& redundantGateSets,
bool only_derivates=
false );
707 void adjust_parameters_for_derivation(
DFEgate_kernel_type* DFEgates,
const int gatesNum,
int& gate_idx,
int& gate_set_index );
713 DFEgate_kernel_type* convert_to_batched_DFE_gates( std::vector<Matrix_real>& parameters_mtx_vec,
int& gatesNum,
int& gateSetNum,
int& redundantGateSets );
734 void extract_gate_kernels_target_and_control_qubits(std::vector<Matrix> &u3_qbit, std::vector<int> &
target_qbit, std::vector<int> &
control_qbit,
Matrix_real& parameters_mtx);
818 #endif //GATES_BLOCK, Gates_block * get_flat_circuit()
Method to generate a flat circuit.
void add_adaptive(int target_qbit, int control_qbit)
Append a Adaptive gate to the list of gates.
void add_composite_to_front()
Add a Composite gate to the front of the list of gates.
void add_cz_nu(int target_qbit, int control_qbit)
Append a CZ_NU gate to the list of gates.
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.
Header file for a class for the representation of general gate operations.
void release_gate(int idx)
Call to release one gate in the list.
void determine_parents(Gate *gate)
Call to obtain the parent gates in the circuit.
void add_z_to_front(int target_qbit)
Add a Z gate to the front of the list of gates.
void add_h(int target_qbit)
Append a Hadamard gate to the list of gates.
virtual Matrix get_matrix()
Call to retrieve the operation matrix.
std::map< std::string, int > get_gate_nums()
Call to get the number of the individual gate types in the list of gates.
Matrix_real reverse_parameters(const Matrix_real &v_in, std::vector< Gate *>::iterator gates_it, int num_of_gates)
Call to reverse the order of the parameters in an array.
void add_x(int target_qbit)
Append a X gate to the list of gates.
int control_qbit
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations...
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.
void add_gate(Gate *gate)
Append a general gate to the list of gates.
void add_u2(int target_qbit)
Append a U2 gate to the list of gates.
std::vector< int > get_involved_qubits()
Call to get the qubits involved in the gates stored in the block of gates.
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.
int max_fusion
maximal number of qubits in partitions
void add_u1(int target_qbit)
Append a U1 gate to the list of gates.
void add_on_to_front()
Add a OUN gate to the front of the list of gates.
Header file for a class representing a controlled rotation gate around the Y axis.
int target_qbit
The index of the qubit on which the operation acts (target_qbit >= 0)
std::vector< Gate * > get_gates()
Call to get the gates stored in the class.
Gates_block * create_remapped_circuit(const std::map< int, int > &qbit_map)
Call to create a new circuit with remapped qubits.
void release_gates()
Call to release the stored gates.
virtual void reorder_qubits(std::vector< int > qbit_list)
Call to reorder the qubits in the matrix of the gates (Obsolete function)
std::vector< int > block_type
void get_parameter_max(Matrix_real &range_max)
void add_r(int target_qbit)
Append a R gate to the list of gates.
std::vector< std::vector< int > > involved_qbits
int layer_num
number of gate layers
void add_cnot(int target_qbit, int control_qbit)
Append a CNOT gate gate to the list of gates.
Gates_block * import_gate_list_from_binary(Matrix_real ¶meters, const std::string &filename, int verbosity=3)
?????????
bool fragmented
boolean variable indicating whether the circuit was already partitioned or not
void add_cz_to_front(int target_qbit, int control_qbit)
Add a CZ gate gate to the front of the list of gates.
virtual void apply_to(Matrix_real ¶meters_mtx, Matrix &input, int parallel=0)
Call to apply the gate on the input array/matrix Gates_block*input.
void add_crot(int target_qbit, int control_qbit, crot_type subtype_in)
Append a CNOT gate gate to the list of gates.
void add_rz_to_front(int target_qbit)
Add a RZ gate to the front of the list of gates.
void add_r_to_front(int target_qbit)
Add a R gate to the front of the list of gates.
void add_un_to_front()
Add a UN gate to the front of the list of gates.
int get_gate_num()
Call to get the number of gates grouped in the class.
void add_h_to_front(int target_qbit)
Add a Hadamard gate to the front of the list of gates.
std::vector< Gate * > gates
The list of stored gates.
void add_x_to_front(int target_qbit)
Add a X gate to the front of the list of gates.
void add_sx_to_front(int target_qbit)
Add a SX gate to the front of the list of gates.
std::vector< int > block_end
void add_y_to_front(int target_qbit)
Add a Y gate to the front of the list of gates.
void add_syc(int target_qbit, int control_qbit)
Append a Sycamore gate (i.e.
int get_parameter_num()
Call to get the number of free parameters.
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.
void add_syc_to_front(int target_qbit, int control_qbit)
Add a Sycamore gate (i.e.
void add_ch(int target_qbit, int control_qbit)
Append a CH gate (i.e.
void add_ch_to_front(int target_qbit, int control_qbit)
Add a CH gate (i.e.
void add_composite()
Append a Composite gate to the list of gates.
void add_u2_to_front(int target_qbit)
Add a U2 gate to the front of the list of gates.
void add_u3(int target_qbit)
Append a U3 gate to the list of gates.
void add_rz(int target_qbit)
Append a RZ gate to the list of gates.
void add_y(int target_qbit)
Append a Y gate to the list of gates.
void reset_dependency_graph()
Method to reset the dependency graph of the gates in the circuit.
void combine(Gates_block *op_block)
Call to append the gates of an gate block to the current block.
void add_ry(int target_qbit)
Append a RY gate to the list of gates.
void add_on()
Append a ON gate to the list of gates.
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...
void determine_children(Gate *gate)
Call to obtain the child gates in the circuit.
void add_u1_to_front(int target_qbit)
Add a U1 gate to the front of the list of gates.
int extract_gates(Gates_block *op_block)
Call to extract the gates stored in the class.
void add_cry_to_front(int target_qbit, int control_qbit)
Add a CRY gate to the front of the list of gates.
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.
virtual Gates_block * clone()
Create a clone of the present class.
virtual void apply_from_right(Matrix_real ¶meters_mtx, Matrix &input)
Call to apply the gate on the input array/matrix by input*CNOT.
bool contains_adaptive_gate()
Call to determine, whether the circuit contains daptive gate or not.
Class to store data of complex arrays and its properties.
void add_gates_to_front(std::vector< Gate *> gates_in)
Add an array of gates to the front of the list of gates.
void add_gate_to_front(Gate *gate)
Add an gate to the front of the list of gates.
void add_z(int target_qbit)
Append a Z gate to the list of gates.
void add_cry(int target_qbit, int control_qbit)
Append a CRY gate to the list of gates.
Gates_block()
Default constructor of the class.
void add_rx_to_front(int target_qbit)
Add a RX gate to the front of the list of gates.
void add_tdg_to_front(int target_qbit)
Add a Tdg gate to the front of the list of gates.
A class responsible for grouping two-qubit (CNOT,CZ,CH) and one-qubit gates into layers.
void add_tdg(int target_qbit)
Append a Tdg gate to the list of gates.
void add_u3_to_front(int target_qbit)
Add a U3 gate to the front of the list of gates.
void add_cz(int target_qbit, int control_qbit)
Append a CZ gate gate to the list of gates.
Fixed point data related to a gate operation.
Base class for the representation of general gate operations.
bool is_qbit_present(std::vector< int > involved_qbits, int new_qbit, int num_of_qbits)
Call to check whether the given qubit is involved in the sub-circuit or not.
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...
void add_ry_to_front(int target_qbit)
Add a RY gate to the front of the list of gates.
virtual ~Gates_block()
Destructor of the class.
Header file for commonly used functions and wrappers to CBLAS functions.
void add_rx(int target_qbit)
Append a RX gate to the list of gates.
void add_un()
Append a UN gate to the list of gates.
void insert_gate(Gate *gate, int idx)
Call to insert a gate at a given position.
virtual Matrix_real extract_parameters(Matrix_real ¶meters)
Call to extract parameters from the parameter array corresponding to the circuit, in which the gate i...
void reset_parameter_start_indices()
Method to reset the parameter start indices of gate operations incorporated in the circuit...
Matrix_real inverse_reverse_parameters(const Matrix_real &v_in, std::vector< Gate *>::iterator gates_it, int num_of_gates)
Call to inverse-reverse the order of the parameters in an array.
void add_t_to_front(int target_qbit)
Add a T gate to the front of the list of gates.
Header file for DFE support in unitary simulation.
Gate * get_gate(int idx)
Call to get the gates stored in the class.
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...
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.
void add_adaptive_to_front(int target_qbit, int control_qbit)
Add a Adaptive gate to the front of the list of gates.
void add_gates(std::vector< Gate *> gates_in)
Append a list of gates to the list of gates.
void add_t(int target_qbit)
Append a T gate to the list of gates.
Class to store data of complex arrays and its properties.
void export_gate_list_to_binary(Matrix_real ¶meters, Gates_block *gates_block, const std::string &filename, int verbosity=3)
?????????
void add_sx(int target_qbit)
Append a SX gate to the list of gates.
virtual void set_qbit_num(int qbit_num_in)
Set the number of qubits spanning the matrix of the gates stored in the block of gates.