Skip to content

Commit

Permalink
Add iterator-access methods to SparseObservable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jakelishman committed Oct 30, 2024
1 parent 0bc6662 commit 0aa0080
Show file tree
Hide file tree
Showing 2 changed files with 699 additions and 21 deletions.
Loading

0 comments on commit 0aa0080

Please sign in to comment.