File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ namespace providers {
3131// / @brief Backend class using SQC.
3232class SQCBackend : public BackendV2 {
3333private:
34- sqcInitOptions* init_options_;
3534 // / @note A circuit data will be built via qiskit-cpp, not SQC.
3635 // / A `qc_handle_` field is just used for an interface between qiskit-cpp and SQC.
3736 sqcQC* qc_handle_;
@@ -47,24 +46,16 @@ class SQCBackend : public BackendV2 {
4746 // / @param backend_name a resource name for backend.
4847 SQCBackend (const std::string name)
4948 : name_(name),
50- init_options_ (NULL ),
5149 qc_handle_ (NULL ),
5250 backend_type_(SQC_RPC_SCHED_QC_TYPE_IBM_DACC),
5351 {
54- init_options_ = sqcMallocInitOptions ();
55- init_options_->use_qiskit = 1 ; // only ibm_dacc is supported
56- if (sqcInitialize (init_options_) != E_SUCCESS) {
57- std::cerr << " Failed to initialize SQC" << std::endl;
58- }
52+
5953 qc_handle_ = sqcQuantumCircuit (0 );
6054 }
6155
62- SQCBackend (const SQCBackend& other) = delete;
63-
64- ~SQCBackend () {
56+ ~SQCBackend ()
57+ {
6558 sqcDestroyQuantumCircuit (qc_handle_);
66- sqcFinalize (init_options_);
67- sqcFreeInitOptions (init_options_);
6859 }
6960
7061 // / @brief Return a target properties for this backend.
Original file line number Diff line number Diff line change @@ -24,14 +24,26 @@ namespace service {
2424
2525class QiskitRuntimeService {
2626private:
27+ sqcInitOptions* init_options_;
28+
2729public:
2830 // / @brief Create a new runtime service class
2931 QiskitRuntimeService ()
32+ : init_options_(NULL )
3033 {
34+ init_options_ = sqcMallocInitOptions ();
35+ init_options_->use_qiskit = 1 ; // only ibm_dacc is supported
36+ if (sqcInitialize (init_options_) != E_SUCCESS) {
37+ std::cerr << " Failed to initialize SQC" << std::endl;
38+ }
3139 }
3240
41+ QiskitRuntimeService (QiskitRuntimeService const &) = delete ;
42+
3343 ~QiskitRuntimeService ()
3444 {
45+ sqcFinalize (init_options_);
46+ sqcFreeInitOptions (init_options_);
3547 }
3648
3749 // / @brief create a new backend object
You can’t perform that action at this time.
0 commit comments