Hi everyone, we’re excited to announce PennyLane version 0.4.0.
This is a major release, that contains some great new features and improvements. These include:
Changes in how we request expectation values.
qml.expval()is now a top-level function, and is no longer a package of classes. To request an expectation value of an observable, the following syntax is now used:
import pennylane as qml from pennylane import expval dev = qml.device("default.qubit", wires=2) @qml.qnode(dev) def circuit(x, y): qml.RX(x, wires=0) qml.CNOT(wires=(0, 1)) return expval(qml.PauliZ(0)), expval(qml.PauliX(1))
For now, the existing
qml.expval.Observableinterface continues to work, but will raise a deprecation warning.
QNodes can now return the variance of observables, via the top-level
qml.var()function. To support this on plugin devices, there is a new
Device.varmethod. We also support analytic gradients on hardware of variance values!
Adds support for multi-qubit observables using the
New QML Templates
New random initialization functions supporting the templates available in the new submodule
Added various quantum embedding strategies
default.qubitplugin now uses
np.tensordotwhen applying quantum operations and evaluating expectations, resulting in significant speedup!
See the full release notes for more details on the latest PennyLane release.
As always, this release would not have been possible without all the help from our contributors: