Skip to content

Releases: PennyLaneAI/pennylane

Release 0.7.0

19 Nov 05:50
b11abe6
Compare
Choose a tag to compare

New features since last release

  • Custom padding constant in AmplitudeEmbedding is supported (see 'Breaking changes'.) #419

  • StronglyEntanglingLayer and RandomLayer now work with a single wire. #409 #413

  • Added support for applying the inverse of an Operation within a circuit. #377

  • Added an OperationRecorder() context manager, that allows templates and quantum functions to be executed while recording events. The recorder can be used with and without QNodes as a debugging utility. #388

  • Operations can now specify a decomposition that is used when the desired operation is not supported on the target device. #396

  • The ability to load circuits from external frameworks as templates has been added via the new qml.load() function. This feature requires plugin support --- this initial release provides support for Qiskit circuits and QASM files when pennylane-qiskit is installed, via the functions qml.from_qiskit and qml.from_qasm. #418

  • An experimental tensor network device has been added #416 #395 #394 #380

  • An experimental tensor network device which uses TensorFlow for backpropagation has been added #427

  • Custom padding constant in AmplitudeEmbedding is supported (see 'Breaking changes'.) #419

Breaking changes

  • The pad parameter in `AmplitudeEmbedding()is now eitherNone`` (no automatic padding), or a number that is used as the padding constant. #419

  • Initialization functions now return a single array of weights per function. Utilities for multi-weight templates Interferometer() and CVNeuralNetLayers() are provided. #412

  • The single layer templates RandomLayer(), CVNeuralNetLayer() and StronglyEntanglingLayer() have been turned into private functions _random_layer(), _cv_neural_net_layer() and _strongly_entangling_layer(). Recommended use is now via the corresponding Layers() templates. #413

Improvements

  • Added extensive input checks in templates. #419

  • Templates integration tests are rewritten - now cover keyword/positional argument passing, interfaces and combinations of templates. #409 #419

  • State vector preparation operations in the default.qubit plugin can now be applied to subsets of wires, and are restricted to being the first operation in a circuit. #346

  • The QNode class is split into a hierarchy of simpler classes. #354 #398 #415 #417 #425

  • Added the gates U1, U2 and U3 parametrizing arbitrary unitaries on 1, 2 and 3 qubits and the Toffoli gate to the set of qubit operations. #396

  • Changes have been made to accomodate the movement of the main function in pytest._internal to pytest._internal.main in pip 19.3. #404

  • Added the templates BasisStatePreparation and MottonenStatePreparation that use gates to prepare a basis state and an arbitrary state respectively. #336

  • Added decompositions for BasisState and QubitStateVector based on state preparation templates.
    #414

  • Replaces the pseudo-inverse in the quantum natural gradient optimizer (which can be numerically unstable) with np.linalg.solve. #428

Contributors

This release contains contributions from (in alphabetical order):

Ville Bergholm, Josh Izaac, Nathan Killoran, Angus Lowe, Johannes Jakob Meyer, Oluwatobi Ogunbayo, Maria Schuld, Antal Száva.

Release 0.6.1

30 Oct 18:38
82d8135
Compare
Choose a tag to compare

New features since last release

  • Added a print_applied method to QNodes, allowing the operation and observable queue to be printed as last constructed. #378

Improvements

  • A new Operator base class is introduced, which is inherited by both the Observable class and the Operation class. #355

  • Removed deprecated @abstractproperty decorators in _device.py. #374

  • Comprehensive gradient tests have been added for the interfaces. #381

Documentation

  • The new restructured documentation has been polished and updated. #387 #375 #372 #370 #369 #367 #364

  • Updated the development guides. #382 #379

  • Added all modules, classes, and functions to the API section in the documentation. #373

Bug fixes

  • Replaces the existing np.linalg.norm normalization with hand-coded normalization, allowing AmplitudeEmbedding` to be used with differentiable parameters. AmplitudeEmbedding tests have been added and improved. #376

Contributors

