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

Multiplexed single-axis rotations. More...

#include <Multiplexor.hpp>

Inheritance diagram for tket::MultiplexedRotationBox:
Inheritance graph
[legend]
Collaboration diagram for tket::MultiplexedRotationBox:
Collaboration graph
[legend]

Public Member Functions

 MultiplexedRotationBox (const ctrl_op_map_t &op_map)
 Construct from a op_map.
 
 MultiplexedRotationBox (const MultiplexedRotationBox &other)
 Copy constructor.
 
 ~MultiplexedRotationBox () override
 
Op_ptr symbol_substitution (const SymEngine::map_basic_basic &sub_map) const override
 Operation with values for symbols substituted.
 
SymSet free_symbols () const override
 Set of all free symbols occurring in operation parameters.
 
ctrl_op_map_t get_ops () const
 
bool is_equal (const Op &op_other) const override
 Equality check between two MultiplexedRotationBox instances.
 
Op_ptr dagger () const override
 Inverse (of a unitary operation)
 
Op_ptr transpose () const override
 Transpose of a unitary operation.
 
op_signature_t get_signature () const override
 Vector specifying type of data for each port on op.
 
ctrl_op_map_t get_op_map () const
 
std::vector< GateSpecdecompose () const
 
- Public Member Functions inherited from tket::Box
 Box (const OpType &type, const op_signature_t &signature={})
 
 Box (const Box &other)
 
unsigned n_qubits () const override
 Number of Quantum inputs.
 
unsigned n_boolean () const
 Number of Boolean inputs.
 
unsigned n_classical () const
 Number of Classical inputs.
 
nlohmann::json serialize () const override
 
std::shared_ptr< Circuitto_circuit () const
 Circuit represented by box.
 
virtual std::optional< Eigen::MatrixXcd > get_box_unitary () const
 If meaningful and implemented, return the numerical unitary matrix (in ILO-BE convention) which this Box represents.
 
Eigen::MatrixXcd get_unitary () const override
 If meaningful and implemented, return the numerical unitary matrix (in ILO-BE convention) which this Op represents.
 
boost::uuids::uuid get_id () const
 Unique identifier (preserved on copy)
 
- Public Member Functions inherited from tket::Op
virtual std::vector< Exprget_params () const
 Sequence of phase parameters, if applicable.
 
virtual std::vector< Exprget_params_reduced () const
 Sequence of phase parameters reduced to canonical range, if applicable.
 
virtual std::string get_name (bool latex=false) const
 String representation.
 
virtual std::string get_command_str (const unit_vector_t &args) const
 Command representation.
 
OpDesc get_desc () const
 Get operation descriptor.
 
OpType get_type () const
 Get operation type.
 
virtual std::optional< Paulicommuting_basis (port_t i) const
 Which Pauli, if any, commutes with the operation at a given port.
 
virtual bool commutes_with_basis (const std::optional< Pauli > &colour, port_t i) const
 Whether the operation commutes with the given Pauli at the given port.
 
virtual bool is_extern () const
 return if the op is external
 
virtual std::optional< double > is_identity () const
 Test whether operation is identity up to a phase and return phase if so.
 
virtual bool is_clifford () const
 Test whether operation is in the Clifford group.
 
virtual bool has_symmetry (unsigned port1, unsigned port2) const
 Checks for symmetry of port pairs.
 
virtual ~Op ()
 
bool operator== (const Op &other) const
 

Static Public Member Functions

static Op_ptr from_json (const nlohmann::json &j)
 
static nlohmann::json to_json (const Op_ptr &op)
 
- Static Public Member Functions inherited from tket::Box
static Op_ptr deserialize (const nlohmann::json &j)
 

Protected Member Functions

