Skip to content

Releases: PennyLaneAI/pennylane-sf

Release 0.29.1

05 May 16:32
3df303a
Compare
Choose a tag to compare

Breaking changes

  • Pins package to working with PennyLane less than version 0.30.
    (#134)

Release 0.29.0

28 Feb 22:33
969e348
Compare
Choose a tag to compare

Breaking changes

  • Remove python 3.7 support.
    (#129)

Bug fixes

  • Fixed a bug where StrawberryFieldsRemote.probability fails with newer numpy versions.
    (#125)

Contributors

This release contains contributions from (in alphabetical order):

Matthew Silverman, Antal Száva

Release 0.20.1

29 Mar 17:19
dfeb883
Compare
Choose a tag to compare

Bug fixes

  • Changed DeviceSpec to Device due to a breaking change in Strawberry Fields. (#102)

Contributors

This release contains contributions from (in alphabetical order):

Theodor Isacsson

Release 0.20.0

14 Dec 07:53
4a14679
Compare
Choose a tag to compare

Improvements

  • Updated how cat states are handled in the plugin. (#86)

  • Switched to the latest remote API used by Strawberry Fields. (#86)

  • Updated how the expectation value of the identity operator is computed as qml.Identity only takes a single wire. (#86)

  • The GBS device uses qml.probs (instead of the identity) to mark basis state probability computations internally. (#84)

Contributors

This release contains contributions from (in alphabetical order):

Samuel Banning, Antal Száva

Release 0.19.0

09 Nov 05:43
7dc9977
Compare
Choose a tag to compare

Improvements

  • Changed the name of qml.Interferometer to qml.InterferometerUnitary due to a breaking change in PennyLane. (#77)

Contributors

This release contains contributions from (in alphabetical order):

Romain Moyard

Release 0.16.0

22 Jun 03:15
3ffe8f8
Compare
Choose a tag to compare

Improvements

  • Adds support for Python 3.9. (#71)

Bug fixes

  • Replaced left-over references to the deprecated analytic attribute with shots. (#68)

Contributors

This release contains contributions from (in alphabetical order):

Olivia Di Matteo, Romain Moyard

Release 0.15.0

20 Apr 08:09
acd609d
Compare
Choose a tag to compare

Breaking changes

  • For compatibility with PennyLane v0.15, the analytic keyword argument has been removed from all devices. Analytic expectation values can still be computed by setting shots=None. (#65)

Contributors

This release contains contributions from (in alphabetical order):

Josh Izaac

Release 0.14.0

02 Feb 08:41
319591e
Compare
Choose a tag to compare

Improvements

  • Updated the tests to work with the new core of PennyLane. (#60)

Bug fixes

  • Removed the device differentiation method from the TF device, and fixed it to work with the latest PL release. (#62)

  • Adjusted the StrawberryFieldsGBS.jacobian method to work with the new core of PennyLane. (#60)

Contributors

This release contains contributions from (in alphabetical order):

Theodor Isacsson, Josh Izaac.

Release 0.12.0

20 Oct 08:18
16dc17b
Compare
Choose a tag to compare

Release 0.12.0

New features since last release

  • A new device, strawberryfields.tf, provides support for using Strawberry Fields TensorFlow backend from within PennyLane. (#50)

    dev = qml.device('strawberryfields.tf', wires=2, cutoff_dim=10)

    This device supports classical backpropagation when using the TensorFlow interface:

      @qml.qnode(dev, interface="tf", diff_method="backprop")
      def circuit(x, theta):
          qml.Displacement(x, 0, wires=0)
          qml.Beamsplitter(theta, 0, wires=[0, 1])
          return qml.probs(wires=0)

    Gradients will be computed using TensorFlow backpropagation:

    >>> x = tf.Variable(1.0)
    >>> theta = tf.Variable(0.543)
    >>> with tf.GradientTape() as tape:
    ...     res = circuit(x, theta)
    >>> jac = tape.jacobian(res, x)
    >>> print(jac)
    <tf.Tensor: shape=(1, 10), dtype=float32, numpy=
    array([[-7.0436597e-01,  1.8805575e-01,  3.2707882e-01,  1.4299491e-01,
             3.7763387e-02,  7.2306832e-03,  1.0900890e-03,  1.3535164e-04,
             1.3895189e-05,  9.9099987e-07]], dtype=float32)>

    For more details, please see the TF device documentation

  • A new device, strawberryfields.gbs, provides support for training of the Gaussian boson sampling (GBS) distribution. (#47)

    dev = qml.device('strawberryfields.gbs', wires=4, cutoff_dim=4)

    This device allows the adjacency matrix A of a graph to be trained. The QNode must have a fixed structure:

    from pennylane_sf.ops import ParamGraphEmbed
    import numpy as np
    
    A = np.array([
        [0.0, 1.0, 1.0, 1.0],
        [1.0, 0.0, 1.0, 0.0],
        [1.0, 1.0, 0.0, 0.0],
        [1.0, 0.0, 0.0, 0.0]])
    n_mean = 2.5
    
    @qml.qnode(dev)
    def quantum_function(x):
        ParamGraphEmbed(x, A, n_mean, wires=range(4))
        return qml.probs(wires=range(4))

    Here, n_mean is the initial mean number of photons in the output GBS samples. The GBS probability distribution for a choice of trainable parameters x can then be accessed:

    >>> x = 0.9 * np.ones(4)
    >>> quantum_function(x)

    For more details, please see the gbs device documentation

Improvements

  • Adds the ability for the StrawberryFieldsGBS device to use the reparametrization trick in sampling mode. (#55)

Bug fixes

  • Applies minor fixes to RemoteEngine. (#53)

  • Sets a fixed cutoff dimension for RemoteEngine. (#54)

  • Adds unwrapping for operation parameters as indexing into NumPy arrays was added to PennyLane. (#56)

Contributors

This release contains contributions from (in alphabetical order):

Juan Miguel Arrazola, Thomas Bromley, Josh Izaac.

Release 0.11.0

19 Aug 07:53
Compare
Choose a tag to compare

New features since last release

  • A new device, strawberryfields.remote, provides support for Xanadu's photonic hardware from within PennyLane. (#41)

    dev = qml.device('strawberryfields.remote', backend="X8", shots=10, sf_token="XXX")

    Once created, the device can be bound to photonic QNode for evaluation and training:

    @qml.qnode(dev)
    def quantum_function(theta, x):
        qml.TwoModeSqueezing(1.0, 0.0, wires=[0, 4])
        qml.TwoModeSqueezing(1.0, 0.0, wires=[1, 5])
        qml.Beamsplitter(theta, phi, wires=[0, 1])
        qml.Beamsplitter(theta, phi, wires=[4, 5])
        return qml.expval(qml.NumberOperator(0))

    Samples can also be returned from the hardware using

    return [qml.sample(qml.NumberOperator(i)) for i in [0, 1, 2, 4]]

    For more details, please see the remote device documentation

  • The Strawberry Fields devices now support returning Fock state probabilities. (#39)

    @qml.qnode(dev)
    def quantum_function(theta, x):
        qml.TwoModeSqueezing(1.0, 0.0, wires=[0, 1])
        return qml.probs(wires=0)

    If a subset of wires are requested, the marginal probabilities will be computed and returned. The returned probabilities will have the shape [cutoff] * wires.

    If not specified when instantiated, the cutoff for the Gaussian simulator is by default 10.

  • Added the ability to compute the expectation value and variance of tensor number operators (#37) (#42)

  • The Strawberry Fields devices now support custom wire labels. (#48)

    dev = qml.device('strawberryfields.gaussian', wires=['alice', 1])
    
    @qml.qnode(dev)
    def circuit(x):
        qml.Displacement(x, 0, wires='alice')
        qml.Beamsplitter(wires=['alice', 1])
        return qml.probs(wires=[0, 1])

Improvements

  • PennyLane-SF has been updated to support the latest version of Strawberry Fields (v0.15) (#44)

Contributors

This release contains contributions from (in alphabetical order):

Josh Izaac, Maria Schuld, Antal Száva