qcs_sdk.qpu
The QPU module contains the API for interacting with Rigetti Quantum Processing Units (QPUs).
🔨 This page is under construction and the documentation for some submodules is missing. In the meantime, you can find documentation in the the type hints.
Encapsulates data returned from the QPU after executing a job.
QPUResultData
contains "mappings", which map declared memory regions
in a program (ie. "ro[0]") to that regions readout key in QPUResultData.readout_values
.
readout_values
maps those readout keys to the values emitted for that region
across all shots.
Read more about QPU readout data in the QCS Documentation
Get a copy of this result data flattened into a RawQPUReadoutData
. This reduces
the contained data down to primitive types, offering a simpler structure at the
cost of the type safety provided by ReadoutValues
and MemoryValues
.
Get mapping of a memory region (ie. "ro") to the final contents of that memory region.
Get the mappings of a readout values identifier (ie. "q0") to a set of ReadoutValues
Get the mappings of a memory region (ie. "ro[0]") to it's key name in QPUResultData.readout_values
Encapsulates data returned from the QPU after executing a job. Compared to
QPUResultData.readout_values
, the readout values in this class are returned as lists
of numbers instead of values wrapped by the ReadoutValues
class.
Get mapping of a memory region (ie. "ro") to the final contents of that memory region.
A row of readout values from the QPU. Each row contains all the values emitted to a memory reference across all shots. There is a variant for each possible type the list of readout values could be.
Variants:
integer
: Corresponds to the QuilBIT
,OCTET
, orINTEGER
types.real
: Corresponds to the QuilREAL
type.complex
: Corresponds to readout values containing complex numbers
Methods (each per variant):
- ``is_*``: if the underlying values are that type.
- ``as_*``: if the underlying values are that type, then those values, otherwise ``None``.
- ``to_*``: the underlying values as that type, raises `ValueError` if they are not.
- ``from_*``: wrap underlying values as this enum type.
Construct a new ReadoutValues
from a list of values.
A row of data containing the contents of a memory region at the end of a job. There is a variant for each possible type the memory region could be.
Variants:
binary
: Corresponds to the QuilBIT
andOCTET
types.integer
: Corresponds to the QuilINTEGER
types.real
: Corresponds to the QuilRE
AL`` type.
Methods (each per variant):
is_*
: if the underlying values are that type.as_*
: if the underlying values are that type, then those values, otherwiseNone
.to_*
: the underlying values as that type, raisesValueError
if they are not.from_*
: wrap underlying values as this enum type.
Construct a new ReadoutValues
from a list of values.
A request to list available Quantum Processors failed.
Inherited Members
- builtins.RuntimeError
- RuntimeError
- builtins.BaseException
- with_traceback
- add_note
- args
Returns all available Quantum Processor (QPU) IDs.
Parameters
- client: The
qcs_sdk.client.QCSClient
to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration - timeout: Maximum duration to wait for API calls to complete, in seconds.
Raises
- ListQuantumProcessorsError: If the request to list available QPU IDs failed.
Returns all available Quantum Processor IDs.
(async analog of list_quantum_processors
)
Parameters
- client: The
qcs_sdk.client.QCSClient
to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration - timeout: Maximum duration to wait for API calls to complete, in seconds.
Raises
- ListQuantumProcessorsError: If the request to list available QPU IDs failed.