qcs_sdk.qpu.api
Execution readout data from a particular memory location.
Execution readout data for all memory locations.
Options available when executing a job on a QPU.
Use [Default] to get a reasonable set of defaults, or start with [ExecutionOptionsBuilder]
to build a custom set of options.
Builder for ExecutionOptions.
Options available when executing a job on a QPU, particular to the execution service's API.
This is a conventent alias for [InnerApiExecutionOptions] which provides a builder.
Use [Default] to get a reasonable set of defaults, or start with [ApiExecutionOptionsBuilder]
to build a custom set of options.
Get an [ExecutionOptionsBuilder] that can be used to build a custom [ExecutionOptions].
Get the configured timeout value.
Note, this is the timeout while running a job; the job will be evicted from the hardware once this time has elapsed.
If unset, the job's estimated duration will be used; if the job does not have an estimated duration, the default timeout is selected by the service.
The service may also enforce a maximum value for this field.
Builder for ApiExecutionOptions.
The duration of an API call.
The connection strategy to use when submitting and retrieving jobs from a QPU.
Inherited Members
Inherited Members
Inherited Members
Errors that can occur while attempting to establish a connection to the QPU.
Errors that may occur when submitting a program for execution.
Errors building execution options.
Submits an executable program to be run on the specified QPU.
Parameters
- program: An executable program (see
qcs_sdk.qpu.translation.translate). - patch_values: A mapping of symbols to their desired values (see
build_patch_values). - quantum_processor_id: The ID of the quantum processor to run the executable on.
This field is required, unless being used with the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. Creates one using environment configuration if unset. See https://docs.rigetti.com/qcs/references/qcs-client-configuration for more information. - execution_options: The
ExecutionOptionsto use. If the connection strategy option used isConnectionStrategy.endpoint_id("endpoint_id"), then direct access to "endpoint_id" overrides thequantum_processor_idparameter.
:returns: The ID of the submitted job which can be used to fetch results.
Raises
- LoadClientError: If there is an issue loading the QCS Client configuration.
- SubmissionError: If there was a problem submitting the program for execution.
Submits an executable program to be run on the specified QPU.
Parameters
- program: An executable program (see
qcs_sdk.qpu.translation.translate). - patch_values: A mapping of symbols to their desired values (see
build_patch_values). - quantum_processor_id: The ID of the quantum processor to run the executable on.
This field is required, unless being used with the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. Creates one using environment configuration if unset. See https://docs.rigetti.com/qcs/references/qcs-client-configuration for more information. - execution_options: The
ExecutionOptionsto use. If the connection strategy option used isConnectionStrategy.endpoint_id("endpoint_id"), then direct access to "endpoint_id" overrides thequantum_processor_idparameter.
:returns: The ID of the submitted job which can be used to fetch results.
Raises
- LoadClientError: If there is an issue loading the QCS Client configuration.
- SubmissionError: If there was a problem submitting the program for execution.
Execute a compiled program on a QPU with multiple sets of patch_values.
This action is atomic in that all jobs will be queued, or none of them will. On success, this
function will return a list of strings where the length and order correspond to the
patch_values given. However, note that execution in the order of given patch values is not
guaranteed. If there is a failure to queue any of the jobs, then none will be queued.
Parameters
- program: An executable program (see
translate). - patch_values: An iterable containing one or more mapping of symbols to their desired values.
- quantum_processor_id: The ID of the quantum processor to run the executable on. This field is required, unless being used with the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration - execution_options: The
ExecutionOptionsto use.
:returns: The IDs of the submitted jobs which can be used to fetch results.
Raises
- LoadClientError: If there is an issue loading the QCS Client configuration.
- SubmissionError: If there was a problem submitting any of the jobs for execution, or if no
patch_valuesare given.
Execute a compiled program on a QPU with multiple sets of patch_values.
This action is atomic in that all jobs will be queued, or none of them will. On success, this
function will return a list of strings where the length and order correspond to the
patch_values given. However, note that execution in the order of given patch values is not
guaranteed. If there is a failure to queue any of the jobs, then none will be queued.
Parameters
- program: An executable program (see
translate). - patch_values: An iterable containing one or more mapping of symbols to their desired values.
- quantum_processor_id: The ID of the quantum processor to run the executable on. This field is required, unless being used with the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration - execution_options: The
ExecutionOptionsto use.
:returns: The IDs of the submitted jobs which can be used to fetch results.
Raises
- LoadClientError: If there is an issue loading the QCS Client configuration.
- SubmissionError: If there was a problem submitting any of the jobs for execution, or if no
patch_valuesare given.
Cancel a job that has yet to begin executing.
This action is not atomic, and will attempt to cancel a job even if it cannot be cancelled. A job can be cancelled only if it has not yet started executing.
Success response indicates only that the request was received. Cancellation is not guaranteed, as it is based on job state at the time of cancellation, and is completed on a best effort basis.
Parameters
- job_id: The job ID to cancel.
- quantum_processor_id: The quantum processor to execute the job on. This parameter is required unless using the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. - execution_options: The
ExecutionOptionsto use.
Cancel a job that has yet to begin executing.
This action is not atomic, and will attempt to cancel a job even if it cannot be cancelled. A job can be cancelled only if it has not yet started executing.
Success response indicates only that the request was received. Cancellation is not guaranteed, as it is based on job state at the time of cancellation, and is completed on a best effort basis.
Parameters
- job_id: The job ID to cancel.
- quantum_processor_id: The quantum processor to execute the job on. This parameter is required unless using the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. - execution_options: The
ExecutionOptionsto use.
Cancel all given jobs that have yet to begin executing.
This action is not atomic, and will attempt to cancel every job even when some jobs cannot be cancelled. A job can be cancelled only if it has not yet started executing.
Success response indicates only that the request was received. Cancellation is not guaranteed, as it is based on job state at the time of cancellation, and is completed on a best effort basis.
Parameters
- job_ids: The job IDs to cancel.
- quantum_processor_id: The quantum processor to execute the job on. This parameter is required unless using the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. - execution_options: The
ExecutionOptionsto use.
Cancel all given jobs that have yet to begin executing.
This action is not atomic, and will attempt to cancel every job even when some jobs cannot be cancelled. A job can be cancelled only if it has not yet started executing.
Success response indicates only that the request was received. Cancellation is not guaranteed, as it is based on job state at the time of cancellation, and is completed on a best effort basis.
Parameters
- job_ids: The job IDs to cancel.
- quantum_processor_id: The quantum processor to execute the job on. This parameter is required unless using the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. - execution_options: The
ExecutionOptionsto use.
Fetches execution results for the given QCS Job ID.
Parameters
- job_id: The ID of the job to retrieve results for.
- quantum_processor_id: The ID of the quantum processor the job ran on. This field is required, unless being used with the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration - execution_options: The
ExecutionOptionsto use.
:returns: Results from execution.
Raises
- LoadClientError: If there is an issue loading the QCS Client configuration.
- QpuApiError: If there was a problem retrieving the results.
Fetches execution results for the given QCS Job ID.
Parameters
- job_id: The ID of the job to retrieve results for.
- quantum_processor_id: The ID of the quantum processor the job ran on. This field is required, unless being used with the
ConnectionStrategy.endpoint_id()execution option. - client: The
Qcsclient to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration - execution_options: The
ExecutionOptionsto use.
:returns: Results from execution.
Raises
- LoadClientError: If there is an issue loading the QCS Client configuration.
- QpuApiError: If there was a problem retrieving the results.