This release contains contributions from (in alphabetical order):

Josh Izaac, Nathan Killoran, Maria Schuld, Antal Száva

Release 0.6

18 Oct 20:00
a4a66e5
Compare
Choose a tag to compare

New features since last release

  • The devices default.qubit and default.gaussian have a new initialization parameter analytic that indicates if expectation values and variances should be calculated analytically and not be estimated from data. #317

  • Added C-SWAP gate to the set of qubit operations #330

  • The TensorFlow interface has been renamed from "tfe" to "tf", and now supports TensorFlow 2.0. #337

  • Added the S and T gates to the set of qubit operations. #343

  • Tensor observables are now supported within the expval, var, and sample functions, by using the @ operator. #267

Breaking changes

  • The argument n specifying the number of samples in the method Device.sample was removed. Instead, the method will always return Device.shots many samples. #317

Improvements

  • The number of shots / random samples used to estimate expectation values and variances, Device.shots, can now be changed after device creation. #317

  • Unified import shortcuts to be under qml in qnode.py and test_operation.py #329

  • The quantum natural gradient now uses scipy.linalg.pinvh which is more efficient for symmetric matrices than the previously used scipy.linalg.pinv. #331

  • The deprecated qml.expval.Observable syntax has been removed. #267

  • Remainder of the unittest-style tests were ported to pytest. #310

  • The do_queue argument for operations now only takes effect within QNodes. Outside of QNodes, operations can now be instantiated without needing to specify do_queue. #359

Documentation

  • The docs are rewritten and restructured to contain a code introduction section as well as an API section. #314

  • Added Ising model example to the tutorials [#319] (#319)

  • Added tutorial for QAOA on MaxCut problem #328

  • Added QGAN flow chart figure to its tutorial #333

  • Added missing figures for gallery thumbnails of state-preparation and QGAN tutorials #326

  • Fixed typos in the state preparation tutorial #321

  • Fixed bug in VQE tutorial 3D plots #327

Bug fixes

  • Fixed typo in measurement type error message in qnode.py #341

Contributors

This release contains contributions from (in alphabetical order):

Shahnawaz Ahmed, Ville Bergholm, Aroosa Ijaz, Josh Izaac, Nathan Killoran, Angus Lowe, Johannes Jakob Meyer, Maria Schuld, Antal Száva, Roeland Wiersema.

Release 0.5

09 Sep 22:33
Compare
Choose a tag to compare

New features since last release

  • Adds a new optimizer, qml.QNGOptimizer, which optimizes QNodes using quantum natural gradient descent. See https://arxiv.org/abs/1909.02108 for more details. #295 #311

  • Adds a new QNode method, QNode.metric_tensor(), which returns the block-diagonal approximation to the Fubini-Study metric tensor evaluated on the attached device. #295

  • Sampling support: QNodes can now return a specified number of samples from a given observable via the top-level pennylane.sample() function. To support this on plugin devices, there is a new Device.sample method.

    Calculating gradients of QNodes that involve sampling is not possible. #256

  • default.qubit has been updated to provide support for sampling. #256

  • Added controlled rotation gates to PennyLane operations and default.qubit plugin. #251

Breaking changes

  • The method Device.supported was removed, and replaced with the methods Device.supports_observable and Device.supports_operation. Both methods can be called with string arguments (dev.supports_observable('PauliX')) and class arguments (dev.supports_observable(qml.PauliX)). #276

  • The following CV observables were renamed to comply with the new Operation/Observable scheme: MeanPhoton to NumberOperator, Homodyne to QuadOperator and NumberState to FockStateProjector. #243

Improvements

  • The AmplitudeEmbedding function now provides options to normalize and pad features to ensure a valid state vector is prepared. #275

  • Operations can now optionally specify generators, either as existing PennyLane operations, or by providing a NumPy array. #295 #313

  • Adds a Device.parameters property, so that devices can view a dictionary mapping free parameters to operation parameters. This will allow plugin devices to take advantage of parametric compilation. #283

  • Introduces two enumerations: Any and All, representing any number of wires and all wires in the system respectively. They can be imported from pennylane.operation, and can be used when defining the Operation.num_wires class attribute of operations. #277

    As part of this change:

    • All is equivalent to the integer 0, for backwards compatibility with the existing test suite

    • Any is equivalent to the integer -1 to allow numeric comparison operators to continue working

    • An additional validation is now added to the Operation class, which will alert the user that an operation with num_wires = All is being incorrectly.

  • The one-qubit rotations in pennylane.plugins.default_qubit no longer depend on Scipy's expm. Instead they are calculated with Euler's formula. #292

  • Creates an ObservableReturnTypes enumeration class containing Sample, Variance and Expectation. These new values can be assigned to the return_type attribute of an Observable. #290

  • Changed the signature of the RandomLayer and RandomLayers templates to have a fixed seed by default. #258

  • setup.py has been cleaned up, removing the non-working shebang, and removing unused imports. #262

Documentation

  • A documentation refactor to simplify the tutorials and include Sphinx-Gallery. #291

    • Examples and tutorials previously split across the examples/ and doc/tutorials/ directories, in a mixture of ReST and Jupyter notebooks, have been rewritten as Python scripts with ReST comments in a single location, the examples/ folder.

    • Sphinx-Gallery is used to automatically build and run the tutorials. Rendered output is displayed in the Sphinx documentation.

    • Links are provided at the top of every tutorial page for downloading the tutorial as an executable python script, downloading the tutorial as a Jupyter notebook, or viewing the notebook on GitHub.

    • The tutorials table of contents have been moved to a single quick start page.

  • Fixed a typo in QubitStateVector. #295

  • Fixed a typo in the default_gaussian.gaussian_state function. #293

  • Fixed a typo in the gradient recipe within the RX, RY, RZ operation docstrings. #248

  • Fixed a broken link in the tutorial documentation, as a result of the qml.expval.Observable deprecation. #246

Bug fixes

  • Fixed a bug where a PolyXP observable would fail if applied to subsets of wires on default.gaussian. #277

Contributors

This release contains contributions from (in alphabetical order):

Simon Cross, Aroosa Ijaz, Josh Izaac, Nathan Killoran, Johannes Jakob Meyer, Rohit Midha, Nicolás Quesada, Maria Schuld, Antal Száva, Roeland Wiersema.

Release 0.4

22 Jun 18:37
478e0fa
Compare
Choose a tag to compare

New features since last release

  • pennylane.expval() is now a top-level function, and is no longer a package of classes. For now, the existing pennylane.expval.Observable interface continues to work, but will raise a deprecation warning. #232

  • Variance support: QNodes can now return the variance of observables, via the top-level pennylane.var() function. To support this on plugin devices, there is a new Device.var method.

    The following observables support analytic gradients of variances:

    • All qubit observables (requiring 3 circuit evaluations for involutory observables such as Identity, X, Y, Z; and 5 circuit evals for non-involutary observables, currently only qml.Hermitian)

    • First-order CV observables (requiring 5 circuit evaluations)

    Second-order CV observables support numerical variance gradients.

  • pennylane.about() function added, providing details on current PennyLane version, installed plugins, Python,
    platform, and NumPy versions #186

  • Removed the logic that allowed wires to be passed as a positional argument in quantum operations. This allows us to raise more useful error messages for the user if incorrect syntax is used. #188

  • Adds support for multi-qubit expectation values of the pennylane.Hermitian() observable #192

  • Adds support for multi-qubit expectation values in default.qubit. #202

  • Organize templates into submodules #195. This included the following improvements:

    • Distinguish embedding templates, layer templates, and parameter templates.

    • New random initialization functions supporting the templates available in the new submodule pennylane.init.

    • Added a random circuit template (RandomLayers()), in which rotations and 2-qubit gates are randomly distributed over the wires

    • Add various embedding strategies

Breaking changes

  • The Device methods expectations, pre_expval, and post_expval have been renamed to observables, pre_measure, and post_measure respectively. #232

Improvements

  • default.qubit plugin now uses np.tensordot when applying quantum operations and evaluating expectations, resulting in significant speedup #239, #241

  • Allows division of quantum operation parameters by a constant #179

  • Portions of the test suite are in the process of being ported to pytest. Note: this is still a work in progress.

    Ported tests include:

    • test_ops.py
    • test_about.py
    • test_classical_gradients.py
    • test_observables.py
    • test_measure.py
    • test_init.py
    • test_templates*.py
    • test_ops.py
    • test_variable.py
    • test_qnode.py (partial)

Bug fixes

  • Fixes a bug in Device.supported, which would incorrectly mark an operation as supported if it shared a name with an observable #203

  • Fixes a bug in Operation.wires, by explicitly casting the type of each wire to an integer #206

  • Removes code in PennyLane which configured the logger, as this would clash with users' configurations #208

  • Fixes a bug in default.qubit, in which QubitStateVector operations were accidentally being cast to np.float instead of np.complex. #211

Contributors

This release contains contributions from:

Shahnawaz Ahmed, riveSunder, Aroosa Ijaz, Josh Izaac, Nathan Killoran, Maria Schuld.

Release 0.3.1

09 Mar 05:27
e0a7e4c
Compare
Choose a tag to compare

Bug fixes

  • Fixed a bug where the interfaces submodule was not correctly being packaged via setup.py.

Release 0.3

13 Feb 23:55
Compare
Choose a tag to compare

New features since last release

  • PennyLane now includes a new interfaces submodule, which enables QNode integration with additional machine learning libraries (#165).
  • Adds support for an experimental PyTorch interface for QNodes
  • Adds support for an experimental TensorFlow eager execution interface for QNodes
  • Adds a PyTorch+GPU+QPU tutorial to the documentation
  • Documentation now includes links and tutorials including the new PennyLane-Forest plugin.

Improvements

  • Printing a QNode object, via print(qnode) or in an interactive terminal, now displays more useful information regarding the QNode, including the device it runs on, the number of wires, it's interface, and the quantum function it uses:
    >>> print(qnode)
    <QNode: device='default.qubit', func=circuit, wires=2, interface=PyTorch>

Contributors

This release contains contributions from:

Josh Izaac and Nathan Killoran.

Release 0.2

30 Jan 21:52
1c40513
Compare
Choose a tag to compare

New features since last release

  • Added the Identity expectation value for both CV and qubit models (#135)
  • Added the templates.py submodule, containing some commonly used QML models to be used as ansatz in QNodes (#133)
  • Added the qml.Interferometer CV operation (#152)
  • Wires are now supported as free QNode parameters (#151)
  • Added ability to update stepsizes of the optimizers (#159)

Improvements

  • Removed use of hardcoded values in the optimizers, made them parameters (see #131 and #132)
  • Created the new PlaceholderExpectation, to be used when both CV and qubit expval modules contain expectations with the same name
  • Provide the plugins a way to view the operation queue before applying operations. This allows for on-the-fly modifications of the queue, allowing hardware-based plugins to support the full range of qubit expectation values. (#143)
  • QNode return values now support any form of sequence, such as lists, sets, etc. (#144)
  • CV analytic gradient calculation is now more robust, allowing for operations which may not themselves be differentiated, but have a well defined _heisenberg_rep method, and so may succeed operations that are analytically differentiable (#152)

Bug fixes

  • Fixed a bug where the variational classifier example was not batching when learning parity (see #128 and #129)
  • Fixed an inconsistency where some initial state operations were documented as accepting complex parameters - all operations now accept real values (#146)

Contributors

This release contains contributions from:

Christian Gogolin, Josh Izaac, Nathan Killoran, and Maria Schuld.

Release 0.1

13 Nov 01:41
Compare
Choose a tag to compare

First public release of PennyLane.

Contributors

This release contains contributions from:

Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, and Nathan Killoran.