QDMI v1.2.1
Quantum Device Management Interface
Loading...
Searching...
No Matches
client.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/types.h" // IWYU pragma: export
28
29#ifdef __cplusplus
30#include <cstddef>
31
32extern "C" {
33#else
34#include <stddef.h>
35#endif
36
37// The following clang-tidy warning cannot be addressed because this header is
38// used from both C and C++ code.
39// NOLINTBEGIN(performance-enum-size, modernize-use-using)
40
57
64typedef struct QDMI_Device_impl_d *QDMI_Device;
65
83
89typedef struct QDMI_Session_impl_d *QDMI_Session;
90
108
193
196
246 QDMI_Session_Parameter param, size_t size,
247 const void *value);
248
270
307
310
365 QDMI_Session_Property prop, size_t size,
366 void *value, size_t *size_ret);
367
376 // end of client_session_interface
378
388
435 QDMI_Device_Property prop, size_t size,
436 void *value, size_t *size_ret);
437
489 QDMI_Site_Property prop, size_t size,
490 void *value, size_t *size_ret);
491
574 QDMI_Device device, QDMI_Operation operation, size_t num_sites,
575 const QDMI_Site *sites, size_t num_params, const double *params,
576 QDMI_Operation_Property prop, size_t size, void *value, size_t *size_ret);
577 // end of client_query_interface
579
597
607typedef struct QDMI_Job_impl_d *QDMI_Job;
608
626
680
683
735 const void *value);
736
797
800
851 void *value, size_t *size_ret);
852
869
884
900
920int QDMI_job_wait(QDMI_Job job, size_t timeout);
921
972int QDMI_job_get_results(QDMI_Job job, QDMI_Job_Result result, size_t size,
973 void *data, size_t *size_ret);
974
982 // end of client_job_interface
984 // end of client_interface
986
987// NOLINTEND(performance-enum-size, modernize-use-using)
988
989#ifdef __cplusplus
990} // extern "C"
991#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_SITE_PROPERTY_T QDMI_Site_Property
Site property type.
Definition constants.h:667
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
struct QDMI_Device_impl_d * QDMI_Device
A handle for a device implementing the QDMI Device Interface.
Definition client.h:64
enum QDMI_JOB_PROPERTY_T QDMI_Job_Property
Job property type.
Definition client.h:799
int QDMI_job_submit(QDMI_Job job)
Submit a job to the device.
QDMI_JOB_PARAMETER_T
Enum of the job parameters that can be set.
Definition client.h:632
enum QDMI_JOB_PARAMETER_T QDMI_Job_Parameter
Job parameter type.
Definition client.h:682
int QDMI_job_wait(QDMI_Job job, size_t timeout)
Wait for a job to finish.
QDMI_JOB_PROPERTY_T
Enum of the job properties that can be queried via QDMI_job_query_property as part of the client inte...
Definition client.h:744
int QDMI_job_set_parameter(QDMI_Job job, QDMI_Job_Parameter param, size_t size, const void *value)
Set a parameter for a job.
void QDMI_job_free(QDMI_Job job)
Free a job.
int QDMI_device_create_job(QDMI_Device device, QDMI_Job *job)
Create a job.
struct QDMI_Job_impl_d * QDMI_Job
A handle for a client-side job.
Definition client.h:607
int QDMI_job_get_results(QDMI_Job job, QDMI_Job_Result result, size_t size, void *data, size_t *size_ret)
Retrieve the results of a job.
int QDMI_job_cancel(QDMI_Job job)
Cancel an already submitted job.
int QDMI_job_check(QDMI_Job job, QDMI_Job_Status *status)
Check the status of a job.
int QDMI_job_query_property(QDMI_Job job, QDMI_Job_Property prop, size_t size, void *value, size_t *size_ret)
Query a job property.
@ QDMI_JOB_PARAMETER_CUSTOM1
This enum value is reserved for a custom parameter.
Definition client.h:670
@ QDMI_JOB_PARAMETER_CUSTOM4
Definition client.h:676
@ QDMI_JOB_PARAMETER_SHOTSNUM
size_t The number of shots to execute for a quantum circuit job.
Definition client.h:655
@ QDMI_JOB_PARAMETER_CUSTOM3
Definition client.h:674
@ QDMI_JOB_PARAMETER_CUSTOM5
Definition client.h:678
@ QDMI_JOB_PARAMETER_CUSTOM2
Definition client.h:672
@ QDMI_JOB_PARAMETER_MAX
The maximum value of the enum.
Definition client.h:663
@ QDMI_JOB_PARAMETER_PROGRAM
void* The program to be executed.
Definition client.h:650
@ QDMI_JOB_PARAMETER_PROGRAMFORMAT
QDMI_Program_Format The format of the program to be executed.
Definition client.h:640
@ QDMI_JOB_PROPERTY_CUSTOM5
Definition client.h:795
@ QDMI_JOB_PROPERTY_CUSTOM1
This enum value is reserved for a custom parameter.
Definition client.h:787
@ QDMI_JOB_PROPERTY_MAX
The maximum value of the enum.
Definition client.h:780
@ QDMI_JOB_PROPERTY_PROGRAM
void* The program to be executed.
Definition client.h:765
@ QDMI_JOB_PROPERTY_SHOTSNUM
size_t The number of shots to execute for a quantum circuit job.
Definition client.h:771
@ QDMI_JOB_PROPERTY_ID
char* (string) The job's ID.
Definition client.h:753
@ QDMI_JOB_PROPERTY_PROGRAMFORMAT
QDMI_Program_Format The format of the program to be executed.
Definition client.h:759
@ QDMI_JOB_PROPERTY_CUSTOM2
Definition client.h:789
@ QDMI_JOB_PROPERTY_CUSTOM3
Definition client.h:791
@ QDMI_JOB_PROPERTY_CUSTOM4
Definition client.h:793
int QDMI_device_query_device_property(QDMI_Device device, QDMI_Device_Property prop, size_t size, void *value, size_t *size_ret)
Query a device property.
int QDMI_device_query_operation_property(QDMI_Device device, 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_query_site_property(QDMI_Device device, QDMI_Site site, QDMI_Site_Property prop, size_t size, void *value, size_t *size_ret)
Query a site property.
void QDMI_session_free(QDMI_Session session)
Free a session.
int QDMI_session_set_parameter(QDMI_Session session, QDMI_Session_Parameter param, size_t size, const void *value)
Set a parameter for a session.
struct QDMI_Session_impl_d * QDMI_Session
A handle for a session.
Definition client.h:89
int QDMI_session_query_session_property(QDMI_Session session, QDMI_Session_Property prop, size_t size, void *value, size_t *size_ret)
Query a property of a session.
QDMI_SESSION_PROPERTY_T
Enum of the session properties that can be queried via QDMI_session_query_session_property.
Definition client.h:277
int QDMI_session_alloc(QDMI_Session *session)
Allocate a new session.
QDMI_SESSION_PARAMETER_T
Enum of the session parameters that can be set via QDMI_session_set_parameter.
Definition client.h:115
enum QDMI_SESSION_PARAMETER_T QDMI_Session_Parameter
Session parameter type.
Definition client.h:195
enum QDMI_SESSION_PROPERTY_T QDMI_Session_Property
Session property type.
Definition client.h:309
int QDMI_session_init(QDMI_Session session)
Initialize a session.
@ QDMI_SESSION_PROPERTY_CUSTOM3
Definition client.h:301
@ QDMI_SESSION_PROPERTY_CUSTOM2
Definition client.h:299
@ QDMI_SESSION_PROPERTY_CUSTOM1
This enum value is reserved for a custom property.
Definition client.h:297
@ QDMI_SESSION_PROPERTY_CUSTOM5
Definition client.h:305
@ QDMI_SESSION_PROPERTY_MAX
The maximum value of the enum.
Definition client.h:290
@ QDMI_SESSION_PROPERTY_DEVICES
QDMI_Device* (QDMI_Device list) The devices the client has access to.
Definition client.h:282
@ QDMI_SESSION_PROPERTY_CUSTOM4
Definition client.h:303
@ QDMI_SESSION_PARAMETER_CUSTOM1
This enum value is reserved for a custom parameter.
Definition client.h:183
@ QDMI_SESSION_PARAMETER_AUTHURL
char* (string) The URL to an authentication server used as part of the authentication procedure.
Definition client.h:146
@ QDMI_SESSION_PARAMETER_CUSTOM3
Definition client.h:187
@ QDMI_SESSION_PARAMETER_PASSWORD
char* (string) The password to use for the session.
Definition client.h:160
@ QDMI_SESSION_PARAMETER_MAX
The maximum value of the enum.
Definition client.h:176
@ QDMI_SESSION_PARAMETER_CUSTOM5
Definition client.h:191
@ QDMI_SESSION_PARAMETER_CUSTOM2
Definition client.h:185
@ QDMI_SESSION_PARAMETER_CUSTOM4
Definition client.h:189
@ QDMI_SESSION_PARAMETER_USERNAME
char* (string) The username to use for the session.
Definition client.h:153
@ QDMI_SESSION_PARAMETER_TOKEN
char* (string) The token to use for the session.
Definition client.h:122
@ QDMI_SESSION_PARAMETER_PROJECTID
char* (string) The project ID to use for the session.
Definition client.h:167
@ QDMI_SESSION_PARAMETER_AUTHFILE
char* (string) A file path to a file containing authentication information.
Definition client.h:132
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