Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Functions | Variables
common_GROQ.cpp File Reference

Provides functions to link and manage data-flow accelerator libraries for state vector simulation. More...

#include "common_GROQ.h"
#include "matrix_base.hpp"
#include <dlfcn.h>
#include <unistd.h>
#include <tbb/queuing_mutex.h>
Include dependency graph for common_GROQ.cpp:

Go to the source code of this file.

Functions

void apply_to_groq_sv (int reserved_device_num, int chosen_device_num, int qbit_num, std::vector< Matrix > &u3_qbit, std::vector< int > &target_qbits, std::vector< int > &control_qbits, Matrix &quantum_state, int id_in)
 Call to pefrom the state vector simulation on the Groq hardware. More...
 
int get_initialize_id ()
 Call to get the identification number of the inititalization of the library. More...
 
int init_groq_sv_lib (const int reserved_device_num, int initialize_id_in)
 Call to allocated Groq cards for calculations. More...
 
void unload_groq_sv_lib ()
 Call to unload the programs from the reserved Groq cards. More...
 

Variables

int(* calcsvKernelGroq_dll )(int num_gates, float *gates, int *target_qubits, int *control_qubits, float *result_real, float *result_imag, int device_num) = NULL
 
size_t(* get_accelerator_avail_num_sv_dll )() = NULL
 
size_t(* get_accelerator_free_num_sv_dll )() = NULL
 
void * handle_sv = NULL
 
int(* initialize_groq_sv_dll )(int accelerator_num) = NULL
 
int initialize_id = -1
 
int(* load_sv_dll )(float *data, size_t num_qubits, size_t device_num) = NULL
 
void(* releive_groq_sv_dll )() = NULL
 

Detailed Description

Provides functions to link and manage data-flow accelerator libraries for state vector simulation.

Definition in file common_GROQ.cpp.

Function Documentation

◆ apply_to_groq_sv()

void apply_to_groq_sv ( int  reserved_device_num,
int  chosen_device_num,
int  qbit_num,
std::vector< Matrix > &  u3_qbit,
std::vector< int > &  target_qbits,
std::vector< int > &  control_qbits,
Matrix quantum_state,
int  id_in 
)

Call to pefrom the state vector simulation on the Groq hardware.

Parameters
reserved_device_numThe number of Groq accelerator cards to be allocated for the calulations
chosen_device_numThe ordinal number of the Groq accelerator card on which the calculation should be performed (0<=chosen_device_num<reserved_device_num)
qbit_numThe number of qubits
u3_qbitAn array of the gate kernels
target_qbitsThe array of target qubits
control_qbitsThe array of control qubits
quantum_stateThe input state vector on which the transformation is applied. The transformed state is returned via this input.
id_inIdentification number of the inititalized library

Definition at line 157 of file common_GROQ.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_initialize_id()

int get_initialize_id ( )

Call to get the identification number of the inititalization of the library.

Returns
Returns with the identification number of the inititalization of the library

Definition at line 64 of file common_GROQ.cpp.

◆ init_groq_sv_lib()

int init_groq_sv_lib ( const int  reserved_device_num,
int  initialize_id_in 
)

Call to allocated Groq cards for calculations.

Parameters
reserved_device_numThe number of Groq accelerator cards to be allocated for the calulations
initialize_id_inIdentification number of the inititalization of the library
Returns
Returns with 1 on success

Definition at line 105 of file common_GROQ.cpp.

Here is the caller graph for this function:

◆ unload_groq_sv_lib()

void unload_groq_sv_lib ( )

Call to unload the programs from the reserved Groq cards.

Definition at line 78 of file common_GROQ.cpp.

Variable Documentation

◆ calcsvKernelGroq_dll

int(* calcsvKernelGroq_dll) (int num_gates, float *gates, int *target_qubits, int *control_qubits, float *result_real, float *result_imag, int device_num) = NULL

Definition at line 48 of file common_GROQ.cpp.

◆ get_accelerator_avail_num_sv_dll

size_t(* get_accelerator_avail_num_sv_dll) () = NULL

Definition at line 46 of file common_GROQ.cpp.

◆ get_accelerator_free_num_sv_dll

size_t(* get_accelerator_free_num_sv_dll) () = NULL

Definition at line 47 of file common_GROQ.cpp.

◆ handle_sv

void* handle_sv = NULL

Definition at line 42 of file common_GROQ.cpp.

◆ initialize_groq_sv_dll

int(* initialize_groq_sv_dll) (int accelerator_num) = NULL

Definition at line 51 of file common_GROQ.cpp.

◆ initialize_id

int initialize_id = -1

Definition at line 56 of file common_GROQ.cpp.

◆ load_sv_dll

int(* load_sv_dll) (float *data, size_t num_qubits, size_t device_num) = NULL

Definition at line 49 of file common_GROQ.cpp.

◆ releive_groq_sv_dll

void(* releive_groq_sv_dll) () = NULL

Definition at line 50 of file common_GROQ.cpp.