Skip to content

bloqade.analog.task.base.Report

← Module overview

classReportsource

bloqade.analog.task.base.Report

Report is a helper class for organizing and analysing data

class Report(data, metas, geos, name='')

When you’ve retrieved your results from either emulation or hardware you can generate a .report():

report = results.report()

For the examples below we analyze the results of a two atom program.

The report contains useful information such as:

The raw bitstrings measured per each execution of the program

>>> report.bitstrings()
[array([[1, 1],
[1, 1],
[1, 1],
...,
[1, 1],
[1, 1],

The number of times each unique bitstring occurred:

>>> report.counts()
[OrderedDict([('11', 892), ('10', 59), ('01', 49)])]

The Rydberg Density for each atom

>>> report.rydberg_densities()
0 1
task_number
0 0.053 0.054

Parameters

NameTypeDefaultDescription
data—required
metas—required
geos—required
name—''

Attributes

NameTypeDefaultDescription
dataframepd.DataFramedata
metasList[Dict]metas
geosList[Geometry]geos
namestrname + ' ' + str(datetime.datetime.now())

methodlist_paramsource

bloqade.analog.task.base.Report.list_param

def list_param(field_name: str) -> List[Union[Number, None]]

List the parameters associate with the given variable field_name for each tasks.

Parameters

NameTypeDescription
field_namestrvariable name

Returns

List[Union[Number, None]]

source

propertymarkdownsource

bloqade.analog.task.base.Report.markdown

markdown: str

Get the markdown representation of the dataframe

source

methodbitstringssource

bloqade.analog.task.base.Report.bitstrings

Signature
def bitstrings(filter_perfect_filling: bool = True, clusters: Union[tuple[int, int], List[tuple[int, int]]] = []) -> List[NDArray]

Get the bitstrings from the data.

Parameters

NameTypeDefaultDescription
filter_perfect_fillingboolTruewhether return will only contain perfect filling shots. Defaults to True.
clustersUnion[tuple[int, int], List[tuple[int, int]]][](tuple[int, int], Sequence[Tuple[int, int]]): cluster index to filter shots from. If none are provided all clusters are used, defaults to [].

Returns

list of ndarraybitstrings: list corresponding to each task in the report. Each element is an ndarray of shape (nshots, nsites) where nshots is the number of shots for the task and nsites is the number of sites in the task. For example: ```python3 [array([[1, 1], [1, 1], [1, 1], ..., [1, 1], [1, 1], [1, 0]], dtype=int8)] ```

Note

Note that nshots may vary between tasks if filter_perfect_filling is set to True.

source

methodcountssource

bloqade.analog.task.base.Report.counts

Signature
def counts(filter_perfect_filling: bool = True, clusters: Union[tuple[int, int], List[tuple[int, int]]] = []) -> List[OrderedDict[str, int]]

Get the counts of unique bit strings.

Parameters

NameTypeDefaultDescription
filter_perfect_fillingboolTruewhether return will only contain perfect filling shots. Defaults to True.
clustersUnion[tuple[int, int], List[tuple[int, int]]][](tuple[int, int], Sequence[Tuple[int, int]]): cluster index to filter shots from. If none are provided all clusters are used, defaults to [].

Returns

list of OrderedDict[str, int]counts: list corresponding to each task in the report. Each element is an ndarray of shape (nshots, nsites) where nshots is the number of shots for the task and nsites is the number of sites in the task. For example: ```python [OrderedDict([('11', 892), ('10', 59), ('01', 49)])] ```

Note

Note that nshots may vary between tasks if filter_perfect_filling is set to True.

source

methodrydberg_densitiessource

bloqade.analog.task.base.Report.rydberg_densities

Signature
def rydberg_densities(filter_perfect_filling: bool = True, clusters: Union[tuple[int, int], List[tuple[int, int]]] = []) -> Union[pd.Series, pd.DataFrame]

Get rydberg density for each task.

Parameters

NameTypeDefaultDescription
filter_perfect_fillingboolTruewhether return will only contain perfect filling shots. Defaults to True.
clustersUnion[tuple[int, int], List[tuple[int, int]]][](tuple[int, int], Sequence[Tuple[int, int]]): cluster index to filter shots from. If none are provided all clusters are used, defaults to [].

Returns

Union[pd.Series, pd.DataFrame]rydberg_densities: per-site rydberg density for each task as a pandas DataFrame or Series. For example: ```python 0 1 task_number 0 0.053 0.054 ```

source

methodshowsource

bloqade.analog.task.base.Report.show

def show()

Interactive Visualization of the Report

source