|
Maestro 0.2.5
Unified interface for quantum circuit simulation
|
Condition that checks if the bits are equal to a given value. More...
#include <Conditional.h>
Inheritance diagram for Circuits::EqualCondition:
Collaboration diagram for Circuits::EqualCondition:Public Member Functions | |
| EqualCondition (const std::vector< size_t > &ind, const std::vector< bool > &b) | |
| Construct a new EqualCondition object. | |
| std::shared_ptr< ICondition > | Clone () const override |
| Get a shared pointer to a clone of this object. | |
| const std::vector< bool > & | GetAllBits () const |
| Get the values to compare the bits to. | |
| 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. | |
| bool | IsConditionMet (OperationState &state) const override |
| Check if the condition is met. | |
| std::shared_ptr< ICondition > | Remap (const std::unordered_map< Types::qubit_t, Types::qubit_t > &bitsMap={}) const override |
| Get a shared pointer to a remapped condition. | |
| void | SetBits (const std::vector< bool > &b) |
| Set the values to compare the bits to. | |
| void | SetBitsIndices (const std::vector< size_t > &ind) |
| Set the indices of the bits used in the condition. | |
Condition that checks if the bits are equal to a given value.
Condition that checks if the bits are equal to a given value.
| Time | The type of the time parameter that is used for operations timing. |
Definition at line 127 of file Conditional.h.
|
inline |
Construct a new EqualCondition object.
Construct a new EqualCondition object with the given classical bits indices and classical bits values.
| ind | The indices of the bits that are used in the condition. |
| b | The values to compare the bits to. |
Definition at line 137 of file Conditional.h.
|
inlineoverridevirtual |
Get a shared pointer to a clone of this object.
Returns a shared pointer to a copy of this object.
Implements Circuits::ICondition.
Definition at line 173 of file Conditional.h.
References GetAllBits(), and Circuits::ICondition::GetBitsIndices().
|
inline |
Get the values to compare the bits to.
Get the values to compare the classical bits to.
Definition at line 157 of file Conditional.h.
Referenced by Clone(), and IsConditionMet().
|
inlineinherited |
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 Clone(), and IsConditionMet().
|
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 109 of file Conditional.h.
|
inlineoverridevirtual |
Check if the condition is met.
Check if the condition is met on the given classical state.
| state | The state to check the condition against. |
Implements Circuits::ICondition.
Definition at line 147 of file Conditional.h.
References GetAllBits(), Circuits::OperationState::GetBits(), and Circuits::ICondition::GetBitsIndices().
|
inlineoverridevirtual |
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. |
Implements Circuits::ICondition.
Definition at line 186 of file Conditional.h.
|
inline |
Set the values to compare the bits to.
Set the values to compare the classical bits to.
| b | The values to compare the bits to. |
Definition at line 165 of file Conditional.h.
|
inlineinherited |
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.