-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
13 changed files
with
2,750 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
The OpenQASM 2 importer previously would output incorrect :class:`.Gate` instances for gate | ||
calls referring to a ``gate`` definition that followed a prior ``gate`` definition that was | ||
being treated as a built-in operation by a :class:`~.qasm2.CustomInstruction`. See | ||
`#13339 <https://github.com/Qiskit/qiskit/issues/13339>`__ for more detail. |
32 changes: 32 additions & 0 deletions
32
releasenotes/notes/sparse-observable-7de70dcdf6962a64.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
features_quantum_info: | ||
- | | ||
A new observable class has been added. :class:`.SparseObservable` represents observables as a | ||
sum of terms, similar to :class:`.SparsePauliOp`, but with two core differences: | ||
1. Each complete term is stored as (effectively) a series of ``(qubit, bit_term)`` pairs, | ||
without storing qubits that undergo the identity for that term. This significantly improves | ||
the memory usage of observables such as the weighted sum of Paulis :math:`\sum_i c_i Z_i`. | ||
2. The single-qubit term alphabet is overcomplete for the operator space; it can represent Pauli | ||
operators (like :class:`.SparsePauliOp`), but also projectors onto the eigenstates of the | ||
Pauli operators, like :math:`\lvert 0\rangle\langle 0\rangle`. Such projectors can be | ||
measured on hardware equally as efficiently as their corresponding Pauli operator, but | ||
:class:`.SparsePauliOp` would require an exponential number of terms to represent | ||
:math:`{\lvert0\rangle\langle0\rvert}^{\otimes n}` over :math:`n` qubits, while | ||
:class:`.SparseObservable` needs only a single term. | ||
You can construct and manipulate :class:`.SparseObservable` using an interface familiar to users | ||
of :class:`.SparsePauliOp`:: | ||
from qiskit.quantum_info import SparseObservable | ||
obs = SparseObservable.from_sparse_list([ | ||
("XZY", (2, 1, 0), 1.5j), | ||
("+-", (100, 99), 0.5j), | ||
("01", (50, 49), 0.5), | ||
]) | ||
:class:`.SparseObservable` is not currently supported as an input format to the primitives | ||
(:mod:`qiskit.primitives`), but we expect to expand these interfaces to include them in the | ||
future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.