Maestro 0.1.0
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Circuits::NoOperation< Time > Class Template Reference

The no operation. More...

#include <Operations.h>

Inheritance diagram for Circuits::NoOperation< Time >:
Circuits::IOperation< Types::time_type >

Public Member Functions

 NoOperation (Time delay=0)
 Construct a new NoOperation object.
void Execute (const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
 Execute the operation.
std::shared_ptr< IOperation< Time > > Clone () const override
 Get a shared pointer to a clone of this object.
std::shared_ptr< IOperation< Time > > Remap (const std::unordered_map< Types::qubit_t, Types::qubit_t > &qubitsMap, const std::unordered_map< Types::qubit_t, Types::qubit_t > &bitsMap) const override
 Get a shared pointer to a remapped operation.
bool IsClifford () const override
 Checks if the operation is a Clifford one.
Public Member Functions inherited from Circuits::IOperation< Types::time_type >
 IOperation (Types::time_type delay=0)
 Construct a new IOperation object.
virtual ~IOperation ()=default
 Destroy the IOperation object.
virtual OperationType GetType () const
 Get the type of the operation.
virtual bool CanAffectQuantumState () const
 Find if the operation can affect the quantum state.
virtual bool NeedsEntanglementForDistribution () const
 Find if the operation needs entanglement for distribution.
virtual bool IsConditional () const
 Find if the operation is a conditional operation.
virtual Types::qubits_vector AffectedQubits () const
 Returns the affected qubits.
virtual std::vector< size_t > AffectedBits () const
 Returns the affected bits.
std::shared_ptr< IOperation< Types::time_type > > getptr ()
 Get a shared pointer to this object.
Types::time_type GetDelay () const
 Get the delay of the operation.
void SetDelay (Types::time_type d)
 Set the delay of the operation.

Detailed Description

template<typename Time = Types::time_type>
class Circuits::NoOperation< Time >

The no operation.

This a an operation that does nothing.

Template Parameters
TimeThe type of the delay time parameter.
See also
IOperation

Definition at line 534 of file Operations.h.

Constructor & Destructor Documentation

◆ NoOperation()

template<typename Time = Types::time_type>
Circuits::NoOperation< Time >::NoOperation ( Time delay = 0)
inline

Construct a new NoOperation object.

Construct a new NoOperation object with the specified execution time.

Parameters
delayThe execution time of the operation.

Definition at line 542 of file Operations.h.

Member Function Documentation

◆ Clone()

template<typename Time = Types::time_type>
std::shared_ptr< IOperation< Time > > Circuits::NoOperation< Time >::Clone ( ) const
inlineoverridevirtual

Get a shared pointer to a clone of this object.

Returns a shared pointer to a copy of this object.

Returns
A shared pointer to this object.

Implements Circuits::IOperation< Types::time_type >.

Definition at line 565 of file Operations.h.

◆ Execute()

template<typename Time = Types::time_type>
void Circuits::NoOperation< Time >::Execute ( const std::shared_ptr< Simulators::ISimulator > & sim,
OperationState & state ) const
inlineoverridevirtual

Execute the operation.

Execute the operation on the specified simulator. The execution does nothing, except adding the delay for the execution if a discrete event simulator is used. To not be confused with the simulator passed here as a parameter, which is a quantum simulator.

Parameters
simThe simulator to execute the operation on.
stateThe state of the operation.
See also
ISimulator
OperationState

Implements Circuits::IOperation< Types::time_type >.

Definition at line 556 of file Operations.h.

◆ IsClifford()

template<typename Time = Types::time_type>
bool Circuits::NoOperation< Time >::IsClifford ( ) const
inlineoverridevirtual

Checks if the operation is a Clifford one.

Checks if the operation is a Clifford one, allowing to be simulated in a stabilizers simulator.

Returns
True if it can be applied in a stabilizers simulator, false otherwise.

Reimplemented from Circuits::IOperation< Types::time_type >.

Definition at line 595 of file Operations.h.

◆ Remap()

template<typename Time = Types::time_type>
std::shared_ptr< IOperation< Time > > Circuits::NoOperation< Time >::Remap ( const std::unordered_map< Types::qubit_t, Types::qubit_t > & qubitsMap,
const std::unordered_map< Types::qubit_t, Types::qubit_t > & bitsMap ) const
inlineoverridevirtual

Get a shared pointer to a remapped operation.

Returns a shared pointer to a copy of the operation with qubits and classical bits changed according to the provided maps.

Parameters
qubitsMapThe map of qubits to remap.
bitsMapThe map of classical bits to remap.
Returns
A shared pointer to the remapped object.

Implements Circuits::IOperation< Types::time_type >.

Definition at line 580 of file Operations.h.


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