Release 0.8.0
See the release notes on the PennyLane website for code examples and more details.
New features since last release
-
Added a quantum chemistry package,
pennylane.qchem
, which supports integration with OpenFermion, Psi4, PySCF, and OpenBabel. Functions and classes for creating and solving VQE
problems have also been addded. (#453) (#467)Features include:
- Generate the qubit Hamiltonians directly starting with the atomic structure of the molecule.
- Calculate the mean-field (Hartree-Fock) electronic structure of molecules.
- Allow to define an active space based on the number of active electrons and active orbitals.
- Perform the fermionic-to-qubit transformation of the electronic Hamiltonian by
using different functions implemented in OpenFermion. - Convert OpenFermion's QubitOperator to a Pennylane
Hamiltonian
class. - Perform a Variational Quantum Eigensolver (VQE) computation with this Hamiltonian in PennyLane.
qml.Hamiltonian
: a lightweight class for representing qubit Hamiltoniansqml.VQECost
: a class for quickly constructing a differentiable cost function
given a circuit ansatz, Hamiltonian, and one or more devices
Check out the quantum chemistry quickstart, as well the quantum chemistry and VQE tutorials.
-
Added a circuit drawing feature that provides a text-based representation of a QNode instance. It can be invoked via
qnode.draw()
. The user can specify to display variable names instead of variable values and choose either an ASCII or Unicode charset. (#446) -
Added
QAOAEmbedding
and its parameter initialization as a new trainable template.
(#442) -
Added the
qml.probs()
measurement function, allowing QNodes to differentiate variational circuit probabilities on simulators and hardware. QNodes that return probabilities fully support autodifferentiation. (#432) -
Added the convenience load functions
qml.from_pyquil
,qml.from_quil
andqml.from_quil_file
that convert pyQuil objects and Quil code to PennyLane templates. This feature requires version 0.8 or above of the PennyLane-Forest plugin. (#459) -
Added a
qml.inv
method that inverts templates and sequences of Operations. Added a@qml.template
decorator that makes templates return the queued Operations. (#462) -
Added the
QNodeCollection
container class, that allows independent QNodes to be stored and evaluated simultaneously. Experimental support for asynchronous evaluation of contained QNodes is provided with theparallel=True
keyword argument. (#466) -
Added a high level
qml.map
function, that maps a quantum circuit template over a list of observables or devices, returning aQNodeCollection
. (#466) -
Added high level
qml.sum
,qml.dot
,qml.apply
functions that act on QNode collections.qml.sum
andqml.dot
take the sum of a QNode collection, and a dot product of tensors/arrays/QNode collections, respectively.(#466)
Breaking changes
- Deprecated the old-style
QNode
such that only the new-styleQNode
and its syntax can be used, moved all related files from thepennylane/beta
folder topennylane
. (#440)
Improvements
-
Added the
Tensor.prune()
method and theTensor.non_identity_obs
property for extracting non-identity instances from the observables making up aTensor
instance. (#498) -
Renamed the
expt.tensornet
andexpt.tensornet.tf
devices todefault.tensor
anddefault.tensor.tf
. (#495) -
Added a serialization method to the
CircuitGraph
class that is used to create a unique hash for each quantum circuit graph. (#470) -
Added the
Observable.eigvals
method to return the eigenvalues of observables. (#449) -
Added the
Observable.diagonalizing_gates
method to return the gates that diagonalize an observable in the computational basis. (#454) -
Added the
Operator.matrix
method to return the matrix representation of an operator in the computational basis. (#454) -
Added a
QubitDevice
class which implements common functionalities of plugin devices such that plugin devices can rely on these implementations. The newQubitDevice
includes a newexecute
method, which allows for more convenient plugin design. As a result, the way samples are generated on qubit based devices has been unified. (#461) (#452) (#473) -
Improved documentation of
AmplitudeEmbedding
andBasisEmbedding
templates. (#441) (#439) -
Codeblocks in the documentation now have a 'copy' button for easily copying examples. (#437)
Documentation
- Update the developers plugin guide to use QubitDevice. (#483)
Bug fixes
- Fixed a bug in
CVQNode._pd_analytic
, where non-descendant observables were not Heisenberg-transformed before evaluating the partial derivatives when using the order-2 parameter-shift method, resulting in an erroneous Jacobian for some circuits. (#433)
Contributors
This release contains contributions from (in alphabetical order):
Juan Miguel Arrazola, Ville Bergholm, Alain Delgado Gran, Olivia Di Matteo, Theodor Isacsson, Josh Izaac, Soran Jahangiri, Nathan Killoran, Johannes Jakob Meyer, Zeyue Niu, Maria Schuld, Antal Száva.