Maestro 0.2.5
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Simulator.h
Go to the documentation of this file.
1
14#pragma once
15
16#ifndef _SIMULATOR_INTERFACE_H_
17#define _SIMULATOR_INTERFACE_H_
18
19#include "State.h"
20
21namespace Simulators {
22
33class ISimulator : public IState, std::enable_shared_from_this<ISimulator> {
34 public:
42 virtual void ApplyP(Types::qubit_t qubit, double lambda) = 0;
43
50 virtual void ApplyX(Types::qubit_t qubit) = 0;
51
58 virtual void ApplyY(Types::qubit_t qubit) = 0;
59
66 virtual void ApplyZ(Types::qubit_t qubit) = 0;
67
74 virtual void ApplyH(Types::qubit_t qubit) = 0;
75
82 virtual void ApplyS(Types::qubit_t qubit) = 0;
83
90 virtual void ApplySDG(Types::qubit_t qubit) = 0;
91
98 virtual void ApplyT(Types::qubit_t qubit) = 0;
99
106 virtual void ApplyTDG(Types::qubit_t qubit) = 0;
107
114 virtual void ApplySx(Types::qubit_t qubit) = 0;
115
122 virtual void ApplySxDAG(Types::qubit_t qubit) = 0;
123
130 virtual void ApplyK(Types::qubit_t qubit) = 0;
131
139 virtual void ApplyRx(Types::qubit_t qubit, double theta) = 0;
140
148 virtual void ApplyRy(Types::qubit_t qubit, double theta) = 0;
149
157 virtual void ApplyRz(Types::qubit_t qubit, double theta) = 0;
158
169 virtual void ApplyU(Types::qubit_t qubit, double theta, double phi,
170 double lambda, double gamma) = 0;
171
179 virtual void ApplyCX(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
180
188 virtual void ApplyCY(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
189
197 virtual void ApplyCZ(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
198
207 virtual void ApplyCP(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
208 double lambda) = 0;
209
218 virtual void ApplyCRx(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
219 double theta) = 0;
220
229 virtual void ApplyCRy(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
230 double theta) = 0;
231
240 virtual void ApplyCRz(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
241 double theta) = 0;
242
250 virtual void ApplyCH(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit) = 0;
251
259 virtual void ApplyCSx(Types::qubit_t ctrl_qubit,
260 Types::qubit_t tgt_qubit) = 0;
261
269 virtual void ApplyCSxDAG(Types::qubit_t ctrl_qubit,
270 Types::qubit_t tgt_qubit) = 0;
271
279 virtual void ApplySwap(Types::qubit_t qubit0, Types::qubit_t qubit1) = 0;
280
289 virtual void ApplyCCX(Types::qubit_t qubit0, Types::qubit_t qubit1,
290 Types::qubit_t qubit2) = 0;
291
300 virtual void ApplyCSwap(Types::qubit_t ctrl_qubit, Types::qubit_t qubit0,
301 Types::qubit_t qubit1) = 0;
302
314 virtual void ApplyCU(Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit,
315 double theta, double phi, double lambda,
316 double gamma) = 0;
317
325 virtual void ApplyNop() = 0;
326
337 virtual std::unique_ptr<ISimulator> Clone() = 0;
338
346 std::shared_ptr<ISimulator> getptr() { return shared_from_this(); }
347};
348} // namespace Simulators
349
350#endif // !_SIMULATOR_INTERFACE_H_
Interface class for a quantum computing simulator.
Definition Simulator.h:33
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:346
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:103
uint_fast64_t qubit_t
The type of a qubit.
Definition Types.h:21