QDMI v1.2.0
Quantum Device Management Interface
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1/*------------------------------------------------------------------------------
2Copyright 2024 Munich Quantum Software Stack Project
3
4Licensed under the Apache License, Version 2.0 with LLVM Exceptions (the
5"License"); you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8https://github.com/Munich-Quantum-Software-Stack/QDMI/blob/develop/LICENSE
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13License for the specific language governing permissions and limitations under
14the License.
15
16SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
17------------------------------------------------------------------------------*/
18
22
23#pragma once
24
25#include "qdmi/constants.h" // IWYU pragma: export
26#include "qdmi/types.h" // IWYU pragma: export
27
28#ifdef __cplusplus
29#include <cstddef>
30
31extern "C" {
32#else
33#include <stddef.h>
34#endif
35
36// The following clang-tidy warning cannot be addressed because this header is
37// used from both C and C++ code.
38// NOLINTBEGIN(performance-enum-size, modernize-use-using)
39
56
63typedef struct QDMI_Device_impl_d *QDMI_Device;
64
82
88typedef struct QDMI_Session_impl_d *QDMI_Session;
89
107
192
195
245 QDMI_Session_Parameter param, size_t size,
246 const void *value);
247
269
306
309
364 QDMI_Session_Property prop, size_t size,
365 void *value, size_t *size_ret);
366
375 // end of client_session_interface
377
387
434 QDMI_Device_Property prop, size_t size,
435 void *value, size_t *size_ret);
436
488 QDMI_Site_Property prop, size_t size,
489 void *value, size_t *size_ret);
490
573 QDMI_Device device, QDMI_Operation operation, size_t num_sites,
574 const QDMI_Site *sites, size_t num_params, const double *params,
575 QDMI_Operation_Property prop, size_t size, void *value, size_t *size_ret);
620 QDMI_Device device, QDMI_Pulse_Parameter parameter,
621 QDMI_Pulse_Parameter_Property prop, size_t size, void *value,
622 size_t *size_ret);
666 QDMI_Pulse_Waveform waveform,
668 size_t size, void *value,
669 size_t *size_ret);
715 QDMI_Pulse_Implementation_Property prop, size_t size, void *value,
716 size_t *size_ret); // end of client_query_interface
718
736
746typedef struct QDMI_Job_impl_d *QDMI_Job;
747
765
819
822
874 const void *value);
875
936
939
990 void *value, size_t *size_ret);
991
1008
1023
1039
1059int QDMI_job_wait(QDMI_Job job, size_t timeout);
1060
1111int QDMI_job_get_results(QDMI_Job job, QDMI_Job_Result result, size_t size,
1112 void *data, size_t *size_ret);
1113
1121 // end of client_job_interface
1123 // end of client_interface
1125
1126// NOLINTEND(performance-enum-size, modernize-use-using)
1127
1128#ifdef __cplusplus
1129} // extern "C"
1130#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:688
enum QDMI_JOB_RESULT_T QDMI_Job_Result
Job result type.
Definition constants.h:946
enum QDMI_SITE_PROPERTY_T QDMI_Site_Property
Site property type.
Definition constants.h:438
enum QDMI_PULSE_PARAMETER_PROPERTY_T QDMI_Pulse_Parameter_Property
Pulse parameter property type.
Definition constants.h:548
enum QDMI_OPERATION_PROPERTY_T QDMI_Operation_Property
Operation property type.
Definition constants.h:486
enum QDMI_PULSE_WAVEFORM_PROPERTY_T QDMI_Pulse_Waveform_Property
Pulse waveform property type.
Definition constants.h:601
enum QDMI_PULSE_IMPLEMENTATION_PROPERTY_T QDMI_Pulse_Implementation_Property
Pulse implementation property type.
Definition constants.h:659
enum QDMI_DEVICE_PROPERTY_T QDMI_Device_Property
Device property type.
Definition constants.h:361
struct QDMI_Device_impl_d * QDMI_Device
A handle for a device implementing the QDMI Device Interface.
Definition client.h:63
enum QDMI_JOB_PROPERTY_T QDMI_Job_Property
Job property type.
Definition client.h:938
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:771
enum QDMI_JOB_PARAMETER_T QDMI_Job_Parameter
Job parameter type.
Definition client.h:821
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:883
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:746
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:809
@ QDMI_JOB_PARAMETER_CUSTOM4
Definition client.h:815
@ QDMI_JOB_PARAMETER_SHOTSNUM
size_t The number of shots to execute for a quantum circuit job.
Definition client.h:794
@ QDMI_JOB_PARAMETER_CUSTOM3
Definition client.h:813
@ QDMI_JOB_PARAMETER_CUSTOM5
Definition client.h:817
@ QDMI_JOB_PARAMETER_CUSTOM2
Definition client.h:811
@ QDMI_JOB_PARAMETER_MAX
The maximum value of the enum.
Definition client.h:802
@ QDMI_JOB_PARAMETER_PROGRAM
void* The program to be executed.
Definition client.h:789
@ QDMI_JOB_PARAMETER_PROGRAMFORMAT
QDMI_Program_Format The format of the program to be executed.
Definition client.h:779
@ QDMI_JOB_PROPERTY_CUSTOM5
Definition client.h:934
@ QDMI_JOB_PROPERTY_CUSTOM1
This enum value is reserved for a custom parameter.
Definition client.h:926
@ QDMI_JOB_PROPERTY_MAX
The maximum value of the enum.
Definition client.h:919
@ QDMI_JOB_PROPERTY_PROGRAM
void* The program to be executed.
Definition client.h:904
@ QDMI_JOB_PROPERTY_SHOTSNUM
size_t The number of shots to execute for a quantum circuit job.
Definition client.h:910
@ QDMI_JOB_PROPERTY_ID
char* (string) The job's ID.
Definition client.h:892
@ QDMI_JOB_PROPERTY_PROGRAMFORMAT
QDMI_Program_Format The format of the program to be executed.
Definition client.h:898
@ QDMI_JOB_PROPERTY_CUSTOM2
Definition client.h:928
@ QDMI_JOB_PROPERTY_CUSTOM3
Definition client.h:930
@ QDMI_JOB_PROPERTY_CUSTOM4
Definition client.h:932
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_pulse_waveform_property(QDMI_Device device, QDMI_Pulse_Waveform waveform, QDMI_Pulse_Waveform_Property prop, size_t size, void *value, size_t *size_ret)
Query a pulse waveform property.
int QDMI_device_query_pulse_implementation_property(QDMI_Device device, QDMI_Pulse_Implementation impl, QDMI_Pulse_Implementation_Property prop, size_t size, void *value, size_t *size_ret)
Query a pulse implementation property.
int QDMI_device_query_pulse_parameter_property(QDMI_Device device, QDMI_Pulse_Parameter parameter, QDMI_Pulse_Parameter_Property prop, size_t size, void *value, size_t *size_ret)
Query a pulse parameter 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:88
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:276
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:114
enum QDMI_SESSION_PARAMETER_T QDMI_Session_Parameter
Session parameter type.
Definition client.h:194
enum QDMI_SESSION_PROPERTY_T QDMI_Session_Property
Session property type.
Definition client.h:308
int QDMI_session_init(QDMI_Session session)
Initialize a session.
@ QDMI_SESSION_PROPERTY_CUSTOM3
Definition client.h:300
@ QDMI_SESSION_PROPERTY_CUSTOM2
Definition client.h:298
@ QDMI_SESSION_PROPERTY_CUSTOM1
This enum value is reserved for a custom property.
Definition client.h:296
@ QDMI_SESSION_PROPERTY_CUSTOM5
Definition client.h:304
@ QDMI_SESSION_PROPERTY_MAX
The maximum value of the enum.
Definition client.h:289
@ QDMI_SESSION_PROPERTY_DEVICES
QDMI_Device* (QDMI_Device list) The devices the client has access to.
Definition client.h:281
@ QDMI_SESSION_PROPERTY_CUSTOM4
Definition client.h:302
@ QDMI_SESSION_PARAMETER_CUSTOM1
This enum value is reserved for a custom parameter.
Definition client.h:182
@ QDMI_SESSION_PARAMETER_AUTHURL
char* (string) The URL to an authentication server used as part of the authentication procedure.
Definition client.h:145
@ QDMI_SESSION_PARAMETER_CUSTOM3
Definition client.h:186
@ QDMI_SESSION_PARAMETER_PASSWORD
char* (string) The password to use for the session.
Definition client.h:159
@ QDMI_SESSION_PARAMETER_MAX
The maximum value of the enum.
Definition client.h:175
@ QDMI_SESSION_PARAMETER_CUSTOM5
Definition client.h:190
@ QDMI_SESSION_PARAMETER_CUSTOM2
Definition client.h:184
@ QDMI_SESSION_PARAMETER_CUSTOM4
Definition client.h:188
@ QDMI_SESSION_PARAMETER_USERNAME
char* (string) The username to use for the session.
Definition client.h:152
@ QDMI_SESSION_PARAMETER_TOKEN
char* (string) The token to use for the session.
Definition client.h:121
@ QDMI_SESSION_PARAMETER_PROJECTID
char* (string) The project ID to use for the session.
Definition client.h:166
@ QDMI_SESSION_PARAMETER_AUTHFILE
char* (string) A file path to a file containing authentication information.
Definition client.h:131
Defines all types used within QDMI across the QDMI Client Interface and the QDMI Device Interface.
struct QDMI_Pulse_Parameter_impl_d * QDMI_Pulse_Parameter
A handle for a pulse parameter.
Definition types.h:82
struct QDMI_Pulse_Implementation_impl_d * QDMI_Pulse_Implementation
A handle for a pulse implementation.
Definition types.h:101
struct QDMI_Site_impl_d * QDMI_Site
A handle for a site.
Definition types.h:53
struct QDMI_Pulse_Waveform_impl_d * QDMI_Pulse_Waveform
A handle for a pulse waveform.
Definition types.h:91
struct QDMI_Operation_impl_d * QDMI_Operation
A handle for an operation.
Definition types.h:72