51 CRX::CRX(
int qbit_num_in,
int target_qbit_in,
int control_qbit_in) :
RX(qbit_num_in, target_qbit_in) {
61 std::stringstream sstream;
62 sstream <<
"The index of the control qubit is larger than the number of qubits in CRX gate." << std::endl;
std::vector< Gate * > parents
list of parent gates to be applied in the circuit prior to this current gate
void print(const std::stringstream &sstream, int verbose_level=1) const
Call to print output messages in the function of the verbosity level.
A class representing a controlled RX gate.
int control_qbit
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations...
void set_children(std::vector< Gate *> &children_)
Call to set the children of the current gate.
int target_qbit
The index of the qubit on which the operation acts (target_qbit >= 0)
Header file for a class representing a controlled X rotation gate.
~CRX() override
Destructor of the class.
virtual CRX * clone() override
Call to create a clone of the present class.
gate_type type
The type of the operation (see enumeration gate_type)
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 ...
int get_parameter_start_idx()
Call to get the starting index of the parameters in the parameter array corresponding to the circuit ...
std::string name
A string labeling the gate operation.
std::vector< Gate * > children
list of child gates to be applied after this current gate
void set_parents(std::vector< Gate *> &parents_)
Call to set the parents of the current gate.
CRX()
Nullary constructor of the class.
int qbit_num
number of qubits spanning the matrix of the operation