QDMI v1.1.0
Quantum Device Management Interface
Loading...
Searching...
No Matches
constants.h File Reference

Description

Defines all enums used within QDMI across the QDMI Client Interface and the QDMI Device Interface.

Go to the source code of this file.

Typedefs

typedef enum QDMI_DEVICE_SESSION_PARAMETER_T QDMI_Device_Session_Parameter
 Device session parameter type.
 
typedef enum QDMI_DEVICE_JOB_PARAMETER_T QDMI_Device_Job_Parameter
 Device job parameter type.
 
typedef enum QDMI_DEVICE_PROPERTY_T QDMI_Device_Property
 Device property type.
 
typedef enum QDMI_DEVICE_STATUS_T QDMI_Device_Status
 Device status type.
 
typedef enum QDMI_SITE_PROPERTY_T QDMI_Site_Property
 Site property type.
 
typedef enum QDMI_OPERATION_PROPERTY_T QDMI_Operation_Property
 Operation property type.
 
typedef enum QDMI_JOB_STATUS_T QDMI_Job_Status
 Job status type.
 
typedef enum QDMI_PROGRAM_FORMAT_T QDMI_Program_Format
 Program format type.
 
typedef enum QDMI_JOB_RESULT_T QDMI_Job_Result
 Job result type.
 

Enumerations

enum  QDMI_STATUS {
  QDMI_WARN_GENERAL = 1 , QDMI_SUCCESS = 0 , QDMI_ERROR_FATAL = -1 , QDMI_ERROR_OUTOFMEM = -2 ,
  QDMI_ERROR_NOTIMPLEMENTED = -3 , QDMI_ERROR_LIBNOTFOUND = -4 , QDMI_ERROR_NOTFOUND = -5 , QDMI_ERROR_OUTOFRANGE = -6 ,
  QDMI_ERROR_INVALIDARGUMENT = -7 , QDMI_ERROR_PERMISSIONDENIED = -8 , QDMI_ERROR_NOTSUPPORTED = -9 , QDMI_ERROR_BADSTATE = -10
}
 Status codes returned by the API. More...
 
enum  QDMI_DEVICE_SESSION_PARAMETER_T {
  QDMI_DEVICE_SESSION_PARAMETER_TOKEN = 0 , QDMI_DEVICE_SESSION_PARAMETER_BASEURL = 1 , QDMI_DEVICE_SESSION_PARAMETER_MAX = 2 , QDMI_DEVICE_SESSION_PARAMETER_CUSTOM1 = 999999995 ,
  QDMI_DEVICE_SESSION_PARAMETER_CUSTOM2 = 999999996 , QDMI_DEVICE_SESSION_PARAMETER_CUSTOM3 = 999999997 , QDMI_DEVICE_SESSION_PARAMETER_CUSTOM4 = 999999998 , QDMI_DEVICE_SESSION_PARAMETER_CUSTOM5 = 999999999
}
 Enum of the device session parameters that can be set via QDMI_device_session_set_parameter. More...
 
enum  QDMI_DEVICE_JOB_PARAMETER_T {
  QDMI_DEVICE_JOB_PARAMETER_PROGRAMFORMAT = 0 , QDMI_DEVICE_JOB_PARAMETER_PROGRAM = 1 , QDMI_DEVICE_JOB_PARAMETER_SHOTSNUM = 2 , QDMI_DEVICE_JOB_PARAMETER_MAX = 3 ,
  QDMI_DEVICE_JOB_PARAMETER_CUSTOM1 = 999999995 , QDMI_DEVICE_JOB_PARAMETER_CUSTOM2 = 999999996 , QDMI_DEVICE_JOB_PARAMETER_CUSTOM3 = 999999997 , QDMI_DEVICE_JOB_PARAMETER_CUSTOM4 = 999999998 ,
  QDMI_DEVICE_JOB_PARAMETER_CUSTOM5 = 999999999
}
 Enum of the device job parameters that can be set via QDMI_device_job_set_parameter. More...
 
