21#include <MQSSCIInterfaces/MQSSCompiler.h>
25#include <mqss/submitter/Job.h>
30namespace mqss::submitter {
34namespace mqss::qrmci {
48 const mqss::QuantumTask &task,
const BackendRegistry &availableBackends,
57[[nodiscard]] std::expected<void, Error>
59 mqss::mqssci::MQSSCompiler &compiler);
71[[nodiscard]] std::expected<void, Error>
93 const mqss::QuantumTask &task,
94 const std::vector<std::optional<mqss::submitter::Counts>> &histogram);
115[[nodiscard]] std::expected<std::vector<mqss::submitter::Job>,
Error>
117 const mqss::submitter::Device &device);
132[[nodiscard]] std::expected<std::vector<mqss::submitter::Job>,
Error>
134 const mqss::submitter::Device &device,
135 const std::atomic<bool> &terminationFlag);
153[[nodiscard]] std::expected<mqss::QuantumResult, Error>
155 std::vector<mqss::submitter::Job> &jobs,
156 std::chrono::seconds waitTimeout);
175 const mqss::QuantumTask &task, std::vector<mqss::submitter::Job> &jobs,
176 std::chrono::seconds waitTimeout,
const std::atomic<bool> &terminationFlag);
192[[nodiscard]] std::expected<mqss::QuantumResult, Error>
194 const mqss::submitter::Device &device,
195 std::chrono::seconds waitTimeout);
208 const mqss::QuantumTask &task,
const mqss::submitter::Device &device,
209 std::chrono::seconds waitTimeout,
const std::atomic<bool> &terminationFlag);
216[[nodiscard]] mqss::QuantumResult
218 const std::string &cancelReason);
The set of backends a QRM&CI process may schedule onto, and the time-to-live after which an entry nob...
BackendSelectionPolicy
Named rule deciding which backend wins when several of them could run the same task.
@ LowestName
The compatible backend whose name sorts first.
One backend's capabilities as the QRM&CI pipeline sees them, read either from a live device or from a...
Pure translations between the submitter, mqss protocol and mqss-ci enumerations: status,...
The error type every std::expected in QRM&CI's public interfaces carries.
std::expected< void, Error > compileQuantumTask(mqss::QuantumTask &task, const BackendWrapper &backendInfo, mqss::mqssci::MQSSCompiler &compiler)
Compile the quantum task using compiler.
std::expected< mqss::QuantumResult, Error > buildQuantumResult(const mqss::QuantumTask &task, const std::vector< std::optional< mqss::submitter::Counts > > &histogram)
Build a QuantumResult from a task and its job-result histogram, the shared tail end of submitQuantumT...
std::expected< std::string, Error > chooseBackend(const mqss::QuantumTask &task, const BackendRegistry &availableBackends, BackendSelectionPolicy policy=BackendSelectionPolicy::LowestName)
Choose the backend that should execute a quantum task.
std::expected< std::vector< mqss::submitter::Job >, Error > submitQuantumTask(const mqss::QuantumTask &task, const mqss::submitter::Device &device)
Submit the quantum task's circuits to the device without waiting for their results.
std::expected< mqss::QuantumResult, Error > collectQuantumResult(const mqss::QuantumTask &task, std::vector< mqss::submitter::Job > &jobs, std::chrono::seconds waitTimeout)
Collect the results of previously submitted quantum jobs.
std::expected< mqss::QuantumResult, Error > executeQuantumTask(const mqss::QuantumTask &task, const mqss::submitter::Device &device, std::chrono::seconds waitTimeout)
Execute the quantum task on the device: submits it and collects its result in one call.
mqss::QuantumResult cancelQuantumTask(const mqss::QuantumTask &task, const std::string &cancelReason)
Cancel the quantum task and return a cancellation result.
Owns the backends a process knows about, keyed by backend name.
A snapshot of one backend's capabilities: name, qubit count, status, supported instructions,...
A failure reported by a QRM&CI operation: a kind the caller can act on, plus a human-readable detail ...