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

The gate operation interface. More...

#include <Operations.h>

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

Public Member Functions

 IGateOperation (Time delay=0)
 Construct a new IGateOperation object.
OperationType GetType () const override
 Get the type of the operation.
virtual unsigned int GetNumQubits () const =0
 Get the number of qubits.
virtual void SetQubit (Types::qubit_t qubit, unsigned long index=0)=0
 Set the qubits involved.
virtual Types::qubit_t GetQubit (unsigned int index=0) const =0
 Get the qubit involved.
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 void Execute (const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const=0
 Execute the operation.
virtual std::shared_ptr< IOperation< Types::time_type > > Clone () const=0
 Get a shared pointer to a clone of this object.
virtual std::shared_ptr< IOperation< Types::time_type > > 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< 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.
virtual bool IsClifford () const
 Checks if the operation is a Clifford one.

Detailed Description

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

The gate operation interface.

The gate operation interface, this is the base class for all gate operations.

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

Definition at line 607 of file Operations.h.

Constructor & Destructor Documentation

◆ IGateOperation()

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

Construct a new IGateOperation object.

Construct a new IGateOperation object with the specified execution time.

Parameters
delayThe execution time of the operation.

Definition at line 615 of file Operations.h.

Member Function Documentation

◆ GetNumQubits()

template<typename Time = Types::time_type>
virtual unsigned int Circuits::IGateOperation< Time >::GetNumQubits ( ) const
pure virtual

Get the number of qubits.

Get the number of qubits the gate operates on.

Returns
The number of qubits the gate operates on.

Implemented in 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 >.

◆ GetQubit()

template<typename Time = Types::time_type>
virtual Types::qubit_t Circuits::IGateOperation< Time >::GetQubit ( unsigned int index = 0) const
pure virtual

Get the qubit involved.

Get the qubit involved.

Parameters
indexThe index of the qubit to get (0, 1, or 2, the maximum depending on the number of qubits of the gate).
Returns
The qubit involved.

Implemented in 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 >.

◆ GetType()

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

Get the type of the operation.

Get the type of the operation, in this case, gate.

Returns
The type of the operation, gate in this case.
See also
OperationType

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

Definition at line 624 of file Operations.h.

◆ SetQubit()

template<typename Time = Types::time_type>
virtual void Circuits::IGateOperation< Time >::SetQubit ( Types::qubit_t qubit,
unsigned long index = 0 )
pure virtual

Set the qubits involved.

Set the qubits involved.

Parameters
qubitThe qubit to set.
indexThe index of the qubit to set (0 for 1 qubit gates, 0 and 1 for two qubit gates, 0, 1 and 3 for three qubit gates).

Implemented in 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 >.


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