|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
Reset operation class. More...
#include <Reset.h>
Public Member Functions | |
| Reset (const Types::qubits_vector &qubits={}, Time delay=0, const std::vector< bool > &resetTargets={}) | |
| Construct a new Reset object. | |
| void | Execute (const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override |
| Execute the operation. | |
| OperationType | GetType () const override |
| Get the type of operation. | |
| void | SetQubits (const Types::qubits_vector &qs, const std::vector< bool > &resetTgts={}) |
| Set the qubits to reset and the values to reset them to. | |
| const Types::qubits_vector & | GetQubits () const |
| Get the qubits to reset. | |
| const std::vector< bool > & | GetResetTargets () const |
| Get the values to reset the qubits to. | |
| std::shared_ptr< IOperation< Time > > | Clone () const override |
| Get a shared pointer to a clone of this object. | |
| Types::qubits_vector | AffectedQubits () const override |
| Get the qubits affected by this operation. | |
| 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. | |
| bool | IsClifford () const override |
| Checks if the operation is a Clifford one. | |
| 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 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 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. | |
Protected Member Functions | |
| void | SetQubit (size_t index, Types::qubit_t qubit) |
| Set the qubit to reset. | |
Reset operation class.
This operation can be used to reset qubits.
| Time | The time type used for operation timing. |
|
inline |
|
inlineoverridevirtual |
Get the qubits affected by this operation.
This method returns the qubits affected by this operation, that is, the reset qubits.
Reimplemented from Circuits::IOperation< Types::time_type >.
|
inlineoverridevirtual |
Get a shared pointer to a clone of this object.
Returns a shared pointer to a copy of this object.
Implements Circuits::IOperation< Types::time_type >.
|
inlineoverridevirtual |
Execute the operation.
This method executes the reset operation. It's done by a measurement that is then discarded, followed by an X gate applied if needed.
| sim | The simulator to execute the operation on. |
| state | The current classical state. |
Implements Circuits::IOperation< Types::time_type >.
|
inline |
|
inline |
|
inlineoverridevirtual |
Get the type of operation.
This method returns the type of operation.
Reimplemented from Circuits::IOperation< Types::time_type >.
|
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.
Reimplemented from Circuits::IOperation< Types::time_type >.
|
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.
| qubitsMap | The map of qubits to remap. |
| bitsMap | The map of classical bits to remap. |
Implements Circuits::IOperation< Types::time_type >.
|
inlineprotected |
|
inline |