This is the client for the Quantum Engine API that deals with the engine protos
and the gRPC client but not cirq protos or objects. All users are likely better
served by using the Engine, EngineProgram, EngineJob, EngineProcessor, and
Calibration objects instead of using this directly.
Args
service_args
A dictionary of arguments that can be used to
configure options on the underlying gRPC client.
verbose
Suppresses stderr messages when set to False. Default is
true.
max_retry_delay_seconds
The maximum number of seconds to retry when
a retryable error code is returned.
Attributes
grpc_client
Creates an async grpc client for the Quantum Engine service.
This action is only valid if the associated [QuantumProcessor]
schedule not been frozen. Otherwise, delete_reservation should
be used.
The reservation will be truncated to end at the time when the request is
serviced and any remaining time will be made available as an open swim
period. This action will only succeed if the reservation has not yet
ended and is within the processor's freeze window. If the reservation
has already ended or is beyond the processor's freeze window, then the
call will return an error.
Args
project_id
A project_id of the parent Google Cloud Project.
processor_id
The processor unique identifier.
reservation_id
Unique ID of the reservation in the parent project,
This action is only valid if the associated [QuantumProcessor]
schedule not been frozen. Otherwise, delete_reservation should
be used.
The reservation will be truncated to end at the time when the request is
serviced and any remaining time will be made available as an open swim
period. This action will only succeed if the reservation has not yet
ended and is within the processor's freeze window. If the reservation
has already ended or is beyond the processor's freeze window, then the
call will return an error.
Args
project_id
A project_id of the parent Google Cloud Project.
processor_id
The processor unique identifier.
reservation_id
Unique ID of the reservation in the parent project,
Either both run_name and device_config_name must be set, or neither
of them must be set. If none of them are set, a default internal device
configuration will be used. If both run_name and snapshot_id are
set, then snapshot_id will be preferred.
Args
project_id
A project_id of the parent Google Cloud Project.
program_id
Unique ID of the program within the parent project.
job_id
Unique ID of the job within the parent program.
run_context
Properly serialized run context.
priority
Optional priority to run at, 0-1000.
description
Optional description to set on the job.
labels
Optional set of labels to set on the job.
processor_id
Processor id for running the program.
run_name
A unique identifier representing an automation run for the
specified processor. An Automation Run contains a collection of
device configurations for a processor. If specified, processor_id
is required to be set.
snapshot_id
A unique identifier for an immutable snapshot reference.
A snapshot contains a collection of device configurations for the
processor.
device_config_name
An identifier used to select the processor configuration
utilized to run the job. A configuration identifies the set of
available qubits, couplers, and supported gates in the processor.
If specified, processor_id is required to be set.
Returns
Tuple of created job id and job.
Raises
ValueError
If the priority is not between 0 and 1000.
ValueError
If only one of run_name and device_config_name are specified.
ValueError
If either run_name and device_config_name are set but
processor_id is empty.
Either both run_name and device_config_name must be set, or neither
of them must be set. If none of them are set, a default internal device
configuration will be used. If both run_name and snapshot_id are
set, then snapshot_id will be preferred.
Args
project_id
A project_id of the parent Google Cloud Project.
program_id
Unique ID of the program within the parent project.
job_id
Unique ID of the job within the parent program.
run_context
Properly serialized run context.
priority
Optional priority to run at, 0-1000.
description
Optional description to set on the job.
labels
Optional set of labels to set on the job.
processor_id
Processor id for running the program.
run_name
A unique identifier representing an automation run for the
specified processor. An Automation Run contains a collection of
device configurations for a processor. If specified, processor_id
is required to be set.
snapshot_id
A unique identifier for an immutable snapshot reference.
A snapshot contains a collection of device configurations for the
processor.
device_config_name
An identifier used to select the processor configuration
utilized to run the job. A configuration identifies the set of
available qubits, couplers, and supported gates in the processor.
If specified, processor_id is required to be set.
Returns
Tuple of created job id and job.
Raises
ValueError
If the priority is not between 0 and 1000.
ValueError
If only one of run_name and device_config_name are specified.
ValueError
If either run_name and device_config_name are set but
processor_id is empty.
Filter string current only supports 'timestamp' with values
of epoch time in seconds or short string 'yyyy-MM-dd'. For example:
'timestamp > 1577960125 AND timestamp <= 1578241810'
'timestamp > 2020-01-02 AND timestamp <= 2020-01-05'
Filter string current only supports 'timestamp' with values
of epoch time in seconds or short string 'yyyy-MM-dd'. For example:
'timestamp > 1577960125 AND timestamp <= 1578241810'
'timestamp > 2020-01-02 AND timestamp <= 2020-01-05'
Optional, a unique ID of the program within the parent
project. If None, jobs will be listed across all programs within
the project.
created_after
retrieve jobs that were created after this date
or time.
created_before
retrieve jobs that were created after this date
or time.
has_labels
retrieve jobs that have labels on them specified by
this dict. If the value is set to *, filters having the label
regardless of the label value will be filtered. For example, to
query programs that have the shape 'label' and have the 'color'
label with value 'red' can be queried using:
{'color': 'red', 'shape': '*'}
execution_states
retrieve jobs that have an execution state that
is contained in execution_states. See
quantum.ExecutionStatus.State enum for accepted values.
executed_processor_ids
filters jobs by processor ID used for
execution. Matches any of provided IDs.
scheduled_processor_ids
filters jobs by any of provided
scheduled processor IDs.
Optional, a unique ID of the program within the parent
project. If None, jobs will be listed across all programs within
the project.
created_after
retrieve jobs that were created after this date
or time.
created_before
retrieve jobs that were created after this date
or time.
has_labels
retrieve jobs that have labels on them specified by
this dict. If the value is set to *, filters having the label
regardless of the label value will be filtered. For example, to
query programs that have the shape 'label' and have the 'color'
label with value 'red' can be queried using:
{'color': 'red', 'shape': '*'}
execution_states
retrieve jobs that have an execution state that
is contained in execution_states. See
quantum.ExecutionStatus.State enum for accepted values.
executed_processor_ids
filters jobs by processor ID used for
execution. Matches any of provided IDs.
scheduled_processor_ids
filters jobs by any of provided
scheduled processor IDs.
Returns a list of Processors that the user has visibility to in the current Engine project.
The names of these processors are used to
identify devices when scheduling jobs and gathering calibration metrics.
Returns a list of Processors that the user has visibility to in the current Engine project.
The names of these processors are used to
identify devices when scheduling jobs and gathering calibration metrics.
Returns a list of previously executed quantum programs.
Args
project_id
the id of the project
created_after
retrieve programs that were created after this date
or time.
created_before
retrieve programs that were created after this date
or time.
has_labels
retrieve programs that have labels on them specified by
this dict. If the value is set to *, filters having the label
regardless of the label value will be filtered. For example, to
query programs that have the 'shape' label and have the 'color'
label with value 'red' can be queried using:
Returns a list of previously executed quantum programs.
Args
project_id
the id of the project
created_after
retrieve programs that were created after this date
or time.
created_before
retrieve programs that were created after this date
or time.
has_labels
retrieve programs that have labels on them specified by
this dict. If the value is set to *, filters having the label
regardless of the label value will be filtered. For example, to
query programs that have the 'shape' label and have the 'color'
label with value 'red' can be queried using:
Only reservations owned by this project will be returned.
Args
project_id
A project_id of the parent Google Cloud Project.
processor_id
The processor unique identifier.
filter_str
A string for filtering quantum reservations.
The fields eligible for filtering are start_time and end_time
Examples:
start_time >= 1584385200: Reservation began on or after
the epoch time Mar 16th, 7pm GMT.
end_time >= 1483370475: Reservation ends on
or after Jan 2nd 2017 15:21:15
Only reservations owned by this project will be returned.
Args
project_id
A project_id of the parent Google Cloud Project.
processor_id
The processor unique identifier.
filter_str
A string for filtering quantum reservations.
The fields eligible for filtering are start_time and end_time
Examples:
start_time >= 1584385200: Reservation began on or after
the epoch time Mar 16th, 7pm GMT.
end_time >= 1483370475: Reservation ends on
or after Jan 2nd 2017 15:21:15
Runs a job with the given program and job information over a stream.
Sends the request over the Quantum Engine QuantumRunStream bidirectional stream, and returns
a future for the stream response. The future will be completed with a QuantumResult if
the job is successful; otherwise, it will be completed with a QuantumJob.
Args
project_id
A project_id of the parent Google Cloud Project.
program_id
Unique ID of the program within the parent project.
code
Properly serialized program code.
run_context
Properly serialized run context.
program_description
An optional description to set on the program.
program_labels
Optional set of labels to set on the program.
job_id
Unique ID of the job within the parent program.
priority
Optional priority to run at, 0-1000.
job_description
Optional description to set on the job.
job_labels
Optional set of labels to set on the job.
processor_id
Processor id for running the program.
run_name
A unique identifier representing an automation run for the
specified processor. An Automation Run contains a collection of
device configurations for a processor. If specified, processor_id
is required to be set.
snapshot_id
A unique identifier for an immutable snapshot reference.
A snapshot contains a collection of device configurations for the
processor.
device_config_name
An identifier used to select the processor configuration
utilized to run the job. A configuration identifies the set of
available qubits, couplers, and supported gates in the processor.
If specified, processor_id is required to be set.
Returns
A future for the job result, or the job if the job has failed.
Raises
ValueError
If the priority is not between 0 and 1000.
ValueError
If processor_id is not set.
ValueError
If only one of run_name and device_config_name are specified.
This will update a quantum reservation's starting time, ending time,
and list of allowlisted users. If any field is not filled, it will
not be updated.
Args
project_id
A project_id of the parent Google Cloud Project.
processor_id
The processor unique identifier.
reservation_id
Unique ID of the reservation in the parent project,
start
the new starting time of the reservation as a datetime object
end
the new ending time of the reservation as a datetime object
allowlisted_users
a list of emails that can use the reservation.
The empty list, [], will clear the allowlisted_users while None
will leave the value unchanged.
This will update a quantum reservation's starting time, ending time,
and list of allowlisted users. If any field is not filled, it will
not be updated.
Args
project_id
A project_id of the parent Google Cloud Project.
processor_id
The processor unique identifier.
reservation_id
Unique ID of the reservation in the parent project,
start
the new starting time of the reservation as a datetime object
end
the new ending time of the reservation as a datetime object
allowlisted_users
a list of emails that can use the reservation.
The empty list, [], will clear the allowlisted_users while None
will leave the value unchanged.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-08 UTC."],[],[]]