tket
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tket::OpDesc Class Reference

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_tsignature () 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.
 

Detailed Description

Operation descriptor.

An object of this class holds information about a specific operation type.

Definition at line 36 of file OpDesc.hpp.

Constructor & Destructor Documentation

◆ OpDesc()

tket::OpDesc::OpDesc ( OpType  type)
explicit

Definition at line 23 of file OpDesc.cpp.

Member Function Documentation

◆ is_barrier()

bool tket::OpDesc::is_barrier ( ) const

Whether the operation is a Barrier.

Definition at line 79 of file OpDesc.cpp.

◆ is_box()

bool tket::OpDesc::is_box ( ) const

Whether the operation is a box of some kind.

Definition at line 81 of file OpDesc.cpp.

◆ is_classical()

bool tket::OpDesc::is_classical ( ) const

Whether the operation is purely classical.

Definition at line 87 of file OpDesc.cpp.

◆ is_clifford_gate()

bool tket::OpDesc::is_clifford_gate ( ) const

Whether the operation is a Clifford gate.

Definition at line 99 of file OpDesc.cpp.

◆ is_flowop()

bool tket::OpDesc::is_flowop ( ) const

Whether the operation is for control flow.

Definition at line 85 of file OpDesc.cpp.

◆ is_gate()

bool tket::OpDesc::is_gate ( ) const

Whether the operation is a normal (quantum or classical) gate.

Definition at line 83 of file OpDesc.cpp.

◆ is_meta()

bool tket::OpDesc::is_meta ( ) const

Whether the 'operation' is actually an input or output.

Definition at line 77 of file OpDesc.cpp.

◆ is_oneway()

bool tket::OpDesc::is_oneway ( ) const

Whether the operation has no defined dagger.

Definition at line 93 of file OpDesc.cpp.

◆ is_parameterised_pauli_rotation()

bool tket::OpDesc::is_parameterised_pauli_rotation ( ) const

Whether the operation is a parameterised Pauli rotation.

Definition at line 101 of file OpDesc.cpp.

◆ is_rotation()

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.

◆ is_singleq_unitary()

bool tket::OpDesc::is_singleq_unitary ( ) const

Whether the operation is a single-qubit unitary.

Definition at line 95 of file OpDesc.cpp.

◆ latex()

std::string tket::OpDesc::latex ( ) const

Name in Latex representation.

Definition at line 42 of file OpDesc.cpp.

◆ n_boolean()

OptUInt tket::OpDesc::n_boolean ( ) const

Number of classical bits read.

Definition at line 59 of file OpDesc.cpp.

◆ n_classical()

OptUInt tket::OpDesc::n_classical ( ) const

Number of classical bits written to.

Definition at line 68 of file OpDesc.cpp.

◆ n_params()

unsigned tket::OpDesc::n_params ( ) const

Number of phase parameters.

Definition at line 44 of file OpDesc.cpp.

◆ n_qubits()

OptUInt tket::OpDesc::n_qubits ( ) const

Number of input and output qubits.

Definition at line 50 of file OpDesc.cpp.

◆ name()

std::string tket::OpDesc::name ( ) const

Name.

Definition at line 40 of file OpDesc.cpp.

◆ param_mod()

unsigned tket::OpDesc::param_mod ( unsigned  i) const

The modulus for a parameter.

Parameters
ithe index of the parameter
Returns
\( n \) such that the parameter is to be regarded as an element of \( \mathbb{R} / n \mathbb{Z} \).

Definition at line 91 of file OpDesc.cpp.

◆ signature()

std::optional< op_signature_t > tket::OpDesc::signature ( ) const

Types of each input/output.

Definition at line 46 of file OpDesc.cpp.

◆ type()

OpType tket::OpDesc::type ( ) const

Type of operation.

Definition at line 38 of file OpDesc.cpp.


The documentation for this class was generated from the following files: