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

Delay (idle) operation class. More...

#include <Delay.h>

Inheritance diagram for Circuits::Delay< Time >:
Collaboration diagram for Circuits::Delay< Time >:

Public Member Functions

 Delay (Types::qubit_t qubit=0, Time duration=0)
 Construct a new Delay object.
virtual std::vector< size_t > AffectedBits () const
 Returns the affected bits.
Types::qubits_vector AffectedQubits () const override
 Return the affected qubits.
bool CanAffectQuantumState () const override
 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 delay operation on the simulator.
Types::time_type GetDelay () const
 Get the delay of the operation.
Time GetDuration () const
 Get the delay duration.
std::shared_ptr< IOperation< Types::time_type > > getptr ()
 Get a shared pointer to this object.
Types::qubit_t GetQubit () const
 Get the target qubit.
OperationType GetType () const override
 Get the operation type.
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.
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.
void SetDelay (Time d) override
 Set the delay of the operation.
virtual void SetDelay (Types::time_type d)
 Set the delay of the operation.
void SetDuration (Time d)
 Set the delay duration.
void SetQubit (Types::qubit_t q)
 Set the target qubit.

Detailed Description

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

Delay (idle) operation class.

Represents a physical delay or idling period on a target qubit with duration tau. In ideal noiseless simulation, it acts as an identity operation. In noisy simulation, it triggers wall-clock thermal relaxation, continuous Ornstein-Uhlenbeck dephasing, and coherent detuning rotation.

Template Parameters
TimeThe time type used for operation timing.
See also
IOperation

Definition at line 30 of file Delay.h.

Constructor & Destructor Documentation

◆ Delay()

template<typename Time = Types::time_type>
Circuits::Delay< Time >::Delay ( Types::qubit_t qubit = 0,
Time duration = 0 )
inline

Construct a new Delay object.

Parameters
qubitThe target qubit.
durationThe physical delay duration in seconds.

Definition at line 37 of file Delay.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 482 of file Operations.h.

◆ AffectedQubits()

template<typename Time = Types::time_type>
Types::qubits_vector Circuits::Delay< Time >::AffectedQubits ( ) const
inlineoverridevirtual

Return the affected qubits.

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

Definition at line 61 of file Delay.h.

◆ CanAffectQuantumState()

template<typename Time = Types::time_type>
bool Circuits::Delay< Time >::CanAffectQuantumState ( ) const
inlineoverridevirtual

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 from Circuits::IOperation< Types::time_type >.

Definition at line 91 of file Delay.h.

◆ Clone()

template<typename Time = Types::time_type>
std::shared_ptr< IOperation< Time > > Circuits::Delay< 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 94 of file Delay.h.

References GetDuration().

◆ Execute()

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

Execute the delay operation on the simulator.

In noiseless simulation, delay does not alter the quantum state.

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

Definition at line 47 of file Delay.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 501 of file Operations.h.

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

◆ GetDuration()

template<typename Time = Types::time_type>
Time Circuits::Delay< Time >::GetDuration ( ) const
inline

Get the delay duration.

Definition at line 76 of file Delay.h.

References Circuits::IOperation< Time >::GetDelay().

Referenced by 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 491 of file Operations.h.

◆ GetQubit()

template<typename Time = Types::time_type>
Types::qubit_t Circuits::Delay< Time >::GetQubit ( ) const
inline

Get the target qubit.

Definition at line 66 of file Delay.h.

◆ GetType()

template<typename Time = Types::time_type>
OperationType Circuits::Delay< Time >::GetType ( ) const
inlineoverridevirtual

Get the operation type.

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

Definition at line 56 of file Delay.h.

References Circuits::kDelay.

◆ IsBranching()

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

◆ IsClifford()

template<typename Time = Types::time_type>
bool Circuits::Delay< 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 92 of file Delay.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 462 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 449 of file Operations.h.

◆ Remap()

template<typename Time = Types::time_type>
std::shared_ptr< IOperation< Time > > Circuits::Delay< 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 98 of file Delay.h.

◆ SetDelay() [1/2]

template<typename Time = Types::time_type>
void Circuits::Delay< Time >::SetDelay ( Time d)
inlineoverride

Set the delay of the operation.

Definition at line 89 of file Delay.h.

References SetDuration().

◆ SetDelay() [2/2]

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

◆ SetDuration()

template<typename Time = Types::time_type>
void Circuits::Delay< Time >::SetDuration ( Time d)
inline

Set the delay duration.

Definition at line 81 of file Delay.h.

References Circuits::IOperation< Time >::SetDelay().

Referenced by SetDelay().

◆ SetQubit()

template<typename Time = Types::time_type>
void Circuits::Delay< Time >::SetQubit ( Types::qubit_t q)
inline

Set the target qubit.

Definition at line 71 of file Delay.h.


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