Maestro 0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
QCSimGateSimulator.h
Go to the documentation of this file.
1#pragma once
2#if defined(INCLUDED_BY_FACTORY)
4#include "QuantumGate.h"
5
7{
8// Gate storage for backends that consume QCSim gate matrices. Backends with
9// native named-gate APIs derive directly from ImmediateQCSimSimulator instead.
10class QCSimGateSimulator : public ImmediateQCSimSimulator
11{
12 protected:
13 // These gates are never modified, and their matrix accessors return const
14 // references. Sharing them avoids allocation on construction and cloning.
15 inline static const QC::Gates::PauliXGate<> xgate;
16 inline static const QC::Gates::PauliYGate<> ygate;
17 inline static const QC::Gates::PauliZGate<> zgate;
18 inline static const QC::Gates::HadamardGate<> h;
19 inline static const QC::Gates::SGate<> sgate;
20 inline static const QC::Gates::SDGGate<> sdggate;
21 inline static const QC::Gates::TGate<> tgate;
22 inline static const QC::Gates::TDGGate<> tdggate;
23 inline static const QC::Gates::SquareRootNOTGate<> sxgate;
24 inline static const QC::Gates::SquareRootNOTDagGate<> sxdaggate;
25 inline static const QC::Gates::HyGate<> k;
26 inline static const QC::Gates::CNOTGate<> cxgate;
27 inline static const QC::Gates::ControlledYGate<> cygate;
28 inline static const QC::Gates::ControlledZGate<> czgate;
29 inline static const QC::Gates::ControlledHadamardGate<> ch;
30 inline static const QC::Gates::ControlledSquareRootNOTGate<> csx;
31 inline static const QC::Gates::ControlledSquareRootNOTDagGate<> csxdag;
32 inline static const QC::Gates::SwapGate<> swapgate;
33 inline static const QC::Gates::ToffoliGate<> ccxgate;
34 inline static const QC::Gates::FredkinGate<> cswapgate;
35
36 // Setters update these matrices before each application. Keep them local
37 // to each simulator so independent instances and clones cannot interfere.
38 QC::Gates::PhaseShiftGate<> pgate;
39 QC::Gates::RxGate<> rxgate;
40 QC::Gates::RyGate<> rygate;
41 QC::Gates::RzGate<> rzgate;
42 QC::Gates::UGate<> ugate;
43 QC::Gates::ControlledPhaseShiftGate<> cpgate;
44 QC::Gates::ControlledRxGate<> crxgate;
45 QC::Gates::ControlledRyGate<> crygate;
46 QC::Gates::ControlledRzGate<> crzgate;
47 QC::Gates::ControlledUGate<> cugate;
48};
49} // namespace Simulators::Private
50#endif