From 66c1fec3bd3452aeaec4ddaaa27dc532c5a897dc Mon Sep 17 00:00:00 2001 From: Theodor Date: Tue, 22 Mar 2022 17:42:57 -0400 Subject: [PATCH] Incrementing the version number to 0.22.0 (#696) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bump version and update changelog * update changelog * Update .github/CHANGELOG.md Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com> * update changelog Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com> --- .github/CHANGELOG.md | 94 ++++++++++++++++++++++++++++++++++-- strawberryfields/_version.py | 2 +- 2 files changed, 90 insertions(+), 6 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 1c8e03abd..f5c91d866 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,4 +1,4 @@ -# Release 0.22.0 (development release) +# Release 0.22.0 (current release)

New features since last release

@@ -10,13 +10,57 @@ [_Simple factorization of unitary transformations_](https://doi.org/10.1103/PhysRevA.97.022328). [(#665)](https://github.com/XanaduAI/strawberryfields/pull/665) + ```python + import numpy as np + + import strawberryfields as sf + from strawberryfields import ops + + U = np.array([[-0.39302099+0.28732291j, 0.83734522+0.24866248j], + [ 0.00769051+0.87345344j, -0.3847068 +0.29836325j]]) + + prog = sf.Program(2) + + with prog.context as q: + ops.Interferometer(U, mesh="sun_compact") | q + ``` + * A `Device.certificate` method is added which returns the hardware device certificate. [(#679)](https://github.com/XanaduAI/strawberryfields/pull/679) + ```pycon + >>> import strawberryfields as sf + >>> eng = sf.RemoteEngine("X8") + >>> print(eng.device.certificate) + {'target': 'X8_01' ... } + ``` + * Setting `shots=None` in the engine or program run options will not execute any measurements applied on the circuit. [(#682)](https://github.com/XanaduAI/strawberryfields/pull/682) + ```python + import strawberryfields as sf + from strawberryfields import ops + + prog = sf.Program(1) + eng = sf.Engine("gaussian") + + with prog.context as q: + ops.Sgate(0.5) | q[0] + ops.MeasureFock() | q + + results = eng.run(prog, shots=None) + + # samples will output an empty list [] + print(results.samples) + + # the resulting Gaussian state is still accessible + # via its vector of means and covariance matrix + print(results.state.means()) + print(results.state.cov()) + ``` + * There's a `program_equivalence` function in `strawberryfields/program_utils.py` which checks Strawberry Fields programs for equivalence. [(#686)](https://github.com/XanaduAI/strawberryfields/pull/686) @@ -25,10 +69,43 @@ gates and respective parameters, are applied in order. [(#686)](https://github.com/XanaduAI/strawberryfields/pull/686) + ```python + import strawberryfields as sf + from strawberryfields import ops + + prog_1 = sf.Program(1) + prog_2 = sf.Program(1) + + with prog.context as q: + ops.Sgate(0.42) | q[0] + ops.MeasureFock() | q + + with prog.context as q: + ops.Sgate(0.42) | q[0] + ops.MeasureFock() | q + + assert prog_1 == prog_2 + ``` + * A `Program.equivalence` convenience method is added which calls the `program_equivalence` utility function. [(#686)](https://github.com/XanaduAI/strawberryfields/pull/686) + ```python + prog_1 = sf.Program(1) + prog_2 = sf.Program(1) + + with prog.context as q: + ops.Sgate(1.1) | q[0] + ops.MeasureFock() | q + + with prog.context as q: + ops.Sgate(0.42) | q[0] + ops.MeasureFock() | q + + assert prog_1.equivalence(prog_2, compare_params=False) + ``` + * A `Device.validate_target` static method is added which checks that the target in the layout is the same as the target field in the specification. This check is also performed at `Device` initialization. [(#687)](https://github.com/XanaduAI/strawberryfields/pull/687) @@ -42,9 +119,18 @@

Breaking Changes

-* `DeviceSpec` is renamed to `Device`. +* `DeviceSpec` is renamed to `Device`, which now also contains more than only the device specification. [(#679)](https://github.com/XanaduAI/strawberryfields/pull/679) + ```pycon + >>> import strawberryfields as sf + >>> eng = sf.RemoteEngine("X8") + >>> isinstance(eng.device, sf.Device) + True + >>> print(eng.device.target) + X8_01 + ``` +

Bug fixes

* It's now possible to show graphs using the plot apps layer when not run in notebooks. @@ -63,15 +149,13 @@ the register references. [(#688)](https://github.com/XanaduAI/strawberryfields/pull/688) -

Documentation

-

Contributors

This release contains contributions from (in alphabetical order): Sebastian Duque, Theodor Isacsson, Jon Schlipf, Hossein Seifoory -# Release 0.21.0 (current release) +# Release 0.21.0

New features since last release

diff --git a/strawberryfields/_version.py b/strawberryfields/_version.py index 6d0e41f8d..ff6dc7f56 100644 --- a/strawberryfields/_version.py +++ b/strawberryfields/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.22.0-dev" +__version__ = "0.22.0"