Skip to content
Pasqal Documentation

BitStrings

class pulser.backend.BitStrings(*, evaluation_times=None, num_shots=1000, one_state=None, tag_suffix=None)

Bases: Observable

Stores bitstrings sampled from the state at the evaluation times.

Error rates are taken from the NoiseModel passed to the backend via the EmulationConfig. The bitstrings are stored as a Counter[str].

Parameters:
  • evaluation_times (Sequence[float] | None, default: None) – The relative times at which to sample bitstrings. If left as None, uses the default_evaluation_times of the backend’s EmulationConfig.

  • num_shots (int, default: 1000) – How many bitstrings to sample each time this observable is computed.

  • one_state (Literal['u', 'd', 'r', 'g', 'h', 'x'] | Literal['0', '1'] | None, default: None) – The eigenstate that measures to 1. Can be left undefined if the state’s eigenstates form a known eigenbasis with a defined “one state”.

  • tag_suffix (str | None, default: None) – An optional suffix to append to the tag. Needed if multiple instances of the same observable are given to the same EmulationConfig.

Attributes

tag

Label for the observable, used to index the Results object.

uuid

A universal unique identifier for this instance.

Methods

apply

Calculates the observable to store in the Results.

Signatures

apply(*, config, state, **kwargs)

Calculates the observable to store in the Results.

Return type:

Counter[str]

property tag: str

Label for the observable, used to index the Results object.

Within a Results instance, all computed observables must have different tags.

Returns:

The tag of the observable.

property uuid: UUID

A universal unique identifier for this instance.