|
Sequential Quantum Gate Decomposer
v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
A class representing a CCX (Toffoli) operation. More...
#include <CCX.h>

Public Member Functions | |
| void | add_child (Gate *child) |
| Call to add a child gate to the current gate. More... | |
| void | add_parent (Gate *parent) |
| Call to add a parent gate to the current gate. More... | |
| virtual std::vector< Matrix > | apply_derivate_to (Matrix_real ¶meters_mtx_in, Matrix &input, int parallel) |
| 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_in, Matrix &input, int parallel, std::vector< Matrix > &output) |
| virtual std::vector< Matrix_float > | apply_derivate_to (Matrix_real_float ¶meters_mtx_in, Matrix_float &input, int parallel) |
| Float32 overload for derivative evaluation. More... | |
| virtual void | apply_derivate_to (Matrix_real_float ¶meters_mtx_in, Matrix_float &input, int parallel, std::vector< Matrix_float > &output) |
| 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 (Matrix_real ¶meter_mtx, Matrix &input) |
| Call to apply the gate on the input array/matrix by input*Gate. More... | |
| virtual void | apply_from_right (Matrix_real_float ¶meter_mtx, Matrix_float &input) |
| Float32 overload for right-side parametric gate application by input*Gate. More... | |
| virtual void | apply_from_right_inner (Matrix_real ¶meter_mtx, const Matrix_real &precomputed_sincos, Matrix &input) |
| Internal right-apply entry that consumes already precomputed sin/cos values. More... | |
| virtual void | apply_from_right_inner (Matrix_real_float ¶meter_mtx, const Matrix_real_float &precomputed_sincos, Matrix_float &input) |
| Float32 internal right-apply entry that consumes already precomputed sin/cos values. More... | |
| virtual void | apply_to (Matrix &input, int parallel) |
| Call to apply the gate on the input array/matrix. More... | |
| virtual void | apply_to (Matrix_float &input, int parallel) |
| Float32 overload for gate application. More... | |
| virtual void | apply_to (Matrix_real ¶meter_mtx, Matrix &input, int parallel) |
| Abstract function to be overriden in derived classes to be used to transform an input upon a parametric gate operation. More... | |
| virtual void | apply_to (Matrix_real_float ¶meter_mtx, Matrix_float &input, int parallel) |
| Float32 overload for parametric gate application. More... | |
| void | apply_to (Matrix_any &input, int parallel) |
| Precision-agnostic dispatch helper for matrix/state application. More... | |
| void | apply_to (Matrix_real_any ¶meter_mtx, Matrix_any &input, int parallel) |
| Precision-agnostic dispatch helper for parametric application. More... | |
| virtual std::vector< Matrix > | apply_to_combined (Matrix_real ¶meters_mtx_in, Matrix &input, int parallel) |
| Combined forward + derivative application with shared precomputed trig cache. More... | |
| virtual void | apply_to_combined (Matrix_real ¶meters_mtx_in, Matrix &input, int parallel, std::vector< Matrix > &output) |
| virtual std::vector< Matrix_float > | apply_to_combined (Matrix_real_float ¶meters_mtx_in, Matrix_float &input, int parallel) |
| Float32 combined forward + derivative application. More... | |
| virtual void | apply_to_combined (Matrix_real_float ¶meters_mtx_in, Matrix_float &input, int parallel, std::vector< Matrix_float > &output) |
| virtual std::vector< Matrix > | apply_to_combined_inner (Matrix_real ¶meters_mtx_in, const Matrix_real &precomputed_sincos, Matrix &input, int parallel) |
| Internal combined forward+derivative entry with precomputed sin/cos. More... | |
| virtual void | apply_to_combined_inner (Matrix_real ¶meters_mtx_in, const Matrix_real &precomputed_sincos, Matrix &input, int parallel, std::vector< Matrix > &output) |
| virtual std::vector< Matrix_float > | apply_to_combined_inner (Matrix_real_float ¶meters_mtx_in, const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel) |
| Float32 internal combined forward+derivative entry with precomputed sin/cos. More... | |
| virtual void | apply_to_combined_inner (Matrix_real_float ¶meters_mtx_in, const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel, std::vector< Matrix_float > &output) |
| virtual void | apply_to_inner (Matrix_real ¶meter_mtx, const Matrix_real &precomputed_sincos, Matrix &input, int parallel) |
| Internal apply entry that consumes already precomputed sin/cos values. More... | |
| virtual void | apply_to_inner (Matrix_real_float ¶meter_mtx, const Matrix_real_float &precomputed_sincos, Matrix_float &input, int parallel) |
| Float32 internal apply entry that consumes already precomputed sin/cos values. 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 (Matrix_real ¶meters_mtx, std::vector< Matrix > &inputs, int parallel) |
| Abstract function to be overriden in derived classes to be used to transform a list of inputs upon a parametric gate operation. 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... | |
| virtual void | apply_to_list (Matrix_real_float ¶meters_mtx, std::vector< Matrix_float > &inputs, int parallel) |
| Float32 overload: apply gate to a list of float32 inputs with float32 parameters. More... | |
| CCX () | |
| Nullary constructor of the class. More... | |
| CCX (int qbit_num_in, int target_qbit_in, const std::vector< int > &control_qbits_in) | |
| Constructor of the class. More... | |
| void | clear_children () |
| Call to erase data on children. More... | |
| void | clear_parents () |
| Call to erase data on parents. More... | |
| virtual CCX * | clone () override |
| Call to create a clone of the present class. 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... | |
| 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) |
| virtual Matrix_real | extract_parameters (Matrix_real ¶meters) |
| Call to extract parameters from the parameter array corresponding to the circuit, in which the gate is embedded. More... | |
| virtual Matrix_real_float | extract_parameters (Matrix_real_float ¶meters) |
| Float32 overload of extract_parameters. More... | |
| 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) |
| 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... | |
| virtual std::vector< int > | get_involved_qubits (bool only_target=false) |
| Call to get the qubits involved in the gate operation. More... | |
| virtual Matrix | get_matrix (Matrix_real ¶meters, int parallel) |
| Call to retrieve the gate matrix. More... | |
| virtual Matrix | get_matrix (Matrix_real ¶meters) |
| Convenience overload: retrieve the gate matrix (sequential). 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... | |
| virtual Matrix_float | get_matrix (Matrix_real_float ¶meters, int parallel) |
| Float32 overload: retrieve the gate matrix. More... | |
| std::string | get_name () |
| Call to get the name label of the gate. More... | |
| virtual std::vector< double > | get_parameter_multipliers () const |
| Returns the per-parameter multipliers relative to 2Ï used by extract_parameters. More... | |
| virtual int | get_parameter_num () |
| Call to get the number of free parameters. More... | |
| int | get_parameter_start_idx () |
| Call to get the starting index of the parameters in the parameter array corresponding to the circuit in which the current gate is incorporated. More... | |
| std::vector< Gate * > | get_parents () |
| Call to get the parents of the current gate. More... | |
| int | get_qbit_num () |
| Call to get the number of qubits composing the unitary. More... | |
| 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... | |
| gate_type | get_type () |
| Call to get the type of the operation. 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 | print (const std::stringstream &sstream, int verbose_level=1) const |
| Call to print output messages in the function of the verbosity level. More... | |
| virtual void | reorder_qubits (std::vector< int > qbit_list) |
| Call to reorder the qubits in the matrix of the operation. 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_debugfile (std::string debugfile) |
| Call to set the debugfile name. More... | |
| void | set_matrix (Matrix input) |
| Call to set the stored matrix in the operation. More... | |
| void | set_matrix (Matrix_float input) |
| void | set_parameter_start_idx (int start_idx) |
| Call to set the starting index of the parameters in the parameter array corresponding to the circuit in which the current gate is incorporated. More... | |
| void | set_parents (std::vector< Gate *> &parents_) |
| Call to set the parents of the current gate. More... | |
| virtual void | set_qbit_num (int qbit_num_in) |
| Set the number of qubits spanning the matrix of the operation. More... | |
| void | set_target_qbit (int target_qbit_in) |
| Call to set the target qubit for the gate operation. More... | |
| void | set_target_qbits (const std::vector< int > &target_qbits_in) |
| Call to set the target qubits for the gate operation. More... | |
| void | set_verbose (int verbose_in) |
| Call to set the verbose attribute. More... | |
| ~CCX () override | |
| 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) |
Public Attributes | |
| bool | debug |
| Logical variable. Set true to write output messages to the 'debug.txt' file. More... | |
| std::string | debugfile_name |
| String variable. Set the debug file name. More... | |
| int | verbose |
| Set the verbosity level of the output messages. More... | |
Protected Member Functions | |
| 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... | |
| 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... | |
Protected Attributes | |
| std::vector< Gate * > | children |
| list of child gates to be applied after this current gate More... | |
| int | control_qbit |
| The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations. More... | |
| std::vector< int > | control_qbits |
| Vector of control qubit indices (for multi-qubit gates) More... | |
| int | matrix_size |
| The size N of the NxN matrix associated with the operations. More... | |
| std::string | name |
| A string labeling the gate operation. More... | |
| int | parameter_num |
| the number of free parameters of the operation More... | |
| int | parameter_start_idx |
| the index in the parameter array (corrensponding to the encapsulated circuit) where the gate parameters begin (if gates are placed into a circuit a single parameter array is used to execute the whole circuit) More... | |
| std::vector< Gate * > | parents |
| list of parent gates to be applied in the circuit prior to this current gate More... | |
| int | qbit_num |
| number of qubits spanning the matrix of the operation More... | |
| int | target_qbit |
| The index of the qubit on which the operation acts (target_qbit >= 0) More... | |
| std::vector< int > | target_qbits |
| Vector of target qubit indices (for multi-qubit gates) More... | |
| gate_type | type |
| The type of the operation (see enumeration gate_type) More... | |
| CCX::CCX | ( | ) |
Constructor of the class.
| qbit_num_in | The number of qubits in the unitaries |
| target_qbit_in | The identification number of the target qubit. (0 <= target_qbit <= qbit_num-1) |
| control_qbits_in | Vector of control qubit indices (should contain exactly 2 elements for CCX) |
Definition at line 51 of file CCX.cpp.

