Quantum Gate Decomposer
v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
|
Base class for the representation of one- and two-qubit operations. More...
#include <Operation.h>
Public Member Functions | |
Operation * | clone () |
Call to create a clone of the present class. More... | |
int | get_control_qbit () |
Call to get the index of the control qubit. More... | |
Matrix | get_matrix () |
Call to retrieve the operation matrix. More... | |
unsigned int | get_parameter_num () |
Call to get the number of free parameters. 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... | |
operation_type | get_type () |
Call to get the type of the operation. More... | |
Operation () | |
Default constructor of the class. More... | |
Operation (int qbit_num_in) | |
Constructor of the class. More... | |
virtual void | reorder_qubits (std::vector< int > qbit_list) |
Call to reorder the qubits in the matrix of the operation. More... | |
void | set_matrix (Matrix input) |
Call to set the stored matrix in the operation. More... | |
virtual void | set_qbit_num (int qbit_num_in) |
Set the number of qubits spanning the matrix of the operation. More... | |
virtual | ~Operation () |
Destructor of the class. More... | |
Protected Attributes | |
int | control_qbit |
The index of the qubit which acts as a control qubit (control_qbit >= 0) in controlled operations. More... | |
int | matrix_size |
The size N of the NxN matrix associated with the operations. More... | |
unsigned int | parameter_num |
the number of free parameters of the operation 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... | |
operation_type | type |
The type of the operation (see enumeration operation_type) More... | |
Private Attributes | |
Matrix | matrix_alloc |
Matrix of the operation. More... | |
Base class for the representation of one- and two-qubit operations.
Definition at line 40 of file Operation.h.
Operation::Operation | ( | ) |
Default constructor of the class.
Deafult constructor of the class.
Definition at line 32 of file Operation.cpp.
|
virtual |
Destructor of the class.
Definition at line 75 of file Operation.cpp.
Operation::Operation | ( | int | qbit_num_in | ) |
Constructor of the class.
qbit_num_in | The number of qubits spanning the unitaries |
Definition at line 55 of file Operation.cpp.
Operation * Operation::clone | ( | ) |
Call to create a clone of the present class.
Definition at line 192 of file Operation.cpp.
int Operation::get_control_qbit | ( | ) |
Call to get the index of the control qubit.
Definition at line 157 of file Operation.cpp.
Matrix Operation::get_matrix | ( | ) |
Call to retrieve the operation matrix.
Definition at line 97 of file Operation.cpp.
unsigned int Operation::get_parameter_num | ( | ) |
Call to get the number of free parameters.
Definition at line 165 of file Operation.cpp.
int Operation::get_qbit_num | ( | ) |
Call to get the number of qubits composing the unitary.
Definition at line 183 of file Operation.cpp.
int Operation::get_target_qbit | ( | ) |
Call to get the index of the target qubit.
Definition at line 149 of file Operation.cpp.
operation_type Operation::get_type | ( | ) |
Call to get the type of the operation.
Definition at line 174 of file Operation.cpp.
|
virtual |
Call to reorder the qubits in the matrix of the operation.
qbit_list | The reordered list of qubits spanning the matrix |
Reimplemented in Decomposition_Base, Operation_block, U3, and CNOT.
Definition at line 118 of file Operation.cpp.
void Operation::set_matrix | ( | Matrix | input | ) |
Call to set the stored matrix in the operation.
input | The operation matrix to be stored. The matrix is stored by attribute matrix_alloc. |
Definition at line 109 of file Operation.cpp.
|
virtual |
Set the number of qubits spanning the matrix of the operation.
qbit_num_in | The number of qubits spanning the matrix |
Reimplemented in Operation_block, U3, and CNOT.
Definition at line 82 of file Operation.cpp.
|
protected |
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.
|
private |
Matrix of the operation.
Definition at line 61 of file Operation.h.
|
protected |
The size N of the NxN matrix associated with the operations.
Definition at line 54 of file Operation.h.
|
protected |
the number of free parameters of the operation
Definition at line 56 of file Operation.h.
|
protected |
number of qubits spanning the matrix of the operation
Definition at line 46 of file Operation.h.
|
protected |
The index of the qubit on which the operation acts (target_qbit >= 0)
Definition at line 50 of file Operation.h.
|
protected |
The type of the operation (see enumeration operation_type)
Definition at line 48 of file Operation.h.