bloqade.analog.task.base.Report
classReport¶source
bloqade.analog.task.base.Report
Report is a helper class for organizing and analysing data
class Report(data, metas, geos, name='')Analyzing Results
Section titled “Analyzing Results”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 1task_number0 0.053 0.054Parameters
| Name | Type | Default | Description |
|---|---|---|---|
data | — | required | |
metas | — | required | |
geos | — | required | |
name | — | '' |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
dataframe | pd.DataFrame | data | |
metas | List[Dict] | metas | |
geos | List[Geometry] | geos | |
name | str | name + ' ' + str(datetime.datetime.now()) |
methodlist_param¶source
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
| Name | Type | Description |
|---|---|---|
field_name | str | variable name |
Returns
List[Union[Number, None]]
propertymarkdown¶source
bloqade.analog.task.base.Report.markdown
methodbitstrings¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
filter_perfect_filling | bool | True | whether return will only contain perfect filling shots. Defaults to True. |
clusters | Union[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.
sourcemethodcounts¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
filter_perfect_filling | bool | True | whether return will only contain perfect filling shots. Defaults to True. |
clusters | Union[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.
sourcemethodrydberg_densities¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
filter_perfect_filling | bool | True | whether return will only contain perfect filling shots. Defaults to True. |
clusters | Union[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 ```
methodshow¶source
bloqade.analog.task.base.Report.show