-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Milestone
Description
In ObservablesArray
, each item is a mapping from Pauli strings to coefficients. We want to replace this internal representation with objects of type SparseObservable
.
- Extend
ObservableLike
to includeSparseObservable
. -
ObservablesArray
andEstimatorPub
will have a new Boolean member namedallow_projections
, whose default value will beFalse
. Edit: not sure that we need it. - The method
coerce_observable
will take care that entries ofObservablesArrayLike._array
will all be of typeSparseObservable
. It will also callSparseObservable.simplify
for every observable, and raise an error if some of the observables contain projections andallow_projections
isFalse
. - The methods
__array__
,__getitem__
, andtolist
will return mappings, as today. Their alphabet will be extended toIXYZ01+-lr
. -
__repr__
will return the same string as it does now. - Write new methods
get_sparse_observable(index)
andsparse_observable_array
, which will be the equivalents of__getitem__
and__array__
, returning sparse observables instead of mappings. - Write a new method
apply_layout
, which will simply callapply_layout
for every observable. - Make
BackendEstimatorV2
andStatevectorEstimator
support projections (this one is not for 2.1.0, and in fact deserves a separate issue).