execute_on_qpu
Execute an Executable
on a specified QPU.
Definition
struct ExecutionResult *execute_on_qpu(struct Executable *executable, char *qpu_id);
Safety
- In order to run this function safely, you must provide the return value from this function to
free_execution_result
once you're done with it. - The input
qpu_id
must be a valid, nul-terminated, non-null string which remains constant for the duration of this function.
Usage
In order to execute, you must have an active reservation for the QPU you're targeting as well as valid, configured QCS credentials.
Configuration
Valid settings and secrets must be set either in ~/.qcs or by setting the OS environment variables QCS_SECRETS_FILE_PATH
and QCS_SETTINGS_FILE_PATH
for secrets and settings respectively. QCS_PROFILE_NAME
can also be used to choose a different profile in those configuration files.
Arguments
executable
: TheExecutable
to execute.qpu_id
: the ID of the QPU to run on (e.g."Aspen-11"
)
Errors
This program will return the Error
variant of ExecutionResult
with a human-readable description of the error. Some common errors:
- QCS could not be authenticated with due to missing / invalid configuration.
- Authenticated user has no active reservation for the requested
qpu_id
. - A syntax error in the provided Quil when calling
executable_from_quil
. - There was no data to read (improper or missing
read_from
option).