QDMI v1.3.0-dev
Quantum Device Management Interface
Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 - 2025 Munich Quantum Software Stack Project
3 * All rights reserved.
4 *
5 * Licensed under the Apache License v2.0 with LLVM Exceptions (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://github.com/Munich-Quantum-Software-Stack/QDMI/blob/develop/LICENSE.md
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 *
17 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
18 */
19
23
24#pragma once
25
26#include "qdmi/constants.h" // IWYU pragma: export
27#include "qdmi/export.h" // IWYU pragma: export
28#include "qdmi/types.h" // IWYU pragma: export
29
30#ifdef __cplusplus
31#include <cstddef>
32
33extern "C" {
34#else
35#include <stddef.h>
36#endif
37
38// The following clang-tidy warning cannot be addressed because this header is
39// used from both C and C++ code.
40// NOLINTBEGIN(performance-enum-size,modernize-use-using,modernize-redundant-void-arg)
41
60
69QDMI_EXPORT int QDMI_device_initialize(void);
70
80QDMI_EXPORT int QDMI_device_finalize(void);
81
102
108typedef struct QDMI_Device_Session_impl_d *QDMI_Device_Session;
109
126
160QDMI_EXPORT int
163 size_t size, const void *value);
164
192
200 // end of device_session_interface
202
212
250 QDMI_Device_Session session, QDMI_Device_Property prop, size_t size,
251 void *value, size_t *size_ret);
252
292 size_t size, void *value, size_t *size_ret);
293
351 QDMI_Device_Session session, QDMI_Operation operation, size_t num_sites,
352 const QDMI_Site *sites, size_t num_params, const double *params,
353 QDMI_Operation_Property prop, size_t size, void *value, size_t *size_ret);
354 // end of device_query_interface
356
374
384typedef struct QDMI_Device_Job_impl_d *QDMI_Device_Job;
385
406QDMI_EXPORT int
408 QDMI_Device_Job *job);
409
446 size_t size, const void *value);
447
484 size_t size, void *value,
485 size_t *size_ret);
486
501
515
530 QDMI_Job_Status *status);
531
550QDMI_EXPORT int QDMI_device_job_wait(QDMI_Device_Job job, size_t timeout);
551
587 QDMI_Job_Result result, size_t size,
588 void *data, size_t *size_ret);
589
597 // end of device_job_interface
599 // end of device_interface
601
602// NOLINTEND(performance-enum-size,modernize-use-using,modernize-redundant-void-arg)
603
604#ifdef __cplusplus
605} // extern "C"
606#endif
Defines all enums used within QDMI across the QDMI Client Interface and the QDMI Device Interface.
enum QDMI_JOB_STATUS_T QDMI_Job_Status
Job status type.
Definition constants.h:845
enum QDMI_JOB_RESULT_T QDMI_Job_Result
Job result type.
Definition constants.h:1120
enum QDMI_DEVICE_JOB_PARAMETER_T QDMI_Device_Job_Parameter
Device job parameter type.
Definition constants.h:203
enum QDMI_SITE_PROPERTY_T QDMI_Site_Property
Site property type.
Definition constants.h:667
enum QDMI_DEVICE_JOB_PROPERTY_T QDMI_Device_Job_Property
Device job property type.
Definition constants.h:269
enum QDMI_DEVICE_SESSION_PARAMETER_T QDMI_Device_Session_Parameter
Device session parameter type.
Definition constants.h:144
enum QDMI_OPERATION_PROPERTY_T QDMI_Operation_Property
Operation property type.
Definition constants.h:817
enum QDMI_DEVICE_PROPERTY_T QDMI_Device_Property
Device property type.
Definition constants.h:432
Defines macros for controlling the visibility of symbols.
int QDMI_device_initialize(void)
Initialize a device.
int QDMI_device_finalize(void)
Finalize a device.
int QDMI_device_job_get_results(QDMI_Device_Job job, QDMI_Job_Result result, size_t size, void *data, size_t *size_ret)
Retrieve the results of a job.
int QDMI_device_job_set_parameter(QDMI_Device_Job job, QDMI_Device_Job_Parameter param, size_t size, const void *value)
Set a parameter for a job.
int QDMI_device_job_query_property(QDMI_Device_Job job, QDMI_Device_Job_Property prop, size_t size, void *value, size_t *size_ret)
Query a job property.
int QDMI_device_session_create_device_job(QDMI_Device_Session session, QDMI_Device_Job *job)
Create a job.
int QDMI_device_job_check(QDMI_Device_Job job, QDMI_Job_Status *status)
Check the status of a job.
int QDMI_device_job_cancel(QDMI_Device_Job job)
Cancel an already submitted job.
int QDMI_device_job_wait(QDMI_Device_Job job, size_t timeout)
Wait for a job to finish.
struct QDMI_Device_Job_impl_d * QDMI_Device_Job
A handle for a device job.
Definition device.h:384
int QDMI_device_job_submit(QDMI_Device_Job job)
Submit a job to the device.
void QDMI_device_job_free(QDMI_Device_Job job)
Free a job.
int QDMI_device_session_query_operation_property(QDMI_Device_Session session, QDMI_Operation operation, size_t num_sites, const QDMI_Site *sites, size_t num_params, const double *params, QDMI_Operation_Property prop, size_t size, void *value, size_t *size_ret)
Query an operation property.
int QDMI_device_session_query_site_property(QDMI_Device_Session session, QDMI_Site site, QDMI_Site_Property prop, size_t size, void *value, size_t *size_ret)
Query a site property.
int QDMI_device_session_query_device_property(QDMI_Device_Session session, QDMI_Device_Property prop, size_t size, void *value, size_t *size_ret)
Query a device property.
int QDMI_device_session_init(QDMI_Device_Session session)
Initialize a device session.
struct QDMI_Device_Session_impl_d * QDMI_Device_Session
A handle for a device session.
Definition device.h:108
void QDMI_device_session_free(QDMI_Device_Session session)
Free a QDMI device session.
int QDMI_device_session_set_parameter(QDMI_Device_Session session, QDMI_Device_Session_Parameter param, size_t size, const void *value)
Set a parameter for a device session.
int QDMI_device_session_alloc(QDMI_Device_Session *session)
Allocate a new device session.
Defines all types used within QDMI across the QDMI Client Interface and the QDMI Device Interface.
struct QDMI_Site_impl_d * QDMI_Site
A handle for a site.
Definition types.h:54
struct QDMI_Operation_impl_d * QDMI_Operation
A handle for an operation.
Definition types.h:73