BitStrings
- class pulser.backend.BitStrings(*, evaluation_times=None, num_shots=None, one_state=None, tag_suffix=None)
Bases:
ObservableStores 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 thedefault_evaluation_timesof the backend’sEmulationConfig.num_shots (
int|None, default:None) – How many bitstrings to sample each time this observable is computed. If left as None, will use default_num_shots of the backend’sEmulationConfig.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
default_aggregation_methodHow many bitstrings to sample each time this observable is computed.
Label for the observable, used to index the Results object.
A universal unique identifier for this instance.
Methods
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 num_shots: int | None
How many bitstrings to sample each time this observable is computed.
Warning
The default value for this parameter was changed from 1000 to None in Pulser v1.7. When left as None, it now relies on EmulationConfig.default_num_shots to decide how many shots to take.
- 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.