From 3c8b50923f759a41ec94341cd4cebdf5ad58626f Mon Sep 17 00:00:00 2001 From: Theodor Date: Thu, 23 Sep 2021 18:12:24 -0400 Subject: [PATCH] Increment version to 0.19.0 (#630) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bump version number * update changelog * add upload workflow * add td3 to changelog * pin blackbird * Add Eli Bourassa contribution * minor updates * more minor updates Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com> --- .github/CHANGELOG.md | 60 +++++++++++++++++++----------------- .github/workflows/upload.yml | 35 +++++++++++++++++++++ requirements.txt | 2 +- strawberryfields/_version.py | 2 +- 4 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/upload.yml diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 49d90d2a3..0b7671cb6 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,20 +1,20 @@ -# Release 0.19.0 (development release) +# Release 0.19.0 (current release)

New features since last release

* Compact decompositions as described in , - (``rectangular_compact`` and ``triangular_compact``) are now available in - the ``sf.decompositions`` module, and as options in the ``Interferometer`` operation. - [(#584)](https://github.com/XanaduAI/strawberryfields/pull/584) + (``rectangular_compact`` and ``triangular_compact``) are now available in + the ``sf.decompositions`` module, and as options in the ``Interferometer`` operation. + [(#584)](https://github.com/XanaduAI/strawberryfields/pull/584) - This decomposition allows for lower depth photonic circuits in physical devices by applying two - independent phase shifts in parallel inside each Mach-Zehnder interferometer. - ``rectangular_compact`` reduces the layers of phase shifters from 2N+1 to N+2 - for an N mode interferometer when compared to e.g. ``rectangular_MZ``. + This decomposition allows for lower depth photonic circuits in physical devices by applying two + independent phase shifts in parallel inside each Mach-Zehnder interferometer. + ``rectangular_compact`` reduces the layers of phase shifters from 2N+1 to N+2 + for an N mode interferometer when compared to e.g. ``rectangular_MZ``. - Example: + Example: - ```python + ```python import numpy as np from strawberryfields import Program from strawberryfields.ops import Interferometer @@ -37,7 +37,7 @@ Uout = S[:M,:M] + 1j * S[M:,:M] # unitary transformation print(np.allclose(U, Uout)) - ``` + ``` * A new compiler, ``GaussianMerge``, has been added. It is aimed at reducing calculation overhead for non-Gaussian circuits by minimizing the amount of Gaussian operations @@ -130,53 +130,58 @@ [-0.6708+8.2152e-17j 0.6708+0.0000e+00j]]) | (q[0], q[1]) ``` -

Improvements

-* Cleanup `backends/tfbackend/ops.py` to reduce line count, clarify function +* `backends/tfbackend/ops.py` is cleaned up to reduce line count, clarify function similarity across backend ops, and replace `tensorflow.tensordot` with broadcasting. [(#567)](https://github.com/XanaduAI/strawberryfields/pull/567) +* Support is added for using a ``TDMProgram`` to construct time-domain circuits with Fock + measurements and multiple loops. + [(#601)](https://github.com/XanaduAI/strawberryfields/pull/601) + * `measure_threshold` in the `gaussian` backend now supports displaced Gaussian states. [(#615)](https://github.com/XanaduAI/strawberryfields/pull/615) -* Speed improvements to ``gaussian_unitary`` compiler +* Speed improvements are addded to ``gaussian_unitary`` compiler. [(#603)](https://github.com/XanaduAI/strawberryfields/pull/603) - -* Added native support in the Fock backend for the MZgate. +* Adds native support in the Fock backend for the MZgate. [(#610)](https://github.com/XanaduAI/strawberryfields/issues/610) * `measure_threshold` is now supported in the `bosonic` backend. [(#618)](https://github.com/XanaduAI/strawberryfields/pull/618) -

Breaking Changes

-

Bug fixes

-* Fixed an unexpected behaviour that can result in increasing memory usage due +* Fixes an unexpected behaviour that can result in increasing memory usage due to ``sympy.lambdify`` caching too much data using ``linecache``. [(#579)](https://github.com/XanaduAI/strawberryfields/pull/579) -* Keep symbolic expressions when converting a Strawberry Fields circuit to a Blackbird program +* Keeps symbolic expressions when converting a Strawberry Fields circuit to a Blackbird program by storing them as `blackbird.RegRefTransforms` in the resulting Blackbird program. [(#596)](https://github.com/XanaduAI/strawberryfields/pull/596) -* Fixed a bug in the validation step of `strawberryfields.tdm.TdmProgram.compile` which almost always +* Fixes a bug in the validation step of `strawberryfields.tdm.TdmProgram.compile` which almost always used the wrong set of allowed gate parameter ranges to validate the parameters in a program. [(#605)](https://github.com/XanaduAI/strawberryfields/pull/605) -* The correct samples are now returned when running a TDMProgram with several shots, where +* The correct samples are now returned when running a `TDMProgram` with several shots, where `timebins % concurrent_modes != 0`. [(#611)](https://github.com/XanaduAI/strawberryfields/pull/611) +* Fixes the formula used for sampling generaldyne outcomes in the gaussian backend. + [(#614)](https://github.com/XanaduAI/strawberryfields/pull/614) + * Measurement arguments are now stored as non-keyword arguments, instead of keyword arguments, in the resulting Blackbird program when using the `io.to_blackbird()` converter function. [(#622)](https://github.com/XanaduAI/strawberryfields/pull/622) - -* Now factorials of numbers larger than 170 are calculated approximately and stored on a `float`. + +* Factorials of numbers larger than 170 are now calculated using long integer arithmetic, using + the flag `exact=True` in `scipy.special.factorial`, when calling + `sf.apps.similarity.orbit_cardinality`. [(#628)](https://github.com/XanaduAI/strawberryfields/pull/628)

Documentation

@@ -191,11 +196,10 @@ This release contains contributions from (in alphabetical order): +J. Eli Bourassa, Jake Bulmer, Sebastian Duque, Theodor Isacsson, Aaron Robertson, Jeremy Swinarton, +Antal Száva, Federico Rueda, Yuan Yao. -J. Eli Bourassa, Jake Bulmer, Sebastian Duque, Theodor Isacsson, Aaron Robertson, Jeremy Swinarton, Antal Száva, Federico Rueda, Yuan Yao. - - -# Release 0.18.0 (current release) +# Release 0.18.0

New features since last release

diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml new file mode 100644 index 000000000..950016151 --- /dev/null +++ b/.github/workflows/upload.yml @@ -0,0 +1,35 @@ +name: Upload +on: + release: + types: [published] + +jobs: + upload: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Build and install Strawberry Fields + run: | + python -m pip install --upgrade pip wheel + python setup.py bdist_wheel + pip install dist/StrawberryFields*.whl + + - name: Install test dependencies + run: | + pip install wheel pytest pytest-cov pytest-mock --upgrade + + - name: Run tests + run: | + python -m pytest tests --tb=native + + - name: Publish + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI }} diff --git a/requirements.txt b/requirements.txt index b9a907242..b4e74a332 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ sympy>=1.5 tensorflow>=2.0 tensorboard>=2.0 networkx>=2.0 -git+https://github.com/XanaduAI/blackbird@master#egg=quantum-blackbird +quantum-blackbird==0.4.0 python-dateutil==2.8.0 thewalrus>=0.16.0 toml diff --git a/strawberryfields/_version.py b/strawberryfields/_version.py index ebcb6339b..31a90b62a 100644 --- a/strawberryfields/_version.py +++ b/strawberryfields/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.19.0-dev" +__version__ = "0.19.0"