|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
The gate operation interface. More...
#include <Operations.h>
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. | |
The gate operation interface.
The gate operation interface, this is the base class for all gate operations.
| Time | The type of the delay time parameter. |
Definition at line 607 of file Operations.h.
|
inline |
Construct a new IGateOperation object.
Construct a new IGateOperation object with the specified execution time.
| delay | The execution time of the operation. |
Definition at line 615 of file Operations.h.
|
pure virtual |
Get the number of qubits.
Get 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 >.
|
pure virtual |
Get the qubit involved.
Get the qubit involved.
| index | The index of the qubit to get (0, 1, or 2, the maximum depending on the number of qubits of the gate). |
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 >.
|
inlineoverridevirtual |
Get the type of the operation.
Get the type of the operation, in this case, gate.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 624 of file Operations.h.
|
pure virtual |
Set the qubits involved.
Set the qubits involved.
| qubit | The qubit to set. |
| index | The 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 >.