|
Maestro 0.3.11
Unified interface for quantum circuit simulation
|
A conditional random generator. More...
#include <Conditional.h>
Public Member Functions | |
| ConditionalRandomGen (const std::shared_ptr< Random< Time > > &operation, const std::shared_ptr< ICondition > &condition, Time delay=0) | |
| Construct a new ConditionalRandomGen object. | |
| std::vector< size_t > | AffectedBits () const override |
| Get bits that are involved in the condition. | |
| Types::qubits_vector | AffectedQubits () const override |
| Get the quantum bits 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. | |
| bool | IsNoiseless () const |
| Whether noise models skip this 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. | |
| virtual void | SetDelay (Types::time_type d) |
| Set the delay of the operation. | |
| void | SetNoiseless (bool value=true) |
| Mark the operation as exempt from injected gate noise. | |
| void | SetOperation (const std::shared_ptr< IOperation< Types::time_type > > &op) |
| Set the operation for the conditional operation. | |
A conditional random generator.
A random generator 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 542 of file Conditional.h.
|
inline |
Construct a new ConditionalRandomGen object.
Construct a new ConditionalRandomGen object with the given random generator, condition and delay.
| operation | The random generator to execute if the condition is met. |
| condition | The condition to check. |
| delay | The time required for the operation to complete. |
Definition at line 557 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 341 of file Conditional.h.
|
inlineoverridevirtual |
Get the quantum bits affected by the operation.
Get the quantum bits affected by the operation. Returns an empty vector as the operation is not affecting any qubit. Implementation is required by the interface.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 595 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 >, Circuits::Circuit< Types::time_type >, Circuits::Delay< Time >, and Circuits::QuantumChannelOperation< Time >.
Definition at line 473 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 580 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 267 of file Conditional.h.
|
inlineinherited |
Get the condition for the conditional operation.
Get the condition to check.
Definition at line 330 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 546 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 306 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 535 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 569 of file Conditional.h.
References Circuits::kConditionalRandomGen.
|
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 409 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 393 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 500 of file Operations.h.
|
inlineinherited |
Whether noise models skip this operation.
Definition at line 580 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 >, Circuits::Circuit< Types::time_type >, and Circuits::QuantumChannelOperation< Time >.
Definition at line 488 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 373 of file Conditional.h.
|
inlineinherited |
Set the condition for the conditional operation.
Assigns the condition to check.
| cond | The assigned condition. |
Definition at line 318 of file Conditional.h.
|
inlinevirtualinherited |
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 557 of file Operations.h.
|
inlineinherited |
Mark the operation as exempt from injected gate noise.
Noise models add no noise after a noiseless operation. This is for basis changes that belong to a non-Z measurement or reset rather than being gates in their own right. Gate copies (Clone, Remap) keep the mark.
| value | True to exempt the operation from gate noise. |
Definition at line 570 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 284 of file Conditional.h.