qiskit_noise_learning.analysis.LinearSystemData
class qiskit_noise_learning.analysis.LinearSystemData(A: ndarray, b: ndarray, sigma_b: ndarray, row_diagnostics: Mapping[str, ndarray], row_index_map: Mapping[RowIndex, int], column_index_map: Mapping[ColumnIndex, int], time_lb: datetime64, time_ub: datetime64)
Bases: Generic[RowIndex, ColumnIndex]
The linear system to solve and metadata in raw format.
A linear system A @ x = b with axis labels and metadata.
The row and column labels are of arbitrary hashable types: this class carries no assumptions about what a row or column denotes. In the systems built by from_fit() the rows are Path objects and the columns are the fidelity model’s parameter labels.
The index maps are the authoritative record of how labels correspond to positions in A. Anything that needs to align a label-keyed quantity with the arrays should index through row_index_map or column_index_map rather than rebuilding the correspondence from row_labels or column_labels.
Parameters
- A – The matrix with shape
(m, n). - b – The target vector length
m. - sigma_b – Statistical
1-sigma uncertainty onbper row, with lengthm. - row_diagnostics – Named per-row quantities recorded by the stages that produced
b, each an array of lengthmholdingnanfor rows the quantity is undefined for. Keys are the metadata names used upstream; seefrom_fit(). - row_index_map – A mapping from row labels to their integer row position in
A. - column_index_map – A mapping from column labels to their integer column position in
A. - time_lb – Earliest time bound across the rows.
- time_ub – Latest time bound across the rows.
__init__
__init__(A: ndarray, b: ndarray, sigma_b: ndarray, row_diagnostics: Mapping[str, ndarray], row_index_map: Mapping[RowIndex, int], column_index_map: Mapping[ColumnIndex, int], time_lb: datetime64, time_ub: datetime64) → None
Methods
Column 1 | Column 2 |
|---|---|
__init__(A, b, sigma_b, row_diagnostics, ...) | |
from_fit(fit) | Build the linear system arrays from a Fit. |
Attributes
Column 1 | Column 2 |
|---|---|
column_labels | Column labels, ordered by their column position in A. |
row_labels | Row labels, ordered by their row position in A. |
A | |
b | |
sigma_b | |
row_diagnostics | |
row_index_map | |
column_index_map | |
time_lb | |
time_ub |
row_labels
Type: list[RowIndex]
Row labels, ordered by their row position in A.
column_labels
Type: list[ColumnIndex]
Column labels, ordered by their column position in A.
from_fit
classmethod from_fit(fit: Fit) → LinearSystemData[Path, Hashable]
Build the linear system arrays from a Fit.
Rows are the Path objects of the AggregatedObservableData, columns are the fidelity model’s parameter labels, and row_diagnostics holds every real-valued per-observable metadata entry under the name the producing stage used — for instance "reduced_chi_squared" from CurveFitObservables.
Warns
UserWarning – If any row’s uncertainty is non-positive or non-finite, giving those rows’ positions in row_labels. Such a row carries no usable statistical weight, and how it is treated is up to the solver.