|
Sequential Quantum Gate Decomposer
v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gates. More...
#include <N_Qubit_Decomposition.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_ccx (int target_qbit, const std::vector< int > &control_qbits) |
| Append a CCX gate (i.e. More... | |
| void | add_ccx_to_front (int target_qbit, const std::vector< int > &control_qbits) |
| Add a CCX gate (i.e. 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_cp (int target_qbit, int control_qbit) |
| Append a CRY gate to the list of gates. More... | |
| void | add_cp_to_front (int target_qbit, int control_qbit) |
| Add a CRY gate to the front of the list of gates. More... | |
| void | add_cr (int target_qbit, int control_qbit) |
| Append a CR gate to the list of gates. More... | |
| void | add_cr_to_front (int target_qbit, int control_qbit) |
| Add a CR gate to the front of the list of gates. More... | |
| void | add_crot (int target_qbit, int control_qbit) |
| Append a CROT gate gate to the list of gates. More... | |
| void | add_crot_to_front (int target_qbit, int control_qbit) |
| Add a CROT gate gate to the front of the list of gates. More... | |
| void | add_crx (int target_qbit, int control_qbit) |
| Append a CRY gate to the list of gates. More... | |
| void | add_crx_to_front (int target_qbit, int control_qbit) |
| Add a CRY 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_crz (int target_qbit, int control_qbit) |
| Append a CRY gate to the list of gates. More... | |
| void | add_crz_to_front (int target_qbit, int control_qbit) |
| Add a CRY gate to the front of the list of gates. More... | |
| void | add_cswap (const std::vector< int > &target_qbits, const std::vector< int > &control_qbits) |
| Append a CSWAP gate (Controlled SWAP) to the list of gates. More... | |
| void | add_cswap_to_front (const std::vector< int > &target_qbits, const std::vector< int > &control_qbits) |
| Add a CSWAP gate (Controlled SWAP) to the front of the list of gates. More... | |
| void | add_cu (int target_qbit, int control_qbit) |
| Append a CU gate (i.e. More... | |
| void | add_cu_to_front (int target_qbit, int control_qbit) |
| Add a CU gate (i.e. More... | |
| void | add_cz (int target_qbit, int control_qbit) |
| Append a CZ gate gate to 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... | |
| virtual void | add_finalyzing_layer () |
| Call to add further layer to the gate structure used in the subdecomposition. 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_general_operation (const Matrix &operation_mtx, const std::vector< int > &target_qbits=std::vector< int >(), const std::vector< int > &control_qbits=std::vector< int >()) |
| Append a GENERAL_OPERATION gate with an explicitly provided matrix. 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_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_rxx (std::vector< int > target_qbits) |
| Append a RXX gate to the list of gates. More... | |
| void | add_rxx_to_front (std::vector< int > target_qbits) |
| Add a RXX 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_ryy (std::vector< int > target_qbits) |
| Append a RYY gate to the list of gates. More... | |
| void | add_ryy_to_front (std::vector< int > target_qbits) |
| Add a RYY 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_rzz (std::vector< int > target_qbits) |
| Append a RZZ gate to the list of gates. More... | |
| void | add_rzz_to_front (std::vector< int > target_qbits) |
| Add a RZZ gate to the front of the list of gates. More... | |
| void | add_s (int target_qbit) |
| Append a S gate to the list of gates. More... | |
| void | add_s_to_front (int target_qbit) |
| Add a S gate to the front of the list of gates. More... | |
| void | add_sdg (int target_qbit) |
| Append a Sdg gate to the list of gates. More... | |
| void | add_sdg_to_front (int target_qbit) |
| Add a Sdg gate to the front of the list of gates. More... | |
| void | add_swap (const std::vector< int > &target_qbits) |
| Append a SWAP gate to the list of gates. More... | |
| void | add_swap_to_front (const std::vector< int > &target_qbits) |
| Add a SWAP 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_sxdg (int target_qbit) |
| Append a SXdg gate to the list of gates. More... | |
| void | add_sxdg_to_front (int target_qbit) |
| Add a SXdg 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_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) override |
| Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters. More... | |
| virtual void | apply_derivate_to (Matrix_real ¶meters_mtx, Matrix &input, int parallel, std::vector< Matrix > &output) override |
| void | apply_derivate_to (Matrix_real ¶meters_mtx, Matrix &input, int parallel, std::vector< Matrix > &output, size_t output_offset, bool resize_output) |
| virtual std::vector< Matrix_float > | apply_derivate_to (Matrix_real_float ¶meters_mtx, Matrix_float &input, int parallel) override |
| Float32 overload: evaluate the derivative of the circuit w.r.t. More... | |
| virtual void | apply_derivate_to (Matrix_real_float ¶meters_mtx, Matrix_float &input, int parallel, std::vector< Matrix_float > &output) override |
| void | apply_derivate_to (Matrix_real_float ¶meters_mtx, Matrix_float &input, int parallel, std::vector< Matrix_float > &output, size_t output_offset, bool resize_output) |
| virtual void | apply_from_right (Matrix_real ¶meters_mtx, Matrix &input) override |
| Call to apply the gate on the input array/matrix by input*CNOT. More... | |
| virtual void | apply_from_right (Matrix_real_float ¶meters_mtx, Matrix_float &input) override |
| Float32 overload for right-side parametric gate application 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... | |
| virtual void | apply_from_right (Matrix_float &input) |
| Float32 overload for right-side gate application by input*Gate. More... | |
| virtual void | apply_from_right_inner (Matrix_real ¶meters_mtx, const Matrix_real &precomputed_sincos, Matrix &input) override |
| Internal right-apply entry that consumes already precomputed sin/cos values. More... | |
| virtual void | apply_from_right_inner (Matrix_real_float ¶meters_mtx, const Matrix_real_float &precomputed_sincos, Matrix_float &input) override |
| Float32 internal right-apply entry that consumes already precomputed sin/cos values. More... | |
| Matrix | apply_gate (Matrix &gate_mtx, Matrix &input_matrix) |
| Apply an gates on the input matrix. More... | |
| void | apply_global_phase_factor (QGD_Complex16 global_phase_factor, Matrix &u3_gate) |
| Call to apply the global phase to a matrix. More... | |
| void | apply_global_phase_factor () |
| Call to apply the current global phase to the unitary matrix. More... | |
| virtual void | apply_to (Matrix_real ¶meters_mtx, Matrix &input, int parallel=0) override |
| Call to apply the gate on the input array/matrix Gates_block*input. More... | |
| virtual void | apply_to (Matrix_float &input, int parallel=0) override |
| Float32 overload for gate application. More... | |
| virtual void | apply_to (Matrix_real_float ¶meters_mtx, Matrix_float &input, int parallel=0) override |
| Float32 overload for parametric gate application. More... | |
| virtual void | apply_to (Matrix_real_any ¶meters_mtx, Matrix_any &input, int parallel=0) |
| Precision-agnostic apply entry point for float32/float64 execution. More... | |
| virtual void | apply_to (Matrix &input, int parallel) |
| Call to apply the gate on the input array/matrix. More... | |
| void | apply_to (Matrix_any &input, int parallel) |
| Precision-agnostic dispatch helper for matrix/state application. More... | |
| virtual std::vector< Matrix > | apply_to_combined (Matrix_real ¶meters_mtx, Matrix &input, int parallel) override |
| Combined forward + derivative application with shared precomputed trig cache. More... | |
| virtual void | apply_to_combined (Matrix_real ¶meters_mtx, Matrix &input, int parallel, std::vector< Matrix > &output) override |
| virtual std::vector< Matrix_float > | apply_to_combined (Matrix_real_float ¶meters_mtx, Matrix_float &input, int parallel) override |
| Float32 combined forward + derivative application. More... | |
| virtual void | apply_to_combined (Matrix_real_float ¶meters_mtx, Matrix_float &input, int parallel, std::vector< Matrix_float > &output) override |
| virtual std::vector< Matrix > | apply_to_combined_inner (Matrix_real ¶meters_mtx, const Matrix_real &precomputed_sincos, Matrix &input, int parallel) override |
| Internal combined forward+derivative entry with precomputed sin/cos. More... | |
| virtual void | apply_to_combined_inner (Matrix_real ¶meters_mtx, const Matrix_real &precomputed_sincos, Matrix &input, int parallel, std::vector< Matrix > &output) override |
| virtual std::vector< Matrix_float > | apply_to_combined_inner (Matrix_real_float ¶meters_mtx, const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel) override |
| Float32 internal combined forward+derivative entry with precomputed sin/cos. More... | |
| virtual void | apply_to_combined_inner (Matrix_real_float ¶meters_mtx, const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel, std::vector< Matrix_float > &output) override |
| virtual void | apply_to_inner (Matrix_real ¶meters_mtx, const Matrix_real &precomputed_sincos, Matrix &input, int parallel=0) override |
| Internal apply entry that consumes already precomputed sin/cos values. More... | |
| virtual void | apply_to_inner (Matrix_real_float ¶meters_mtx, const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel=0) override |
| Float32 internal apply entry that consumes already precomputed sin/cos values. More... | |
| void | apply_to_list (Matrix_real ¶meters, std::vector< Matrix > &inputs, int parallel) override |
| Call to apply the gate on the input array/matrix by U3*input. More... | |
| void | apply_to_list (Matrix_real_float ¶meters, std::vector< Matrix_float > &inputs, int parallel) override |
| Float32 overload: apply circuit to a list of float32 matrices. More... | |
| virtual void | apply_to_list (std::vector< Matrix > &inputs, int parallel) |
| Call to apply the gate on a list of inputs. More... | |
| virtual void | apply_to_list (std::vector< Matrix_float > &inputs, int parallel) |
| Float32 overload: apply gate to a list of float32 inputs without parameters. More... | |
| void | calc_decomposition_error (Matrix &decomposed_matrix) |
| Calculate the error of the decomposition according to the spectral norm of \( U-U_{approx} \), where \( U_{approx} \) is the unitary produced by the decomposing quantum cirquit. More... | |
| double | calculate_cost_function (Matrix &matrix_new, Matrix *ret_temp=NULL) |
| Calculate the current cost function value from an already transformed matrix. More... | |
| double | calculate_cost_function (Matrix_float &matrix_new, Matrix_float *ret_temp=NULL) |
| Float32 cost-function entry. More... | |
| void | calculate_new_global_phase_factor (QGD_Complex16 global_phase_factor_new) |
| Calculate the new global phase of the Unitary matrix after removing a trivial U3 matrix. More... | |
| bool | check_optimization_solution () |
| check_optimization_solution More... | |
| void | clear_children () |
| Call to erase data on children. More... | |
| void | clear_parents () |
| Call to erase data on parents. More... | |
| virtual Gates_block * | clone () override |
| 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... | |
| Matrix_real | compute_precomputed_sincos (const Matrix_real ¶meters) const |
| Public wrapper to precompute gate-local sin/cos pairs. More... | |
| Matrix_real_float | compute_precomputed_sincos (const Matrix_real_float ¶meters) const |
| Float32 public wrapper to precompute gate-local sin/cos pairs. 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 | decompose_submatrix () |
| Start the decompostion process to recursively decompose the submatrices. More... | |
| virtual Matrix | derivative_aux_kernel (const Matrix_real &precomputed_sincos, int param_idx) |
| virtual Matrix_float | derivative_aux_kernel (const Matrix_real_float &precomputed_sincos, int param_idx) |
| virtual void | derivative_aux_kernel_to (const Matrix_real &precomputed_sincos, int param_idx, Matrix &output) |
| virtual void | derivative_aux_kernel_to (const Matrix_real_float &precomputed_sincos, int param_idx, Matrix_float &output) |
| virtual Matrix | derivative_kernel (const Matrix_real &precomputed_sincos, int param_idx) |
| virtual Matrix_float | derivative_kernel (const Matrix_real_float &precomputed_sincos, int param_idx) |
| virtual void | derivative_kernel_to (const Matrix_real &precomputed_sincos, int param_idx, Matrix &output) |
| virtual void | derivative_kernel_to (const Matrix_real_float &precomputed_sincos, int param_idx, Matrix_float &output) |
| 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... | |
| void | export_current_cost_fnc (double current_minimum) |
| Call to print out into a file the current cost function and the second Rényi entropy on the subsystem made of qubits 0 and 1. More... | |
| virtual void | export_current_cost_fnc (double current_minimum, Matrix_real ¶meters) |
| Call to print out into a file the current cost function and the second Rényi entropy on the subsystem made of qubits 0 and 1. More... | |
| void | export_unitary (std::string &filename) |
| exports unitary matrix to binary file More... | |
| int | extract_gates (Gates_block *op_block) |
| Call to extract the gates stored in the class. More... | |
| virtual Matrix_real_float | extract_parameters (Matrix_real_float ¶meters) |
| Float32 overload of extract_parameters. More... | |
| virtual Matrix_real | extract_parameters (Matrix_real ¶meters) override |
| Call to extract parameters from the parameter array corresponding to the circuit, in which the gate is embedded. More... | |
| void | extract_subdecomposition_results (Sub_Matrix_Decomposition *cSub_decomposition) |
| Call to extract and store the calculated parameters and gates of the sub-decomposition processes. More... | |
| void | final_optimization () |
| final optimization procedure improving the accuracy of the decompositin when all the qubits were already disentangled. More... | |
| void | finalize_decomposition () |
| After the main optimization problem is solved, the indepent qubits can be rotated into state |0> by this def. More... | |
| void | fragment_circuit () |
| virtual Matrix | gate_kernel (const Matrix_real &precomputed_sincos) |
| Compute the gate kernel matrix from precomputed trigonometric values. More... | |
| virtual Matrix_float | gate_kernel (const Matrix_real_float &precomputed_sincos) |
| virtual void | gate_kernel_to (const Matrix_real &precomputed_sincos, Matrix &output) |
| virtual void | gate_kernel_to (const Matrix_real_float &precomputed_sincos, Matrix_float &output) |
| int | get_accelerator_num () |
| Get the number of accelerators to be reserved on DFEs on users demand. More... | |
| 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... | |
| std::vector< int > | get_control_qbits () const |
| Call to get the vector of control qubits. More... | |
| double | get_correction1_scale () |
| Call to get the prefactor of the single-bitflip errors in the cost function. More... | |
| double | get_correction2_scale () |
| Call to get the prefactor of the two-bitflip errors in the cost function. More... | |
| cost_function_type | get_cost_function_variant () |
| Call to get the variant of the cost function used in the calculations. More... | |
| double | get_current_minimum () |
| Call to get the obtained minimum of the cost function. More... | |
| Matrix | get_decomposed_matrix () |
| Calculate the decomposed matrix resulted by the effect of the optimized gates on the unitary Umtx. More... | |
| double | get_decomposition_error () |
| Call to get the error of the decomposition. 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... | |
| QGD_Complex16 | get_global_phase_factor () |
| Get the global phase of the Unitary matrix. More... | |
| std::vector< int > | get_involved_qubits (bool only_target=false) override |
| Call to get the qubits involved in the gates stored in the block of gates. More... | |
| Matrix | get_matrix (Matrix_real ¶meters) override |
| Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block) More... | |
| Matrix | get_matrix (Matrix_real ¶meters, int parallel) override |
| Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block) More... | |
| Matrix_float | get_matrix (Matrix_real_float ¶meters) |
| Matrix_float | get_matrix (Matrix_real_float ¶meters, int parallel) override |
| Float32 overload: retrieve the gate matrix. More... | |
| virtual Matrix | get_matrix () |
| Retrieve the gate matrix for zero-parameter gates (no parameters). More... | |
| virtual Matrix | get_matrix (int parallel) |
| Retrieve the gate matrix for zero-parameter gates with parallel flag. More... | |
| std::string | get_name () |
| Call to get the name label of the gate. More... | |
| int | get_num_iters () |
| Get the number of processed iterations during the optimization process. More... | |
| Matrix_real | get_optimized_parameters () |
| Call to get the optimized parameters. More... | |
| void | get_optimized_parameters (double *ret) |
| Call to get the optimized parameters. More... | |
| Matrix_real_float | get_optimized_parameters_float () |
| Return optimized parameters in float32. More... | |
| int | get_parallel_configuration () |
| Get the parallel configuration from the config. More... | |
| void | get_parameter_max (Matrix_real &range_max) |
| virtual std::vector< double > | get_parameter_multipliers () const |
| Returns the per-parameter multipliers relative to 2Ï used by extract_parameters. More... | |
| int | get_parameter_num () override |
| 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... | |
| double | get_previous_cost_function_value () |
| Call to retrieve the previous value of the cost funtion to be used to evaluate bitflip errors in the cost funtion (see Eq. More... | |
| std::string | get_project_name () |
| Call to get the current name of the project. 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... | |
| std::vector< int > | get_target_qbits () const |
| Call to get the vector of target qubits. More... | |
| int | get_trace_offset () |
| Get the trace ffset used in the evaluation of the cost function. More... | |
| gate_type | get_type () |
| Call to get the type of the operation. More... | |
| Matrix | get_Umtx () |
| Call to retrive a pointer to the unitary to be transformed. More... | |
| Matrix_float | get_Umtx_float () |
| Return the float32 unitary copy used by float execution. More... | |
| int | get_Umtx_size () |
| Call to get the size of the unitary to be transformed. More... | |
| bool | get_use_float () const |
| True when config["use_float"] requests float32 circuit execution. More... | |
| Matrix | import_unitary_from_binary (std::string &filename) |
| Import a Unitary matrix from a file. More... | |
| void | increment_num_iters (int delta=1) |
| Atomically increment the tracked number of optimization iterations. More... | |
| void | insert_gate (Gate *gate, int idx) |
| Call to insert a gate at a given position. More... | |
| virtual Matrix | inverse_gate_kernel (const Matrix_real &precomputed_sincos) |
| virtual Matrix_float | inverse_gate_kernel (const Matrix_real_float &precomputed_sincos) |
| virtual void | inverse_gate_kernel_to (const Matrix_real &precomputed_sincos, Matrix &output) |
| virtual void | inverse_gate_kernel_to (const Matrix_real_float &precomputed_sincos, Matrix_float &output) |
| void | list_gates (int start_index) |
| Call to print the gates decomposing the initial unitary. 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... | |
| N_Qubit_Decomposition () | |
| Nullary constructor of the class. More... | |
| N_Qubit_Decomposition (Matrix Umtx_in, int qbit_num_in, bool optimize_layer_num_in, std::map< std::string, Config_Element > &config, guess_type initial_guess_in) | |
| Constructor of the class. More... | |
| N_Qubit_Decomposition (Matrix_float Umtx_in, int qbit_num_in, bool optimize_layer_num_in, std::map< std::string, Config_Element > &config, guess_type initial_guess_in) | |
| Constructor of the class from a single precision unitary matrix. More... | |
| virtual double | optimization_problem (const double *parameters) |
| This is an abstact definition of function giving the cost functions measuring the entaglement of the qubits. More... | |
| double | optimization_problem (double *parameters) |
| Evaluate the optimization problem of the optimization. More... | |
| virtual double | optimization_problem (Matrix_real ¶meters) |
| The optimization problem of the final optimization. More... | |
| double | optimization_problem (Matrix_real parameters, void *void_instance, Matrix ret_temp) |
| The optimization problem of the final optimization. More... | |
| Matrix_real | optimization_problem_batched (std::vector< Matrix_real > ¶meters_vec) |
| The cost function of the optimization with batched input (implemented only for the Frobenius norm cost function when run with DFE) More... | |
| virtual void | optimization_problem_combined (Matrix_real parameters, double *f0, Matrix_real grad) |
| Call to calculate both the cost function and the its gradient components. More... | |
| virtual void | optimization_problem_combined_non_static (Matrix_real parameters, void *void_instance, double *f0, Matrix_real &grad) |
| Call to calculate both the cost function and the its gradient components. More... | |
| void | optimization_problem_combined_unitary (Matrix_real parameters, Matrix &Umtx, std::vector< Matrix > &Umtx_deriv) |
| Call to calculate both the effect of the circuit on th eunitary and it's gradient componets. More... | |
| virtual double | optimization_problem_non_static (Matrix_real parameters, void *void_instance) |
| The optimization problem of the final optimization. More... | |
| double | optimization_problem_panelty (double *parameters, Gates_block *gates_block) |
| The optimization problem of the final optimization. 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 | randomize_parameters (Matrix_real &input, Matrix_real &output, const double f0) |
| Call to randomize the parameter. 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... | |
| void | reorder_qubits (std::vector< int > qbit_list) |
| Call to reorder the qubits in the matrix of the gate. 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_control_qbits (const std::vector< int > &control_qbits_in) |
| Call to set the control qubits for the gate operation. More... | |
| void | set_convergence_threshold (double convergence_threshold_in) |
| Call to set the threshold of convergence in the optimization processes. More... | |
| void | set_cost_function_variant (cost_function_type variant) |
| Call to set the variant of the cost function used in the calculations. More... | |
| void | set_custom_gate_structure (std::map< int, Gates_block *> gate_structure_in) |
| Call to set custom layers to the gate structure that are intended to be used in the subdecomposition. More... | |
| void | set_custom_gate_structure (Gates_block *gate_structure_in) |
| Call to set custom layers to the gate structure that are intended to be used in the subdecomposition. More... | |
| void | set_debugfile (std::string debugfile) |
| Call to set the debugfile name. More... | |
| void | set_global_phase (double new_global_phase) |
| Call to set global phase. More... | |
| int | set_identical_blocks (int n, int identical_blocks_in) |
| Set the number of identical successive blocks during the subdecomposition of the n-th qubit. More... | |
| int | set_identical_blocks (std::map< int, int > identical_blocks_in) |
| Set the number of identical successive blocks during the subdecomposition of the n-th qubit. More... | |
| int | set_iteration_loops (int n, int iteration_loops_in) |
| Set the number of iteration loops during the subdecomposition of the n-th qubit. More... | |
| int | set_iteration_loops (std::map< int, int > iteration_loops_in) |
| Set the number of iteration loops during the subdecomposition of the qbit-th qubit. More... | |
| void | set_matrix (Matrix input) |
| Call to set the stored matrix in the operation. More... | |
| void | set_matrix (Matrix_float input) |
| void | set_max_inner_iterations (int max_inner_iterations_in) |
| Call to set the maximal number of iterations for which an optimization engine tries to solve the optimization problem. More... | |
| void | set_max_iteration (int max_outer_iterations_in) |
| Call to set the maximal number of the iterations in the optimization process. More... | |
| int | set_max_layer_num (int n, int max_layer_num_in) |
| Set the maximal number of layers used in the subdecomposition of the n-th qubit. More... | |
| int | set_max_layer_num (std::map< int, int > max_layer_num_in) |
| Set the maximal number of layers used in the subdecomposition of the n-th qubit. More... | |
| void | set_min_fusion (int min_fusion) |
| void | set_optimization_blocks (int optimization_block_in) |
| Call to set the number of gate blocks to be optimized in one shot. More... | |
| void | set_optimization_tolerance (double tolerance_in) |
| Call to set the tolerance of the optimization processes. More... | |
| void | set_optimized_parameters (double *parameters, int num_of_parameters) |
| Call to set the optimized parameters for initial optimization. More... | |
| void | set_optimizer (optimization_aglorithms alg_in) |
| Call to set the optimizer engine to be used in solving the optimization problem. More... | |
| void | set_osr_params (std::vector< std::vector< int >> use_cuts_in, int osr_rank_in, bool use_softmax_in) |
| 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... | |
| void | set_project_name (std::string &project_name_new) |
| Call to set the name of the project. More... | |
| 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. More... | |
| void | set_random_shift_count_max (int random_shift_count_max_in) |
| Call to set the maximal number of parameter randomization tries to escape a local minimum. More... | |
| void | set_target_qbit (int target_qbit_in) |
| Call to set the target qubit for the gate operation. More... | |
| void | set_target_qbits (const std::vector< int > &target_qbits_in) |
| Call to set the target qubits for the gate operation. More... | |
| void | set_trace_offset (int trace_offset_in) |
| Set the trace offset used in the evaluation of the cost function. More... | |
| void | set_verbose (int verbose_in) |
| Call to set the verbose attribute. More... | |
| void | solve_layer_optimization_problem (int num_of_parameters, Matrix_real solution_guess) |
| Call to solve layer by layer the optimization problem via calling one of the implemented algorithms. More... | |
| void | solve_layer_optimization_problem_ADAM (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via ADAM algorithm. More... | |
| void | solve_layer_optimization_problem_ADAM_BATCHED (int num_of_parameters, Matrix_real &solution_guess_) |
| Call to solve layer by layer the optimization problem via batched ADAM algorithm. More... | |
| void | solve_layer_optimization_problem_AGENTS (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via the AGENT algorithm. More... | |
| void | solve_layer_optimization_problem_AGENTS_COMBINED (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via the AGENT COMBINED algorithm. More... | |
| void | solve_layer_optimization_problem_BAYES_AGENTS (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via Bayes & Agents algorithm. More... | |
| void | solve_layer_optimization_problem_BAYES_OPT (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via Bayes algorithm. More... | |
| void | solve_layer_optimization_problem_BFGS (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via BBFG algorithm. More... | |
| void | solve_layer_optimization_problem_BFGS2 (int num_of_parameters, Matrix_real solution_guess) |
| Call to solve layer by layer the optimization problem via BBFG algorithm. More... | |
| void | solve_layer_optimization_problem_COSINE (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via the COSINE algorithm. More... | |
| void | solve_layer_optimization_problem_GRAD_DESCEND (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via the GRAD_DESCEND (line search in the direction determined by the gradient) algorithm. More... | |
| void | solve_layer_optimization_problem_GRAD_DESCEND_PARAMETER_SHIFT_RULE (int num_of_parameters, Matrix_real &solution_guess) |
| Call to solve layer by layer the optimization problem via the GRAD_DESCEND_PARAMETER_SHIFT_RULE algorithm. More... | |
| void | solve_optimization_problem (double *solution_guess, int solution_guess_num) |
| This method can be used to solve the main optimization problem which is devidid into sub-layer optimization processes. More... | |
| virtual void | start_decomposition (bool finalize_decomp=true) |
| Start the disentanglig process of the unitary. More... | |
| virtual | ~N_Qubit_Decomposition () |
| Destructor of the class. More... | |
Static Public Member Functions | |
| static Matrix | calc_one_qubit_u3 (double ThetaOver2=0.0, double Phi=0.0, double Lambda=0.0) |
| Build a 2x2 U3 kernel from angles (theta/2, phi, lambda). More... | |
| static Matrix_float | calc_one_qubit_u3 (float ThetaOver2, float Phi, float Lambda) |
| static void | export_current_cost_fnc (double current_minimum, Matrix_real ¶meters, void *void_instance) |
| Call to print out into a file the current cost function and the second Rényi entropy on the subsystem made of qubits 0 and 1. More... | |
| static void | Init_max_layer_num () |
| Initializes default layer numbers. More... | |
| static double | optimization_problem (Matrix_real parameters, void *void_instance) |
| The optimization problem of the final optimization. More... | |
| static void | optimization_problem_combined (Matrix_real parameters, void *void_instance, double *f0, Matrix_real &grad) |
| Call to calculate both the cost function and the its gradient components. More... | |
| static void | optimization_problem_combined_unitary (Matrix_real parameters, void *void_instance, Matrix &Umtx, std::vector< Matrix > &Umtx_deriv) |
| Call to calculate both the effect of the circuit on th eunitary and it's gradient componets. More... | |
| static void | optimization_problem_grad (Matrix_real parameters, void *void_instance, Matrix_real &grad) |
| Calculate the derivative of the cost function with respect to the free parameters. More... | |
Public Attributes | |
| std::map< std::string, Config_Element > | config |
| config metadata utilized during the optimization More... | |
| 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... | |
| QGD_Complex16 | global_phase_factor |
| The global phase. More... | |
| int | id |
| unique id indentifying the instance of the class More... | |
| int | max_inner_iterations |
| the maximal number of iterations for which an optimization engine tries to solve the optimization problem More... | |
| int | optimization_block |
| number of gate blocks used in one shot of the optimization process More... | |
| double | optimization_tolerance |
| The maximal allowed error of the optimization problem (The error of the decomposition would scale with the square root of this value) More... | |
| std::string | project_name |
| the name of the project More... | |
| int | random_shift_count_max |
| the maximal number of parameter randomization tries to escape a local minimum. More... | |
| int | verbose |
| Set the verbosity level of the output messages. More... | |
Static Public Attributes | |
| static std::map< int, int > | max_layer_num_def |
| A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process by default for the subdecomposing of the nth qubits. More... | |
Protected Member Functions | |
| std::vector< Matrix > | apply_derivative_to_precomputed (const Matrix_real &precomputed_sincos, 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_derivative_to_precomputed (const Matrix_real &precomputed_sincos, Matrix &input, int parallel, std::vector< Matrix > &output, size_t offset=0, bool resize_output=true) |
| std::vector< Matrix_float > | apply_derivative_to_precomputed (const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel) |
| void | apply_derivative_to_precomputed (const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel, std::vector< Matrix_float > &output, size_t offset=0, bool resize_output=true) |
| void | apply_kernel_from_right (Matrix &u3_1qbit, Matrix &input, const Matrix *alt_kernel=nullptr) |
| Call to apply the gate kernel on the input state or unitary from right (no AVX support) More... | |
| void | apply_kernel_from_right (Matrix_float &u3_1qbit, Matrix_float &input, const Matrix_float *alt_kernel=nullptr) |
| void | apply_kernel_to (Matrix &u3_1qbit, Matrix &input, bool deriv=false, int parallel=0, const Matrix *alt_kernel=nullptr) |
| Call to apply the gate kernel on the input state or unitary with optional AVX support. More... | |
| void | apply_kernel_to (Matrix_float &u3_1qbit, Matrix_float &input, bool deriv=false, int parallel=0, const Matrix_float *alt_kernel=nullptr) |
| Float32 overload of one-qubit kernel application helper. More... | |
| void | invalidate_structure_cache () |
| Matrix_real | precompute_sincos (const Matrix_real ¶meters) const |
| Precompute sin/cos pairs for each gate-local parameter. More... | |
| Matrix_real_float | precompute_sincos (const Matrix_real_float ¶meters) const |
| Float32 precompute sin/cos pairs for each gate-local parameter. More... | |
| void | sync_optimized_parameters_float () |
| Synchronize the float32 parameter mirror from the double optimizer storage. More... | |
Protected Attributes | |
| int | accelerator_num |
| number of utilized accelerators More... | |
| bool | adaptive_eta |
| logical variable indicating whether adaptive learning reate is used in the ADAM algorithm More... | |
| optimization_aglorithms | alg |
| The optimization algorithm to be used in the optimization. More... | |
| std::vector< Gate * > | children |
| list of child gates to be applied after this current gate More... | |
| double | circuit_simulation_time |
| Time spent on circuit simulation/cost function evaluation. More... | |
| int | control_qbit |
| The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations. More... | |
| std::vector< int > | control_qbits |
| Vector of control qubit indices (for multi-qubit gates) More... | |
| double | convergence_threshold |
| The convergence threshold in the optimization process. More... | |
| double | correction1_scale |
| prefactor of the single-bitflip errors in the cost function. (see Eq. (21) in arXiv:2210.09191) More... | |
| double | correction2_scale |
| prefactor of the double-bitflip errors in the cost function. (see Eq. (21) in arXiv:2210.09191) More... | |
| cost_function_type | cost_fnc |
| The chosen variant of the cost function. More... | |
| double | CPU_time |
| time spent on optimization More... | |
| volatile double | current_minimum |
| The current minimum of the optimization problem. More... | |
| double | decomposition_error |
| error of the final decomposition More... | |
| bool | decomposition_finalized |
| The optimized parameters for the gates. More... | |
| int | finalizing_gates_num |
| number of finalizing (deterministic) opertaions rotating the disentangled qubits into state |0>. More... | |
| int | finalizing_parameter_num |
| the number of the finalizing (deterministic) parameters of gates rotating the disentangled qubits into state |0>. More... | |
| SmartAtomicPtr< Gates_block > | fusion_block |
| std::map< int, Gates_block * > | gate_structure |
| A map of <int n: Gates_block* block> describing custom gate structure to be used in the decomposition. Gate block corresponding to n is used in the subdecomposition of the n-th qubit. The Gate block is repeated periodically. More... | |
| std::vector< Gate * > | gates |
| The list of stored gates. More... | |
| std::mt19937 | gen |
| Standard mersenne_twister_engine seeded with rd() More... | |
| double | global_target_minimum |
| The global target minimum of the optimization problem. More... | |
| std::map< int, int > | identical_blocks |
| A map of <int n: int num> indicating that how many identical successive blocks should be used in the disentanglement of the nth qubit from the others. More... | |
| guess_type | initial_guess |
| type to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2 More... | |
| std::vector< int > | involved_qubits_cache |
| std::shared_ptr< tbb::spin_mutex > | involved_qubits_cache_mutex |
| bool | involved_qubits_cache_valid |
| std::vector< int > | involved_target_qubits_cache |
| bool | involved_target_qubits_cache_valid |
| std::map< int, int > | iteration_loops |
| A map of <int n: int num> indicating the number of iteration in each step of the decomposition. More... | |
| int | layer_num |
| number of gate layers More... | |
| int | matrix_size |
| The size N of the NxN matrix associated with the operations. More... | |
| std::map< int, int > | max_layer_num |
| A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process for the subdecomposing of the nth qubits. More... | |
| int | max_outer_iterations |
| Maximal number of iterations allowed in the optimization process. More... | |
| int | min_fusion |
| maximal number of qubits in partitions More... | |
| std::string | name |
| A string labeling the gate operation. More... | |
| int | num_threads |
| Store the number of OpenMP threads. (During the calculations OpenMP multithreading is turned off.) More... | |
| std::atomic< int > | number_of_iters |
| number of iterations More... | |
| bool | optimization_problem_solved |
| logical value describing whether the optimization problem was solved or not More... | |
| bool | optimize_layer_num |
| logical value. Set true to optimize the minimum number of gate layers required in the decomposition, or false when the predefined maximal number of layer gates is used (ideal for general unitaries). More... | |
| Matrix_real | optimized_parameters_mtx |
| The optimized parameters for the gates. More... | |
| Matrix_real_float | optimized_parameters_mtx_float |
| Float32 optimized parameters used by the hot gate-application path. More... | |
| int | osr_rank = -1 |
| rank used for OSR entanglement cost function 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... | |
| std::vector< Gate * > | parents |
| list of parent gates to be applied in the circuit prior to this current gate More... | |
| double | prev_cost_fnv_val |
| the previous value of the cost funtion to be used to evaluate bitflip errors in the cost funtion (see Eq. (21) in arXiv:2210.09191) More... | |
| int | qbit_num |
| number of qubits spanning the matrix of the operation More... | |
| double | radius |
| parameter to contron the radius of parameter randomization around the curren tminimum More... | |
| double | randomization_rate |
| randomization rate More... | |
| int | target_qbit |
| The index of the qubit on which the operation acts (target_qbit >= 0) More... | |
| std::vector< int > | target_qbits |
| Vector of target qubit indices (for multi-qubit gates) More... | |
| int | trace_offset |
| The offset in the first columns from which the "trace" is calculated. In this case Tr(A) = sum_(i-offset=j) A_{ij}. More... | |
| gate_type | type |
| The type of the operation (see enumeration gate_type) More... | |
| Matrix | Umtx |
| The unitary to be decomposed. More... | |
| Matrix_float | Umtx_float |
| Float32 copy of the unitary used when config["use_float"] is true. More... | |
| std::vector< std::vector< int > > | use_cuts |
| cuts used for OSR entanglement cost function More... | |
| bool | use_float |
| Selects float32 circuit application for parameter/unitary/state data. More... | |
| bool | use_softmax = false |
| logical variable indicating whether to use softmax or average in the OSR entanglement cost function More... | |
A base class to determine the decomposition of an N-qubit unitary into a sequence of CNOT and U3 gates.
This class contains the non-template implementation of the decomposition class.
Definition at line 35 of file N_Qubit_Decomposition.h.
| N_Qubit_Decomposition::N_Qubit_Decomposition | ( | ) |
Nullary constructor of the class.
Definition at line 33 of file N_Qubit_Decomposition.cpp.


| N_Qubit_Decomposition::N_Qubit_Decomposition | ( | Matrix | Umtx_in, |
| int | qbit_num_in, | ||
| bool | optimize_layer_num_in, | ||
| std::map< std::string, Config_Element > & | config_in, | ||
| guess_type | initial_guess_in = CLOSE_TO_ZERO |
||
| ) |
Constructor of the class.
| Umtx_in | The unitary matrix to be decomposed |
| qbit_num_in | The number of qubits spanning the unitary Umtx |
| optimize_layer_num_in | Optional logical value. If true, then the optimization tries to determine the lowest number of the layers needed for the decomposition. If False (default), the optimization is performed for the maximal number of layers. |
| initial_guess_in | Enumeration element indicating the method to guess initial values for the optimization. Possible values: 'zeros=0' ,'random=1', 'close_to_zero=2' |
Definition at line 53 of file N_Qubit_Decomposition.cpp.

| N_Qubit_Decomposition::N_Qubit_Decomposition | ( | Matrix_float | Umtx_in, |
| int | qbit_num_in, | ||
| bool | optimize_layer_num_in, | ||
| std::map< std::string, Config_Element > & | config, | ||
| guess_type | initial_guess_in | ||
| ) |
Constructor of the class from a single precision unitary matrix.
Definition at line 62 of file N_Qubit_Decomposition.cpp.

|
virtual |
Destructor of the class.
Definition at line 73 of file N_Qubit_Decomposition.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 2440 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 2455 of file Gates_block.cpp.

Append a CCX gate (i.e.
Toffoli gate) to the list of gates
| target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
| control_qbits | Vector of control qubit indices (should contain exactly 2 elements for CCX) |
Toffoli gate) operation to the list of gates
| target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
| control_qbits | Vector of control qubit indices (should contain exactly 2 elements for CCX) |
Definition at line 2342 of file Gates_block.cpp.

|
inherited |
Add a CCX gate (i.e.
Toffoli gate) to the front of the list of gates
| target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
| control_qbits | Vector of control qubit indices (should contain exactly 2 elements for CCX) |
Toffoli gate) operation to the front of the list of gates
| target_qbit | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
| control_qbits | Vector of control qubit indices (should contain exactly 2 elements for CCX) |
Definition at line 2354 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 2278 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 2295 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 1880 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 1897 of file Gates_block.cpp.

Append a CRY gate to the list of gates.
Append a CRX 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 1758 of file Gates_block.cpp.

Add a CRY gate to the front of the list of gates.
Add a CRX 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 1774 of file Gates_block.cpp.

Append a CR 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 1789 of file Gates_block.cpp.

Add a CR 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 1805 of file Gates_block.cpp.

Append a CROT gate gate to the list of gates.
Append a CROT 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 1821 of file Gates_block.cpp.

Add a CROT gate gate to the front of the list of gates.
Add a CROT 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 1837 of file Gates_block.cpp.

Append a CRY gate to the list of gates.
Append a CRX 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 1696 of file Gates_block.cpp.

Add a CRY gate to the front of the list of gates.
Add a CRX 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 1712 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 1665 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 1681 of file Gates_block.cpp.

Append a CRY gate to the list of gates.
Append a CRX 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 1727 of file Gates_block.cpp.

Add a CRY gate to the front of the list of gates.
Add a CRX 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 1743 of file Gates_block.cpp.

|
inherited |
Append a CSWAP gate (Controlled SWAP) to the list of gates.
| target_qbits | Vector of target qubit indices (should contain exactly 2 elements) |
| control_qbits | Vector of control qubit indices (should contain exactly 1 element) |
Definition at line 2388 of file Gates_block.cpp.

|
inherited |
Add a CSWAP gate (Controlled SWAP) to the front of the list of gates.
| target_qbits | Vector of target qubit indices (should contain exactly 2 elements) |
| control_qbits | Vector of control qubit indices (should contain exactly 1 element) |
Definition at line 2400 of file Gates_block.cpp.

Append a CU gate (i.e.
controlled U 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 U 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 2310 of file Gates_block.cpp.

Add a CU gate (i.e.
controlled U 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 U 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 2327 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 1915 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 1932 of file Gates_block.cpp.

|
virtualinherited |
Call to add further layer to the gate structure used in the subdecomposition.
Reimplemented in N_Qubit_Decomposition_adaptive.
Definition at line 407 of file Optimization_Interface.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 2500 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 2598 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 2533 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 2411 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 2424 of file Gates_block.cpp.

|
inherited |
Append a GENERAL_OPERATION gate with an explicitly provided matrix.
| operation_mtx | The operation matrix. Must be matrix_size x matrix_size. |
| target_qbits | Optional metadata for target qubits involved in this gate. |
| control_qbits | Optional metadata for control qubits involved in this gate. |
Definition at line 2472 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 1946 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 1959 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 1605 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 1618 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 1498 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 1511 of file Gates_block.cpp.

|
inherited |
Append a RXX gate to the list of gates.
| target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 1525 of file Gates_block.cpp.

|
inherited |
Add a RXX 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 1538 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 1633 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 1647 of file Gates_block.cpp.

|
inherited |
Append a RYY gate to the list of gates.
| target_qbits | The identification numbers of the target qubits (should contain exactly 2 elements) |
Definition at line 1552 of file Gates_block.cpp.

|
inherited |
Add a RYY gate to the front of the list of gates.
| target_qbits | The identification numbers of the target qubits (should contain exactly 2 elements) |
Definition at line 1565 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 1851 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 1864 of file Gates_block.cpp.

|
inherited |
Append a RZZ gate to the list of gates.
| target_qbits | The identification numbers of the target qubits (should contain exactly 2 elements) |
Definition at line 1579 of file Gates_block.cpp.

|
inherited |
Add a RZZ gate to the front of the list of gates.
| target_qbits | The identification numbers of the target qubits (should contain exactly 2 elements) |
Definition at line 1592 of file Gates_block.cpp.

|
inherited |
Append a S gate to the list of gates.
| target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 2065 of file Gates_block.cpp.

|
inherited |
Add a S 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 2078 of file Gates_block.cpp.

|
inherited |
Append a Sdg gate to the list of gates.
| target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 2094 of file Gates_block.cpp.

|
inherited |
Add a Sdg 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 2107 of file Gates_block.cpp.

|
inherited |
Append a SWAP gate to the list of gates.
| target_qbits | Vector of target qubit indices (should contain exactly 2 elements for SWAP) |
Definition at line 2365 of file Gates_block.cpp.

|
inherited |
Add a SWAP gate to the front of the list of gates.
| target_qbits | Vector of target qubit indices (should contain exactly 2 elements for SWAP) |
Definition at line 2376 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 2186 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 2199 of file Gates_block.cpp.

|
inherited |
Append a SXdg gate to the list of gates.
| target_qbit | The identification number of the targt qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 2214 of file Gates_block.cpp.

|
inherited |
Add a SXdg 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 2227 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 2243 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 2260 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 2124 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 2137 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 2154 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 2167 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 1419 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 1432 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 1445 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 1458 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 1471 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 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 1977 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 1990 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 2006 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 2019 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 2035 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 2048 of file Gates_block.cpp.

|
overridevirtualinherited |
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 996 of file Gates_block.cpp.

|
overridevirtualinherited |
Reimplemented from Gate.
Definition at line 1005 of file Gates_block.cpp.

|
inherited |
|
overridevirtualinherited |
Float32 overload: evaluate the derivative of the circuit w.r.t.
all free parameters. Stabilized path: casts inputs to float64, runs the float64 derivative, then casts the results back to float32. Identical computational route to the float64 overload.
| parameters_mtx_in | Float32 parameter array |
| input | Float32 input matrix/state |
| parallel | Set 0 for sequential execution, 1 for parallel with TBB (optional) |
Reimplemented from Gate.
Definition at line 1162 of file Gates_block.cpp.

|
overridevirtualinherited |
Reimplemented from Gate.
Definition at line 1171 of file Gates_block.cpp.

|
inherited |
|
protectedinherited |
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) |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
overridevirtualinherited |
Call to apply the gate on the input array/matrix by input*CNOT.
Call to apply the gate on the input array/matrix by input*Gate_block.
| input | The input array on which the gate is applied |
Reimplemented from Gate.
Definition at line 885 of file Gates_block.cpp.

|
overridevirtualinherited |
Float32 overload for right-side parametric gate application by input*Gate.
| parameter_mtx | Float32 parameter matrix |
| input | The float32 input array on which the gate is applied |
Reimplemented from Gate.
Definition at line 939 of file Gates_block.cpp.

|
virtualinherited |
|
virtualinherited |
|
overridevirtualinherited |
Internal right-apply entry that consumes already precomputed sin/cos values.
Reimplemented from Gate.
Definition at line 893 of file Gates_block.cpp.


|
overridevirtualinherited |
Float32 internal right-apply entry that consumes already precomputed sin/cos values.
Reimplemented from Gate.
Definition at line 947 of file Gates_block.cpp.

Apply an gates on the input matrix.
| gate_mtx | The matrix of the gate. |
| input_matrix | The input matrix to be transformed. |
Definition at line 851 of file Decomposition_Base.cpp.

|
inherited |
Call to apply the global phase to a matrix.
Call to apply global phase of U3 matrices to matrix.
| global_phase_factor | The value of the phase |
Definition at line 1098 of file Decomposition_Base.cpp.

|
inherited |
Call to apply the current global phase to the unitary matrix.
| global_phase_factor | The value of the phase |
Definition at line 1107 of file Decomposition_Base.cpp.


|
protectedinherited |
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 2082 of file Gate.cpp.

|
protectedinherited |
|
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 1478 of file Gate.cpp.

|
protectedinherited |
|
overridevirtualinherited |
Call to apply the gate on the input array/matrix Gates_block*input.
| 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 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 |
| 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 606 of file Gates_block.cpp.


|
overridevirtualinherited |
Float32 overload for gate application.
| input | Float32 input matrix/state |
| 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 714 of file Gates_block.cpp.

|
overridevirtualinherited |
Float32 overload for parametric gate application.
| parameter_mtx | Float32 parameter matrix |
| input | Float32 input matrix/state |
| 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 722 of file Gates_block.cpp.

|
virtualinherited |
Precision-agnostic apply entry point for float32/float64 execution.
| parameters_mtx | Precision-tagged parameter matrix carrier |
| input | Precision-tagged matrix/state carrier |
| parallel | Set 0 for sequential execution, 1 for OpenMP and 2 for TBB |
Definition at line 838 of file Gates_block.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) |
Definition at line 433 of file Gate.cpp.

|
inherited |
|
overridevirtualinherited |
Combined forward + derivative application with shared precomputed trig cache.
Return format: first element is forward apply_to result, remaining elements are derivatives.
| parameters_mtx_in | Parameter matrix for the gate |
| input | Input matrix/state |
| parallel | Parallel mode selector |
Reimplemented from Gate.
Definition at line 1320 of file Gates_block.cpp.


|
overridevirtualinherited |
Reimplemented from Gate.
Definition at line 1328 of file Gates_block.cpp.

|
overridevirtualinherited |
Float32 combined forward + derivative application.
Return format: first element is forward apply_to result, remaining elements are derivatives.
| parameters_mtx_in | Float32 parameter matrix for the gate |
| input | Float32 input matrix/state |
| parallel | Parallel mode selector |
Reimplemented from Gate.
Definition at line 1368 of file Gates_block.cpp.

|
overridevirtualinherited |
Reimplemented from Gate.
Definition at line 1376 of file Gates_block.cpp.

|
overridevirtualinherited |
Internal combined forward+derivative entry with precomputed sin/cos.
Reimplemented from Gate.
Definition at line 1336 of file Gates_block.cpp.

|
overridevirtualinherited |
Reimplemented from Gate.
Definition at line 1345 of file Gates_block.cpp.

|
overridevirtualinherited |
Float32 internal combined forward+derivative entry with precomputed sin/cos.
Reimplemented from Gate.
Definition at line 1384 of file Gates_block.cpp.

|
overridevirtualinherited |
Reimplemented from Gate.
Definition at line 1393 of file Gates_block.cpp.

|
overridevirtualinherited |
Internal apply entry that consumes already precomputed sin/cos values.
parameter_mtx is preserved for gates with custom parameter handling.
Reimplemented from Gate.
Definition at line 614 of file Gates_block.cpp.


|
overridevirtualinherited |
Float32 internal apply entry that consumes already precomputed sin/cos values.
parameter_mtx is preserved for gates with custom parameter handling.
Reimplemented from Gate.
Definition at line 730 of file Gates_block.cpp.

|
overridevirtualinherited |
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 578 of file Gates_block.cpp.
|
overridevirtualinherited |
Float32 overload: apply circuit to a list of float32 matrices.
| parameters_mtx | Float32 parameter array |
| inputs | Float32 input matrices/states |
| 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 592 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 320 of file Gate.cpp.


|
virtualinherited |
Float32 overload: apply gate to a list of float32 inputs without parameters.
| inputs | Float32 input matrices/states |
| parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Definition at line 380 of file Gate.cpp.

|
inherited |
Calculate the error of the decomposition according to the spectral norm of \( U-U_{approx} \), where \( U_{approx} \) is the unitary produced by the decomposing quantum cirquit.
The calculated error is stored in the attribute decomposition_error.
| decomposed_matrix | The decomposed matrix, i.e. the result of the decomposing gate structure applied on the initial unitary. |
| decomposed_matrix | The decomposed matrix, i.e. the result of the decomposing gate structure applied on the initial unitary. |
Definition at line 432 of file Optimization_Interface.cpp.


|
staticinherited |
|
staticinherited |
|
inherited |
Calculate the current cost function value from an already transformed matrix.
Calculate the current cost function from an already transformed matrix.
| matrix_new | The transformed matrix/state produced by applying the circuit. |
| ret_temp | Optional temporary storage for trace-based cost variants. |
| matrix_new | The transformed matrix/state produced by applying the circuit. |
| ret_temp | Optional storage for trace-based terms used by gradient calculations. |
Definition at line 676 of file Optimization_Interface.cpp.


|
inherited |
Float32 cost-function entry.
Expensive trace-like reductions run on Matrix_float; uncommon double-only variants upcast locally.
Definition at line 736 of file Optimization_Interface.cpp.

|
inherited |
Calculate the new global phase of the Unitary matrix after removing a trivial U3 matrix.
Call to calculate new global phase.
| global_phase_factor_new | global phase calculated from the product of two U3 matrices |
| global_phase_factor | The value of the phase |
Definition at line 1071 of file Decomposition_Base.cpp.

|
inherited |
check_optimization_solution
Checks the convergence of the optimization problem.
Definition at line 732 of file Decomposition_Base.cpp.

|
inherited |
|
inherited |
|
overridevirtualinherited |
Create a clone of the present class.
Reimplemented from Gate.
Reimplemented in Sub_Matrix_Decomposition.
Definition at line 3321 of file Gates_block.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 3243 of file Gates_block.cpp.


|
inherited |
|
inherited |
|
inherited |
Call to determine, whether the circuit contains daptive gate or not.
Definition at line 3394 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 3421 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 3014 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 3028 of file Gates_block.cpp.

| void N_Qubit_Decomposition::decompose_submatrix | ( | ) |
Start the decompostion process to recursively decompose the submatrices.
Definition at line 228 of file N_Qubit_Decomposition.cpp.


|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
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 3741 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 3695 of file Gates_block.cpp.


|
inherited |
Call to print out into a file the current cost function and the second Rényi entropy on the subsystem made of qubits 0 and 1.
Parameters stored in the class are used to calculate the Renyi entropy
| current_minimum | The current minimum (to avoid calculating it again |
| current_minimum | The current minimum (to avoid calculating it again |
Definition at line 329 of file Optimization_Interface.cpp.

|
virtualinherited |
Call to print out into a file the current cost function and the second Rényi entropy on the subsystem made of qubits 0 and 1.
| current_minimum | The current minimum (to avoid calculating it again |
| parameters | Parameters to be used in the calculations (For Rényi entropy) |
Reimplemented in Generative_Quantum_Machine_Learning_Base.
Definition at line 342 of file Optimization_Interface.cpp.

|
staticinherited |
Call to print out into a file the current cost function and the second Rényi entropy on the subsystem made of qubits 0 and 1.
| current_minimum | The current minimum (to avoid calculating it again |
| parameters | Parameters to be used in the calculations (For Rényi entropy) |
| instance | A pointer pointing ti the current class instance. |
Definition at line 393 of file Optimization_Interface.cpp.

|
inherited |
exports unitary matrix to binary file
Call to export the unitary (with possible phase shift) into a binary file.
| filename | file to be exported to |
| filename | The path to the file where the unitary is expored |
Definition at line 1118 of file Decomposition_Base.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 3346 of file Gates_block.cpp.


|
virtualinherited |
Float32 overload of extract_parameters.
Uses get_parameter_multipliers() identically.
| parameters | The float32 parameter array corresponding to the circuit in which the gate is embedded |
Uses get_parameter_multipliers() identically. Multiplier m â extracted[i] = fmodf(m * params[start+i], m * 2Ï).
Definition at line 2710 of file Gate.cpp.

|
overridevirtualinherited |
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 3866 of file Gates_block.cpp.

| void N_Qubit_Decomposition::extract_subdecomposition_results | ( | Sub_Matrix_Decomposition * | cSub_decomposition | ) |
Call to extract and store the calculated parameters and gates of the sub-decomposition processes.
| cSub_decomposition | An instance of class Sub_Matrix_Decomposition used to disentangle the n-th qubit from the others. |
Definition at line 428 of file N_Qubit_Decomposition.cpp.


|
inherited |
final optimization procedure improving the accuracy of the decompositin when all the qubits were already disentangled.
Definition at line 484 of file Optimization_Interface.cpp.


| void N_Qubit_Decomposition::finalize_decomposition | ( | ) |
After the main optimization problem is solved, the indepent qubits can be rotated into state |0> by this def.
The constructed gates are added to the array of gates needed to the decomposition of the input unitary.
Definition at line 343 of file N_Qubit_Decomposition.cpp.


|
inherited |
|
virtualinherited |
Compute the gate kernel matrix from precomputed trigonometric values.
Default gate_kernel: throws if not overridden.
Returns a 2x2 matrix for single-qubit (and controlled single-qubit) gates, or a 4x4 matrix for 2-qubit gates (RXX, RYY, RZZ, etc.). Zero-parameter gates ignore the precomputed_sincos argument.
| precomputed_sincos | Gate-local sin/cos table with shape (parameter_num, 2). |
Reimplemented in SYC, RXX, RYY, RZZ, CROT, U3, H, S, SDG, SX, SXdg, T, Tdg, X, Y, Z, CU, R, RX, RY, RZ, U1, and U2.
Definition at line 2546 of file Gate.cpp.

|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
inherited |
Get the number of accelerators to be reserved on DFEs on users demand.
Definition at line 1830 of file Optimization_Interface.cpp.

|
inherited |
|
inherited |
|
inherited |
|
inherited |
Call to get the prefactor of the single-bitflip errors in the cost function.
Call to get the pre factor of the single-bitflip errors in the cost function.
(see Eq. (21) in arXiv:2210.09191)
Definition at line 1716 of file Optimization_Interface.cpp.

|
inherited |
Call to get the prefactor of the two-bitflip errors in the cost function.
Call to get the pre factor of the two-bitflip errors in the cost function.
(see Eq. (21) in arXiv:2210.09191)
Definition at line 1729 of file Optimization_Interface.cpp.

|
inherited |
Call to get the variant of the cost function used in the calculations.
Definition at line 1565 of file Optimization_Interface.cpp.

|
inherited |
Call to get the obtained minimum of the cost function.
Definition at line 1043 of file Decomposition_Base.cpp.

|
inherited |
Calculate the decomposed matrix resulted by the effect of the optimized gates on the unitary Umtx.
Definition at line 828 of file Decomposition_Base.cpp.

|
inherited |
Call to get the error of the decomposition.
Definition at line 1030 of file Decomposition_Base.cpp.
|
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 3828 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 3229 of file Gates_block.cpp.

|
inherited |
Call to get the number of gates grouped in the class.
Definition at line 2656 of file Gates_block.cpp.

|
inherited |
Call to get the number of the individual gate types in the list of gates.
Definition at line 2630 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 3220 of file Gates_block.cpp.

|
inherited |
Get the global phase of the Unitary matrix.
Call to get global phase.
| global_phase_factor | The value of the phase |
Definition at line 1080 of file Decomposition_Base.cpp.
|
overridevirtualinherited |
Call to get the qubits involved in the gates stored in the block of gates.
Reimplemented from Gate.
Definition at line 3158 of file Gates_block.cpp.


|
overridevirtualinherited |
Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block)
Call to retrieve the operation matrix (Which is the product of all the operation matrices stored in the operation block)
| parameters | An array pointing to the parameters of the gates |
| parameters | An array pointing to the parameters of the gates |
Reimplemented from Gate.
Definition at line 193 of file Gates_block.cpp.


|
overridevirtualinherited |
Call to retrieve the gate matrix (Which is the product of all the gate matrices stored in the gate block)
Call to retrieve the operation matrix (Which is the product of all the operation matrices stored in the operation block)
| parameters | An array pointing to the parameters of the gates |
| parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
| parameters | An array pointing to the parameters of the gates |
| 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 209 of file Gates_block.cpp.

|
inherited |
|
overridevirtualinherited |
Float32 overload: retrieve the gate matrix.
| parameters | Float32 parameter array |
| parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Base implementation creates a float32 identity and applies the gate with parallel=0 to avoid any broken AVX path. Derived classes should override this.
| parameters | Float32 parameter array |
| parallel | Unused in the base implementation (always uses sequential path) |
Reimplemented from Gate.
Definition at line 238 of file Gates_block.cpp.

|
virtualinherited |
|
inherited |
|
inherited |
Get the number of processed iterations during the optimization process.
Get the number of iterations.
Definition at line 1744 of file Optimization_Interface.cpp.

|
inherited |
Call to get the optimized parameters.
Definition at line 776 of file Decomposition_Base.cpp.


|
inherited |
Call to get the optimized parameters.
| ret | Preallocated array to store the optimized parameters. |
Definition at line 793 of file Decomposition_Base.cpp.

|
inherited |
Return optimized parameters in float32.
Definition at line 782 of file Decomposition_Base.cpp.

|
inherited |
Get the parallel configuration from the config.
Definition at line 1174 of file Decomposition_Base.cpp.

|
inherited |
|
virtualinherited |
Returns the per-parameter multipliers relative to 2Ï used by extract_parameters.
Returns the per-parameter multipliers relative to 2Ï.
A multiplier of 2 means extracted = fmod(2*p, 4Ï); multiplier of 1 means fmod(p, 2Ï). Zero-parameter gates return an empty vector. Override in every parametric gate subclass.
Default implementation: empty (zero-parameter gate).
Reimplemented in RXX, RYY, RZZ, CROT, U3, CU, R, RX, RY, RZ, U1, and U2.
|
overridevirtualinherited |
Call to get the number of free parameters.
Reimplemented from Gate.
Definition at line 2645 of file Gates_block.cpp.

|
inherited |
|
inherited |
|
inherited |
Call to retrieve the previous value of the cost funtion to be used to evaluate bitflip errors in the cost funtion (see Eq.
(21) in arXiv:2210.09191)
Definition at line 1703 of file Optimization_Interface.cpp.

|
inherited |
Call to get the current name of the project.
Definition at line 1053 of file Decomposition_Base.cpp.
|
inherited |
|
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 3448 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 3625 of file Gates_block.cpp.


|
inherited |
|
inherited |
|
inherited |
Get the trace ffset used in the evaluation of the cost function.
Get the trace offset used in the evaluation of the cost function.
Definition at line 1782 of file Optimization_Interface.cpp.

|
inherited |
|
inherited |
Call to retrive a pointer to the unitary to be transformed.
Definition at line 751 of file Decomposition_Base.cpp.

|
inherited |
Return the float32 unitary copy used by float execution.
Definition at line 755 of file Decomposition_Base.cpp.

|
inherited |
Call to get the size of the unitary to be transformed.
Definition at line 768 of file Decomposition_Base.cpp.
|
inherited |
True when config["use_float"] requests float32 circuit execution.
Definition at line 759 of file Decomposition_Base.cpp.

|
inherited |
Import a Unitary matrix from a file.
Call to import the unitary (with possible phase shift) into a binary file.
| filename | .binary file to read |
| filename | The path to the file from which the unitary is imported. |
Definition at line 1144 of file Decomposition_Base.cpp.


|
inherited |
Atomically increment the tracked number of optimization iterations.
| delta | The number of iterations to add. |
Definition at line 1755 of file Optimization_Interface.cpp.

|
staticinherited |
Initializes default layer numbers.
Definition at line 985 of file Decomposition_Base.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 2569 of file Gates_block.cpp.


|
protectedinherited |
Definition at line 121 of file Gates_block.cpp.


|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
inherited |
Call to print the gates decomposing the initial unitary.
These gates brings the intial matrix into unity.
| start_index | The index of the first gate |
Definition at line 350 of file Decomposition_Base.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 2666 of file Gates_block.cpp.


|
virtualinherited |
This is an abstact definition of function giving the cost functions measuring the entaglement of the qubits.
When the qubits are indepent, teh cost function should be zero.
| parameters | An array of the free parameters to be optimized. (The number of the free paramaters should be equal to the number of parameters in one sub-layer) |
Definition at line 720 of file Decomposition_Base.cpp.
|
inherited |
Evaluate the optimization problem of the optimization.
| parameters | An array of the free parameters to be optimized. |
Definition at line 616 of file Optimization_Interface.cpp.

|
virtualinherited |
The optimization problem of the final optimization.
Evaluate the optimization problem of the optimization.
| parameters | An array of the free parameters to be optimized. |
Reimplemented in Variational_Quantum_Eigensolver_Base, and Generative_Quantum_Machine_Learning_Base.
Definition at line 633 of file Optimization_Interface.cpp.

|
inherited |
The optimization problem of the final optimization.
The static cost function of the optimization.
| parameters | Array containing the parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
| ret_temp | A matrix to store trace in for gradient for HS test |
| parameters | Array containing the parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
| ret_temp | A matrix to store trace in for gradient for HS test |
Definition at line 1043 of file Optimization_Interface.cpp.

|
staticinherited |
The optimization problem of the final optimization.
The cost function of the optimization.
| parameters | Array containing the parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
Definition at line 1104 of file Optimization_Interface.cpp.

|
inherited |
The cost function of the optimization with batched input (implemented only for the Frobenius norm cost function when run with DFE)
The cost function of the optimization with batched input (implemented only for the Frobenius norm cost function when run with DFE, only state vector simulation if executed on Groq)
| parameters | An array of the free parameters to be optimized. |
Definition at line 939 of file Optimization_Interface.cpp.


|
staticinherited |
Call to calculate both the cost function and the its gradient components.
| parameters | Array containing the free parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
| f0 | The value of the cost function at x0. |
| grad | Array containing the calculated gradient components. |
Definition at line 1493 of file Optimization_Interface.cpp.


|
virtualinherited |
Call to calculate both the cost function and the its gradient components.
| parameters | The parameters for which the cost fuction shoule be calculated |
| f0 | The value of the cost function at x0. |
| grad | An array storing the calculated gradient components |
| onlyCPU | Set true to use only CPU in the calculations (has effect if compiled to use accelerator devices) |
| parameters | Array containing the free parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
| f0 | The value of the cost function at x0. |
| grad | Array containing the calculated gradient components. |
Reimplemented in Variational_Quantum_Eigensolver_Base, and Generative_Quantum_Machine_Learning_Base.
Definition at line 1507 of file Optimization_Interface.cpp.

|
virtualinherited |
Call to calculate both the cost function and the its gradient components.
| parameters | Array containing the free parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
| f0 | The value of the cost function at x0. |
| grad | Array containing the calculated gradient components. |
Reimplemented in Variational_Quantum_Eigensolver_Base, and Generative_Quantum_Machine_Learning_Base.
Definition at line 1142 of file Optimization_Interface.cpp.


|
staticinherited |
Call to calculate both the effect of the circuit on th eunitary and it's gradient componets.
| parameters | Array containing the free parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
| Umtx | The unitary on which the circuit is applied in place. |
| Umtx_deriv | Array containing the calculated gradient components. |
Definition at line 1522 of file Optimization_Interface.cpp.


|
inherited |
Call to calculate both the effect of the circuit on th eunitary and it's gradient componets.
| parameters | Array containing the free parameters to be optimized. |
| Umtx | The unitary on which the circuit is applied in place. |
| Umtx_deriv | Array containing the calculated gradient components. |
Definition at line 1553 of file Optimization_Interface.cpp.

|
staticinherited |
Calculate the derivative of the cost function with respect to the free parameters.
| parameters | Array containing the free parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
| grad | Array containing the calculated gradient components. |
Definition at line 1121 of file Optimization_Interface.cpp.

|
virtualinherited |
The optimization problem of the final optimization.
The cost function of the optimization.
| parameters | An array of the free parameters to be optimized. (The number of teh free paramaters should be equal to the number of parameters in one sub-layer) |
| parameters | Array containing the parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
Reimplemented in Variational_Quantum_Eigensolver_Base, and Generative_Quantum_Machine_Learning_Base.
Definition at line 1087 of file Optimization_Interface.cpp.


|
inherited |
The optimization problem of the final optimization.
| parameters | A GNU Scientific Library containing the parameters to be optimized. |
| void_instance | A void pointer pointing to the instance of the current class. |
|
protectedinherited |
|
protectedinherited |
|
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 randomize the parameter.
| input | The parameters are randomized around the values stores in this array |
| output | The randomized parameters are stored within this array |
| f0 | weight in the randomiztaion (output = input + rand()*sqrt(f0) ). |
Definition at line 575 of file Optimization_Interface.cpp.


|
inherited |
Call to release one gate in the list.
Definition at line 168 of file Gates_block.cpp.


|
inherited |
Call to release the stored gates.
Definition at line 146 of file Gates_block.cpp.


|
virtualinherited |
Call to reorder the qubits in the matrix of the gate.
| qbit_list | The reordered list of qubits spanning the matrix |
Reimplemented from Gates_block.
Definition at line 900 of file Decomposition_Base.cpp.

|
inherited |
Method to reset the dependency graph of the gates in the circuit.
Definition at line 3799 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 3778 of file Gates_block.cpp.


|
inherited |
|
inherited |
|
inherited |
|
inherited |
Call to set the threshold of convergence in the optimization processes.
| convergence_threshold_in | The value of the threshold. |
Definition at line 1020 of file Decomposition_Base.cpp.
|
inherited |
Call to set the variant of the cost function used in the calculations.
| variant | The variant of the cost function from the enumaration cost_function_type |
Definition at line 1577 of file Optimization_Interface.cpp.


| void N_Qubit_Decomposition::set_custom_gate_structure | ( | std::map< int, Gates_block *> | gate_structure_in | ) |
Call to set custom layers to the gate structure that are intended to be used in the subdecomposition.
| gate_structure | An <int, Gates_block*> map containing the gate structure used in the individual subdecomposition (default is used, if a gate structure for specific subdecomposition is missing). |
Definition at line 466 of file N_Qubit_Decomposition.cpp.

|
inherited |
Call to set custom layers to the gate structure that are intended to be used in the subdecomposition.
| gate_structure | An <int, Gates_block*> map containing the gate structure used in the individual subdecomposition (default is used, if a gate structure for specific subdecomposition is missing). |
Definition at line 1767 of file Optimization_Interface.cpp.


|
inherited |
Call to set the debugfile name.
| debugfile | String variable. Set the debugfile name. |
Definition at line 95 of file logging.cpp.

|
inherited |
Call to set global phase.
| global_phase_factor_new | The value of the new phase |
Definition at line 1088 of file Decomposition_Base.cpp.

Set the number of identical successive blocks during the subdecomposition of the n-th qubit.
| n | The number of qubits for which the maximal number of layers should be used in the subdecomposition. |
| identical_blocks_in | The number of successive identical layers used in the subdecomposition. |
Definition at line 493 of file N_Qubit_Decomposition.cpp.

Set the number of identical successive blocks during the subdecomposition of the n-th qubit.
| identical_blocks_in | An <int,int> map containing the number of successive identical layers used in the subdecompositions. |
Definition at line 514 of file N_Qubit_Decomposition.cpp.

Set the number of iteration loops during the subdecomposition of the n-th qubit.
| n | The number of qubits for which number of iteration loops should be used in the subdecomposition., |
| iteration_loops_in | The number of iteration loops in each sted of the subdecomposition. |
Definition at line 950 of file Decomposition_Base.cpp.

Set the number of iteration loops during the subdecomposition of the qbit-th qubit.
| iteration_loops_in | An <int,int> map containing the number of iteration loops for the individual subdecomposition processes |
Definition at line 970 of file Decomposition_Base.cpp.

|
inherited |
|
inherited |
|
inherited |
Call to set the maximal number of iterations for which an optimization engine tries to solve the optimization problem.
Call to set the number of iterations for which an optimization engine tries to solve the optimization problem.
| max_inner_iterations_in | The number of iterations for which an optimization engine tries to solve the optimization problem |
Definition at line 1594 of file Optimization_Interface.cpp.

|
inherited |
Call to set the maximal number of the iterations in the optimization process.
| max_outer_iterations_in | maximal number of iteartions in the optimization process |
Definition at line 339 of file Decomposition_Base.cpp.

Set the maximal number of layers used in the subdecomposition of the n-th qubit.
| n | The number of qubits for which the maximal number of layers should be used in the subdecomposition. |
| max_layer_num_in | The maximal number of the gate layers used in the subdecomposition. |
Definition at line 864 of file Decomposition_Base.cpp.

Set the maximal number of layers used in the subdecomposition of the n-th qubit.
| max_layer_num_in | An <int,int> map containing the maximal number of the gate layers used in the subdecomposition. |
Definition at line 884 of file Decomposition_Base.cpp.

|
inherited |
Definition at line 3264 of file Gates_block.cpp.


|
inherited |
Call to set the number of gate blocks to be optimized in one shot.
| optimization_block_in | The number of gate blocks to be optimized in one shot |
Definition at line 331 of file Decomposition_Base.cpp.

|
inherited |
Call to set the tolerance of the optimization processes.
| tolerance_in | The value of the tolerance. |
| tolerance_in | The value of the tolerance. The error of the decomposition would scale with the square root of this value. |
Definition at line 1008 of file Decomposition_Base.cpp.

|
inherited |
Call to set the optimized parameters for initial optimization.
| ret | Preallocated array to store the optimized parameters. |
Definition at line 803 of file Decomposition_Base.cpp.


|
inherited |
Call to set the optimizer engine to be used in solving the optimization problem.
| alg_in | The chosen algorithm |
Definition at line 1617 of file Optimization_Interface.cpp.

|
inherited |
Definition at line 1837 of file Optimization_Interface.cpp.

|
inherited |
|
inherited |
|
inherited |
Call to set the name of the project.
| project_name_new | pointer to the new project name |
Definition at line 1061 of file Decomposition_Base.cpp.

|
virtualinherited |
Set the number of qubits spanning the matrix of the gates stored in the block of gates.
| qbit_num_in | The number of qubits spanning the matrices. |
Reimplemented from Gates_block.
Definition at line 1196 of file Decomposition_Base.cpp.


|
inherited |
Call to set the maximal number of parameter randomization tries to escape a local minimum.
| random_shift_count_max_in | The number of maximal number of parameter randomization tries to escape a local minimum. |
Definition at line 1606 of file Optimization_Interface.cpp.

|
inherited |
|
inherited |
|
inherited |
Set the trace offset used in the evaluation of the cost function.
Definition at line 1793 of file Optimization_Interface.cpp.


|
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.

|
virtualinherited |
Call to solve layer by layer the optimization problem via calling one of the implemented algorithms.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Reimplemented from Decomposition_Base.
Definition at line 518 of file Optimization_Interface.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via ADAM algorithm.
(optimal for larger problems) The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
(optimal for larger problems) The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 44 of file optimization_engines/Adam.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via batched ADAM algorithm.
(optimal for larger problems) The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
(optimal for larger problems) The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 44 of file ADAM_BATCHED.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via the AGENT algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 42 of file AGENTS.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via the AGENT COMBINED algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 914 of file AGENTS.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via Bayes & Agents algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
Definition at line 40 of file BAYES_AGENTS.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via Bayes algorithm.
Call to solve layer by layer the optimization problem via BBFG algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
(optimal for smaller problems) The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 44 of file optimization_engines/Bayes_Opt.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via BBFG algorithm.
(optimal for smaller problems) The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
(optimal for smaller problems) The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 42 of file BFGS.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via BBFG algorithm.
Call to solve layer by layer the optimization problem via BFGS algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess_gsl | A GNU Scientific Library vector containing the solution guess. |
Definition at line 41 of file BFGS2.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via the COSINE algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 43 of file COSINE.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via the GRAD_DESCEND (line search in the direction determined by the gradient) algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess_gsl | A GNU Scientific Library vector containing the solution guess. |
Definition at line 44 of file optimization_engines/grad_descend.cpp.


|
inherited |
Call to solve layer by layer the optimization problem via the GRAD_DESCEND_PARAMETER_SHIFT_RULE algorithm.
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | A matrix containing the solution guess. |
The optimalized parameters are stored in attribute optimized_parameters.
| num_of_parameters | Number of parameters to be optimized |
| solution_guess | Array containing the solution guess. |
Definition at line 41 of file GRAD_DESCEND_PARAMETER_SHIFT_RULE.cpp.


|
inherited |
This method can be used to solve the main optimization problem which is devidid into sub-layer optimization processes.
This method can be used to solve the main optimization problem which is divided into sub-layer optimization processes.
(The aim of the optimization problem is to disentangle one or more qubits) The optimalized parameters are stored in attribute optimized_parameters.
| solution_guess | An array of the guessed parameters |
| solution_guess_num | The number of guessed parameters. (not necessarily equal to the number of free parameters) |
Definition at line 365 of file Decomposition_Base.cpp.


|
virtual |
Start the disentanglig process of the unitary.
| finalize_decomp | Optional 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 86 of file N_Qubit_Decomposition.cpp.


|
protectedinherited |
Synchronize the float32 parameter mirror from the double optimizer storage.
Definition at line 314 of file Decomposition_Base.cpp.


|
protectedinherited |
number of utilized accelerators
Definition at line 108 of file Optimization_Interface.h.
|
protectedinherited |
logical variable indicating whether adaptive learning reate is used in the ADAM algorithm
Definition at line 102 of file Optimization_Interface.h.
|
protectedinherited |
The optimization algorithm to be used in the optimization.
Definition at line 81 of file Optimization_Interface.h.
|
protectedinherited |
|
protectedinherited |
Time spent on circuit simulation/cost function evaluation.
Definition at line 115 of file Optimization_Interface.h.
|
inherited |
config metadata utilized during the optimization
Definition at line 103 of file Decomposition_Base.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
The convergence threshold in the optimization process.
Definition at line 166 of file Decomposition_Base.h.
|
protectedinherited |
prefactor of the single-bitflip errors in the cost function. (see Eq. (21) in arXiv:2210.09191)
Definition at line 87 of file Optimization_Interface.h.
|
protectedinherited |
prefactor of the double-bitflip errors in the cost function. (see Eq. (21) in arXiv:2210.09191)
Definition at line 89 of file Optimization_Interface.h.
|
protectedinherited |
The chosen variant of the cost function.
Definition at line 83 of file Optimization_Interface.h.
|
protectedinherited |
time spent on optimization
Definition at line 117 of file Optimization_Interface.h.
|
protectedinherited |
The current minimum of the optimization problem.
Definition at line 148 of file Decomposition_Base.h.
|
inherited |
|
inherited |
|
protectedinherited |
error of the final decomposition
Definition at line 139 of file Decomposition_Base.h.
|
protectedinherited |
The optimized parameters for the gates.
logical value describing whether the decomposition was finalized or not (i.e. whether the decomposed qubits were rotated into the state |0> or not)
Definition at line 136 of file Decomposition_Base.h.
|
protectedinherited |
number of finalizing (deterministic) opertaions rotating the disentangled qubits into state |0>.
Definition at line 142 of file Decomposition_Base.h.
|
protectedinherited |
the number of the finalizing (deterministic) parameters of gates rotating the disentangled qubits into state |0>.
Definition at line 145 of file Decomposition_Base.h.
|
protectedinherited |
Definition at line 56 of file Gates_block.h.
|
protected |
A map of <int n: Gates_block* block> describing custom gate structure to be used in the decomposition. Gate block corresponding to n is used in the subdecomposition of the n-th qubit. The Gate block is repeated periodically.
Definition at line 57 of file N_Qubit_Decomposition.h.
|
protectedinherited |
The list of stored gates.
Definition at line 49 of file Gates_block.h.
|
protectedinherited |
Standard mersenne_twister_engine seeded with rd()
Definition at line 170 of file Decomposition_Base.h.
|
inherited |
The global phase.
Definition at line 97 of file Decomposition_Base.h.
|
protectedinherited |
The global target minimum of the optimization problem.
Definition at line 151 of file Decomposition_Base.h.
|
inherited |
unique id indentifying the instance of the class
Definition at line 71 of file Optimization_Interface.h.
A map of <int n: int num> indicating that how many identical successive blocks should be used in the disentanglement of the nth qubit from the others.
Definition at line 79 of file Optimization_Interface.h.
|
protectedinherited |
type to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2
Definition at line 160 of file Decomposition_Base.h.
|
mutableprotectedinherited |
Definition at line 59 of file Gates_block.h.
|
mutableprotectedinherited |
Definition at line 61 of file Gates_block.h.
|
mutableprotectedinherited |
Definition at line 57 of file Gates_block.h.
|
mutableprotectedinherited |
Definition at line 60 of file Gates_block.h.
|
mutableprotectedinherited |
Definition at line 58 of file Gates_block.h.
A map of <int n: int num> indicating the number of iteration in each step of the decomposition.
Definition at line 112 of file Decomposition_Base.h.
|
protectedinherited |
number of gate layers
Definition at line 51 of file Gates_block.h.
|
protectedinherited |
|
inherited |
the maximal number of iterations for which an optimization engine tries to solve the optimization problem
Definition at line 67 of file Optimization_Interface.h.
A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process for the subdecomposing of the nth qubits.
Definition at line 109 of file Decomposition_Base.h.
A map of <int n: int num> indicating that how many layers should be used in the subdecomposition process by default for the subdecomposing of the nth qubits.
Definition at line 91 of file Decomposition_Base.h.
|
protectedinherited |
Maximal number of iterations allowed in the optimization process.
Definition at line 157 of file Decomposition_Base.h.
|
protectedinherited |
maximal number of qubits in partitions
Definition at line 55 of file Gates_block.h.
|
protectedinherited |
|
protectedinherited |
Store the number of OpenMP threads. (During the calculations OpenMP multithreading is turned off.)
Definition at line 163 of file Decomposition_Base.h.
|
protectedinherited |
number of iterations
Definition at line 99 of file Optimization_Interface.h.
|
inherited |
number of gate blocks used in one shot of the optimization process
Definition at line 88 of file Decomposition_Base.h.
|
protectedinherited |
logical value describing whether the optimization problem was solved or not
Definition at line 154 of file Decomposition_Base.h.
|
inherited |
The maximal allowed error of the optimization problem (The error of the decomposition would scale with the square root of this value)
Definition at line 94 of file Decomposition_Base.h.
|
protectedinherited |
logical value. Set true to optimize the minimum number of gate layers required in the decomposition, or false when the predefined maximal number of layer gates is used (ideal for general unitaries).
Definition at line 76 of file Optimization_Interface.h.
|
protectedinherited |
The optimized parameters for the gates.
Definition at line 121 of file Decomposition_Base.h.
|
protectedinherited |
Float32 optimized parameters used by the hot gate-application path.
Definition at line 124 of file Decomposition_Base.h.
|
protectedinherited |
rank used for OSR entanglement cost function
Definition at line 93 of file Optimization_Interface.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
the previous value of the cost funtion to be used to evaluate bitflip errors in the cost funtion (see Eq. (21) in arXiv:2210.09191)
Definition at line 85 of file Optimization_Interface.h.
|
inherited |
the name of the project
Definition at line 100 of file Decomposition_Base.h.
|
protectedinherited |
|
protectedinherited |
parameter to contron the radius of parameter randomization around the curren tminimum
Definition at line 104 of file Optimization_Interface.h.
|
inherited |
the maximal number of parameter randomization tries to escape a local minimum.
Definition at line 69 of file Optimization_Interface.h.
|
protectedinherited |
randomization rate
Definition at line 106 of file Optimization_Interface.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
The offset in the first columns from which the "trace" is calculated. In this case Tr(A) = sum_(i-offset=j) A_{ij}.
Definition at line 111 of file Optimization_Interface.h.
|
protectedinherited |
|
protectedinherited |
The unitary to be decomposed.
Definition at line 115 of file Decomposition_Base.h.
|
protectedinherited |
Float32 copy of the unitary used when config["use_float"] is true.
Definition at line 118 of file Decomposition_Base.h.
|
protectedinherited |
cuts used for OSR entanglement cost function
Definition at line 91 of file Optimization_Interface.h.
|
protectedinherited |
Selects float32 circuit application for parameter/unitary/state data.
Definition at line 127 of file Decomposition_Base.h.
|
protectedinherited |
logical variable indicating whether to use softmax or average in the OSR entanglement cost function
Definition at line 95 of file Optimization_Interface.h.
|
inherited |
1.8.13