Base
Geometry
Class representing geometry of an atom arrangement.
Attributes:
Name | Type | Description |
---|---|---|
sites |
List[Tuple[float, float]]
|
Atom site arrangement |
filling |
List[int]
|
Which sites are filled |
parallel_decoder |
Optional[ParallelDecoder]
|
Decoder object for decoding Geometry object |
LocalTask
Bases: Task
Task
to use for local executions for simulation purposes..
RemoteTask
Bases: Task
Task
to use for remote executions to run the program on Quera
Quantum Computers.
Report
Report(data, metas, geos, name='')
Report is a helper class for organizing and analysing data
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 1
task_number
0 0.053 0.054
Source code in .venv/lib/python3.12/site-packages/bloqade/analog/task/base.py
234 235 236 237 238 239 240 |
|
markdown
property
markdown: str
Get the markdown representation of the dataframe
bitstrings
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 | Description | Default |
---|---|---|---|
filter_perfect_filling
|
bool
|
whether return will only contain perfect filling shots. Defaults to True. |
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:
Name | Type | Description |
---|---|---|
bitstrings |
list of ndarray
|
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:
|
Note
Note that nshots may vary between tasks if filter_perfect_filling is set to True.
Source code in .venv/lib/python3.12/site-packages/bloqade/analog/task/base.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
counts
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 | Description | Default |
---|---|---|---|
filter_perfect_filling
|
bool
|
whether return will only contain perfect filling shots. Defaults to True. |
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:
Name | Type | Description |
---|---|---|
counts |
list of OrderedDict[str, int]
|
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:
|
Note
Note that nshots may vary between tasks if filter_perfect_filling is set to True.
Source code in .venv/lib/python3.12/site-packages/bloqade/analog/task/base.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
|
list_param
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 | Default |
---|---|---|---|
field_name
|
str
|
variable name |
required |
Source code in .venv/lib/python3.12/site-packages/bloqade/analog/task/base.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
rydberg_densities
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 | Description | Default |
---|---|---|---|
filter_perfect_filling
|
bool
|
whether return will only contain perfect filling shots. Defaults to True. |
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:
Name | Type | Description |
---|---|---|
rydberg_densities |
Union[Series, DataFrame]
|
per-site rydberg density for each task as a pandas DataFrame or Series. For example:
|
Source code in .venv/lib/python3.12/site-packages/bloqade/analog/task/base.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
|
show
show()
Interactive Visualization of the Report
Source code in .venv/lib/python3.12/site-packages/bloqade/analog/task/base.py
426 427 428 429 430 431 |
|