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

Multiplexed U2 gate. More...

#include <Multiplexor.hpp>

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

Public Member Functions

 MultiplexedU2Box (const ctrl_op_map_t &op_map, bool impl_diag=true)
 Construct from a op_map.
 
 MultiplexedU2Box (const MultiplexedU2Box &other)
 Copy constructor.
 
 ~MultiplexedU2Box () 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 MultiplexedU2Box 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
 
bool get_impl_diag () const
 
MultiplexedU2Commands decompose () const
 Decompose the multiplexor into a sequence of interleaving CX and single qubit gates followed by a diagonal matrix, given as command descriptions and a diagonal vector.
 
- 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 U2 gate (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 U2 gate.

Definition at line 191 of file Multiplexor.hpp.

Constructor & Destructor Documentation

◆ MultiplexedU2Box() [1/2]

tket::MultiplexedU2Box::MultiplexedU2Box ( const ctrl_op_map_t op_map,
bool  impl_diag = true 
)
explicit

Construct from a op_map.

Ops must be single-qubit unitary gate types or Unitary1QBox.

Parameters
op_map
impl_diagwhether to implement the final DiagonalBox, default to true

Definition at line 616 of file Multiplexor.cpp.

◆ MultiplexedU2Box() [2/2]

tket::MultiplexedU2Box::MultiplexedU2Box ( const MultiplexedU2Box other)

Copy constructor.

Definition at line 642 of file Multiplexor.cpp.

◆ ~MultiplexedU2Box()

tket::MultiplexedU2Box::~MultiplexedU2Box ( )
inlineoverride

Definition at line 207 of file Multiplexor.hpp.

Member Function Documentation

◆ dagger()

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

Inverse (of a unitary operation)

Exceptions
BadOpTypeif operation is not unitary

Reimplemented from tket::Op.

Definition at line 658 of file Multiplexor.cpp.

◆ decompose()

MultiplexedU2Commands tket::MultiplexedU2Box::decompose ( ) const

Decompose the multiplexor into a sequence of interleaving CX and single qubit gates followed by a diagonal matrix, given as command descriptions and a diagonal vector.

Returns
MultiplexedU2Commands

Definition at line 696 of file Multiplexor.cpp.

◆ free_symbols()

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

Set of all free symbols occurring in operation parameters.

Implements tket::Op.

Definition at line 654 of file Multiplexor.cpp.

◆ from_json()

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

Definition at line 688 of file Multiplexor.cpp.

◆ generate_circuit()

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

Implement multiplexed U2 gate (i.e.

uniformly controlled U2 gate (UCU2)) with 2^ctrl_qubits SQ gates, 2^ctrl_qubits CXs, and a DiagonalBox at the end

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

Implements tket::Box.

Definition at line 753 of file Multiplexor.cpp.

◆ get_impl_diag()

bool tket::MultiplexedU2Box::get_impl_diag ( ) const
inline

Definition at line 229 of file Multiplexor.hpp.

◆ get_op_map()

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

Definition at line 227 of file Multiplexor.hpp.

◆ get_ops()

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

Definition at line 214 of file Multiplexor.hpp.

◆ get_signature()

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

Vector specifying type of data for each port on op.

Reimplemented from tket::Box.

Definition at line 667 of file Multiplexor.cpp.

◆ is_equal()

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

Equality check between two MultiplexedU2Box instances.

Reimplemented from tket::Op.

Definition at line 672 of file Multiplexor.cpp.

◆ symbol_substitution()

Op_ptr tket::MultiplexedU2Box::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 648 of file Multiplexor.cpp.

◆ to_json()

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

Definition at line 680 of file Multiplexor.cpp.

◆ transpose()

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

Transpose of a unitary operation.

Reimplemented from tket::Op.

Definition at line 662 of file Multiplexor.cpp.


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