enum  QDMI_DEVICE_PROPERTY_T {
  QDMI_DEVICE_PROPERTY_NAME = 0 , QDMI_DEVICE_PROPERTY_VERSION = 1 , QDMI_DEVICE_PROPERTY_STATUS = 2 , QDMI_DEVICE_PROPERTY_LIBRARYVERSION = 3 ,
  QDMI_DEVICE_PROPERTY_QUBITSNUM = 4 , QDMI_DEVICE_PROPERTY_SITES = 5 , QDMI_DEVICE_PROPERTY_OPERATIONS = 6 , QDMI_DEVICE_PROPERTY_COUPLINGMAP = 7 ,
  QDMI_DEVICE_PROPERTY_NEEDSCALIBRATION = 8 , QDMI_DEVICE_PROPERTY_MAX = 9 , QDMI_DEVICE_PROPERTY_CUSTOM1 = 999999995 , QDMI_DEVICE_PROPERTY_CUSTOM2 = 999999996 ,
  QDMI_DEVICE_PROPERTY_CUSTOM3 = 999999997 , QDMI_DEVICE_PROPERTY_CUSTOM4 = 999999998 , QDMI_DEVICE_PROPERTY_CUSTOM5 = 999999999
}
 
enum  QDMI_DEVICE_STATUS_T {
  QDMI_DEVICE_STATUS_OFFLINE = 0 , QDMI_DEVICE_STATUS_IDLE = 1 , QDMI_DEVICE_STATUS_BUSY = 2 , QDMI_DEVICE_STATUS_ERROR = 3 ,
  QDMI_DEVICE_STATUS_MAINTENANCE = 4 , QDMI_DEVICE_STATUS_CALIBRATION = 5 , QDMI_DEVICE_STATUS_MAX = 6
}
 Enum of different status the device can be in. More...
 
enum  QDMI_SITE_PROPERTY_T {
  QDMI_SITE_PROPERTY_ID = 0 , QDMI_SITE_PROPERTY_T1 = 1 , QDMI_SITE_PROPERTY_T2 = 2 , QDMI_SITE_PROPERTY_MAX = 3 ,
  QDMI_SITE_PROPERTY_CUSTOM1 = 999999995 , QDMI_SITE_PROPERTY_CUSTOM2 = 999999996 , QDMI_SITE_PROPERTY_CUSTOM3 = 999999997 , QDMI_SITE_PROPERTY_CUSTOM4 = 999999998 ,
  QDMI_SITE_PROPERTY_CUSTOM5 = 999999999
}
 
enum  QDMI_OPERATION_PROPERTY_T {
  QDMI_OPERATION_PROPERTY_NAME = 0 , QDMI_OPERATION_PROPERTY_QUBITSNUM = 1 , QDMI_OPERATION_PROPERTY_PARAMETERSNUM = 2 , QDMI_OPERATION_PROPERTY_DURATION = 3 ,
  QDMI_OPERATION_PROPERTY_FIDELITY = 4 , QDMI_OPERATION_PROPERTY_MAX = 5 , QDMI_OPERATION_PROPERTY_CUSTOM1 = 999999995 , QDMI_OPERATION_PROPERTY_CUSTOM2 = 999999996 ,
  QDMI_OPERATION_PROPERTY_CUSTOM3 = 999999997 , QDMI_OPERATION_PROPERTY_CUSTOM4 = 999999998 , QDMI_OPERATION_PROPERTY_CUSTOM5 = 999999999
}
 
enum  QDMI_JOB_STATUS_T {
  QDMI_JOB_STATUS_CREATED = 0 , QDMI_JOB_STATUS_SUBMITTED = 1 , QDMI_JOB_STATUS_DONE = 2 , QDMI_JOB_STATUS_RUNNING = 3 ,
  QDMI_JOB_STATUS_CANCELED = 4
}
 Enum of the status a job can have. More...
 