|
inherited |
|
inherited |
|
virtualinherited |
Call to evaluate the derivate of the circuit on an inout with respect to all of the free parameters.
| parameters | An array of the input parameters. |
| input | The input array on which the gate is applied |
| parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP (NOT IMPLEMENTED YET) and 2 for parallel with TBB (optional) |
Reimplemented in Gates_block, and Adaptive.
Definition at line 784 of file Gate.cpp.

|
virtualinherited |
Reimplemented in Gates_block.
|
virtualinherited |
Float32 overload for derivative evaluation.
| parameters_mtx_in | Float32 parameter matrix |
| input | Float32 input matrix/state |
| parallel | Parallel mode selector |
Reimplemented in Gates_block, and Adaptive.
|
virtualinherited |
Reimplemented in Gates_block.
|
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 |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Call to apply the gate on the input array/matrix by input*Gate.
Apply the gate on input from the right (Matrix_real version)
| parameter_mtx | An array of the input parameters. |
| input | The input array on which the gate is applied |
| parameter_mtx | The gate parameters. |
| input | The input array on which the gate is applied |
Reimplemented in Gates_block, and Adaptive.
|
virtualinherited |
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 in Gates_block, and Adaptive.
|
virtualinherited |
Internal right-apply entry that consumes already precomputed sin/cos values.
Reimplemented in Gates_block, and Adaptive.
Definition at line 977 of file Gate.cpp.


