|
| mqss::CircuitFormat | mqss::qrmci::mapTaskCircuitTypeToCircuitFormat (const std::string &format) noexcept |
| | Translate a task circuit type into its one direct circuit format, for no-modify submission or for a task's already-canonical circuit_file_type after a successful compilation.
|
| std::expected< CompilerTarget, Error > | mqss::qrmci::chooseCompilerTarget (std::span< const mqss::CircuitFormat > backendFormats) |
| | Choose the one compiler target a backend's supported circuit formats make available.
|
| bool | mqss::qrmci::canPrepareTaskForBackend (const mqss::QuantumTask &task, std::span< const mqss::CircuitFormat > backendFormats) |
| | Check whether a task can be prepared – directly submitted or compiled – for a backend supporting backendFormats.
|
| std::expected< void, Error > | mqss::qrmci::validateInputFormatIsSupportedCircuitFormat (std::string_view circuitFileFormat, std::span< const std::string_view > supportedInputFormats) |
| | Check that a task's circuit file format has a known mapping to one of the compiler's supported input formats.
|
The one policy that decides whether a task is directly submittable or compilable for a backend, and which concrete circuit format and compiler result format that choice means.
Kept separate from ConstantsMapping.h: this is task/compiler/backend admission policy, not a translation between two enumerations.
Definition in file CircuitFormatPolicy.h.
| bool mqss::qrmci::canPrepareTaskForBackend |
( |
const mqss::QuantumTask & | task, |
|
|
std::span< const mqss::CircuitFormat > | backendFormats ) |
|
nodiscard |
Check whether a task can be prepared – directly submitted or compiled – for a backend supporting backendFormats.
A no_modify task must already resolve, via mapTaskCircuitTypeToCircuitFormat(), to one of backendFormats. Otherwise the task's circuit type must be a known compiler input format and backendFormats must yield a chooseCompilerTarget(). A task with no_modify=false and a non-compiler input therefore fails here, at admission, rather than later at compilation.
- Parameters
-
| task | The task to check. |
| backendFormats | The backend's own supported circuit formats. |
- Returns
- True if the task is either directly submittable or compilable for a backend supporting
backendFormats.
| std::expected< CompilerTarget, Error > mqss::qrmci::chooseCompilerTarget |
( |
std::span< const mqss::CircuitFormat > | backendFormats | ) |
|
|
nodiscard |
Choose the one compiler target a backend's supported circuit formats make available.
Checked in this fixed priority order – QASM2, QIRBASESTRING, QIRADAPTIVESTRING – never the module variants, since MQSS Compiler only ever returns textual bytes. The backend's own format list order has no effect on the outcome.
- Parameters
-
| backendFormats | The backend's own supported circuit formats. |
- Returns
- The one compiler target to compile for, or an UnsupportedFormat error if none of
backendFormats is a compiler output.
| mqss::CircuitFormat mqss::qrmci::mapTaskCircuitTypeToCircuitFormat |
( |
const std::string & | format | ) |
|
|
nodiscardnoexcept |
Translate a task circuit type into its one direct circuit format, for no-modify submission or for a task's already-canonical circuit_file_type after a successful compilation.
An exhaustive, deterministic switch: qasm/qasm2 -> QASM2, qasm3 -> QASM3, qir/qirbase -> QIRBASESTRING, qiradaptive -> QIRADAPTIVESTRING, and quake/catalyst -> QIRBASESTRING for direct submission because these task circuit types have no distinct protocol wire-format enumerator.
- Parameters
-
| format | The task circuit type to translate (e.g. "qasm3"). |
- Returns
- The matching mqss::CircuitFormat, or mqss::CircuitFormat::CIRCUIT_FORMAT_UNSPECIFIED if
format has no known direct mapping.