enum  QDMI_PROGRAM_FORMAT_T {
  QDMI_PROGRAM_FORMAT_QASM2 = 0 , QDMI_PROGRAM_FORMAT_QASM3 = 1 , QDMI_PROGRAM_FORMAT_QIRBASESTRING = 2 , QDMI_PROGRAM_FORMAT_QIRBASEMODULE = 3 ,
  QDMI_PROGRAM_FORMAT_QIRADAPTIVESTRING = 4 , QDMI_PROGRAM_FORMAT_QIRADAPTIVEMODULE = 5 , QDMI_PROGRAM_FORMAT_CALIBRATION = 6 , QDMI_PROGRAM_FORMAT_MAX = 7 ,
  QDMI_PROGRAM_FORMAT_CUSTOM1 = 999999995 , QDMI_PROGRAM_FORMAT_CUSTOM2 = 999999996 , QDMI_PROGRAM_FORMAT_CUSTOM3 = 999999997 , QDMI_PROGRAM_FORMAT_CUSTOM4 = 999999998 ,
  QDMI_PROGRAM_FORMAT_CUSTOM5 = 999999999
}
 Enum of formats that can be submitted to the device. More...
 
enum  QDMI_JOB_RESULT_T {
  QDMI_JOB_RESULT_SHOTS = 0 , QDMI_JOB_RESULT_HIST_KEYS = 1 , QDMI_JOB_RESULT_HIST_VALUES = 2 , QDMI_JOB_RESULT_STATEVECTOR_DENSE = 3 ,
  QDMI_JOB_RESULT_PROBABILITIES_DENSE = 4 , QDMI_JOB_RESULT_STATEVECTOR_SPARSE_KEYS = 5 , QDMI_JOB_RESULT_STATEVECTOR_SPARSE_VALUES = 6 , QDMI_JOB_RESULT_PROBABILITIES_SPARSE_KEYS = 7 ,
  QDMI_JOB_RESULT_PROBABILITIES_SPARSE_VALUES = 8 , QDMI_JOB_RESULT_MAX = 9 , QDMI_JOB_RESULT_CUSTOM1 = 999999995 , QDMI_JOB_RESULT_CUSTOM2 = 999999996 ,
  QDMI_JOB_RESULT_CUSTOM3 = 999999997 , QDMI_JOB_RESULT_CUSTOM4 = 999999998 , QDMI_JOB_RESULT_CUSTOM5 = 999999999
}
 Enum of the formats the results can be returned in. More...
 

Enumeration Type Documentation

◆ QDMI_STATUS

Status codes returned by the API.

Enumerator
QDMI_WARN_GENERAL 

A general warning.

QDMI_SUCCESS 

The operation was successful.

QDMI_ERROR_FATAL -1 

A fatal error.

QDMI_ERROR_OUTOFMEM -2 

Out of memory.

QDMI_ERROR_NOTIMPLEMENTED -3 

Not implemented.

QDMI_ERROR_LIBNOTFOUND -4 

Library not found.

QDMI_ERROR_NOTFOUND -5 

Element not found.

QDMI_ERROR_OUTOFRANGE -6 

Out of range.

QDMI_ERROR_INVALIDARGUMENT -7 

Invalid argument.

QDMI_ERROR_PERMISSIONDENIED -8 

Permission denied.

QDMI_ERROR_NOTSUPPORTED -9 

Operation is not supported.

QDMI_ERROR_BADSTATE -10 

Resource is in the wrong state for the operation.

◆ QDMI_DEVICE_SESSION_PARAMETER_T

Enum of the device session parameters that can be set via QDMI_device_session_set_parameter.

If not noted otherwise, parameters are optional and devices must not require them to be set.

Enumerator
QDMI_DEVICE_SESSION_PARAMETER_TOKEN 

char* (string) A token to be used in the session initialization for authenticating with the device.

A token could be a password, an API key, or any other form of authentication that the device requires. The device documentation must document what kind of token is required and how it is used. If the device requires authentication via a token, this parameter must be set before calling QDMI_device_session_init.

QDMI_DEVICE_SESSION_PARAMETER_BASEURL 

char* (string) The baseURL or API endpoint to be used for accessing the device within the session.