|
virtualinherited |
Float32 internal right-apply entry that consumes already precomputed sin/cos values.
Reimplemented in Gates_block, and Adaptive.
Definition at line 997 of file Gate.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 |
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.

|
virtualinherited |
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 in Gates_block.
|
virtualinherited |
Abstract function to be overriden in derived classes to be used to transform an input upon a parametric gate operation.
| parameter_mtx | An array conatining the 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) |
Reimplemented in Gates_block, and Adaptive.
Definition at line 501 of file Gate.cpp.

|
virtualinherited |
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 in Gates_block, and Adaptive.
Definition at line 530 of file Gate.cpp.

|
inherited |
|
inherited |
|
virtualinherited |
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 in Gates_block.
Definition at line 816 of file Gate.cpp.

|
virtualinherited |
Reimplemented in Gates_block.
|
virtualinherited |
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 in Gates_block.
|
virtualinherited |
Reimplemented in Gates_block.
|
virtualinherited |
Internal combined forward+derivative entry with precomputed sin/cos.
Reimplemented in Gates_block.
|
virtualinherited |
Reimplemented in Gates_block.
Definition at line 841 of file Gate.cpp.

|
virtualinherited |
Float32 internal combined forward+derivative entry with precomputed sin/cos.
Reimplemented in Gates_block.
|
virtualinherited |
Reimplemented in Gates_block.
Definition at line 890 of file Gate.cpp.

