|
Maestro 0.2.11
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. | |
| virtual std::vector< size_t > | AffectedBits () const |
| Returns the affected bits. | |
| Types::qubits_vector | AffectedQubits () const override |
| Get the qubits affected by this operation. | |
| virtual bool | CanAffectQuantumState () const |
| Find if the operation can affect the quantum state. | |
| std::shared_ptr< IOperation< Time > > | Clone () const override |
| Get a shared pointer to a clone of this object. | |
| void | Execute (const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override |
| Execute the operation. | |
| Types::time_type | GetDelay () const |
| Get the delay of the operation. | |
| std::shared_ptr< IOperation< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| 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. | |
| OperationType | GetType () const override |
| Get the type of operation. | |
| virtual bool | IsBranching () const |
| Checks if the operation is a branching one. | |
| bool | IsClifford () const override |
| Checks if the operation is a Clifford one. | |
| virtual bool | IsConditional () const |
| Find if the operation is a conditional operation. | |
| virtual bool | NeedsEntanglementForDistribution () const |
| Find if the operation needs entanglement for distribution. | |
| 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. | |
| void | SetDelay (Types::time_type d) |
| Set the delay of the 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. | |
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 |
|
inlinevirtualinherited |
Returns the affected bits.
Returns the affected classical bits.
Reimplemented in Circuits::Circuit< Time >, Circuits::Circuit< Types::time_type >, Circuits::IConditionalOperation< Time >, Circuits::IConditionalOperation< Types::time_type >, Circuits::MeasurementOperation< Time >, and Circuits::Random< Time >.
Definition at line 478 of file Operations.h.
|
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 >.
|
inlinevirtualinherited |
Find if the operation can affect the quantum state.
Returns true if the operation can affect the quantum state, false otherwise.
Reimplemented in Circuits::Circuit< Time >, and Circuits::Circuit< Types::time_type >.
Definition at line 429 of file Operations.h.
|
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 >.
Definition at line 126 of file Reset.h.
References Circuits::IOperation< Time >::GetDelay(), GetQubits(), and GetResetTargets().
|
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 >.
|
inlineinherited |
Get the delay of the operation.
Returns the delay due of the execution time of the operation.
Definition at line 497 of file Operations.h.
Referenced by Circuits::NoOperation< Time >::Clone().
|
inlineinherited |
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.
Definition at line 487 of file Operations.h.
|
inline |
|
inline |
Get the values to reset the qubits to.
This method returns the values to reset the qubits to. false means |0>, true means |1>, not specified means |0>.
Definition at line 118 of file Reset.h.
Referenced by Clone(), and Circuits::ComparableCircuit< Time >::operator==().
|
inlineoverridevirtual |
Get the type of operation.
This method returns the type of operation.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 87 of file Reset.h.
References Circuits::kReset.
|
inlinevirtualinherited |
Checks if the operation is a branching one.
Checks if the operation is a branching one, meaning that it can lead to splitting paths (relevant for the path integral simulator).
Reimplemented in Circuits::CHGate< Time >, Circuits::Circuit< Time >, Circuits::Circuit< Types::time_type >, Circuits::CRxGate< Time >, Circuits::CRyGate< Time >, Circuits::CSxDagGate< Time >, Circuits::CSxGate< Time >, Circuits::CUGate< Time >, Circuits::HadamardGate< Time >, Circuits::IConditionalOperation< Time >, Circuits::IConditionalOperation< Types::time_type >, Circuits::KGate< Time >, Circuits::RxGate< Time >, Circuits::RyGate< Time >, Circuits::SxDagGate< Time >, Circuits::SxGate< Time >, and Circuits::UGate< Time >.
Definition at line 526 of file Operations.h.
|
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 >.
|
inlinevirtualinherited |
Find if the operation is a conditional operation.
Returns true if the operation is conditional, false otherwise.
Definition at line 458 of file Operations.h.
|
inlinevirtualinherited |
Find if the operation needs entanglement for distribution.
Returns true if the operation needs entanglement for distribution, false otherwise.
Reimplemented in Circuits::Circuit< Time >, and Circuits::Circuit< Types::time_type >.
Definition at line 446 of file Operations.h.
|
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 >.
|
inlineinherited |
Set the delay of the operation.
Sets the delay due of the execution time of the operation.
| d | The delay of the operation. |
Definition at line 505 of file Operations.h.
|
inlineprotected |
|
inline |