void generate_circuit () const override
 Implement multiplexed rotation (i.e.
 
- Protected Member Functions inherited from tket::Op
 Op (const OpType &type)
 

Additional Inherited Members

- Static Protected Member Functions inherited from tket::Box
static boost::uuids::uuid idgen ()
 
- Protected Attributes inherited from tket::Box
op_signature_t signature_
 
std::shared_ptr< Circuitcirc_
 
boost::uuids::uuid id_
 
- Protected Attributes inherited from tket::Op
const OpDesc desc_
 Operation descriptor.
 
const OpType type_
 Operation type.
 

Detailed Description

Multiplexed single-axis rotations.

Definition at line 118 of file Multiplexor.hpp.

Constructor & Destructor Documentation

◆ MultiplexedRotationBox() [1/2]

tket::MultiplexedRotationBox::MultiplexedRotationBox ( const ctrl_op_map_t op_map)
explicit

Construct from a op_map.

All ops should be of the same type. They can be either Rx, Ry or Rz.

Parameters
op_map

Definition at line 469 of file Multiplexor.cpp.

◆ MultiplexedRotationBox() [2/2]

tket::MultiplexedRotationBox::MultiplexedRotationBox ( const MultiplexedRotationBox other)

Copy constructor.

Definition at line 503 of file Multiplexor.cpp.

◆ ~MultiplexedRotationBox()

tket::MultiplexedRotationBox::~MultiplexedRotationBox ( )
inlineoverride

Definition at line 132 of file Multiplexor.hpp.

Member Function Documentation

◆ dagger()

Op_ptr tket::MultiplexedRotationBox::dagger ( ) const
overridevirtual

Inverse (of a unitary operation)

Exceptions
BadOpTypeif operation is not unitary

Reimplemented from tket::Op.

Definition at line 520 of file Multiplexor.cpp.

◆ decompose()

std::vector< GateSpec > tket::MultiplexedRotationBox::decompose ( ) const

Definition at line 555 of file Multiplexor.cpp.

◆ free_symbols()

SymSet tket::MultiplexedRotationBox::free_symbols ( ) const
overridevirtual

Set of all free symbols occurring in operation parameters.

Implements tket::Op.

Definition at line 516 of file Multiplexor.cpp.

◆ from_json()

Op_ptr tket::MultiplexedRotationBox::from_json ( const nlohmann::json &  j)
static

Definition at line 547 of file Multiplexor.cpp.

◆ generate_circuit()

void tket::MultiplexedRotationBox::generate_circuit ( ) const
overrideprotectedvirtual

Implement multiplexed rotation (i.e.

uniformly controlled same-axis rotations (UCR)), with 2^ctrl_qubits SQ rotations, 2^ctrl_qubits CXs, and 2 H gates for X-axis rotations.

https://arxiv.org/abs/quant-ph/0410066

Implements tket::Box.

Definition at line 581 of file Multiplexor.cpp.

◆ get_op_map()

ctrl_op_map_t tket::MultiplexedRotationBox::get_op_map ( ) const
inline

Definition at line 152 of file Multiplexor.hpp.

◆ get_ops()

ctrl_op_map_t tket::MultiplexedRotationBox::get_ops ( ) const
inline

Definition at line 139 of file Multiplexor.hpp.

◆ get_signature()

op_signature_t tket::MultiplexedRotationBox::get_signature ( ) const
overridevirtual

Vector specifying type of data for each port on op.

Reimplemented from tket::Box.

Definition at line 528 of file Multiplexor.cpp.

◆ is_equal()

bool tket::MultiplexedRotationBox::is_equal ( const Op op_other) const
overridevirtual

Equality check between two MultiplexedRotationBox instances.

Reimplemented from tket::Op.

Definition at line 533 of file Multiplexor.cpp.

◆ symbol_substitution()

Op_ptr tket::MultiplexedRotationBox::symbol_substitution ( const SymEngine::map_basic_basic &  sub_map) const
overridevirtual

Operation with values for symbols substituted.

Parameters
sub_mapmap from symbols to values
Returns
New operation with symbols substituted, or a null pointer if the operation type does not support symbols.

Implements tket::Op.

Definition at line 510 of file Multiplexor.cpp.

◆ to_json()

nlohmann::json tket::MultiplexedRotationBox::to_json ( const Op_ptr op)
static

Definition at line 540 of file Multiplexor.cpp.

◆ transpose()

Op_ptr tket::MultiplexedRotationBox::transpose ( ) const
overridevirtual

Transpose of a unitary operation.

Reimplemented from tket::Op.

Definition at line 524 of file Multiplexor.cpp.


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