Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add iterator-access methods to
SparseObservable
(#13370)
* Add iterator-access methods to `SparseObservable` This adds a new related class, `SparseObservable.Term` to be the item type of the iteration methods, and imbibes it with the simplest mathematical binary relations with `SparseObservable` as the other operand. For some reason, in my head, the methods to convert terms and observables to their corresponding Pauli basis are related to iteration? The `SparseObservable.pauli_bases` and `SparseObservable.Term.pauli_base` methods perform a similar bitwise trick to do this reduction as exemplified in the documentation, but return the other `quantum_info`-native classes `PauliList` and `Pauli`, respectively. These methods are expected to be used by the primitives. * Improve documentation * Return `SparseObservable` from sequence indices
- Loading branch information