![]() |
A processor available via the Quantum Engine API.
cirq.google.EngineProcessor(
project_id: str,
processor_id: str,
context: "engine_base.EngineContext",
_processor: Optional[qtypes.QuantumProcessor] = None
) -> None
Args | |
---|---|
project_id
|
A project_id of the parent Google Cloud Project. |
processor_id
|
Unique ID of the processor. |
context
|
Engine configuration and context to use. |
_processor
|
The optional current processor state. |
Attributes | |
---|---|
project_id
|
A project_id of the parent Google Cloud Project. |
processor_id
|
Unique ID of the processor. |
Methods
create_reservation
create_reservation(
start_time: datetime.datetime,
end_time: datetime.datetime,
whitelisted_users: Optional[List[str]] = None
)
Creates a reservation on this processor.
Args | |
---|---|
start_time
|
the starting date/time of the reservation. |
end_time
|
the ending date/time of the reservation. |
whitelisted_users
|
a list of emails that are allowed to send programs during this reservation (in addition to users with permission "quantum.reservations.use" on the project). |
engine
engine() -> "engine_base.Engine"
Returns the parent Engine object.
Returns | |
---|---|
The program's parent Engine. |
expected_down_time
expected_down_time() -> "Optional[datetime.datetime]"
Returns the start of the next expected down time of the processor, if set.
expected_recovery_time
expected_recovery_time() -> "Optional[datetime.datetime]"
Returns the expected the processor should be available, if set.
get_calibration
get_calibration(
calibration_timestamp_seconds: int
) -> cirq.google.Calibration
Retrieve metadata about a specific calibration run.
Params:
calibration_timestamp_seconds
: The timestamp of the calibration in seconds since epoch.
Returns | |
---|---|
The calibration data. |
get_current_calibration
get_current_calibration() -> Optional[cirq.google.Calibration
]
Returns metadata about the current calibration for a processor.
Returns | |
---|---|
The calibration data or None if there is no current calibration. |
get_device
get_device(
gate_sets: Iterable[cirq.google.SerializableGateSet
]
) -> "cirq.Device"
Returns a Device
created from the processor's device specification.
This method queries the processor to retrieve the device specification,
which is then use to create a SerializableDevice
that will validate
that operations are supported and use the correct qubits.
get_device_specification
get_device_specification() -> Optional[cirq.google.api.v2.device_pb2.DeviceSpecification
]
Returns a device specification proto for use in determining information about the device.
Returns | |
---|---|
Device specification proto if present. |
get_reservation
get_reservation(
reservation_id: str
)
Retrieve a reservation given its id.
get_schedule
get_schedule(
from_time: Union[None, datetime.datetime, datetime.timedelta] = datetime.timedelta(),
to_time: Union[None, datetime.datetime, datetime.timedelta] = datetime.timedelta(weeks=2),
time_slot_type: Optional[cirq.google.engine.client.quantum.enums.QuantumTimeSlot.TimeSlotType
] = None
) -> List[cirq.google.EngineTimeSlot
]
Retrieves the schedule for a processor.
The schedule may be filtered by time.
Time slot type will be supported in the future.
Args | |
---|---|
from_time
|
Filters the returned schedule to only include entries that end no earlier than the given value. Specified either as an absolute time (datetime.datetime) or as a time relative to now (datetime.timedelta). Defaults to now (a relative time of 0). Set to None to omit this filter. |
to_time
|
Filters the returned schedule to only include entries that start no later than the given value. Specified either as an absolute time (datetime.datetime) or as a time relative to now (datetime.timedelta). Defaults to two weeks from now (a relative time of two weeks). Set to None to omit this filter. |
time_slot_type
|
Filters the returned schedule to only include entries with a given type (e.g. maintenance, open swim). Defaults to None. Set to None to omit this filter. |
Returns | |
---|---|
Schedule time slots. |
health
health() -> str
Returns the current health of processor.
list_calibrations
list_calibrations(
earliest_timestamp_seconds: Optional[int] = None,
latest_timestamp_seconds: Optional[int] = None
) -> List[cirq.google.Calibration
]
Retrieve metadata about a specific calibration run.
Params:
earliest_timestamp_seconds
: The earliest timestamp of a calibration to return in UTC.latest_timestamp_seconds
: The latest timestamp of a calibration to return in UTC.
Returns | |
---|---|
The list of calibration data with the most recent first. |
list_reservations
list_reservations(
from_time: Union[None, datetime.datetime, datetime.timedelta] = datetime.timedelta(),
to_time: Union[None, datetime.datetime, datetime.timedelta] = datetime.timedelta(weeks=2)
) -> List[cirq.google.EngineTimeSlot
]
Retrieves the reservations from a processor.
Only reservations from this processor and project will be returned. The schedule may be filtered by starting and ending time.
Args | |
---|---|
from_time
|
Filters the returned reservations to only include entries that end no earlier than the given value. Specified either as an absolute time (datetime.datetime) or as a time relative to now (datetime.timedelta). Defaults to now (a relative time of 0). Set to None to omit this filter. |
to_time
|
Filters the returned reservations to only include entries that start no later than the given value. Specified either as an absolute time (datetime.datetime) or as a time relative to now (datetime.timedelta). Defaults to two weeks from now (a relative time of two weeks). Set to None to omit this filter. |
Returns | |
---|---|
A list of reservations. |
remove_reservation
remove_reservation(
reservation_id: str
)
supported_languages
supported_languages() -> List[str]
Returns the list of processor supported program languages.
update_reservation
update_reservation(
reservation_id: str,
start_time: datetime.datetime = None,
end_time: datetime.datetime = None,
whitelisted_users: List[str] = None
)
Updates a reservation with new information.
Updates a reservation with a new start date, end date, or list of additional users. For each field, it the argument is left as None, it will not be updated.