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 24, 2024
1 parent 68b5c56 commit 6389829
Show file tree
Hide file tree
Showing 2 changed files with 720 additions and 21 deletions.
Loading

0 comments on commit 6389829

Please sign in to comment.