QDMI v1.3.4-dev
Quantum Device Management Interface
Loading...
Searching...
No Matches
QDMI_Program_Format Struct Reference

Exact program format accepted by a device. More...

#include <constants.h>

Data Fields

uint32_t version
 Exact version packed with QDMI_MAKE_VERSION.
uint32_t encoding
 One QDMI_Program_Encoding value.
char id [QDMI_PROGRAM_ID_SIZE]
 NUL-terminated format ID.
char profile [QDMI_PROGRAM_ID_SIZE]
 NUL-terminated profile ID.

Detailed Description

Exact program format accepted by a device.

All fields take part in identity. version is the nonzero, exact packed major, minor, and patch release of the payload specification. Devices list every accepted descriptor separately. Clients must not infer compatibility between versions, profiles, or encodings.

The id and profile arrays must be NUL-terminated, and every byte after the first NUL must be zero. Every API compares descriptor values, not their addresses. A caller may reconstruct a canonical value from its fields; use QDMI_program_format_equal to compare two values. IDs are case-sensitive. QDMI reserves unqualified IDs for standard formats. The standard IDs are openqasm and qir. Vendor formats use <vendor>.<custom-format-identifier> IDs, such as iqm.circuit. The vendor component is an identifier, not a reverse domain name. QDMI does not define vendor-format versions, profiles, wire formats, or result semantics. Providers must document each vendor descriptor and its payload and result contract. An empty profile identifies a format without a named profile. QIR uses base and adaptive; OpenQASM uses an empty profile.

In the following mappings, the regular-site list is the subsequence of QDMI_DEVICE_PROPERTY_SITES for which QDMI_SITE_PROPERTY_ISZONE is false, in provider order. Zone sites are not program-addressable qubits. Standard descriptors require the regular-site list size to equal QDMI_DEVICE_PROPERTY_QUBITSNUM. Standard mappings cover local operations only; a vendor extension must define how a payload selects a zoned operation.

Standard descriptors have the following portable mappings:

  • OpenQASM descriptors use text encoding and an empty profile. A program has exactly one quantum register named q, with one qubit for each regular site. q[i] maps to the i-th regular site. OpenQASM 3 physical qubit $i maps to the regular site whose QDMI_SITE_PROPERTY_INDEX is i. Except for format-mandated measurement and output primitives, each quantum instruction name, number of quantum operands, and number of parameters must equal QDMI_OPERATION_PROPERTY_NAME, QDMI_OPERATION_PROPERTY_QUBITSNUM, and QDMI_OPERATION_PROPERTY_PARAMETERSNUM for one reported local operation.
  • QIR descriptors use LLVM assembly for text encoding and LLVM bitcode for binary encoding. They use the base or adaptive profile. Descriptor version N.M.P identifies the QIR specification release and is independent of the output-schema version in QDMI_JOB_RESULT_PROGRAMOUTPUT. Except for profile-mandated measurement, output, and runtime functions, a QIS function named __quantum__qis__NAME__body maps to the reported local operation whose name is NAME; its qubit and parameter operands must match that operation's qubit and parameter counts. A statically identified qubit with integer value i maps to the regular site whose QDMI_SITE_PROPERTY_INDEX is i. A device that advertises QIR must assign the regular-site index set to [0, N), where N is QDMI_DEVICE_PROPERTY_QUBITSNUM. Dynamic qubit allocation has no portable site mapping. A provider may accept a wider format subset, but clients must not rely on a portable mapping outside these rules. Advertising a standard descriptor guarantees only its normative baseline and its reported optional program features, not every construct expressible in the format.

The QIR Adaptive baseline includes mid-circuit measurement, measured-qubit reuse, measurement-result use, Boolean computation, and forward branching. Devices report optional QIR module flags as program features. Other standard descriptors have an empty program-feature baseline.


The documentation for this struct was generated from the following file: