Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
common_DFE.h
Go to the documentation of this file.
1 /*
2 Created on Fri Jun 26 14:13:26 2020
3 Copyright 2020 Peter Rakyta, Ph.D.
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 
17 
18 @author: Peter Rakyta, Ph.D.
19 */
24 #ifndef common_DFE_H
25 #define common_DFE_H
26 
27 
28 #include <omp.h>
29 #include "QGDTypes.h"
30 #include "dot.h"
31 
32 
33 #include <string>
34 #include <stdio.h>
35 #include <iostream>
36 #include <cmath>
37 #include <vector>
38 #include <cstring>
39 #include <sstream>
40 
41 
42 #define DFE_LIB_9QUBITS "libqgdDFE.so"
43 #define DFE_LIB_10QUBITS "libqgdDFE_10qubits.so"
44 #define DFE_LIB_SIM "libqgdDFE_SIM.so"
45 
46 
47 extern "C"
48 {
49 
50 
61 typedef struct {
62  int32_t ThetaOver2;
63  int32_t Phi;
64  int32_t Lambda;
65  int8_t target_qbit;
66  int8_t control_qbit;
67  int8_t gate_type;
68  uint8_t metadata;
70 
71 
72 }
73 
74 
75 
81 
82 
88 
93 int get_initialize_id();
94 
106 int calcqgdKernelDFE(size_t rows, size_t cols, DFEgate_kernel_type* gates, int gatesNum, int gateSetNum, int traceOffset, double* trace);
107 
108 
114 
115 
116 
117 
122 void uploadMatrix2DFE( Matrix& input );
123 
124 
125 
129 void unload_dfe_lib();
130 
131 
135 void lock_lib();
136 
137 
141 void unlock_lib();
142 
143 
144 
145 
146 
154 int init_dfe_lib( const int accelerator_num, int qbit_num, int initialize_id_in);
155 
156 
157 
158 
159 
160 #endif
161 
void unlock_lib()
Call to unlock the access to the execution of the DFE library.
Definition: common_DFE.cpp:155
size_t get_accelerator_free_num()
Call to get the number of free accelerators.
Definition: common_DFE.cpp:180
void unload_dfe_lib()
Call to unload the DFE libarary and release the allocated devices.
Definition: common_DFE.cpp:78
size_t get_accelerator_avail_num()
Call to get the available number of accelerators.
Definition: common_DFE.cpp:169
void lock_lib()
Call to lock the access to the execution of the DFE library.
Definition: common_DFE.cpp:145
int calcqgdKernelDFE(size_t rows, size_t cols, DFEgate_kernel_type *gates, int gatesNum, int gateSetNum, int traceOffset, double *trace)
Call to execute the calculation on the reserved DFE engines.
Definition: common_DFE.cpp:207
Custom types for the SQUANDER package.
int init_dfe_lib(const int accelerator_num, int qbit_num, int initialize_id_in)
Call to initialize the DFE library support and allocate the requested devices.
Definition: common_DFE.cpp:101
Class to store data of complex arrays and its properties.
Definition: matrix.h:38
int get_initialize_id()
Call to get the identification number of the inititalization of the library.
Definition: common_DFE.cpp:190
Fixed point data related to a gate operation.
Definition: common_DFE.h:61
int get_chained_gates_num()
Call to retrieve the number of gates that should be chained up during the execution of the DFE librar...
Definition: common_DFE.cpp:220
void uploadMatrix2DFE(Matrix &input)
Call to upload the input matrix to the DFE engine.
Definition: common_DFE.cpp:65