Maestro 0.3.11
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 >:
Collaboration diagram for Circuits::NoOperation< Time >:

Public Member Functions

 NoOperation (Time delay=0)
 Construct a new NoOperation object.
virtual std::vector< size_t > AffectedBits () const
 Returns the affected bits.
virtual Types::qubits_vector AffectedQubits () const
 Returns the affected qubits.
virtual bool CanAffectQuantumState () const
 Find if the operation can affect the quantum state.
std::shared_ptr< IOperation< Time > > Clone () const override
 Get a shared pointer to a clone of this object.
void Execute (const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
 Execute the operation.
Types::time_type GetDelay () const
 Get the delay of the operation.
std::shared_ptr< IOperation< Types::time_type > > getptr ()
 Get a shared pointer to this object.
virtual OperationType GetType () const
 Get the type of the operation.
virtual bool IsBranching () const
 Checks if the operation is a branching one.
bool IsClifford () const override
 Checks if the operation is a Clifford one.
virtual bool IsConditional () const
 Find if the operation is a conditional operation.
bool IsNoiseless () const
 Whether noise models skip this operation.
virtual bool NeedsEntanglementForDistribution () const
 Find if the operation needs entanglement for distribution.
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.
virtual void SetDelay (Types::time_type d)
 Set the delay of the operation.
void SetNoiseless (bool value=true)
 Mark the operation as exempt from injected gate noise.

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 625 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 634 of file Operations.h.

References Circuits::IOperation< Types::time_type >::IOperation().

Member Function Documentation

◆ AffectedBits()

virtual std::vector< size_t > Circuits::IOperation< Types::time_type >::AffectedBits ( ) const
inlinevirtualinherited

Returns the affected bits.

Returns the affected classical bits.

Returns
The affected bits.

Reimplemented in Circuits::Circuit< Time >, Circuits::Circuit< Types::time_type >, Circuits::IConditionalOperation< Time >, Circuits::IConditionalOperation< Types::time_type >, Circuits::MeasurementOperation< Time >, and Circuits::Random< Time >.

Definition at line 523 of file Operations.h.

◆ AffectedQubits()

◆ CanAffectQuantumState()

virtual bool Circuits::IOperation< Types::time_type >::CanAffectQuantumState ( ) const
inlinevirtualinherited

Find if the operation can affect the quantum state.

Returns true if the operation can affect the quantum state, false otherwise.

Returns
True if the operation can affect the quantum state, false otherwise.

Reimplemented in Circuits::Circuit< Time >, Circuits::Circuit< Types::time_type >, Circuits::Delay< Time >, and Circuits::QuantumChannelOperation< Time >.

Definition at line 473 of file Operations.h.

◆ 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 658 of file Operations.h.

References Circuits::IOperation< Types::time_type >::GetDelay().

Referenced by Remap().

◆ 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 648 of file Operations.h.

◆ GetDelay()

Types::time_type Circuits::IOperation< Types::time_type >::GetDelay ( ) const
inlineinherited

Get the delay of the operation.

Returns the delay due of the execution time of the operation.

Returns
The delay of the operation.

Definition at line 546 of file Operations.h.

Referenced by Circuits::NoOperation< Time >::Clone().

◆ getptr()

std::shared_ptr< IOperation< Types::time_type > > Circuits::IOperation< Types::time_type >::getptr ( )
inlineinherited

Get a shared pointer to this object.

Returns a shared pointer to this object. The object needs to be already wrapped in a shared pointer.

Returns
A shared pointer to this object.

Definition at line 535 of file Operations.h.

◆ GetType()

◆ IsBranching()

virtual bool Circuits::IOperation< Types::time_type >::IsBranching ( ) const
inlinevirtualinherited

◆ 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 688 of file Operations.h.

◆ IsConditional()

virtual bool Circuits::IOperation< Types::time_type >::IsConditional ( ) const
inlinevirtualinherited

Find if the operation is a conditional operation.

Returns true if the operation is conditional, false otherwise.

Returns
True if the operation is conditional, false otherwise.

Definition at line 500 of file Operations.h.

◆ IsNoiseless()

bool Circuits::IOperation< Types::time_type >::IsNoiseless ( ) const
inlineinherited

Whether noise models skip this operation.

Returns
True if no gate noise is injected after this operation.

Definition at line 580 of file Operations.h.

◆ NeedsEntanglementForDistribution()

virtual bool Circuits::IOperation< Types::time_type >::NeedsEntanglementForDistribution ( ) const
inlinevirtualinherited

Find if the operation needs entanglement for distribution.

Returns true if the operation needs entanglement for distribution, false otherwise.

Returns
True if the operation needs entanglement for distribution, false otherwise.

Reimplemented in Circuits::Circuit< Time >, Circuits::Circuit< Types::time_type >, and Circuits::QuantumChannelOperation< Time >.

Definition at line 488 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 673 of file Operations.h.

References Clone().

◆ SetDelay()

virtual void Circuits::IOperation< Types::time_type >::SetDelay ( Types::time_type d)
inlinevirtualinherited

Set the delay of the operation.

Sets the delay due of the execution time of the operation.

Parameters
dThe delay of the operation.

Definition at line 557 of file Operations.h.

◆ SetNoiseless()

void Circuits::IOperation< Types::time_type >::SetNoiseless ( bool value = true)
inlineinherited

Mark the operation as exempt from injected gate noise.

Noise models add no noise after a noiseless operation. This is for basis changes that belong to a non-Z measurement or reset rather than being gates in their own right. Gate copies (Clone, Remap) keep the mark.

Parameters
valueTrue to exempt the operation from gate noise.

Definition at line 570 of file Operations.h.


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