53 CNOT::CNOT(
int qbit_num_in,
int target_qbit_in,
int control_qbit_in) :
X(qbit_num_in, target_qbit_in) {
64 std::stringstream sstream;
65 sstream <<
"The index of the control qubit is larger than the number of qubits" << 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.
int control_qbit
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations...
int target_qbit
The index of the qubit on which the operation acts (target_qbit >= 0)
virtual CNOT * clone() override
Call to create a clone of the present class.
Header file for a class representing a CNOT operation.
gate_type type
The type of the operation (see enumeration gate_type)
int get_parameter_start_idx()
Call to get the starting index of the parameters in the parameter array corresponding to the circuit ...
~CNOT() override
Destructor of the class.
CNOT()
Nullary constructor of the class.
std::string name
A string labeling the gate operation.
std::vector< Gate * > children
list of child gates to be applied after this current gate
int qbit_num
number of qubits spanning the matrix of the operation