|
Maestro 0.2.11
Unified interface for quantum circuit simulation
|
A conditional measurement. More...
#include <Conditional.h>
Public Member Functions | |
| ConditionalMeasurement (const std::shared_ptr< MeasurementOperation< Time > > &operation, const std::shared_ptr< ICondition > &condition, Time delay=0) | |
| Construct a new ConditionalMeasurement object. | |
| std::vector< size_t > | AffectedBits () const override |
| Get bits that are involved in the condition. | |
| Types::qubits_vector | AffectedQubits () const override |
| Get the qubits affected by the 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. | |
| std::shared_ptr< ICondition > | GetCondition () const |
| Get the condition for the conditional operation. | |
| Types::time_type | GetDelay () const |
| Get the delay of the operation. | |
| std::shared_ptr< IOperation< Types::time_type > > | GetOperation () const |
| Get the operation for the conditional operation. | |
| std::shared_ptr< IOperation< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| OperationType | GetType () const override |
| Get the type of the operation. | |
| bool | IsBranching () const override |
| 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< Types::time_type > > | 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 | SetCondition (const std::shared_ptr< ICondition > &cond) |
| Set the condition for the conditional operation. | |
| void | SetDelay (Types::time_type d) |
| Set the delay of the operation. | |
| void | SetOperation (const std::shared_ptr< IOperation< Types::time_type > > &op) |
| Set the operation for the conditional operation. | |
A conditional measurement.
A measurement that is executed only if a condition is met.
| Time | The type of the time parameter that is used for operations timing. |
Definition at line 457 of file Conditional.h.
|
inline |
Construct a new ConditionalMeasurement object.
Construct a new ConditionalMeasurement object with the given measurement, condition and delay.
| operation | The measurement to execute if the condition is met. |
| condition | The condition to check. |
| delay | The time required for the operation to complete. |
Definition at line 471 of file Conditional.h.
References Circuits::IConditionalOperation< Types::time_type >::IConditionalOperation().
|
inlineoverridevirtualinherited |
Get bits that are involved in the condition.
Get the classical bits that are involved in the condition.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 315 of file Conditional.h.
|
inlineoverridevirtualinherited |
Get the qubits affected by the operation.
Get the qubits affected by the operation.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 327 of file Conditional.h.
|
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 493 of file Conditional.h.
References Clone(), Circuits::IConditionalOperation< Time >::GetCondition(), Circuits::IOperation< Time >::GetDelay(), and Circuits::IConditionalOperation< Time >::GetOperation().
Referenced by Clone().
|
inlineoverridevirtualinherited |
Execute the operation.
Execute the operation if the condition is met with the specified classical state, in the specified simulator.
| sim | The simulator to execute the operation on. |
| state | The classical state to execute the operation on (check condition against it and if it has a classical result, put the results there). |
Implements Circuits::IOperation< Types::time_type >.
Definition at line 248 of file Conditional.h.
|
inlineinherited |
Get the condition for the conditional operation.
Get the condition to check.
Definition at line 307 of file Conditional.h.
|
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 the operation for the conditional operation.
Get the operation to execute if the condition is met.
Definition at line 287 of file Conditional.h.
|
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.
|
inlineoverridevirtual |
Get the type of the operation.
Returns the type of the operation.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 483 of file Conditional.h.
References Circuits::kConditionalMeasurement.
|
inlineoverridevirtualinherited |
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 from Circuits::IOperation< Types::time_type >.
Definition at line 379 of file Conditional.h.
|
inlineoverridevirtualinherited |
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 >.
Definition at line 365 of file Conditional.h.
|
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.
|
inlineoverridevirtualinherited |
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 >.
Definition at line 343 of file Conditional.h.
|
inlineinherited |
Set the condition for the conditional operation.
Assigns the condition to check.
| cond | The assigned condition. |
Definition at line 296 of file Conditional.h.
|
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.
|
inlineinherited |
Set the operation for the conditional operation.
Assigns the operation to execute if the condition is met.
| op | The assigned operation. |
Definition at line 264 of file Conditional.h.