PennyLane has released v0.32, introducing new features and improvements. The update includes a new online library for browsing datasets, the ability to encode matrices using a linear combination of unitaries, and enhanced logging capabilities. Quantum chemistry calculations can now accept more input states, and qubits can be reused and reset after mid-circuit measurements. The release includes various improvements and optimisations, such as PennyLane-styled circuit diagrams and plots. The update was made possible by the hard work of the development team and contributors, including Thomas Bromley and Isaac De Vlugt.
Enhanced Dataset Functionality
PennyLane has improved its dataset functionality. Initially, the curated datasets module was only accessible through Python’s qml.data
methods. Now, an online library has been introduced to make it easier for users to browse available datasets and find what they need. This new feature complements the existing datasets functionality in PennyLane.
Encoding Matrices Using a Linear Combination of Unitaries
The new version of PennyLane allows users to encode an operator into a quantum circuit by decomposing it into a linear combination of unitaries. This is done using the qml.StatePrep and qml.Select
operations input of the coefficients and unitaries, respectively. This feature can be used as a building block within a larger QNode to perform algorithms such as the quantum singular value transformation or Hamiltonian simulation.
Logging Support for Debugging
PennyLane v0.32 introduces Python-native logging support. This feature allows users to enable logging with qml.logging.enable_logging()
and see every step in PennyLane’s pipeline that gets used to run their code. Additional logging configuration settings can be specified by modifying the contents of the logging configuration file.
“Several releases back, we introduced our very own curated datasets module. Initially accessible only through qml.data methods in Python, we are pleased to announce a brand new online library that makes it easier to browse available datasets, and find exactly what you are looking for; complementing our existing datasets functionality in PennyLane.”
Thomas Bromley, Isaac De Vlugt
More Input States for Quantum Chemistry Calculations
PennyLane v0.32 has made it easier to integrate with popular quantum chemistry libraries. It now allows importing entities like PySCF solver objects and returning the corresponding circuit state vector. The qml.qchem.import_state function
can be used to import a PySCF solver object and return the corresponding state vector. The currently supported objects are RCISD, UCISD, RCCSD, and UCCSD.
Reuse and Reset Qubits After Mid-Circuit Measurements
PennyLane now allows circuits to reuse a qubit after a mid-circuit measurement. The wire can also be reset to the 0 state. This feature is activated by setting reset=True when calling qml.measure
. Qubit reuse and reset is also fully differentiable.
Other Improvements and Deprecations
In addition to the new features, PennyLane v0.32 also includes a wide array of improvements and optimizations. Circuit drawings and plots can now be created following the PennyLane style. The qml.draw_mpl
function accepts a style=’pennylane’ argument to create PennyLane-themed circuit diagrams.
However, with the addition of new features, some outdated features have been removed. For instance, support for Python 3.8 has been dropped. The CV observables qml.X and qml.P have been deprecated, and users are advised to use qml.QuadX and qml.QuadP instead.
The release of PennyLane v0.32 is a result of the hard work of the development team and contributors.
“It is now possible to encode an operator A into a quantum circuit by decomposing it into a linear combination of unitaries and using the qml.StatePrep and qml.Select operations to input the coefficients and unitaries, respectively.”
Thomas Bromley, Isaac De Vlugt
Python-native logging can now be enabled with qml.logging.enable_logging(). Consider the following code that is contained in my_code.py.
We aim to make it easy to integrate PennyLane with existing libraries far and wide, including popular quantum chemistry libraries. Importing entities like PySCF solver objects and returning the corresponding circuit state vector is now possible!
“Circuit drawings and plots can now be created following the beloved PennyLane style.” – Thomas Bromley, Isaac De Vlugt
“Any class inheriting from Operator is now automatically registered as a pytree with JAX. This unlocks the ability to JIT functions of Operator.” – Thomas Bromley, Isaac De Vlugt
“Support for Python 3.8 has been dropped.” – Thomas Bromley, Isaac De Vlugt
“As always, this release would not have been possible without the hard work of our development team and contributors.”
Thomas Bromley, Isaac De Vlugt
Summary
The latest release of PennyLane, a quantum computing software, introduces new features such as the ability to encode matrices using a linear combination of unitaries, inspect the software’s inner workings with logging, and reuse and reset qubits after mid-circuit measurements. Additionally, it now supports more input states for quantum chemistry calculations and offers improvements in circuit drawings and plots, among other enhancements.
- PennyLane has released version 0.32, which includes several new features and improvements.
- The release introduces a new online library for browsing available datasets, enhancing the existing datasets functionality in PennyLane.
- It is now possible to encode an operator into a quantum circuit by decomposing it into a linear combination of unitaries. This can be used as a building block within a larger QNode to perform algorithms such as the quantum singular value transformation or Hamiltonian simulation.
- Python-native logging can now be enabled with
qml.logging.enable_logging()
, providing detailed insights into PennyLane’s pipeline. - The release also expands the input states for quantum chemistry calculations, allowing integration with popular quantum chemistry libraries.
- Qubits can now be reused and reset after mid-circuit measurements, with future releases set to explore device-level support for qubit reuse without consuming additional qubits.
- Other improvements include PennyLane-themed circuit diagrams, automatic registration of any class inheriting from Operator as a pytree with JAX, and faster and differentiable pauli decomposition.
- The release was made possible by the hard work of the development team and contributors, including Thomas Bromley and Isaac De Vlugt.
Read More at: https://pennylane.ai/blog/2023/08/pennylane-release-0.32/