|
Maestro 0.3.11
Unified interface for quantum circuit simulation
|
The U gate. More...
#include <QuantumGates.h>
Public Member Functions | |
| UGate (Types::qubit_t qubit=0, double theta=0, double phi=0, double lambda=0, double gamma=0, Time delay=0) | |
| UGate constructor. | |
| virtual std::vector< size_t > | AffectedBits () const |
| Returns the affected bits. | |
| virtual std::vector< size_t > | AffectedBits () const |
| Returns the affected bits. | |
| virtual std::vector< size_t > | AffectedBits () const |
| Returns the affected bits. | |
| virtual std::vector< size_t > | AffectedBits () const |
| Returns the affected bits. | |
| Types::qubits_vector | AffectedQubits () const override |
| Get the qubits the quantum gate is applied to. | |
| virtual bool | CanAffectQuantumState () const |
| Find if the operation can affect the quantum state. | |
| virtual bool | CanAffectQuantumState () const |
| Find if the operation can affect the quantum state. | |
| virtual bool | CanAffectQuantumState () const |
| Find if the operation can affect the quantum state. | |
| virtual bool | CanAffectQuantumState () const |
| Find if the operation can affect the quantum state. | |
| std::shared_ptr< IOperation< Types::time_type > > | 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 quantum gate. | |
| Types::time_type | GetDelay () const |
| Get the delay of the operation. | |
| Types::time_type | GetDelay () const |
| Get the delay of the operation. | |
| Types::time_type | GetDelay () const |
| Get the delay of the operation. | |
| Types::time_type | GetDelay () const |
| Get the delay of the operation. | |
| double | GetGamma () const |
| Get the gamma parameter for the gate. | |
| QuantumGateType | GetGateType () const override |
| Get the type of the quantum gate. | |
| double | GetLambda () const |
| Get the lambda parameter for the gate. | |
| Eigen::MatrixXcd | GetMatrix () const override |
| Get the matrix representation of the quantum gate. | |
| unsigned int | GetNumQubits () const override |
| Get the number of qubits the quantum gate is applied to. | |
| std::vector< double > | GetParams () const override |
| Get the gate parameters. | |
| double | GetPhi () const |
| Get the phi parameter for the gate. | |
| std::shared_ptr< IOperation< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| std::shared_ptr< IOperation< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| std::shared_ptr< IOperation< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| std::shared_ptr< IOperation< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| Types::qubit_t | GetQubit (unsigned int index=0) const override |
| Get the qubit the quantum gate is applied to. | |
| double | GetTheta () const |
| Get the theta parameter for the gate. | |
| OperationType | GetType () const override |
| Get the type of the operation. | |
| OperationType | GetType () const override |
| Get the type of the operation. | |
| 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 | IsConditional () const |
| Find if the operation is a conditional operation. | |
| virtual bool | IsConditional () const |
| Find if the operation is a conditional operation. | |
| virtual bool | IsConditional () const |
| Find if the operation is a conditional operation. | |
| bool | IsNoiseless () const |
| Whether noise models skip this operation. | |
| bool | IsNoiseless () const |
| Whether noise models skip this operation. | |
| bool | IsNoiseless () const |
| Whether noise models skip this operation. | |
| bool | IsNoiseless () const |
| Whether noise models skip this operation. | |
| virtual bool | NeedsEntanglementForDistribution () const |
| Find if the operation needs entanglement for distribution. | |
| virtual bool | NeedsEntanglementForDistribution () const |
| Find if the operation needs entanglement for distribution. | |
| virtual bool | NeedsEntanglementForDistribution () const |
| Find if the operation needs entanglement for distribution. | |
| 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. | |
| virtual void | SetDelay (Types::time_type d) |
| Set the delay of the operation. | |
| virtual void | SetDelay (Types::time_type d) |
| Set the delay of the operation. | |
| virtual void | SetDelay (Types::time_type d) |
| Set the delay of the operation. | |
| virtual void | SetDelay (Types::time_type d) |
| Set the delay of the operation. | |
| void | SetGamma (double g) |
| Set the gamma parameter for the gate. | |
| void | SetLambda (double l) |
| Set the lambda parameter for the gate. | |
| void | SetNoiseless (bool value=true) |
| Mark the operation as exempt from injected gate noise. | |
| void | SetNoiseless (bool value=true) |
| Mark the operation as exempt from injected gate noise. | |
| void | SetNoiseless (bool value=true) |
| Mark the operation as exempt from injected gate noise. | |
| void | SetNoiseless (bool value=true) |
| Mark the operation as exempt from injected gate noise. | |
| void | SetPhi (double p) |
| Set the phi parameter for the gate. | |
| void | SetQubit (Types::qubit_t q, unsigned long index=0) override |
| Set the qubit the quantum gate is applied to. | |
| void | SetTheta (double t) |
| Set the theta parameter for the gate. | |
The U gate.
The U gate.
| Time | The type of the execution delay. |
Definition at line 1838 of file QuantumGates.h.
|
inline |
UGate constructor.
Constructs the UGate object. If specified, the delay is the time the quantum gate takes to execute.
| qubit | The qubit the quantum gate is applied to. |
| theta | The theta angle for the rotation gate. |
| delay | The time the quantum gate takes to execute. |
Definition at line 1851 of file QuantumGates.h.
References UGate().
Referenced by UGate().
|
inlinevirtualinherited |
Returns the affected bits.
Returns the affected classical bits.
Reimplemented in Circuits::Circuit< Time >, Circuits::Circuit< Types::time_type >, Circuits::IConditionalOperation< Time >, Circuits::IConditionalOperation< Types::time_type >, Circuits::MeasurementOperation< Time >, and Circuits::Random< Time >.
Definition at line 523 of file Operations.h.
|
inlinevirtualinherited |
Returns the affected bits.
Returns the affected classical bits.
Definition at line 523 of file Operations.h.
|
inlinevirtualinherited |
Returns the affected bits.
Returns the affected classical bits.
Definition at line 523 of file Operations.h.
|
inlinevirtualinherited |
Returns the affected bits.
Returns the affected classical bits.
Definition at line 523 of file Operations.h.
|
inlineoverridevirtualinherited |
Get the qubits the quantum gate is applied to.
Returns the qubits the quantum gate is applied to, in this case a single qubit.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 232 of file QuantumGates.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.
|
inlinevirtualinherited |
Find if the operation can affect the quantum state.
Returns true if the operation can affect the quantum state, false otherwise.
Definition at line 473 of file Operations.h.
|
inlinevirtualinherited |
Find if the operation can affect the quantum state.
Returns true if the operation can affect the quantum state, false otherwise.
Definition at line 473 of file Operations.h.
|
inlinevirtualinherited |
Find if the operation can affect the quantum state.
Returns true if the operation can affect the quantum state, false otherwise.
Definition at line 473 of file Operations.h.
|
inlineoverridevirtualinherited |
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 144 of file QuantumGates.h.
|
inlineoverridevirtual |
Execute the quantum gate.
Executes the quantum gate on the given simulator with the given classical state.
| sim | The simulator to execute the quantum gate on. |
| state | The classical state to execute the quantum gate with. |
Implements Circuits::IOperation< Types::time_type >.
Definition at line 1866 of file QuantumGates.h.
References Circuits::SingleQubitGate< Time >::GetQubit().
|
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 delay of the operation.
Returns the delay due of the execution time of the operation.
Definition at line 546 of file Operations.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.
|
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.
|
inline |
Get the gamma parameter for the gate.
Returns the gamma parameter for the gate.
Definition at line 1966 of file QuantumGates.h.
|
inlineoverridevirtual |
Get the type of the quantum gate.
Returns the type of the quantum gate.
Implements Circuits::IQuantumGate< Types::time_type >.
Definition at line 1878 of file QuantumGates.h.
References Circuits::kUGateType.
|
inline |
Get the lambda parameter for the gate.
Returns the lambda parameter for the gate.
Definition at line 1944 of file QuantumGates.h.
|
inlineoverridevirtual |
Get the matrix representation of the quantum gate.
Returns the matrix representation of the quantum gate.
Implements Circuits::IQuantumGate< Types::time_type >.
Definition at line 2015 of file QuantumGates.h.
Referenced by Simulators::FusionGate::Matrix().
|
inlineoverridevirtualinherited |
Get the number of qubits the quantum gate is applied to.
Returns the number of qubits the quantum gate is applied to, in this case 1.
Implements Circuits::IGateOperation< Types::time_type >.
Definition at line 193 of file QuantumGates.h.
|
inlineoverridevirtual |
Get the gate parameters.
Returns the parameters of the gate.
Reimplemented from Circuits::IQuantumGate< Types::time_type >.
Definition at line 1977 of file QuantumGates.h.
|
inline |
Get the phi parameter for the gate.
Returns the phi parameter for the gate.
Definition at line 1922 of file QuantumGates.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.
|
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.
|
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.
|
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.
|
inlineoverridevirtualinherited |
Get the qubit the quantum gate is applied to.
Returns the qubit the quantum gate is applied to. Either specify zero for the index or leave it default. The parameter value is ignored anyway.
| index | The index of the qubit to get (ignored, default 0). |
Implements Circuits::IGateOperation< Types::time_type >.
Definition at line 220 of file QuantumGates.h.
|
inline |
Get the theta parameter for the gate.
Returns the theta parameter for the gate.
Definition at line 1900 of file QuantumGates.h.
|
inlineoverridevirtualinherited |
Get the type of the operation.
Get the type of the operation, in this case, gate.
Reimplemented from Circuits::IOperation< Types::time_type >.
Definition at line 720 of file Operations.h.
|
inlineoverrideinherited |
Get the type of the operation.
Get the type of the operation, in this case, gate.
Definition at line 720 of file Operations.h.
|
inlineoverrideinherited |
Get the type of the operation.
Get the type of the operation, in this case, gate.
Definition at line 720 of file Operations.h.
|
inlineoverridevirtual |
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 2004 of file QuantumGates.h.
|
inlineoverridevirtual |
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 1991 of file QuantumGates.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.
|
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.
|
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.
|
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.
|
inlineinherited |
Whether noise models skip this operation.
Definition at line 580 of file Operations.h.
|
inlineinherited |
Whether noise models skip this operation.
Definition at line 580 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.
|
inlinevirtualinherited |
Find if the operation needs entanglement for distribution.
Returns true if the operation needs entanglement for distribution, false otherwise.
Definition at line 488 of file Operations.h.
|
inlinevirtualinherited |
Find if the operation needs entanglement for distribution.
Returns true if the operation needs entanglement for distribution, false otherwise.
Definition at line 488 of file Operations.h.
|
inlinevirtualinherited |
Find if the operation needs entanglement for distribution.
Returns true if the operation needs entanglement for distribution, false otherwise.
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 247 of file QuantumGates.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.
|
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.
|
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.
|
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.
|
inline |
Set the gamma parameter for the gate.
Sets the gamma parameter for the gate.
| g | The gamma parameter for the gate. |
Definition at line 1955 of file QuantumGates.h.
|
inline |
Set the lambda parameter for the gate.
Sets the lambda parameter for the gate.
| l | The lambda parameter for the gate. |
Definition at line 1933 of file QuantumGates.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 |
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 |
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 |
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.
|
inline |
Set the phi parameter for the gate.
Sets the phi parameter for the gate.
| p | The phi parameter for the gate. |
Definition at line 1911 of file QuantumGates.h.
|
inlineoverridevirtualinherited |
Set the qubit the quantum gate is applied to.
Sets the qubit the quantum gate is applied to. Either specify zero for the index or leave it default.
| q | The qubit the quantum gate is applied to. |
| index | The index of the qubit to set (ignored, default 0). |
Implements Circuits::IGateOperation< Types::time_type >.
Definition at line 206 of file QuantumGates.h.
|
inline |
Set the theta parameter for the gate.
Sets the theta parameter for the gate.
| t | The theta parameter for the gate. |
Definition at line 1889 of file QuantumGates.h.