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

The interface for quantum gates. More...

#include <QuantumGates.h>

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

Public Member Functions

 IQuantumGate (Time delay=0)
 IQuantumGate constructor.
virtual QuantumGateType GetGateType () const =0
 Get the type of the quantum gate.
virtual std::vector< double > GetParams () const
 Get the gate parameters.
Public Member Functions inherited from Circuits::IGateOperation< Types::time_type >
 IGateOperation (Types::time_type 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::IQuantumGate< Time >

The interface for quantum gates.

The interface for quantum gates. Quantum gates are quantum operations that can be applied to a quantum state.

Template Parameters
TimeThe type of the execution delay.
See also
IGateOperation

Definition at line 71 of file QuantumGates.h.

Constructor & Destructor Documentation

◆ IQuantumGate()

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

IQuantumGate constructor.

Constructs the IQuantumGate object. If specified, the delay is the time the quantum gate takes to execute.

See also
IGateOperation

Definition at line 80 of file QuantumGates.h.

Member Function Documentation

◆ GetGateType()

◆ GetParams()

template<typename Time = Types::time_type>
virtual std::vector< double > Circuits::IQuantumGate< Time >::GetParams ( ) const
inlinevirtual

Get the gate parameters.

Returns the parameters of the gate.

Returns
A vector with the parameters of the gate, empty if there are no parameters.

Reimplemented in Circuits::ControlledRotationGate< Time >, Circuits::ControlledRotationGate< Types::time_type >, Circuits::CPGate< Time >, Circuits::CUGate< Time >, Circuits::PhaseGate< Time >, Circuits::RotationGate< Time >, Circuits::RotationGate< Types::time_type >, and Circuits::UGate< Time >.

Definition at line 98 of file QuantumGates.h.


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