Maestro 0.1.0
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Simulator.h
Go to the documentation of this file.
1
12
13#pragma once
14
15#ifndef _SIMULATOR_INTERFACE_H_
16#define _SIMULATOR_INTERFACE_H_
17
18#include "State.h"
19
20namespace Simulators {
21
32class ISimulator : public IState, std::enable_shared_from_this<ISimulator> {
33public:
41 virtual void ApplyP(Types::qubit_t qubit, double lambda) = 0;
42
49 virtual void ApplyX(Types::qubit_t qubit) = 0;
50
57 virtual void ApplyY(Types::qubit_t qubit) = 0;
58
65 virtual void ApplyZ(Types::qubit_t qubit) = 0;
66
73 virtual void ApplyH(Types::qubit_t qubit) = 0;
74
81 virtual void ApplyS(Types::qubit_t qubit) = 0;
82
89 virtual void ApplySDG(Types::qubit_t qubit) = 0;
90
97 virtual void ApplyT(Types::qubit_t qubit) = 0;
98
105 virtual void ApplyTDG(Types::qubit_t qubit) = 0;
106
113 virtual void ApplySx(Types::qubit_t qubit) = 0;
114
121 virtual void ApplySxDAG(Types::qubit_t qubit) = 0;
122
129 virtual void ApplyK(Types::qubit_t qubit) = 0;
130
138 virtual void ApplyRx(Types::qubit_t qubit, double theta) = 0;
139
147 virtual void ApplyRy(Types::qubit_t qubit, double theta) = 0;
148
156 virtual void ApplyRz(Types::qubit_t qubit, double theta) = 0;
157
168 virtual void ApplyU(Types::qubit_t qubit, double theta, double phi,
169 double lambda, double gamma) = 0;
170
178 virtual void ApplyCX(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
179
187 virtual void ApplyCY(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
188
196 virtual void ApplyCZ(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
197
206 virtual void ApplyCP(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
207 double lambda) = 0;
208
217 virtual void ApplyCRx(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
218 double theta) = 0;
219
228 virtual void ApplyCRy(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
229 double theta) = 0;
230
239 virtual void ApplyCRz(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
240 double theta) = 0;
241
249 virtual void ApplyCH(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
250
258 virtual void ApplyCSx(Types::qubit_t ctrl_qubit,
259 Types::qubit_t tgt_qubit) = 0;
260
268 virtual void ApplyCSxDAG(Types::qubit_t ctrl_qubit,
269 Types::qubit_t tgt_qubit) = 0;
270
278 virtual void ApplySwap(Types::qubit_t qubit0, Types::qubit_t qubit1) = 0;
279
288 virtual void ApplyCCX(Types::qubit_t qubit0, Types::qubit_t qubit1,
289 Types::qubit_t qubit2) = 0;
290
299 virtual void ApplyCSwap(Types::qubit_t ctrl_qubit, Types::qubit_t qubit0,
300 Types::qubit_t qubit1) = 0;
301
313 virtual void ApplyCU(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
314 double theta, double phi, double lambda,
315 double gamma) = 0;
316
324 virtual void ApplyNop() = 0;
325
336 virtual std::unique_ptr<ISimulator> Clone() = 0;
337
345 std::shared_ptr<ISimulator> getptr() { return shared_from_this(); }
346};
347} // namespace Simulators
348
349#endif // !_SIMULATOR_INTERFACE_H_
Interface class for a quantum computing simulator.
Definition Simulator.h:32
virtual void ApplyCRz(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta)=0
Applies a CRz gate to the qubits.
virtual void ApplySDG(Types::qubit_t qubit)=0
Applies a S dagger gate to the qubit.
virtual void ApplyCCX(Types::qubit_t qubit0, Types::qubit_t qubit1, Types::qubit_t qubit2)=0
Applies a controlled controlled not gate to the qubits.
virtual void ApplyX(Types::qubit_t qubit)=0
Applies a not gate to the qubit.
virtual void ApplyCSxDAG(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0
Applies a CSx dagger gate to the qubits.
std::shared_ptr< ISimulator > getptr()
Get a shared pointer to this object.
Definition Simulator.h:345
virtual void ApplyU(Types::qubit_t qubit, double theta, double phi, double lambda, double gamma)=0
Applies a U gate to the qubit.
virtual void ApplyP(Types::qubit_t qubit, double lambda)=0
Applies a phase shift gate to the qubit.
virtual void ApplySx(Types::qubit_t qubit)=0
Applies a Sx gate to the qubit.
virtual void ApplyTDG(Types::qubit_t qubit)=0
Applies a T dagger gate to the qubit.
virtual void ApplyCU(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta, double phi, double lambda, double gamma)=0
Applies a controlled U gate to the qubits.
virtual void ApplyCRy(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta)=0
Applies a CRy gate to the qubits.
virtual void ApplyCX(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0
Applies a CX gate to the qubits.
virtual void ApplyRy(Types::qubit_t qubit, double theta)=0
Applies a Ry gate to the qubit.
virtual void ApplyCH(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0
Applies a CH gate to the qubits.
virtual void ApplySwap(Types::qubit_t qubit0, Types::qubit_t qubit1)=0
Applies a swap gate to the qubits.
virtual void ApplyCSx(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0
Applies a CSx gate to the qubits.
virtual void ApplyK(Types::qubit_t qubit)=0
Applies a K gate to the qubit.
virtual void ApplyY(Types::qubit_t qubit)=0
Applies a Y gate to the qubit.
virtual void ApplyT(Types::qubit_t qubit)=0
Applies a T gate to the qubit.
virtual void ApplyS(Types::qubit_t qubit)=0
Applies a S gate to the qubit.
virtual void ApplyNop()=0
Applies a nop.
virtual void ApplyCSwap(Types::qubit_t ctrl_qubit, Types::qubit_t qubit0, Types::qubit_t qubit1)=0
Applies a controlled swap gate to the qubits.
virtual void ApplyZ(Types::qubit_t qubit)=0
Applies a Z gate to the qubit.
virtual void ApplyRz(Types::qubit_t qubit, double theta)=0
Applies a Rz gate to the qubit.
virtual void ApplyCRx(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta)=0
Applies a CRx gate to the qubits.
virtual void ApplyCY(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0
Applies a CY gate to the qubits.
virtual void ApplyCZ(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0
Applies a CZ gate to the qubits.
virtual std::unique_ptr< ISimulator > Clone()=0
Clones the simulator.
virtual void ApplyH(Types::qubit_t qubit)=0
Applies a Hadamard gate to the qubit.
virtual void ApplyRx(Types::qubit_t qubit, double theta)=0
Applies a Rx gate to the qubit.
virtual void ApplySxDAG(Types::qubit_t qubit)=0
Applies a Sx dagger gate to the qubit.
virtual void ApplyCP(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double lambda)=0
Applies a CP gate to the qubits.
Interface class for a quantum computing simulator state.
Definition State.h:99
uint_fast64_t qubit_t
The type of a qubit.
Definition Types.h:20