13 #ifndef QUANTUM_PLUGINS_DWACCELERATOR_HPP_ 14 #define QUANTUM_PLUGINS_DWACCELERATOR_HPP_ 16 #include "AcceleratorBuffer.hpp" 17 #include "AnnealingProgram.hpp" 19 #include "RemoteAccelerator.hpp" 21 #include "dwave_sapi.h" 34 std::string description;
40 std::vector<std::pair<int, int>> edges;
48 std::vector<std::pair<int, int>> getConnectivity()
override;
50 const std::string getSignature()
override {
return "dwave-internal" + backend; }
52 const std::string processInput(
53 std::shared_ptr<AcceleratorBuffer> buffer,
54 std::vector<std::shared_ptr<CompositeInstruction>> functions)
override;
56 void processResponse(std::shared_ptr<AcceleratorBuffer> buffer,
57 const std::string &response)
override;
59 void execute(std::shared_ptr<AcceleratorBuffer> buffer,
60 const std::vector<std::shared_ptr<CompositeInstruction>>
63 std::vector<std::shared_ptr<AcceleratorBuffer>> tmpBuffers;
64 for (
auto f : functions) {
65 auto tmpBuffer = std::make_shared<AcceleratorBuffer>(
66 buffer->name() + std::to_string(counter), buffer->size());
67 RemoteAccelerator::execute(tmpBuffer, f);
68 buffer->appendChild(buffer->name() + std::to_string(counter), tmpBuffer);
77 if (config.keyExists<
int>(
"shots")) {
78 shots = config.get<
int>(
"shots");
80 if (config.stringExists(
"backend")) {
81 backend = config.getString(
"backend");
85 const std::vector<std::string> configurationKeys()
override {
86 return {
"shots",
"backend"};
89 const std::string
name()
const override {
return "dwave-internal"; }
92 return "The D-Wave Accelerator executes Ising Hamiltonian parameters " 93 "on a remote D-Wave QPU.";
100 std::string backend =
"DW_2000Q_5";
104 std::map<std::string, DWSolver> availableSolvers;
106 sapi_Connection *connection =
nullptr;
107 sapi_Solver *solver =
nullptr;
108 const sapi_SolverProperties *solver_properties =
nullptr;
110 void searchAPIKey(std::string &key, std::string &url);
111 void findApiKeyInFile(std::string &key, std::string &url,
112 const std::string &p);
Definition: old_DWAccelerator.hpp:43
Definition: Accelerator.hpp:25
const std::string name() const override
Definition: old_DWAccelerator.hpp:89
const std::string description() const override
Definition: old_DWAccelerator.hpp:91
Definition: old_DWAccelerator.hpp:32
Definition: heterogeneous.hpp:45
Definition: RemoteAccelerator.hpp:38