A snapshot of one backend's capabilities: name, qubit count, status, supported instructions, qubit connectivity and circuit formats.
More...
|
|
| BackendWrapper ()=default |
| | Default-construct an empty BackendWrapper.
|
|
| BackendWrapper (const BackendWrapper &)=default |
| | Copy-construct a BackendWrapper.
|
|
| BackendWrapper (BackendWrapper &&)=default |
| | Move-construct a BackendWrapper.
|
|
BackendWrapper & | operator= (const BackendWrapper &)=default |
| | Copy-assign a BackendWrapper.
|
|
BackendWrapper & | operator= (BackendWrapper &&)=default |
| | Move-assign a BackendWrapper.
|
| mqss::Backend | toBackend () const |
| | Build a backend-status message from this snapshot, for publication to other QRM&CI processes.
|
| bool | isOnline () const noexcept |
| | Check whether this backend is currently able to accept tasks.
|
| bool | canRun (const mqss::QuantumTask &task) const |
| | Check whether this backend can run a given task.
|
| std::expected< CompilerTarget, Error > | compilerTarget () const |
| | Find the one compiler target this backend's supported circuit formats make available, in CircuitFormatPolicy's fixed priority order.
|
| const std::string & | getName () const noexcept |
| | Get the backend name.
|
| std::uint32_t | getNumQubits () const noexcept |
| | Get the number of qubits supported by the backend.
|
| mqss::BackendStatus | getStatus () const noexcept |
| | Get the backend status.
|
| const std::vector< std::string > & | getInstructions () const noexcept |
| | Get the instructions supported by the backend.
|
| const std::vector< std::pair< std::uint32_t, std::uint32_t > > & | getQubitConnectivity () const noexcept |
| | Get the qubit connectivity of the backend.
|
| const std::vector< mqss::CircuitFormat > & | getSupportedCircuitFormats () const noexcept |
| | Get the circuit formats supported by the backend.
|
| const std::string & | getQueueName () const noexcept |
| | Get the backend's dispatch queue name.
|
A snapshot of one backend's capabilities: name, qubit count, status, supported instructions, qubit connectivity and circuit formats.
The snapshot is read either from a live device through mqss::submitter::Device or from an mqss::Backend status message, and it answers the three questions the pipeline asks of a backend: whether it is online, whether it can run a given task, and which compiler result format to target for it. It is a value with no setters – refreshing a backend means building a new snapshot.
Definition at line 51 of file BackendWrapper.h.
| std::expected< BackendWrapper, Error > mqss::qrmci::BackendWrapper::fromPublishedStatus |
( |
const mqss::Backend & | backend | ) |
|
|
staticnodiscard |
Build a validated snapshot from a published backend-status message.
The one way a published status becomes a BackendWrapper outside test code, so production can never schedule onto a backend whose status was malformed. Required routing strings (name, dispatch queue) must be non-empty; the three wire enum families (type, status, circuit formats) each normalize an enumerator this build does not know to their *_UNSPECIFIED value rather than propagating an out-of-range value, the same way mapProtoCircuitFormat() already did for circuit formats alone.
- Parameters
-
| backend | The received backend status. |
- Returns
- The validated wrapper, or a MessagingFailed error naming the invalid field.