If this parameter is set, and the device supports it, the device must use the specified baseURL or API endpoint for the session. Devices may use this parameter to switch between different versions of the API or different endpoints for testing or production environments.

QDMI_DEVICE_SESSION_PARAMETER_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM1 999999995 

This enum value is reserved for a custom parameter.

The device defines the meaning and the type of this parameter.

Attention
The value of this enum member must not be changed to maintain binary compatibility.
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM2 999999996 
See also
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM1
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM3 999999997 
See also
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM1
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM4 999999998 
See also
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM1
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM5 999999999 
See also
QDMI_DEVICE_SESSION_PARAMETER_CUSTOM1

◆ QDMI_DEVICE_JOB_PARAMETER_T

Enum of the device job parameters that can be set via QDMI_device_job_set_parameter.

If not noted otherwise, parameters are optional and devices must not require them to be set.

Enumerator
QDMI_DEVICE_JOB_PARAMETER_PROGRAMFORMAT 

QDMI_Program_Format The format of the program to be executed.

This parameter is required. The device must support the specified program format. If the device does not support the specified program format, the QDMI_device_job_set_parameter function must return QDMI_ERROR_NOTSUPPORTED.

QDMI_DEVICE_JOB_PARAMETER_PROGRAM 

void* The program to be executed.

This parameter is required. The program must be in the format specified by the QDMI_DEVICE_JOB_PARAMETER_PROGRAMFORMAT parameter. If the program is invalid, the QDMI_device_job_set_parameter function must return QDMI_ERROR_INVALIDARGUMENT. If the program is valid, but the device cannot execute it, the QDMI_device_job_set_parameter function must return QDMI_ERROR_NOTSUPPORTED.

QDMI_DEVICE_JOB_PARAMETER_SHOTSNUM 

size_t The number of shots to execute for a quantum circuit job.

If this parameter is not set, a device-specific default is used.

QDMI_DEVICE_JOB_PARAMETER_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.
QDMI_DEVICE_JOB_PARAMETER_CUSTOM1 999999995 

This enum value is reserved for a custom parameter.

The device defines the meaning and the type of this parameter.

Attention
The value of this enum member must not be changed to maintain binary compatibility.
QDMI_DEVICE_JOB_PARAMETER_CUSTOM2 999999996 
See also
QDMI_DEVICE_JOB_PARAMETER_CUSTOM1
QDMI_DEVICE_JOB_PARAMETER_CUSTOM3 999999997 
See also
QDMI_DEVICE_JOB_PARAMETER_CUSTOM1
QDMI_DEVICE_JOB_PARAMETER_CUSTOM4 999999998 
See also
QDMI_DEVICE_JOB_PARAMETER_CUSTOM1
QDMI_DEVICE_JOB_PARAMETER_CUSTOM5 999999999 
See also
QDMI_DEVICE_JOB_PARAMETER_CUSTOM1

◆ QDMI_DEVICE_PROPERTY_T

Enum of the device properties that can be queried via QDMI_device_session_query_device_property as part of the device interface and via QDMI_device_query_device_property as part of the client interface.

Enumerator
QDMI_DEVICE_PROPERTY_NAME 

char* (string) The name of the device.

QDMI_DEVICE_PROPERTY_VERSION 

char* (string) The version of the device.

QDMI_DEVICE_PROPERTY_STATUS 

QDMI_Device_Status The status of the device.

QDMI_DEVICE_PROPERTY_LIBRARYVERSION 

char* (string) The implemented version of QDMI.

QDMI_DEVICE_PROPERTY_QUBITSNUM 

size_t The number of qubits in the device.

QDMI_DEVICE_PROPERTY_SITES 

QDMI_Site* (QDMI_Site list) The sites of the device.

The returned QDMI_Site handles may be used to query site and operation properties. The list need not be sorted based on the QDMI_SITE_PROPERTY_ID.

QDMI_DEVICE_PROPERTY_OPERATIONS 

QDMI_Operation* (QDMI_Operation list) The operations supported by the device.

The returned QDMI_Operation handles may be used to query operation properties.

QDMI_DEVICE_PROPERTY_COUPLINGMAP 

QDMI_Site* (QDMI_Site list) The coupling map of the device.

The returned list contains pairs of sites that are coupled. The pairs in the list are flattened such that the first site of the pair is at index 2n and the second site is at index 2n+1.

The sites returned in that list are represented as QDMI_Site handles. For example, consider a 3-site device with a coupling map (0, 1), (1, 2). Additionally, assume site_i is the handle for the i-th site. Then, {site_0, site_1, site_1, site_2} would be returned.

QDMI_DEVICE_PROPERTY_NEEDSCALIBRATION 

size_t Whether the device needs calibration.

This flag indicates whether the device needs calibration. A value of zero indicates that the device does not need calibration, while any non-zero value indicates that the device needs calibration. It is up to the device to assign a specific meaning to the non-zero value.

If a device reports that it needs calibration, a calibration run can be triggered by submitting a job with the QDMI_Program_Format set to QDMI_PROGRAM_FORMAT_CALIBRATION.

QDMI_DEVICE_PROPERTY_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.
QDMI_DEVICE_PROPERTY_CUSTOM1 999999995 

This enum value is reserved for a custom property.

The device defines the meaning and the type of this property.

Attention
The value of this enum member must not be changed to maintain binary compatibility.
QDMI_DEVICE_PROPERTY_CUSTOM2 999999996 
See also
QDMI_DEVICE_PROPERTY_CUSTOM1
QDMI_DEVICE_PROPERTY_CUSTOM3 999999997 
See also
QDMI_DEVICE_PROPERTY_CUSTOM1
QDMI_DEVICE_PROPERTY_CUSTOM4 999999998 
See also
QDMI_DEVICE_PROPERTY_CUSTOM1
QDMI_DEVICE_PROPERTY_CUSTOM5 999999999 
See also
QDMI_DEVICE_PROPERTY_CUSTOM1

◆ QDMI_DEVICE_STATUS_T

Enum of different status the device can be in.

Enumerator
QDMI_DEVICE_STATUS_OFFLINE 

The device is offline.

QDMI_DEVICE_STATUS_IDLE 

The device is idle.

QDMI_DEVICE_STATUS_BUSY 

The device is busy.

QDMI_DEVICE_STATUS_ERROR 

The device is in an error state.

QDMI_DEVICE_STATUS_MAINTENANCE 

The device is in maintenance.

QDMI_DEVICE_STATUS_CALIBRATION 

The device is in calibration.

QDMI_DEVICE_STATUS_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.

◆ QDMI_SITE_PROPERTY_T

Enum of the site properties that can be queried via QDMI_device_session_query_site_property as part of the device interface and via QDMI_device_query_site_property as part of the client interface.

Enumerator
QDMI_SITE_PROPERTY_ID 

size_t The unique ID to identify the site in a program.

The ID of a site is used to link the qubits used in a quantum program to the physical sites of the device that can be queried via this interface. IDs may be non-consecutive and need not start at 0. See QDMI_Program_Format for more information on how the site IDs map to the qubits in a program.

QDMI_SITE_PROPERTY_T1 

double The T1 time of a site in µs.

QDMI_SITE_PROPERTY_T2 

double The T2 time of a site in µs.

QDMI_SITE_PROPERTY_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.
QDMI_SITE_PROPERTY_CUSTOM1 999999995 

This enum value is reserved for a custom property.

The device defines the meaning and the type of this property.

Attention
The value of this enum member must not be changed to maintain binary compatibility.
QDMI_SITE_PROPERTY_CUSTOM2 999999996 
See also
QDMI_SITE_PROPERTY_CUSTOM1
QDMI_SITE_PROPERTY_CUSTOM3 999999997 
See also
QDMI_SITE_PROPERTY_CUSTOM1
QDMI_SITE_PROPERTY_CUSTOM4 999999998 
See also
QDMI_SITE_PROPERTY_CUSTOM1
QDMI_SITE_PROPERTY_CUSTOM5 999999999 
See also
QDMI_SITE_PROPERTY_CUSTOM1

◆ QDMI_OPERATION_PROPERTY_T

Enum of the operation properties that can be queried via QDMI_device_session_query_operation_property as part of the device interface and via QDMI_device_query_operation_property as part of the client interface.

Enumerator
QDMI_OPERATION_PROPERTY_NAME 

char* (string) The string identifier of the operation.

QDMI_OPERATION_PROPERTY_QUBITSNUM 

size_t The number of qubits involved in the operation.

QDMI_OPERATION_PROPERTY_PARAMETERSNUM 

size_t The number of floating point parameters the operation takes.

QDMI_OPERATION_PROPERTY_DURATION 

double The duration of an operation in µs.

QDMI_OPERATION_PROPERTY_FIDELITY 

double The fidelity of an operation.

QDMI_OPERATION_PROPERTY_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.
QDMI_OPERATION_PROPERTY_CUSTOM1 999999995 

This enum value is reserved for a custom property.

The device defines the meaning and the type of this property.

Attention
The value of this enum member must not be changed to maintain binary compatibility.
QDMI_OPERATION_PROPERTY_CUSTOM2 999999996 
See also
QDMI_OPERATION_PROPERTY_CUSTOM1
QDMI_OPERATION_PROPERTY_CUSTOM3 999999997 
See also
QDMI_OPERATION_PROPERTY_CUSTOM1
QDMI_OPERATION_PROPERTY_CUSTOM4 999999998 
See also
QDMI_OPERATION_PROPERTY_CUSTOM1
QDMI_OPERATION_PROPERTY_CUSTOM5 999999999 
See also
QDMI_OPERATION_PROPERTY_CUSTOM1

◆ QDMI_JOB_STATUS_T

Enum of the status a job can have.

See also QDMI Client Job Interface for a description of the job's lifecycle.

Enumerator
QDMI_JOB_STATUS_CREATED 

The job was created and can be configured via QDMI_job_set_parameter.

QDMI_JOB_STATUS_SUBMITTED 

The job was submitted and is waiting to be executed.

QDMI_JOB_STATUS_DONE 

The job is done, and the result can be retrieved.

QDMI_JOB_STATUS_RUNNING 

The job is running, and the result is not yet available.

QDMI_JOB_STATUS_CANCELED 

The job was canceled, and the result is not available.

◆ QDMI_PROGRAM_FORMAT_T

Enum of formats that can be submitted to the device.

Enumerator
QDMI_PROGRAM_FORMAT_QASM2 

char* (string) An OpenQASM 2.0 program.

A text-based representation of a quantum circuit in the OpenQASM 2.0 language. Devices that claim to support this format must accept programs conforming to the following rules:

  • The program contains exactly one quantum register named q.
  • The number of qubits in the quantum register q matches the number of sites in the device.
  • The program only contains gate identifiers that are reported by the QDMI_OPERATION_PROPERTY_NAME property of the device's operations.
Given a program following these rules, the operations in the program are expected to be performed on the physical sites of the device as queried via QDMI_DEVICE_PROPERTY_SITES. Specifically, an operation on q[i] is performed on the i-th site in the list of sites returned by the device.
Note
Devices may decide to support more general OpenQASM 2.0 programs that do not follow these rules, for example, using multiple qubit registers or arbitrary gates. However, in that case, no guarantees can be made about the mapping of qubits in the program to the physical sites of the device.
QDMI_PROGRAM_FORMAT_QASM3 

char* (string) An OpenQASM 3 program.

A text-based representation of a quantum circuit in the OpenQASM 3 language. Devices that claim to support this format must accept programs conforming to the same rules as for QDMI_PROGRAM_FORMAT_QASM2.

Besides the rules for OpenQASM 2.0 programs, OpenQASM 3 programs may be written using physical qubits, which are denoted by $[NUM], with [NUM] being a non-negative integer denoting the physical qubit's index. If a program uses physical qubits, the operations in the program must be performed on the sites with IDs corresponding to the physical qubits in the program.
Note
Devices may decide to support more general OpenQASM 3 programs that do not follow these rules, for example, using multiple qubit registers or arbitrary gates. However, in that case, no guarantees can be made about the mapping of qubits in the program to the physical sites of the device.
QDMI_PROGRAM_FORMAT_QIRBASESTRING 

char* (string) A text-based QIR program complying to the QIR base profile.

A text-based representation of a quantum circuit in the Quantum Intermediate Representation (QIR) format; specifically, the QIR base profile. Devices that claim to support this format must accept programs that follow the rules for the QIR base profile and that only contain operations that are reported by the QDMI_OPERATION_PROPERTY_NAME property of the device's operations (for example, @__quantum__qis__[NAME]__body, where [NAME] is the name of the operation).

QIR has a similar distinction between dynamically allocated and static hardware qubits as QDMI_PROGRAM_FORMAT_QASM3. The same rules apply for the mapping of qubits in the program to the physical sites of the device. Specifically, if the program only allocates a single register named q with as many qubits as there are sites in the device, the operations in the program are expected to be performed on the physical sites of the device as queried via QDMI_DEVICE_PROPERTY_SITES. If the program uses static qubit addresses (for example, ptr inttoptr (i64 1 to ptr)), the operations in the program must be performed on the sites with IDs corresponding to the static qubit addresses in the program.
Note
Devices may decide to support more general QIR programs that do not follow these rules, for example, using multiple qubit registers or arbitrary gates. However, in that case, no guarantees can be made about the mapping of qubits in the program to the physical sites of the device.
QDMI_PROGRAM_FORMAT_QIRBASEMODULE 

void* A QIR binary complying to the QIR base profile.

A binary representation of a quantum circuit in the Quantum Intermediate Representation (QIR) format; specifically, the QIR base profile.

See also
QDMI_PROGRAM_FORMAT_QIRBASESTRING for more information on the QIR base profile and the expected behavior of devices supporting this format.
QDMI_PROGRAM_FORMAT_QIRADAPTIVESTRING 

char* (string) A text-based QIR program complying to the QIR adaptive profile.

A text-based representation of a quantum circuit in the Quantum Intermediate Representation (QIR) format; specifically, the QIR adaptive profile.

See also
QDMI_PROGRAM_FORMAT_QIRBASESTRING for more information on the QIR base profile and the expected behavior of devices supporting this format.
QDMI_PROGRAM_FORMAT_QIRADAPTIVEMODULE 

void* A QIR binary complying to the QIR adaptive profile.

A binary representation of a quantum circuit in the Quantum Intermediate Representation (QIR) format; specifically, the QIR adaptive profile.

See also
QDMI_PROGRAM_FORMAT_QIRBASESTRING for more information on the QIR base profile and the expected behavior of devices supporting this format.
QDMI_PROGRAM_FORMAT_CALIBRATION 

void* A calibration program.

This program format is used to request the device to perform a calibration run. Triggering a calibration run does not require a program to be set via QDMI_DEVICE_JOB_PARAMETER_PROGRAM.

QDMI_PROGRAM_FORMAT_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.
QDMI_PROGRAM_FORMAT_CUSTOM1 999999995 

This enum value is reserved for a custom program format.

The device defines the meaning and the type of this value.

Attention
The value of this enum member must not be changed to maintain binary compatibility.
QDMI_PROGRAM_FORMAT_CUSTOM2 999999996 
See also
QDMI_PROGRAM_FORMAT_CUSTOM1
QDMI_PROGRAM_FORMAT_CUSTOM3 999999997 
See also
QDMI_PROGRAM_FORMAT_CUSTOM1
QDMI_PROGRAM_FORMAT_CUSTOM4 999999998 
See also
QDMI_PROGRAM_FORMAT_CUSTOM1
QDMI_PROGRAM_FORMAT_CUSTOM5 999999999 
See also
QDMI_PROGRAM_FORMAT_CUSTOM1

◆ QDMI_JOB_RESULT_T

