Skip to content

Catalyst v0.8.1

Compare
Choose a tag to compare
@rauletorresc rauletorresc released this 12 Sep 02:11
2c45243

New features

  • The catalyst.mitigate_with_zne error 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

Breaking changes

  • The argument scale_factors of mitigate_with_zne function 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_p primitive (like jax.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.