Skip to content

Release 0.21.0

Compare
Choose a tag to compare
@mlxd mlxd released this 07 Feb 20:43

New features since last release

  • Add C++ only benchmark for a given list of gates. (#199)

  • Wheel-build support for Python 3.10. (#186)

  • C++ support for probability, expectation value and variance calculations. (#185)

Improvements

  • setup.py adds debug only when --debug is given (#208)

  • Add new highly-performant C++ kernels for quantum gates. (#202)

The new kernels significantly improve the runtime performance of PennyLane-Lightning
for both differentiable and non-differentiable workflows. Here is an example workflow
using the adjoint differentiation method with a circuit of 5 strongly entangling layers:

import pennylane as qml
from pennylane import numpy as np
from pennylane.templates.layers import StronglyEntanglingLayers
from numpy.random import random
np.random.seed(42)
n_layers = 5
n_wires = 6
dev = qml.device("lightning.qubit", wires=n_wires)

@qml.qnode(dev, diff_method="adjoint")
def circuit(weights):
    StronglyEntanglingLayers(weights, wires=list(range(n_wires)))
    return [qml.expval(qml.PauliZ(i)) for i in range(n_wires)]

init_weights = np.random.random(StronglyEntanglingLayers.shape(n_layers=n_layers, n_wires=n_wires))
params = np.array(init_weights,requires_grad=True)
jac = qml.jacobian(circuit)(params)

The latest release shows improved performance on both single and multi-threaded evaluations!

  • Ensure debug info is built into dynamic libraries. (#201)

Documentation

  • New guidelines on adding and benchmarking C++ kernels. (#202)

Bug fixes

  • Update clang-format version (#219)

  • Fix failed tests on Windows. (#218)

  • Fix failed tests for the non-binary wheel. (#213)

  • Add virtual destructor to C++ state-vector classes. (#200)

Contributors

This release contains contributions from (in alphabetical order):

Ali Asadi, Amintor Dusko, Chae-Yeun Park, Lee James O'Riordan