|
virtualinherited |
Internal apply entry that consumes already precomputed sin/cos values.
parameter_mtx is preserved for gates with custom parameter handling.
Reimplemented in Gates_block, and Adaptive.
Definition at line 549 of file Gate.cpp.


|
virtualinherited |
Float32 internal apply entry that consumes already precomputed sin/cos values.
parameter_mtx is preserved for gates with custom parameter handling.
Reimplemented in Gates_block, and Adaptive.
Definition at line 574 of file Gate.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 |
Abstract function to be overriden in derived classes to be used to transform a list of inputs upon a parametric gate operation.
| parameter_mtx | An array conatining the parameters of the 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) |
Reimplemented in Gates_block.
Definition at line 355 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.

|
virtualinherited |
Float32 overload: apply gate to a list of float32 inputs with float32 parameters.
| parameters_mtx | Float32 parameter matrix |
| 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 in Gates_block.
Definition at line 407 of file Gate.cpp.

|
staticinherited |
|
staticinherited |
|
inherited |
|
inherited |
|
overridevirtual |
|
inherited |
|
inherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Call to extract parameters from the parameter array corresponding to the circuit, in which the gate is embedded.
| parameters | The parameter array corresponding to the circuit in which the gate is embedded |
Uses get_parameter_multipliers() to apply fmod wrapping generically. Multiplier m â extracted[i] = fmod(m * params[start+i], m * 2Ï).
Reimplemented in Gates_block.
Definition at line 2679 of file Gate.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.

|
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 |
|
inherited |
|
inherited |
Call to get the qubits involved in the gate operation.
Reimplemented in Gates_block.
Definition at line 1219 of file Gate.cpp.

|
virtualinherited |
Call to retrieve the gate matrix.
| parameters | An array of parameters to calculate the matrix of the U3 gate. |
| parallel | Set 0 for sequential execution, 1 for parallel execution with OpenMP and 2 for parallel with TBB (optional) |
Reimplemented in Gates_block.
Definition at line 269 of file Gate.cpp.


|
virtualinherited |
Convenience overload: retrieve the gate matrix (sequential).
Reimplemented in Gates_block.
|
virtualinherited |
|
virtualinherited |
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 in Gates_block.
Definition at line 306 of file Gate.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.
|
virtualinherited |
Call to get the number of free parameters.
Reimplemented in Gates_block.
Definition at line 1324 of file Gate.cpp.

|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
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.
|
virtualinherited |
Call to reorder the qubits in the matrix of the operation.
| qbit_list | The reordered list of qubits spanning the matrix |
Reimplemented in Gates_block, and Decomposition_Base.
Definition at line 1151 of file Gate.cpp.

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

|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
virtualinherited |
Set the number of qubits spanning the matrix of the operation.
| qbit_num_in | The number of qubits spanning the matrix |
Reimplemented in Gates_block, and Decomposition_Base.
Definition at line 244 of file Gate.cpp.


|
inherited |
|
inherited |
|
inherited |
Call to set the verbose attribute.
| verbose_in | Integer variable. Set the number to specify the verbosity level for output messages. |
Definition at line 85 of file logging.cpp.

|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
1.8.13