A class representing a CNOT operation.
More...
#include <CNOT.h>
A class representing a CNOT operation.
Definition at line 36 of file CNOT.h.
◆ CNOT()
CNOT::CNOT |
( |
int |
qbit_num_in, |
|
|
int |
target_qbit_in, |
|
|
int |
control_qbit_in |
|
) |
| |
Constructor of the class.
- Parameters
-
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_qbit_in | The identification number of the control qubit. (0 <= target_qbit <= qbit_num-1) |
Definition at line 38 of file CNOT.cpp.
◆ ~CNOT()
Destructor of the class.
Definition at line 70 of file CNOT.cpp.
◆ clone()
Call to create a clone of the present class.
- Returns
- Return with a pointer pointing to the cloned object
Definition at line 192 of file CNOT.cpp.
◆ composite_cnot()
Matrix CNOT::composite_cnot |
( |
| ) |
|
Calculate the matrix of a CNOT gate operation acting on the space of qbit_num qubits.
- Returns
- Returns with the operation matrix
Definition at line 87 of file CNOT.cpp.
◆ get_control_qbit()
int Operation::get_control_qbit |
( |
| ) |
|
|
inherited |
Call to get the index of the control qubit.
- Returns
- Return with the index of the control qubit (return with -1 if control qubit was not set)
Definition at line 157 of file Operation.cpp.
◆ get_matrix()
Call to retrieve the operation matrix.
- Returns
- Returns with the matrix of the operation
Definition at line 79 of file CNOT.cpp.
◆ get_parameter_num()
unsigned int Operation::get_parameter_num |
( |
| ) |
|
|
inherited |
Call to get the number of free parameters.
- Returns
- Return with the number of the free parameters
Definition at line 165 of file Operation.cpp.
◆ get_qbit_num()
int Operation::get_qbit_num |
( |
| ) |
|
|
inherited |
Call to get the number of qubits composing the unitary.
- Returns
- Return with the number of qubits composing the unitary
Definition at line 183 of file Operation.cpp.
◆ get_target_qbit()
int Operation::get_target_qbit |
( |
| ) |
|
|
inherited |
Call to get the index of the target qubit.
- Returns
- Return with the index of the target qubit (return with -1 if target qubit was not set)
Definition at line 149 of file Operation.cpp.
◆ get_type()
Call to get the type of the operation.
- Returns
- Return with the type of the operation (see operation_type for details)
Definition at line 174 of file Operation.cpp.
◆ reorder_qubits()
void CNOT::reorder_qubits |
( |
std::vector< int > |
qbit_list | ) |
|
|
virtual |
Call to reorder the qubits in the matrix of the operation.
- Parameters
-
qbit_list | The reordered list of qubits spanning the matrix |
Reimplemented from Operation.
Definition at line 180 of file CNOT.cpp.
◆ set_matrix()
void Operation::set_matrix |
( |
Matrix |
input | ) |
|
|
inherited |
Call to set the stored matrix in the operation.
- Parameters
-
input | The operation matrix to be stored. The matrix is stored by attribute matrix_alloc. |
- Returns
- Returns with 0 on success.
Definition at line 109 of file Operation.cpp.
◆ set_qbit_num()
void CNOT::set_qbit_num |
( |
int |
qbit_num | ) |
|
|
virtual |
Call to set the number of qubits spanning the matrix of the operation.
- Parameters
-
qbit_num | The number of qubits |
Reimplemented from Operation.
Definition at line 168 of file CNOT.cpp.
◆ control_qbit
int Operation::control_qbit |
|
protectedinherited |
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations.
Definition at line 52 of file Operation.h.
◆ matrix_size
int Operation::matrix_size |
|
protectedinherited |
The size N of the NxN matrix associated with the operations.
Definition at line 54 of file Operation.h.
◆ parameter_num
unsigned int Operation::parameter_num |
|
protectedinherited |
the number of free parameters of the operation
Definition at line 56 of file Operation.h.
◆ qbit_num
number of qubits spanning the matrix of the operation
Definition at line 46 of file Operation.h.
◆ target_qbit
int Operation::target_qbit |
|
protectedinherited |
The index of the qubit on which the operation acts (target_qbit >= 0)
Definition at line 50 of file Operation.h.
◆ type
The type of the operation (see enumeration operation_type)
Definition at line 48 of file Operation.h.
The documentation for this class was generated from the following files: