MQT Core
The Backbone of the Munich Quantum Toolkit (MQT)
Loading...
Searching...
No Matches
qdmi Namespace Reference

Namespaces

namespace  dd
 
namespace  detail
 
namespace  diagnostics
 
namespace  slurm
 

Classes

class  Device
 Class representing a quantum device. More...
 
struct  DeviceDefinition
 Stable registration for a QDMI device. More...
 
struct  DeviceLibrary
 Definition of the device library. More...
 
struct  DeviceSessionConfig
 Configuration for device session parameters. More...
 
class  Driver
 The MQT QDMI driver class. More...
 
class  DynamicDeviceLibrary
 Definition of the dynamic device library. More...
 
struct  FileDeviceConfiguration
 JSON file used to configure one QDMI device session. More...
 
struct  InlineDeviceConfiguration
 Inline JSON used to configure one QDMI device session. More...
 
class  Job
 Class representing a submitted job. More...
 
class  Operation
 Class representing an operation (gate) supported by the device. More...
 
struct  remove_optional
 
struct  remove_optional< std::optional< U > >
 
class  Session
 Class representing the Session library. More...
 
struct  SessionConfig
 Configuration structure for session authentication parameters. More...
 
class  Singleton
 
class  Site
 Class representing a site (qubit) on the device. More...
 

Concepts

concept  custom_property_value
 Concept for supported custom property value types.
 
concept  size_constructible_contiguous_range
 Concept for ranges that are contiguous in memory and can be constructed with a size.
 
concept  value_or_string
 Concept for types that are either integral, floating point, bool, std::string, or QDMI_Device_Status.
 
concept  value_or_string_or_vector
 Concept for types that are either value_or_string or size_constructible_contiguous_range.
 
concept  is_optional
 Concept for types that are std::optional of value_or_string.
 
concept  string_or_optional_string
 Concept for types that are either std::string or std::optional of std::string.
 
concept  maybe_optional_size_constructible_contiguous_range
 Concept for types that are either size_constructible_contiguous_range or std::optional of size_constructible_contiguous_range.
 
concept  maybe_optional_value_or_string
 Concept for types that are either value_or_string or std::optional of value_or_string.
 
concept  maybe_optional_value_or_string_or_vector
 Concept for types that are either value_or_string_or_vector or std::optional of value_or_string_or_vector.
 

Typedefs

using CustomJobParameter = std::variant< std::string, bool, int, double >
 
template<typename T >
using remove_optional_t = remove_optional< T >::type
 Helper type to strip std::optional from a type if it is present.
 
using DeviceConfigurationSource = std::variant< InlineDeviceConfiguration, FileDeviceConfiguration >
 One replaceable source for a runtime device description.
 

Enumerations

enum class  CustomProperty : std::uint8_t {
  Custom1 = 1 , Custom2 = 2 , Custom3 = 3 , Custom4 = 4 ,
  Custom5 = 5
}
 Identifies one of QDMI's implementation-defined custom slots. More...
 
enum class  SessionStatus : uint8_t { ALLOCATED , INITIALIZED }
 The status of a session. More...
 

Functions

constexpr bool isBinaryProgramFormat (const QDMI_Program_Format format) noexcept
 Returns whether a program format carries a binary payload.
 
void unreachable ()
 Function used to mark unreachable code.
 
constexpr auto toString (const QDMI_STATUS result) -> const char *
 Returns the string representation of the given status code result.
 
auto throwIfError (int result, const std::string &msg) -> void
 Throws an exception if the result indicates an error.
 
constexpr auto toString (const QDMI_Session_Parameter param) -> const char *
 Returns the string representation of the given session parameter param.
 
constexpr auto toString (const QDMI_Session_Property prop) -> const char *
 Returns the string representation of the given session property prop.
 
constexpr auto toString (const QDMI_Device_Session_Parameter param) -> const char *
 
constexpr auto toString (const QDMI_Site_Property prop) -> const char *
 Returns the string representation of the given site property prop.
 
constexpr auto toString (const QDMI_Operation_Property prop) -> const char *
 Returns the string representation of the given operation property prop.
 
constexpr auto toString (const QDMI_Device_Property prop) -> const char *
 Returns the string representation of the given device property prop.
 
auto makeDeviceSessionConfig (std::optional< std::string > baseUrl, std::optional< std::string > token, std::optional< std::filesystem::path > authFile, std::optional< std::string > authUrl, std::optional< std::string > username, std::optional< std::string > password, std::optional< std::string > deviceConfig, std::optional< std::filesystem::path > deviceConfigFile, std::optional< std::string > custom1, std::optional< std::string > custom2, std::optional< std::string > custom3, std::optional< std::string > custom4, std::optional< std::string > custom5) -> DeviceSessionConfig
 Construct a device session configuration from individual parameters.
 

Detailed Description

MQT Core's QDMI driver, owning client wrappers, and device integrations.

Typedef Documentation

◆ CustomJobParameter

using qdmi::CustomJobParameter = typedef std::variant<std::string, bool, int, double>

◆ remove_optional_t

template<typename T >
using qdmi::remove_optional_t = typedef remove_optional<T>::type

Helper type to strip std::optional from a type if it is present.

This is useful for template metaprogramming when you want to work with the underlying type of optional without caring about its optionality.

Template Parameters
TThe type to strip optional from.

◆ DeviceConfigurationSource

One replaceable source for a runtime device description.

Enumeration Type Documentation

◆ CustomProperty

enum class qdmi::CustomProperty : std::uint8_t
strong

Identifies one of QDMI's implementation-defined custom slots.

The same selector is used for custom device, site, operation, and job properties as well as custom job results.

Enumerator
Custom1 
Custom2 
Custom3 
Custom4 
Custom5 

◆ SessionStatus

enum class qdmi::SessionStatus : uint8_t
strong

The status of a session.

This enum defines the possible states of a session in the QDMI library. A session can be either allocated or initialized.

Enumerator
ALLOCATED 

The session has been allocated but not initialized.

INITIALIZED 

The session has been initialized and is ready for use.

Function Documentation

◆ isBinaryProgramFormat()

constexpr bool qdmi::isBinaryProgramFormat ( const QDMI_Program_Format  format)
constexprnoexcept

Returns whether a program format carries a binary payload.

QDMI_PROGRAM_FORMAT_QIRBASEMODULE, QDMI_PROGRAM_FORMAT_QIRADAPTIVEMODULE, and QDMI_PROGRAM_FORMAT_QPY hold bitcode or another serialized object. Such a payload can contain a null byte and is not text, so it must be submitted as exact bytes. The string overload of Device::submitJob rejects these formats.

Parameters
formatThe program format to classify.
Returns
True if the format requires exact-byte submission.

◆ unreachable()

void qdmi::unreachable ( )
inline

Function used to mark unreachable code.

Uses compiler-specific extensions if possible. Even if no extension is used, undefined behavior is still raised by an empty function body and the noreturn attribute.

◆ toString() [1/7]

constexpr auto qdmi::toString ( const QDMI_STATUS  result) -> const char*
constexpr

Returns the string representation of the given status code result.

◆ throwIfError()

auto qdmi::throwIfError ( int  result,
const std::string &  msg 
) -> void

Throws an exception if the result indicates an error.

Parameters
resultThe result of a QDMI operation
msgThe error message to include in the exception
Exceptions
std::bad_allocif the result is QDMI_ERROR_OUTOFMEM
std::out_of_rangeif the result is QDMI_ERROR_OUTOFRANGE
std::invalid_argumentif the result is QDMI_ERROR_INVALIDARGUMENT
std::runtime_errorfor all other error results

◆ toString() [2/7]

constexpr auto qdmi::toString ( const QDMI_Session_Parameter  param) -> const char*
constexpr

Returns the string representation of the given session parameter param.

◆ toString() [3/7]

constexpr auto qdmi::toString ( const QDMI_Session_Property  prop) -> const char*
constexpr

Returns the string representation of the given session property prop.

◆ toString() [4/7]

constexpr auto qdmi::toString ( const QDMI_Device_Session_Parameter  param) -> const char*
constexpr

Returns the string representation of the given device session parameter param.

◆ toString() [5/7]

constexpr auto qdmi::toString ( const QDMI_Site_Property  prop) -> const char*
constexpr

Returns the string representation of the given site property prop.

◆ toString() [6/7]

constexpr auto qdmi::toString ( const QDMI_Operation_Property  prop) -> const char*
constexpr

Returns the string representation of the given operation property prop.

◆ toString() [7/7]

constexpr auto qdmi::toString ( const QDMI_Device_Property  prop) -> const char*
constexpr

Returns the string representation of the given device property prop.

◆ makeDeviceSessionConfig()

auto qdmi::makeDeviceSessionConfig ( std::optional< std::string >  baseUrl,
std::optional< std::string >  token,
std::optional< std::filesystem::path >  authFile,
std::optional< std::string >  authUrl,
std::optional< std::string >  username,
std::optional< std::string >  password,
std::optional< std::string >  deviceConfig,
std::optional< std::filesystem::path >  deviceConfigFile,
std::optional< std::string >  custom1,
std::optional< std::string >  custom2,
std::optional< std::string >  custom3,
std::optional< std::string >  custom4,
std::optional< std::string >  custom5 
) -> DeviceSessionConfig
inline

Construct a device session configuration from individual parameters.

Exceptions
std::invalid_argumentIf both an inline device configuration and a device configuration file are set.