|
| 1 | +--- |
| 2 | +features_quantum_info: |
| 3 | + - | |
| 4 | + A new observable class has been added. :class:`.SparseObservable` represents observables as a |
| 5 | + sum of terms, similar to :class:`.SparsePauliOp`, but with two core differences: |
| 6 | +
|
| 7 | + 1. Each complete term is stored as (effectively) a series of ``(qubit, bit_term)`` pairs, |
| 8 | + without storing qubits that undergo the identity for that term. This significantly improves |
| 9 | + the memory usage of observables such as the weighted sum of Paulis :math:`\sum_i c_i Z_i`. |
| 10 | +
|
| 11 | + 2. The single-qubit term alphabet is overcomplete for the operator space; it can represent Pauli |
| 12 | + operators (like :class:`.SparsePauliOp`), but also projectors onto the eigenstates of the |
| 13 | + Pauli operators, like :math:`\lvert 0\rangle\langle 0\rangle`. Such projectors can be |
| 14 | + measured on hardware equally as efficiently as their corresponding Pauli operator, but |
| 15 | + :class:`.SparsePauliOp` would require an exponential number of terms to represent |
| 16 | + :math:`{\lvert0\rangle\langle0\rvert}^{\otimes n}` over :math:`n` qubits, while |
| 17 | + :class:`.SparseObservable` needs only a single term. |
| 18 | +
|
| 19 | + You can construct and manipulate :class:`.SparseObservable` using an interface familiar to users |
| 20 | + of :class:`.SparsePauliOp`:: |
| 21 | +
|
| 22 | + from qiskit.quantum_info import SparseObservable |
| 23 | +
|
| 24 | + obs = SparseObservable.from_sparse_list([ |
| 25 | + ("XZY", (2, 1, 0), 1.5j), |
| 26 | + ("+-", (100, 99), 0.5j), |
| 27 | + ("01", (50, 49), 0.5), |
| 28 | + ]) |
| 29 | +
|
| 30 | + :class:`.SparseObservable` is not currently supported as an input format to the primitives |
| 31 | + (:mod:`qiskit.primitives`), but we expect to expand these interfaces to include them in the |
| 32 | + future. |
0 commit comments