Quantum Resource Manager and Compiler Infrastructure (QRM&CI) 0.1.0
CircuitFormatPolicy.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 MQSS Maintainers
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 */
7
14
15#pragma once
16
17#include "mqss/Protocol.hpp"
18#include "qrmci/Error.h"
19
20#include <MQSSCIInterfaces/MQSSCompiler.h>
21#include <expected>
22#include <span>
23#include <string>
24#include <string_view>
25
26namespace mqss::qrmci {
27
34 mqss::mqssci::ResultFormat compilerFormat;
37 mqss::CircuitFormat circuitFormat;
39 std::string_view taskCircuitType;
40};
41
54[[nodiscard]] mqss::CircuitFormat
55mapTaskCircuitTypeToCircuitFormat(const std::string &format) noexcept;
56
67[[nodiscard]] std::expected<CompilerTarget, Error>
68chooseCompilerTarget(std::span<const mqss::CircuitFormat> backendFormats);
69
83[[nodiscard]] bool
84canPrepareTaskForBackend(const mqss::QuantumTask &task,
85 std::span<const mqss::CircuitFormat> backendFormats);
86
93[[nodiscard]] std::expected<void, Error>
95 std::string_view circuitFileFormat,
96 std::span<const std::string_view> supportedInputFormats);
97
98} // namespace mqss::qrmci
bool 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 back...
mqss::CircuitFormat mapTaskCircuitTypeToCircuitFormat(const std::string &format) noexcept
Translate a task circuit type into its one direct circuit format, for no-modify submission or for a t...
std::expected< CompilerTarget, Error > chooseCompilerTarget(std::span< const mqss::CircuitFormat > backendFormats)
Choose the one compiler target a backend's supported circuit formats make available.
std::expected< void, Error > 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 ...
The error type every std::expected in QRM&CI's public interfaces carries.
One deterministic compilation target: the mqss-ci ResultFormat the compiler must be asked to emit,...
mqss::mqssci::ResultFormat compilerFormat
The result format the MQSS Compiler is asked to emit.
std::string_view taskCircuitType
The circuit_file_type a task carries once compiled to this target.
mqss::CircuitFormat circuitFormat
The protocol format that output is submitted as, and the one chooseCompilerTarget() matches against a...