17#ifndef _QUANTUM_GATES_H_
18#define _QUANTUM_GATES_H_
21#include "QuantumGate.h"
133template <
template <
typename>
class Gate,
template <
typename>
class Base,
typename Time>
class CloneableGate :
public Base<Time>
136 using Base<Time>::Base;
144 std::shared_ptr<IOperation<Time>>
Clone()
const override
146 return std::make_shared<Gate<Time>>(
static_cast<const Gate<Time> &
>(*this));
247 std::shared_ptr<IOperation<Time>>
Remap(
const std::unordered_map<Types::qubit_t, Types::qubit_t> &qubitsMap,
248 const std::unordered_map<Types::qubit_t, Types::qubit_t> &bitsMap = {})
const override
250 auto newGate = this->
Clone();
252 const auto qubitit = qubitsMap.find(qubit);
253 if (qubitit != qubitsMap.end())
254 std::static_pointer_cast<SingleQubitGate<Time>>(newGate)->
SetQubit(qubitit->second);
357 return {qubit1, qubit2};
370 std::shared_ptr<IOperation<Time>>
Remap(
const std::unordered_map<Types::qubit_t, Types::qubit_t> &qubitsMap,
371 const std::unordered_map<Types::qubit_t, Types::qubit_t> &bitsMap = {})
const override
373 auto newGate = this->
Clone();
375 const auto qubitit1 = qubitsMap.find(qubit1);
376 if (qubitit1 != qubitsMap.end())
377 std::static_pointer_cast<TwoQubitsGate<Time>>(newGate)->
SetQubit(qubitit1->second, 0);
379 const auto qubitit2 = qubitsMap.find(qubit2);
380 if (qubitit2 != qubitsMap.end())
381 std::static_pointer_cast<TwoQubitsGate<Time>>(newGate)->
SetQubit(qubitit2->second, 1);
416 :
IQuantumGate<Time>(delay), qubit1(qubit1), qubit2(qubit2), qubit3(qubit3)
490 return {qubit1, qubit2, qubit3};
503 std::shared_ptr<IOperation<Time>>
Remap(
const std::unordered_map<Types::qubit_t, Types::qubit_t> &qubitsMap,
504 const std::unordered_map<Types::qubit_t, Types::qubit_t> &bitsMap = {})
const override
506 auto newGate = this->
Clone();
508 const auto qubitit1 = qubitsMap.find(qubit1);
509 if (qubitit1 != qubitsMap.end())
510 std::static_pointer_cast<ThreeQubitsGate<Time>>(newGate)->
SetQubit(qubitit1->second, 0);
512 const auto qubitit2 = qubitsMap.find(qubit2);
513 if (qubitit2 != qubitsMap.end())
514 std::static_pointer_cast<ThreeQubitsGate<Time>>(newGate)->
SetQubit(qubitit2->second, 1);
516 const auto qubitit3 = qubitsMap.find(qubit3);
517 if (qubitit3 != qubitsMap.end())
518 std::static_pointer_cast<ThreeQubitsGate<Time>>(newGate)->
SetQubit(qubitit3->second, 2);
630 if (std::abs(lambda - M_PI_2) > 1e-10)
644 const QC::Gates::PhaseShiftGate<> pgate(lambda);
646 return pgate.getRawOperatorMatrix();
661template <
typename Time = Types::time_type>
class XGate :
public CloneableGate<XGate, SingleQubitGate, Time>
726 static const QC::Gates::PauliXGate<> xgate;
728 return xgate.getRawOperatorMatrix();
740template <
typename Time = Types::time_type>
class YGate :
public CloneableGate<YGate, SingleQubitGate, Time>
805 static const QC::Gates::PauliYGate<> ygate;
807 return ygate.getRawOperatorMatrix();
819template <
typename Time = Types::time_type>
class ZGate :
public CloneableGate<ZGate, SingleQubitGate, Time>
884 static const QC::Gates::PauliZGate<> zgate;
886 return zgate.getRawOperatorMatrix();
976 static const QC::Gates::HadamardGate<> hgate;
978 return hgate.getRawOperatorMatrix();
990template <
typename Time = Types::time_type>
class SGate :
public CloneableGate<SGate, SingleQubitGate, Time>
1055 static const QC::Gates::SGate<> sgate;
1057 return sgate.getRawOperatorMatrix();
1134 static const QC::Gates::SDGGate<> sdggate;
1136 return sdggate.getRawOperatorMatrix();
1148template <
typename Time = Types::time_type>
class TGate :
public CloneableGate<TGate, SingleQubitGate, Time>
1199 static const QC::Gates::TGate<> tgate;
1201 return tgate.getRawOperatorMatrix();
1264 static const QC::Gates::TDGGate<> tdggate;
1266 return tdggate.getRawOperatorMatrix();
1356 static const QC::Gates::SquareRootNOTGate<> sxgate;
1357 return sxgate.getRawOperatorMatrix();
1447 static const QC::Gates::SquareRootNOTDagGate<> sxdggate;
1448 return sxdggate.getRawOperatorMatrix();
1460template <
typename Time = Types::time_type>
class KGate :
public CloneableGate<KGate, SingleQubitGate, Time>
1538 static const QC::Gates::HyGate<> hygate;
1539 return hygate.getRawOperatorMatrix();
1681 return rxgate.getRawOperatorMatrix();
1760 return rygate.getRawOperatorMatrix();
1826 return rzgate.getRawOperatorMatrix();
1838template <
typename Time = Types::time_type>
class UGate :
public CloneableGate<UGate, SingleQubitGate, Time>
1851 UGate(
Types::qubit_t qubit = 0,
double theta = 0,
double phi = 0,
double lambda = 0,
double gamma = 0, Time delay = 0)
1979 return {theta, phi, lambda, gamma};
2017 const QC::Gates::UGate<> ugate(theta, phi, lambda, gamma);
2018 return ugate.getRawOperatorMatrix();
2110 static const QC::Gates::SwapGate<> swapgate;
2111 return swapgate.getRawOperatorMatrix();
2191 static const QC::Gates::CNOTGate<> cnotgate;
2192 return cnotgate.getRawOperatorMatrix();
2270 static const QC::Gates::ControlledYGate<> cygate;
2271 return cygate.getRawOperatorMatrix();
2349 static const QC::Gates::ControlledZGate<> czgate;
2350 return czgate.getRawOperatorMatrix();
2449 const QC::Gates::ControlledPhaseShiftGate<> cpgate(lambda);
2450 return cpgate.getRawOperatorMatrix();
2530template <
typename Time = Types::time_type>
class CRxGate :
public CloneableGate<CRxGate, ControlledRotationGate, Time>
2598 return crxgate.getRawOperatorMatrix();
2610template <
typename Time = Types::time_type>
class CRyGate :
public CloneableGate<CRyGate, ControlledRotationGate, Time>
2678 return crygate.getRawOperatorMatrix();
2690template <
typename Time = Types::time_type>
class CRzGate :
public CloneableGate<CRzGate, ControlledRotationGate, Time>
2745 return crzgate.getRawOperatorMatrix();
2822 static const QC::Gates::ControlledHadamardGate<> chgate;
2823 return chgate.getRawOperatorMatrix();
2900 static const QC::Gates::ControlledSquareRootNOTGate<> csxgate;
2901 return csxgate.getRawOperatorMatrix();
2979 static const QC::Gates::ControlledSquareRootNOTDagGate<> csxdaggate;
2980 return csxdaggate.getRawOperatorMatrix();
3137 return {theta, phi, lambda, gamma};
3161 const QC::Gates::ControlledUGate<> cugate(theta, phi, lambda, gamma);
3162 return cugate.getRawOperatorMatrix();
3240 static const QC::Gates::ToffoliGate<> ccxaggate;
3241 return ccxaggate.getRawOperatorMatrix();
3307 static const QC::Gates::FredkinGate<> cswapgate;
3308 return cswapgate.getRawOperatorMatrix();
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
CCXGate(Types::qubit_t ctrl1=0, Types::qubit_t ctrl2=1, Types::qubit_t target=2, Time delay=0)
CCXGate 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.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
CHGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, Time delay=0)
CHGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
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.
void SetLambda(double l)
Set the lambda parameter for the controlled phase gate.
double GetLambda() const
Get the lambda parameter for the controlled phase gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
CPGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, double lambda=0, Time delay=0)
CPGate constructor.
std::vector< double > GetParams() const override
Get the gate parameters.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
CRxGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, double theta=0, Time delay=0)
CRxGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
CRyGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, double theta=0, Time delay=0)
CRyGate constructor.
bool IsBranching() const override
Checks if the operation is a branching one.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
CRzGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, double theta=0, Time delay=0)
CRzGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
CSwapGate(Types::qubit_t ctrl=0, Types::qubit_t target1=1, Types::qubit_t target2=2, Time delay=0)
CSwapGate constructor.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
CSxDagGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, Time delay=0)
CSxDagGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
CSxGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, Time delay=0)
CSxGate constructor.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
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.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
void SetLambda(double l)
Set the lambda parameter for the controlled U gate.
double GetLambda() const
Get the lambda parameter for the controlled U gate.
CUGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, double theta=0, double phi=0, double lambda=0, double gamma=0, Time delay=0)
CUGate constructor.
double GetPhi() const
Get the phi parameter for the controlled U gate.
void SetPhi(double p)
Set the phi parameter for the controlled U gate.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
double GetTheta() const
Get the theta parameter for the controlled U gate.
void SetTheta(double t)
Set the theta parameter for the controlled U gate.
std::vector< double > GetParams() const override
Get the gate parameters.
double GetGamma() const
Get the gamma parameter for the controlled U gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
void SetGamma(double g)
Set the gamma parameter for the controlled U gate.
CXGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, Time delay=0)
CXGate 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.
bool IsClifford() const override
Checks if the operation is a Clifford one.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
CYGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, Time delay=0)
CYGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
CZGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, Time delay=0)
CZGate constructor.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Implements Clone() once for a concrete gate.
std::shared_ptr< IOperation< Time > > Clone() const override
Get a shared pointer to a clone of this object.
ControlledRotationGate(Types::qubit_t ctrl=0, Types::qubit_t target=1, double theta=0, Time delay=0)
ControlledRotationGate constructor.
double GetTheta() const
Get the theta angle for the controlled rotation gate.
void SetTheta(double t)
Set the theta angle for the controlled rotation gate.
std::vector< double > GetParams() const override
Get the gate parameters.
HadamardGate(Types::qubit_t qubit=0, Time delay=0)
HadamardGate 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.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
bool IsClifford() const override
Checks if the operation is a Clifford one.
IGateOperation(Types::time_type delay=0)
virtual std::shared_ptr< IOperation< Types::time_type > > Clone() const =0
IQuantumGate(Time delay=0)
IQuantumGate constructor.
virtual QuantumGateType GetGateType() const =0
Get the type of the quantum gate.
virtual Eigen::MatrixXcd GetMatrix() const =0
Get the matrix representation of the quantum gate.
virtual std::vector< double > GetParams() const
Get the gate parameters.
bool IsClifford() const override
Checks if the operation is a Clifford one.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
KGate(Types::qubit_t qubit=0, Time delay=0)
KGate constructor.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
The state class that stores the classical state of a quantum circuit execution.
double GetLambda() const
Get the lambda parameter for the phase gate.
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::vector< double > GetParams() const override
Get the gate parameters.
void SetLambda(double l)
Set the lambda parameter for the phase gate.
PhaseGate(Types::qubit_t qubit=0, double lambda=0, Time delay=0)
PhaseGate constructor.
bool IsClifford() const override
Checks if the operation is a Clifford one.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
RotationGate(Types::qubit_t qubit=0, double theta=0, Time delay=0)
RotationGate constructor.
double GetTheta() const
Get the theta angle for the rotation gate.
std::vector< double > GetParams() const override
Get the gate parameters.
void SetTheta(double t)
Set the theta angle for the rotation gate.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
RxGate(Types::qubit_t qubit=0, double theta=0, Time delay=0)
RxGate constructor.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsBranching() const override
Checks if the operation is a branching one.
RyGate(Types::qubit_t qubit=0, double theta=0, Time delay=0)
RyGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
RzGate(Types::qubit_t qubit=0, double theta=0, Time delay=0)
RzGate 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.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
SGate(Types::qubit_t qubit=0, Time delay=0)
SGate constructor.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
SdgGate(Types::qubit_t qubit=0, Time delay=0)
SdgGate constructor.
The interface for single qubit quantum gates.
void SetQubit(Types::qubit_t q, unsigned long index=0) override
Set the qubit the quantum gate is applied to.
SingleQubitGate(Types::qubit_t qubit=0, Time delay=0)
SingleQubitGate constructor.
virtual ~SingleQubitGate()
The SingleQubitGate destructor.
Types::qubits_vector AffectedQubits() const override
Get the qubits the quantum gate is applied to.
unsigned int GetNumQubits() const override
Get the number of qubits 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.
std::shared_ptr< IOperation< Time > > 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.
SwapGate(Types::qubit_t qubit1=0, Types::qubit_t qubit2=1, Time delay=0)
SwapGate constructor.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
bool IsBranching() const override
Checks if the operation is a branching one.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
SxDagGate(Types::qubit_t qubit=0, Time delay=0)
SxDagGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
bool IsBranching() const override
Checks if the operation is a branching one.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
SxGate(Types::qubit_t qubit=0, Time delay=0)
SxGate constructor.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
TGate(Types::qubit_t qubit=0, Time delay=0)
TGate 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.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
TdgGate(Types::qubit_t qubit=0, Time delay=0)
TdgGate constructor.
The interface for three qubits quantum gates.
Types::qubits_vector AffectedQubits() const override
Get the qubits 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.
unsigned int GetNumQubits() const override
Get the number of qubits the quantum gate is applied to.
std::shared_ptr< IOperation< Time > > 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.
ThreeQubitsGate(Types::qubit_t qubit1=0, Types::qubit_t qubit2=0, Types::qubit_t qubit3=0, Time delay=0)
ThreeQubitsGate constructor.
virtual ~ThreeQubitsGate()
The ThreeQubitsGate destructor.
void SetQubit(Types::qubit_t q, unsigned long index=0) override
Set the qubit the quantum gate is applied to.
The interface for two qubits quantum gates.
Types::qubit_t GetQubit(unsigned int index=0) const override
Get the qubit the quantum gate is applied to.
std::shared_ptr< IOperation< Time > > 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 ~TwoQubitsGate()
The TwoQubitsGate destructor.
void SetQubit(Types::qubit_t q, unsigned long index=0) override
Set the qubit the quantum gate is applied to.
TwoQubitsGate(Types::qubit_t qubit1=0, Types::qubit_t qubit2=0, Time delay=0)
TwoQubitsGate constructor.
unsigned int GetNumQubits() const override
Get the number of qubits the quantum gate is applied to.
Types::qubits_vector AffectedQubits() const override
Get the qubits the quantum gate is applied to.
double GetGamma() const
Get the gamma parameter for the gate.
void SetLambda(double l)
Set the lambda parameter for the gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
bool IsBranching() const override
Checks if the operation is a branching one.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
void SetPhi(double p)
Set the phi parameter for the gate.
double GetLambda() const
Get the lambda parameter for the gate.
void SetTheta(double t)
Set the theta parameter for the gate.
UGate(Types::qubit_t qubit=0, double theta=0, double phi=0, double lambda=0, double gamma=0, Time delay=0)
UGate constructor.
std::vector< double > GetParams() const override
Get the gate parameters.
double GetTheta() const
Get the theta parameter for the gate.
double GetPhi() const
Get the phi parameter for the gate.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
void SetGamma(double g)
Set the gamma parameter for the gate.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
XGate(Types::qubit_t qubit=0, Time delay=0)
XGate constructor.
QuantumGateType GetGateType() const override
Get the type of the quantum gate.
YGate(Types::qubit_t qubit=0, Time delay=0)
YGate constructor.
void Execute(const std::shared_ptr< Simulators::ISimulator > &sim, OperationState &state) const override
Execute the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
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.
Eigen::MatrixXcd GetMatrix() const override
Get the matrix representation of the quantum gate.
bool IsClifford() const override
Checks if the operation is a Clifford one.
ZGate(Types::qubit_t qubit=0, Time delay=0)
ZGate constructor.
QuantumGateType
The type of quantum gates.
std::vector< qubit_t > qubits_vector
The type of a vector of qubits.
uint_fast64_t qubit_t
The type of a qubit.