gate_factory.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "type.hpp"
10 #include "gate.hpp"
11 #include "gate_general.hpp"
12 #include <vector>
13 #include <string>
14 
15 namespace gate{
48 
56  DllExport QuantumGateBase* Identity(UINT qubit_index);
57 
64  DllExport QuantumGateBase* X(UINT qubit_index);
65 
72  DllExport QuantumGateBase* Y(UINT qubit_index);
73 
80  DllExport QuantumGateBase* Z(UINT qubit_index);
81 
88  DllExport QuantumGateBase* H(UINT qubit_index);
89 
96  DllExport QuantumGateBase* S(UINT qubit_index);
97 
104  DllExport QuantumGateBase* Sdag(UINT qubit_index);
105 
112  DllExport QuantumGateBase* T(UINT qubit_index);
113 
120  DllExport QuantumGateBase* Tdag(UINT qubit_index);
121 
128  DllExport QuantumGateBase* sqrtX(UINT qubit_index);
129 
136  DllExport QuantumGateBase* sqrtXdag(UINT qubit_index);
137 
144  DllExport QuantumGateBase* sqrtY(UINT qubit_index);
145 
152  DllExport QuantumGateBase* sqrtYdag(UINT qubit_index);
153 
160  DllExport QuantumGateBase* P0(UINT qubit_index);
161 
168  DllExport QuantumGateBase* P1(UINT qubit_index);
169 
178  DllExport QuantumGateBase* U1(UINT qubit_index, double lambda);
179 
189  DllExport QuantumGateBase* U2(UINT qubit_index, double phi, double lambda);
190 
201  DllExport QuantumGateBase* U3(UINT qubit_index, double theta, double phi, double lambda);
202 
210  DllExport QuantumGateBase* RX(UINT qubit_index,double angle);
211 
219  DllExport QuantumGateBase* RY(UINT qubit_index, double angle);
220 
228  DllExport QuantumGateBase* RZ(UINT qubit_index, double angle);
229 
237  DllExport QuantumGateBase* CNOT(UINT control_qubit_index, UINT target_qubit_index);
238 
246  DllExport QuantumGateBase* CZ(UINT control_qubit_index, UINT target_qubit_index);
247 
255  DllExport QuantumGateBase* SWAP(UINT qubit_index1, UINT qubit_index2);
256 
265  DllExport QuantumGateBase* Pauli(std::vector<UINT> target_qubit_index_list, std::vector<UINT> pauli_id_list);
266 
276  DllExport QuantumGateBase* PauliRotation(std::vector<UINT> target_qubit_index_list, std::vector<UINT> pauli_id_list, double angle);
277 
285  DllExport QuantumGateMatrix* DenseMatrix(UINT target_qubit_index, ComplexMatrix matrix);
286 
295  DllExport QuantumGateMatrix* DenseMatrix(std::vector<UINT> target_qubit_index_list, ComplexMatrix matrix);
296 
297 
305  DllExport QuantumGateBase* BitFlipNoise(UINT target_index, double prob);
306 
314  DllExport QuantumGateBase* DephasingNoise(UINT target_index, double prob);
315 
323  DllExport QuantumGateBase* IndependentXZNoise(UINT target_index, double prob);
324 
333  DllExport QuantumGateBase* DepolarizingNoise(UINT target_index, double prob);
334 
342  DllExport QuantumGateBase* Measurement(UINT target_index, UINT classical_register_address);
343 
344 
345 }
346 
QuantumGateBase * U3(UINT qubit_index, double theta, double phi, double lambda)
Definition: gate_factory.cpp:101
Eigen::Matrix< CPPCTYPE, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > ComplexMatrix
Definition: type.hpp:17
QuantumGateBase * Z(UINT qubit_index)
Definition: gate_factory.cpp:29
#define DllExport
Definition: type.hpp:30
QuantumGateBase * BitFlipNoise(UINT target_index, double prob)
Definition: gate_factory.cpp:135
QuantumGateBase * Y(UINT qubit_index)
Definition: gate_factory.cpp:26
Definition and basic functions for QuantumGate.
Definition: gate_matrix.hpp:9
QuantumGateBase * Measurement(UINT target_index, UINT classical_register_address)
Definition: gate_factory.cpp:147
QuantumGateBase * RX(UINT qubit_index, double angle)
Definition: gate_factory.cpp:65
QuantumGateBase * CNOT(UINT control_qubit_index, UINT target_qubit_index)
Definition: gate_factory.cpp:108
Definition: gate_factory.cpp:17
QuantumGateBase * RZ(UINT qubit_index, double angle)
Definition: gate_factory.cpp:71
QuantumGateBase * create_quantum_gate_from_string(std::string gate_string)
Definition: gate_factory.cpp:151
QuantumGateBase * DephasingNoise(UINT target_index, double prob)
Definition: gate_factory.cpp:138
QuantumGateBase * SWAP(UINT qubit_index1, UINT qubit_index2)
Definition: gate_factory.cpp:114
QuantumGateBase * sqrtYdag(UINT qubit_index)
Definition: gate_factory.cpp:56
QuantumGateBase * sqrtY(UINT qubit_index)
Definition: gate_factory.cpp:53
QuantumGateBase * PauliRotation(std::vector< UINT > target, std::vector< UINT > pauli_id, double angle)
Definition: gate_factory.cpp:122
QuantumGateBase * P1(UINT qubit_index)
Definition: gate_factory.cpp:62
QuantumGateBase * H(UINT qubit_index)
Definition: gate_factory.cpp:32
QuantumGateBase * RY(UINT qubit_index, double angle)
Definition: gate_factory.cpp:68
QuantumGateBase * S(UINT qubit_index)
Definition: gate_factory.cpp:35
QuantumGateBase * U1(UINT qubit_index, double lambda)
Definition: gate_factory.cpp:89
QuantumGateMatrix * DenseMatrix(UINT target_index, ComplexMatrix matrix)
Definition: gate_factory.cpp:127
QuantumGateBase * IndependentXZNoise(UINT target_index, double prob)
Definition: gate_factory.cpp:141
QuantumGateBase * DepolarizingNoise(UINT target_index, double prob)
Definition: gate_factory.cpp:144
QuantumGateBase * X(UINT qubit_index)
Definition: gate_factory.cpp:23
QuantumGateBase * Identity(UINT qubit_index)
Definition: gate_factory.cpp:20
QuantumGateBase * P0(UINT qubit_index)
Definition: gate_factory.cpp:59
QuantumGateBase * Sdag(UINT qubit_index)
Definition: gate_factory.cpp:38
QuantumGateBase * T(UINT qubit_index)
Definition: gate_factory.cpp:41
QuantumGateBase * Pauli(std::vector< UINT > target, std::vector< UINT > pauli_id)
Definition: gate_factory.cpp:118
QuantumGateBase * U2(UINT qubit_index, double phi, double lambda)
Definition: gate_factory.cpp:95
QuantumGateBase * CZ(UINT control_qubit_index, UINT target_qubit_index)
Definition: gate_factory.cpp:111
QuantumGateBase * sqrtXdag(UINT qubit_index)
Definition: gate_factory.cpp:50
QuantumGateBase * Tdag(UINT qubit_index)
Definition: gate_factory.cpp:44
QuantumGateBase * sqrtX(UINT qubit_index)
Definition: gate_factory.cpp:47
Definition: gate.hpp:75