Enum of the formats the results can be returned in.

Enumerator
QDMI_JOB_RESULT_SHOTS 

char* (string) The results of the individual shots as a comma-separated list, for example, "0010,1101,0101,1100,1001,1100" for four qubits and six shots.

QDMI_JOB_RESULT_HIST_KEYS 

char* (string) The keys for the histogram of the results.

The histogram of the measurement results is represented as a key-value mapping. This mapping is returned as a list of keys and an equal-length list of values. The corresponding partners of keys and values can be found at the same index in the lists.

This constant denotes the list of keys, QDMI_JOB_RESULT_HIST_VALUES denotes the list of values.

QDMI_JOB_RESULT_HIST_VALUES 

size_t* (size_t list) The values for the histogram of the results.

See also
QDMI_JOB_RESULT_HIST_KEY
QDMI_JOB_RESULT_STATEVECTOR_DENSE 

double* (double list) The state vector of the result.

The complex amplitudes are stored as a list of real and imaginary parts. The real part of the amplitude is at index 2n and the imaginary part is at index 2n+1. For example, the state vector of a 2-qubit system with amplitudes (0.5, 0.5), (0.5, -0.5), (-0.5, 0.5), (-0.5, -0.5) would be represented as {0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, -0.5}.

QDMI_JOB_RESULT_PROBABILITIES_DENSE 

double* (double list) The probabilities of the result.

The probabilities are stored as a list of real numbers. The probability of the state with index n is at index n in the list. For example, the probabilities of a 2-qubit system with states 00, 01, 10, 11 would be represented as {0.25, 0.25, 0.25, 0.25}.

QDMI_JOB_RESULT_STATEVECTOR_SPARSE_KEYS 

char* (string) The keys for the sparse state vector of the result.

The sparse state vector is represented as a key-value mapping. This mapping is returned as a list of keys and an equal-length list of values. The corresponding partners of keys and values can be found at the same index in the lists.

QDMI_JOB_RESULT_STATEVECTOR_SPARSE_VALUES 

double* (double list) The values for the sparse state vector of the result.

The complex amplitudes are stored in the same way as the dense state vector, but only for the non-zero amplitudes.

See also
QDMI_JOB_RESULT_STATEVECTOR_DENSE
QDMI_JOB_RESULT_STATEVECTOR_SPARSE_KEYS
QDMI_JOB_RESULT_PROBABILITIES_SPARSE_KEYS 

char* (string) The keys for the sparse probabilities of the result.

The sparse probabilities are represented as a key-value mapping. This mapping is returned as a list of keys and an equal-length list of values. The corresponding partners of keys and values can be found at the same index in the lists.

QDMI_JOB_RESULT_PROBABILITIES_SPARSE_VALUES 

double* (double list) The values for the sparse probabilities of the result.

The probabilities are stored in the same way as the dense probabilities, but only for the non-zero probabilities.

See also
QDMI_JOB_RESULT_PROBABILITIES_DENSE
QDMI_JOB_RESULT_PROBABILITIES_SPARSE_KEYS
QDMI_JOB_RESULT_MAX 

The maximum value of the enum.

It can be used by devices for bounds checking and validation of function parameters.

Attention
This value must remain the last regular member of the enum besides the custom members and must be updated when new members are added.
QDMI_JOB_RESULT_CUSTOM1 999999995 

This enum value is reserved for a custom result.

The device defines the meaning and the type of this result.

Attention
The value of this enum member must not be changed to maintain binary compatibility.
QDMI_JOB_RESULT_CUSTOM2 999999996 
See also
QDMI_JOB_RESULT_CUSTOM1
QDMI_JOB_RESULT_CUSTOM3 999999997 
See also
QDMI_JOB_RESULT_CUSTOM1
QDMI_JOB_RESULT_CUSTOM4 999999998 
See also
QDMI_JOB_RESULT_CUSTOM1
QDMI_JOB_RESULT_CUSTOM5 999999999 
See also
QDMI_JOB_RESULT_CUSTOM1