qiskit_noise_learning.data.ObservableData
class qiskit_noise_learning.data.ObservableData(dataset: Dataset)
Bases: LeveledData
A collection of calculated expectation values.
This class is a wrapper around an XArray Dataset, containing the following data:
-
Data variables:
observable_values: Observables computed from singleInstructionSequenceandPathpairs at a given fragment depth, separated by randomizations. Has dimensions("observable", "randomization").np.nanvalues are assumed to be due to raggedness of the"randomization"dimension for different observables.time_lbs: Lower bound on data acquisition times, with dimensions("observable", "randomization"), and of type"datetime64[us]".time_ubs: Upper bound on data acquisition times, with dimensions("observable", "randomization"), and of type"datetime64[us]".
-
Coordinates:
unbound_path: The unbound path (withfragment_depth=None) for each observable, along dimension("observable",), of typePath.fragment_depth: Integer array of fragment depths along dimension("observable",).
Parameters
dataset – A dataset with the above formatting.
__init__
__init__(dataset: Dataset)
Methods
Column 1 | Column 2 |
|---|---|
__init__(dataset) | |
filter_time(lb, ub) | Filter to data gathered within the time bounds. |
from_arrays(unbound_paths, fragment_depths, ...) | Instantiate from data specified as arrays. |
merge(other) | Merge observable data into a single instance. |
Attributes
Column 1 | Column 2 |
|---|---|
dataset | |
observable_values | Observables data array. |
time_lbs | Time lower bounds data array. |
time_ubs | Time upper bounds data array. |
from_arrays
classmethod from_arrays(unbound_paths: list[Path], fragment_depths: ndarray[int], observable_values: ndarray[float64], time_lbs: ndarray[datetime64], time_ubs: ndarray[datetime64])
Instantiate from data specified as arrays.
Parameters
- unbound_paths – The unbound paths corresponding to the observables.
- fragment_depths – The fragment depths for each observable.
- observable_values – A 2d numpy array of
floatswith axes("observable", "randomization"). - time_lbs – A lower bound on the data collection time for each observable and randomization. Has axes
("observable", "randomization"). - time_ubs – Upper bounds on the data collection time for each observable and randomization. Has axes
("observable", "randomization").
observable_values
Type: DataArray
Observables data array.
time_lbs
Type: DataArray
Time lower bounds data array.
time_ubs
Type: DataArray
Time upper bounds data array.
merge
merge(other: Self) → Self
Merge observable data into a single instance.
Parameters
other – The other observable data set.
Returns
The merged data.
filter_time
filter_time(lb: datetime64, ub: datetime64) → Self
Filter to data gathered within the time bounds.
Parameters
- lb – The time lower bound (inclusive).
- ub – The time upper bound (inclusive).
Returns
The time filtered version of self.