tket
|
Operation descriptor. More...
#include <OpDesc.hpp>
Public Member Functions | |
OpDesc (OpType type) | |
OpType | type () const |
Type of operation. | |
std::string | name () const |
Name. | |
std::string | latex () const |
Name in Latex representation. | |
unsigned | n_params () const |
Number of phase parameters. | |
std::optional< op_signature_t > | signature () const |
Types of each input/output. | |
OptUInt | n_qubits () const |
Number of input and output qubits. | |
OptUInt | n_boolean () const |
Number of classical bits read. | |
OptUInt | n_classical () const |
Number of classical bits written to. | |
bool | is_meta () const |
Whether the 'operation' is actually an input or output. | |
bool | is_barrier () const |
Whether the operation is a Barrier. | |
bool | is_box () const |
Whether the operation is a box of some kind. | |
bool | is_gate () const |
Whether the operation is a normal (quantum or classical) gate. | |
bool | is_flowop () const |
Whether the operation is for control flow. | |
bool | is_classical () const |
Whether the operation is purely classical. | |
bool | is_rotation () const |
Whether this is a parametrized rotation. | |
unsigned | param_mod (unsigned i) const |
The modulus for a parameter. | |
bool | is_oneway () const |
Whether the operation has no defined dagger. | |
bool | is_singleq_unitary () const |
Whether the operation is a single-qubit unitary. | |
bool | is_clifford_gate () const |
Whether the operation is a Clifford gate. | |
bool | is_parameterised_pauli_rotation () const |
Whether the operation is a parameterised Pauli rotation. | |
Operation descriptor.
An object of this class holds information about a specific operation type.
Definition at line 36 of file OpDesc.hpp.
|
explicit |
Definition at line 23 of file OpDesc.cpp.
bool tket::OpDesc::is_barrier | ( | ) | const |
Whether the operation is a Barrier.
Definition at line 79 of file OpDesc.cpp.
bool tket::OpDesc::is_box | ( | ) | const |
Whether the operation is a box of some kind.
Definition at line 81 of file OpDesc.cpp.
bool tket::OpDesc::is_classical | ( | ) | const |
Whether the operation is purely classical.
Definition at line 87 of file OpDesc.cpp.
bool tket::OpDesc::is_clifford_gate | ( | ) | const |
Whether the operation is a Clifford gate.
Definition at line 99 of file OpDesc.cpp.
bool tket::OpDesc::is_flowop | ( | ) | const |
Whether the operation is for control flow.
Definition at line 85 of file OpDesc.cpp.
bool tket::OpDesc::is_gate | ( | ) | const |
Whether the operation is a normal (quantum or classical) gate.
Definition at line 83 of file OpDesc.cpp.
bool tket::OpDesc::is_meta | ( | ) | const |
Whether the 'operation' is actually an input or output.
Definition at line 77 of file OpDesc.cpp.
bool tket::OpDesc::is_oneway | ( | ) | const |
Whether the operation has no defined dagger.
Definition at line 93 of file OpDesc.cpp.
bool tket::OpDesc::is_parameterised_pauli_rotation | ( | ) | const |
Whether the operation is a parameterised Pauli rotation.
Definition at line 101 of file OpDesc.cpp.
bool tket::OpDesc::is_rotation | ( | ) | const |
Whether this is a parametrized rotation.
For our purposes, an operation \( O \) is a rotation if and only if it has a single real-valued parameter which is additive in the sense that \( O(\alpha) \circ O(\beta) = O(\alpha + \beta) \).
Definition at line 89 of file OpDesc.cpp.
bool tket::OpDesc::is_singleq_unitary | ( | ) | const |
Whether the operation is a single-qubit unitary.
Definition at line 95 of file OpDesc.cpp.
std::string tket::OpDesc::latex | ( | ) | const |
Name in Latex representation.
Definition at line 42 of file OpDesc.cpp.
OptUInt tket::OpDesc::n_boolean | ( | ) | const |
Number of classical bits read.
Definition at line 59 of file OpDesc.cpp.
OptUInt tket::OpDesc::n_classical | ( | ) | const |
Number of classical bits written to.
Definition at line 68 of file OpDesc.cpp.
unsigned tket::OpDesc::n_params | ( | ) | const |
Number of phase parameters.
Definition at line 44 of file OpDesc.cpp.
OptUInt tket::OpDesc::n_qubits | ( | ) | const |
Number of input and output qubits.
Definition at line 50 of file OpDesc.cpp.
std::string tket::OpDesc::name | ( | ) | const |
Name.
Definition at line 40 of file OpDesc.cpp.
unsigned tket::OpDesc::param_mod | ( | unsigned | i | ) | const |
The modulus for a parameter.
i | the index of the parameter |
Definition at line 91 of file OpDesc.cpp.
std::optional< op_signature_t > tket::OpDesc::signature | ( | ) | const |
Types of each input/output.
Definition at line 46 of file OpDesc.cpp.
OpType tket::OpDesc::type | ( | ) | const |
Type of operation.
Definition at line 38 of file OpDesc.cpp.