|
Maestro 0.1.0
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. | |
| void | Execute (const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override |
| Execute the quantum gate. | |
| QuantumGateType | GetGateType () const override |
| Get the type of the quantum gate. | |
| std::shared_ptr< IOperation< Time > > | Clone () const override |
| Get a shared pointer to a clone of this object. | |
| void | SetTheta (double t) |
| Set the theta parameter for the gate. | |
| double | GetTheta () const |
| Get the theta parameter for the gate. | |
| void | SetPhi (double p) |
| Set the phi parameter for the gate. | |
| double | GetPhi () const |
| Get the phi parameter for the gate. | |
| void | SetLambda (double l) |
| Set the lambda parameter for the gate. | |
| double | GetLambda () const |
| Get the lambda parameter for the gate. | |
| void | SetGamma (double g) |
| Set the gamma parameter for the gate. | |
| double | GetGamma () const |
| Get the gamma parameter for the gate. | |
| std::vector< double > | GetParams () const override |
| Get the gate parameters. | |
| bool | IsClifford () const override |
| Checks if the operation is a Clifford one. | |
| Public Member Functions inherited from Circuits::SingleQubitGate< Types::time_type > | |
| SingleQubitGate (Types::qubit_t qubit=0, Types::time_type delay=0) | |
| SingleQubitGate constructor. | |
| virtual | ~SingleQubitGate () |
| The SingleQubitGate destructor. | |
| unsigned int | GetNumQubits () const override |
| Get the number of qubits the quantum gate is applied to. | |
| void | SetQubit (Types::qubit_t q, unsigned long index=0) override |
| Set the qubit the quantum gate is applied to. | |
| Types::qubit_t | GetQubit (unsigned int index=0) const override |
| Get the qubit the quantum gate is applied to. | |
| Types::qubits_vector | AffectedQubits () const override |
| Get the qubits the quantum gate is applied to. | |
| 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. | |
| Public Member Functions inherited from Circuits::IQuantumGate< Types::time_type > | |
| IQuantumGate (Types::time_type delay=0) | |
| IQuantumGate constructor. | |
| Public Member Functions inherited from Circuits::IGateOperation< Types::time_type > | |
| IGateOperation (Types::time_type delay=0) | |
| Construct a new IGateOperation object. | |
| OperationType | GetType () const override |
| Get the type of the operation. | |
| Public Member Functions inherited from Circuits::IOperation< Types::time_type > | |
| IOperation (Types::time_type delay=0) | |
| Construct a new IOperation object. | |
| virtual | ~IOperation ()=default |
| Destroy the IOperation object. | |
| virtual bool | CanAffectQuantumState () const |
| Find if the operation can affect the quantum state. | |
| virtual bool | NeedsEntanglementForDistribution () const |
| Find if the operation needs entanglement for distribution. | |
| virtual bool | IsConditional () const |
| Find if the operation is a conditional operation. | |
| virtual std::vector< size_t > | AffectedBits () const |
| Returns the affected bits. | |
| std::shared_ptr< IOperation< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| Types::time_type | GetDelay () const |
| Get the delay of the operation. | |
| void | SetDelay (Types::time_type d) |
| Set the delay of the operation. | |
The U gate.
The U gate.
| Time | The type of the execution delay. |
Definition at line 1601 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 1613 of file QuantumGates.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 1650 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 1628 of file QuantumGates.h.
|
inline |
Get the gamma parameter for the gate.
Returns the gamma parameter for the gate.
Definition at line 1718 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 1640 of file QuantumGates.h.
|
inline |
Get the lambda parameter for the gate.
Returns the lambda parameter for the gate.
Definition at line 1702 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 1726 of file QuantumGates.h.
|
inline |
Get the phi parameter for the gate.
Returns the phi parameter for the gate.
Definition at line 1686 of file QuantumGates.h.
|
inline |
Get the theta parameter for the gate.
Returns the theta parameter for the gate.
Definition at line 1670 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 1739 of file QuantumGates.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 1710 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 1694 of file QuantumGates.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 1678 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 1662 of file QuantumGates.h.