|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
Interface for a condition. More...
#include <Conditional.h>
Public Member Functions | |
| ICondition (const std::vector< size_t > &ind) | |
| Construct a new ICondition object. | |
| virtual | ~ICondition ()=default |
| Virtual destructor. | |
| virtual bool | IsConditionMet (OperationState &state) const =0 |
| Check if the condition is met. | |
| const std::vector< size_t > & | GetBitsIndices () const |
| Get the indices of the bits used in the condition. | |
| void | SetBitsIndices (const std::vector< size_t > &ind) |
| Set the indices of the bits used in the condition. | |
| virtual std::shared_ptr< ICondition > | Clone () const =0 |
| Get a shared pointer to a clone of this object. | |
| virtual std::shared_ptr< ICondition > | Remap (const std::unordered_map< Types::qubit_t, Types::qubit_t > &bitsMap={}) const =0 |
| Get a shared pointer to a remapped condition. | |
| std::shared_ptr< ICondition > | getptr () |
| Get a shared pointer to this object. | |
Interface for a condition.
Interface for a condition that can be used to control the execution of an operation. The condition is based on a classical state (typically the result of a measurement).
Definition at line 35 of file Conditional.h.
|
inline |
Construct a new ICondition object.
Construct a new ICondition object with the given indices.
| ind | The indices of the bits that are used in the condition. |
Definition at line 43 of file Conditional.h.
|
virtualdefault |
Virtual destructor.
Destroy the ICondition object. It's a virtual destructor because this class is an abstract class that needs to be derived from.
|
pure virtual |
Get a shared pointer to a clone of this object.
Returns a shared pointer to a copy of this object.
Implemented in Circuits::EqualCondition.
|
inline |
Get the indices of the bits used in the condition.
Get the indices of the classical bits used in the condition.
Definition at line 70 of file Conditional.h.
|
inline |
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 108 of file Conditional.h.
|
pure virtual |
Check if the condition is met.
Check if the condition is met on the given classical state. This function must be implemented by the derived classes.
| state | The state to check the condition against. |
Implemented in Circuits::EqualCondition.
|
pure virtual |
Get a shared pointer to a remapped condition.
Returns a shared pointer to a copy of the condition with classical bits changed according to the provided map.
| bitsMap | The map of classical bits to remap. |
Implemented in Circuits::EqualCondition.
|
inline |
Set the indices of the bits used in the condition.
Set the indices of the classical bits used in the condition.
| ind | The indices of the bits used in the condition. |
Definition at line 78 of file Conditional.h.