qcs_sdk.qpu

class QPUResultData:

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 region's 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

def to_raw_readout_data(self, /):

Get the raw readout data as a flattened structure.

def to_register_map(self, /):

Convert into a [RegisterMap].

The [RegisterMatrix] for each register will be constructed such that each row contains all the final values in the register for a single shot.

Errors

Returns a [RegisterMatrixConversionError] if the execution data for any of the registers would result in a jagged matrix. [QpuResultData] data is captured per measure, meaning a value is returned for every measure to a memory reference, not just once per shot.

This is often the case in programs that use mid-circuit measurement or dynamic control flow, where measurements to the same memory reference might occur multiple times in a shot, or be skipped conditionally. In these cases, building a rectangular [RegisterMatrix] would necessitate making assumptions about the data that could skew the data in undesirable ways. Instead, it's recommended to manually build a matrix from [QpuResultData] that accurately selects the last value per-shot based on the program that was run.

memory_values

The final contents of each memory region, keyed on region name.

mappings

Mappings of a memory region (ie. "ro[0]") to its key name in readout_values (ie. "q0").

readout_values

Mapping of a readout values identifier (ie. "q0") to a set of ReadoutValues.

class RawQPUReadoutData:

A wrapper type for data returned by the QPU in a more flat structure than [QpuResultData] offers. This makes it more convenient to work with the data if you don't care what type of number the readout values for each register contains.

mappings
readout_values
memory_values
class ReadoutValues:

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.

def inner(self, /):
class ReadoutValues.Integer(ReadoutValues):
Inherited Members
ReadoutValues
inner
Integer
Real
Complex
class ReadoutValues.Real(ReadoutValues):
Inherited Members
ReadoutValues
inner
Integer
Real
Complex
class ReadoutValues.Complex(ReadoutValues):
Inherited Members
ReadoutValues
inner
Integer
Real
Complex
class MemoryValues:

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.

def inner(self, /):
class MemoryValues.Binary(MemoryValues):
Inherited Members
MemoryValues
inner
Binary
Integer
Real
class MemoryValues.Integer(MemoryValues):
Inherited Members
MemoryValues
inner
Binary
Integer
Real
class MemoryValues.Real(MemoryValues):
Inherited Members
MemoryValues
inner
Binary
Integer
Real
class ListQuantumProcessorsError(qcs_sdk.QcsSdkError):

API Errors encountered when trying to list available quantum processors.

def list_quantum_processors(client=None, timeout=None):

Returns all available Quantum Processor (QPU) IDs.

Parameters
  • client: The Qcs client 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.
def list_quantum_processors_async(client=None, timeout=None):

Returns all available Quantum Processor (QPU) IDs.

Parameters
  • client: The Qcs client 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.