|
Maestro 0.2.5
Unified interface for quantum circuit simulation
|
Interface for a condition. More...
#include <Conditional.h>
Inheritance diagram for Circuits::ICondition:
Collaboration diagram for Circuits::ICondition:Public Member Functions | |
| ICondition (const std::vector< size_t > &ind) | |
| Construct a new ICondition object. | |
| virtual | ~ICondition ()=default |
| Virtual destructor. | |
| virtual std::shared_ptr< ICondition > | Clone () const =0 |
| Get a shared pointer to a clone of this object. | |
| const std::vector< size_t > & | GetBitsIndices () const |
| Get the indices of the bits used in the condition. | |
| std::shared_ptr< ICondition > | getptr () |
| Get a shared pointer to this object. | |
| virtual bool | IsConditionMet (OperationState &state) const =0 |
| Check if the condition is met. | |
| 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. | |
| void | SetBitsIndices (const std::vector< size_t > &ind) |
| Set the indices of the bits used in the condition. | |
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 36 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 44 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 71 of file Conditional.h.
Referenced by Circuits::EqualCondition::Clone(), and Circuits::EqualCondition::IsConditionMet().
|
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 109 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 79 of file Conditional.h.