Release 0.8.1¶
New features
The
catalyst.mitigate_with_zneerror mitigation compilation pass now supports the option to fold gates locally as well as the existing method of globally. (#1006) (#1129)While global folding applies the scale factor by forming the inverse of the entire quantum circuit (without measurements) and repeating the circuit with its inverse, local folding instead inserts per-gate folding sequences directly in place of each gate in the original circuit.
For example,
import jax import pennylane as qml from catalyst import qjit, mitigate_with_zne from pennylane.transforms import exponential_extrapolate dev = qml.device("lightning.qubit", wires=4, shots=5) @qml.qnode(dev) def circuit(): qml.Hadamard(wires=0) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliY(wires=0)) @qjit(keep_intermediate=True) def mitigated_circuit(): s = jax.numpy.array([1, 2, 3]) return mitigate_with_zne( circuit, scale_factors=s, extrapolate=exponential_extrapolate, folding="local-all" # "local-all" for local on all gates or "global" for the original method (default being "global") )()
>>> circuit() >>> mitigated_circuit()
Improvements
Fixes an issue where certain JAX linear algebra functions from
jax.scipy.linalggave incorrect results when invoked from within a qjit block, and adds full support for otherjax.scipy.linalgfunctions. (#1097)The supported linear algebra functions include, but are not limited to:
``jax.scipy.linalg.cholesky` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.cholesky.html>`_
``jax.scipy.linalg.expm` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.expm.html>`_
``jax.scipy.linalg.funm` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.funm.html>`_
``jax.scipy.linalg.hessenberg` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.hessenberg.html>`_
``jax.scipy.linalg.lu` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.lu.html>`_
``jax.scipy.linalg.lu_solve` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.lu_solve.html>`_
``jax.scipy.linalg.polar` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.polar.html>`_
``jax.scipy.linalg.qr` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.qr.html>`_
``jax.scipy.linalg.schur` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.schur.html>`_
``jax.scipy.linalg.solve` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.solve.html>`_
``jax.scipy.linalg.sqrtm` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.sqrtm.html>`_
``jax.scipy.linalg.svd` <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.linalg.svd.html>`_
Breaking changes
The argument
scale_factorsofmitigate_with_znefunction now follows the proper literature definition. It now needs to be a list of positive odd integers, as we don’t support the fractional part. (#1120)
Bug fixes
Those functions calling the
gather_pprimitive (likejax.scipy.linalg.expm) can now be used in multiple qjits in a single program. (#1096)
Contributors
This release contains contributions from (in alphabetical order):
Joey Carter, Alessandro Cosentino, Paul Haochen Wang, David Ittah, Romain Moyard, Daniel Strano, Raul Torres.