Skip to content

Commit

Permalink
Borealis (#714)
Browse files Browse the repository at this point in the history
* bump version and requirements

* refactor tdm

* update compilers

* update core functionality

* update utilities

* update tests

* update changelog

* fix changelog

* update docs

* Update doc/introduction/photonic_hardware.rst

* Apply suggestions from code review

Co-authored-by: Josh Izaac <[email protected]>
  • Loading branch information
thisac and josh146 authored Jun 1, 2022
1 parent db4d931 commit 915ad42
Show file tree
Hide file tree
Showing 37 changed files with 3,747 additions and 659 deletions.
117 changes: 98 additions & 19 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,134 @@
# Release 0.23.0 (development release)
# Release 0.23.0 (current release)

### New features
<h3>New features since last release</h3>

* Program Xanadu's new Borealis hardware device via Strawberry Fields and Xanadu Cloud.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* GBS data visualization functions are added.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* A set of TDM compilers are added, including a Borealis compiler which compiles
and validates programs against the hardware specification and calibration certificate.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* A `remove_loss` utility function is added to the `program_utils` module, allowing
for the removal of `LossChannels` from Strawberry Fields programs.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* Cropping vacuum modes from TDM program results is now possible by passing
`crop=True` as a run option.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

```python
n, N = get_mode_indices(delays)
prog = sf.TDMProgram(N)

### Breaking changes
with prog.context(*gate_args) as (p, q):
ops.Sgate(p[0]) | q[n[0]]
for i in range(len(delays)):
ops.Rgate(p[2 * i + 1]) | q[n[i]]
ops.BSgate(p[2 * i + 2], np.pi / 2) | (q[n[i + 1]], q[n[i]])
ops.MeasureX | q[0]

### Improvements
eng = sf.Engine("gaussian")
results = eng.run(prog, crop=True)
```

* Resulting samples from TDM jobs return only the non-empty mode measurements when
setting the `crop` option to `True` in the program `run_options` or as a keyword
argument in the engine `run` method.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* Realistic loss can be added to a Borealis circuit for local simulation
execution.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* A locked program can now be (un)rolled, and automatically restores the lock if there.
```python
compile_options = {
"device": device, # hardware device object needed
"realistic_loss": True,
}

eng = sf.Engine("gaussian")
results = eng.run(prog, compile_options=compile_options)
```

* Utility functions are added to allow for easier Borealis program and parameter
creation.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* Functions are added for analyzing GBS results for comparisons with classical
simulations.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

<h3>Improvements</h3>

* A locked program can now be (un)rolled, and automatically restores the lock if
previously in place.
[(#703)](https://github.com/XanaduAI/strawberryfields/pull/703)

* Rolling and unrolling now only happens in place, and does no longer return the (un)rolled circuit.
* Rolling and unrolling now only happens in place, and no longer returns the
(un)rolled circuit.
[(#702)](https://github.com/XanaduAI/strawberryfields/pull/702)

* `Program.assert_number_of_modes` and `Program.assert_max_number_of_measurements` are combined
into a single `assert_modes` method.
* `Program.assert_number_of_modes` and `Program.assert_max_number_of_measurements`
are combined into a single `assert_modes` method.
[(#709)](https://github.com/XanaduAI/strawberryfields/pull/709)

* Job results can now be retrieved without converting integers to `np.int64` objects by setting
`integer_overflow_protection=False` (default `True`) when running a program via `RemoteEngine.run()`.
* Job results can now be retrieved without converting integers to `np.int64` objects
by setting `integer_overflow_protection=False` (default `True`) when running a
program via `RemoteEngine.run()`.
[(#712)](https://github.com/XanaduAI/strawberryfields/pull/712)

### Bug fixes
* The TDM module is refactored to contain `program.py`, with the `TDMProgram` class,
and `utils.py`, with various utility functions.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* The `Compiler` base class is updated to allow for setting a rigid circuit layout
to validate a program during compilation.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* The `Compiler` base class now contains methods that can be overwritten to provide
subclass compilers with loss-additions (e.g., to add realistic loss to a circuit) and program parameter updates.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

* Trying to unroll an already unrolled program with a different number of shots works as expected.
<h3>Bug fixes</h3>

* Trying to unroll an already unrolled program with a different number of shots
works as expected.
[(#702)](https://github.com/XanaduAI/strawberryfields/pull/702)

* Fixed bug with vacuum modes missing.
[(#702)](https://github.com/XanaduAI/strawberryfields/pull/702)

* Validating parameters now work with nested parameter arrays.
* Validating parameters now works with nested parameter arrays.
[(#711)](https://github.com/XanaduAI/strawberryfields/pull/711)

* Store correct rolled circuit before unrolling (fixes issue when rolled circuit has changed due to
e.g., compilation).
* Store correct rolled circuit before unrolling (fixes issue when rolled circuit
has changed due to e.g., compilation).
[(#710)](https://github.com/XanaduAI/strawberryfields/pull/710)

### Documentation
<h3>Documentation</h3>

* The centralized [Xanadu Sphinx Theme](https://github.com/XanaduAI/xanadu-sphinx-theme)
is now used to style the Sphinx documentation.
[(#701)](https://github.com/XanaduAI/strawberryfields/pull/701)

### Contributors
* The documentation on Gaussian circuit operations is fixed so that it's properly rendered.
[(#714)](https://github.com/XanaduAI/strawberryfields/pull/714)

<h3>Contributors</h3>

This release contains contributions from (in alphabetical order):

Mikhail Andrenkov, Theodor Isacsson
Mikhail Andrenkov, Sebastian Duque, Luke Helt, Theodor Isacsson, Josh Izaac, Fabian Laudenbach



---

# Release 0.22.0 (current release)
# Release 0.22.0

<h3>New features since last release</h3>

Expand Down
Binary file added doc/_static/borealis_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/borealis_schematic_advanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/borealis_schematic_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions doc/introduction/photonic_hardware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ Tutorials
For more details on submitting jobs to photonic hardware, check out the following
tutorials.

.. gallery-item::
:description: `Borealis quickstart <https://strawberryfields.ai/photonics/demos/tutorial_borealis_quickstart.html>`__
:figure: _static/borealis_3d.png

.. gallery-item::
:description: `Operating Borealis --- Beginner <https://strawberryfields.ai/photonics/demos/tutorial_borealis_beginner.html>`__
:figure: _static/borealis_schematic_simple.png

.. gallery-item::
:description: `Operating Borealis --- Advanced <https://strawberryfields.ai/photonics/demos/tutorial_borealis_beginner.html>`__
:figure: _static/borealis_schematic_advanced.png

.. gallery-item::
:description: :doc:`demos/tutorial_X8`
:figure: _static/chip.png
Expand Down
Loading

0 comments on commit 915ad42

Please sign in to comment.