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

The operation interface. More...

#include <Operations.h>

Inheritance diagram for Circuits::IOperation< Time >:

Public Member Functions

 IOperation (Time delay=0)
 Construct a new IOperation object.
virtual ~IOperation ()=default
 Destroy the IOperation object.
virtual void Execute (const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const =0
 Execute the operation.
virtual OperationType GetType () const
 Get the type of the operation.
virtual std::shared_ptr< IOperation< Time > > Clone () const =0
 Get a shared pointer to a clone of this object.
virtual 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 =0
 Get a shared pointer to a remapped 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< Time > > getptr ()
 Get a shared pointer to this object.
Time GetDelay () const
 Get the delay of the operation.
void SetDelay (Time d)
 Set the delay of the operation.
virtual bool IsClifford () const
 Checks if the operation is a Clifford one.

Detailed Description

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

The operation interface.

The operation interface along with implementation of some generic functions that apply to all operations.

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

Definition at line 361 of file Operations.h.

Constructor & Destructor Documentation

◆ IOperation()

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

Construct a new IOperation object.

Construct a new IOperation object with the specified execution time.

Parameters
delayThe execution time of the operation.

Definition at line 369 of file Operations.h.

◆ ~IOperation()

template<typename Time = Types::time_type>
virtual Circuits::IOperation< Time >::~IOperation ( )
virtualdefault

Destroy the IOperation object.

Destroy the IOperation object. It's a virtual destructor because this class is an abstract class that needs to be derived from.

Member Function Documentation

◆ AffectedBits()

template<typename Time = Types::time_type>
virtual std::vector< size_t > Circuits::IOperation< Time >::AffectedBits ( ) const
inlinevirtual

◆ AffectedQubits()

◆ CanAffectQuantumState()

template<typename Time = Types::time_type>
virtual bool Circuits::IOperation< Time >::CanAffectQuantumState ( ) const
inlinevirtual

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< Time >, and Circuits::Circuit< Types::time_type >.

Definition at line 432 of file Operations.h.

◆ Clone()

◆ Execute()

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

◆ GetDelay()

template<typename Time = Types::time_type>
Time Circuits::IOperation< Time >::GetDelay ( ) const
inline

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

◆ getptr()

template<typename Time = Types::time_type>
std::shared_ptr< IOperation< Time > > Circuits::IOperation< Time >::getptr ( )
inline

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

◆ GetType()

◆ IsClifford()

◆ IsConditional()

template<typename Time = Types::time_type>
virtual bool Circuits::IOperation< Time >::IsConditional ( ) const
inlinevirtual

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

◆ NeedsEntanglementForDistribution()

template<typename Time = Types::time_type>
virtual bool Circuits::IOperation< Time >::NeedsEntanglementForDistribution ( ) const
inlinevirtual

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< Time >, and Circuits::Circuit< Types::time_type >.

Definition at line 449 of file Operations.h.

◆ Remap()

template<typename Time = Types::time_type>
virtual std::shared_ptr< IOperation< Time > > Circuits::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
pure virtual

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.

Implemented in Circuits::IConditionalOperation< Time >, Circuits::IConditionalOperation< Types::time_type >, Circuits::MeasurementOperation< Time >, Circuits::NoOperation< Time >, Circuits::Random< Time >, Circuits::Reset< Time >, Circuits::SingleQubitGate< Time >, Circuits::SingleQubitGate< Types::time_type >, Circuits::ThreeQubitsGate< Time >, Circuits::ThreeQubitsGate< Types::time_type >, Circuits::TwoQubitsGate< Time >, and Circuits::TwoQubitsGate< Types::time_type >.

◆ SetDelay()

template<typename Time = Types::time_type>
void Circuits::IOperation< Time >::SetDelay ( Time d)
inline

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


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