Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompositions #7

Merged
merged 15 commits into from
Apr 19, 2018
Merged

Decompositions #7

merged 15 commits into from
Apr 19, 2018

Conversation

josh146
Copy link
Member

@josh146 josh146 commented Apr 19, 2018

Description of the Change

Adds the following as frontend functionality to Strawberry Fields:

  • Provides a module of decomposition functions, covering the Takagi, Clements, Williamson, and Bloch-Messiah decompositions.
  • Creates a new abstract base class strawberryfields.ops.Decompositions, which is used to create quantum operations which target the decompositions. The included operation are:
    • CovarianceState: uses the Williamson decomposition to decompose a Gaussian covariance matrix into a symplectic transformation acting on a set of thermal states
    • GaussianTransform: uses the Bloch-Messiah decomposition to decompose a Gaussian symplectic transformation to two linear interferometers and one-mode squeezers
    • Interferometer: decomposes a unitary representing a multi-mode linear interferometer into a combination of beamsplitters and rotation gates, using the Clements decomposition.
  • Documentation has also been updated, with an additional section added to the conventions, detailing the various decompositions.

Benefits

  • Provides front-facing user ability to decompose arbitrary Gaussian states and unitaries into the set of quantum gates provided by Strawberry Fields
  • Supported by all backends when performing numerical simulations
  • Provides a class structure that can be updated with additional decompositions down the line, for example non-Gaussian decompositions for Bose-Hubbard etc.

Possible Drawbacks

  • At the moment, the only way for a user to see the decomposed gates is to apply the decomposition operation and run the engine, then inspect the output of eng.print_applied(). This is consistent with how existing gates are decomposed in Strawberry Fields.
  • The decomposition class only accepts NumPy objects as arguments, not tensorflow objects. If attempting to initialize a decomposition with a tensorflow object, the user will receive a NotImplementedError.

Related GitHub Issues: None

@josh146 josh146 requested review from co9olguy and nquesada April 19, 2018 09:09
@josh146 josh146 removed the request for review from nquesada April 19, 2018 09:11
@codecov
Copy link

codecov bot commented Apr 19, 2018

Codecov Report

Merging #7 into master will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #7      +/-   ##
==========================================
+ Coverage   96.36%   96.53%   +0.16%     
==========================================
  Files          21       22       +1     
  Lines        3302     3464     +162     
==========================================
+ Hits         3182     3344     +162     
  Misses        120      120
Flag Coverage Δ
#b0 94.6% <100%> (+0.26%) ⬆️
#b1 66.1% <98.83%> (+3.08%) ⬆️
#fock 46.99% <98.83%> (+3.99%) ⬆️
#gaussian 42.49% <100%> (+2.82%) ⬆️
#m0 96.33% <100%> (+0.17%) ⬆️
#m1 95.32% <100%> (+0.22%) ⬆️
#tf 67.75% <98.83%> (+2.97%) ⬆️
Impacted Files Coverage Δ
strawberryfields/backends/gaussianbackend/ops.py 93.33% <ø> (-0.19%) ⬇️
...fields/backends/gaussianbackend/gaussiancircuit.py 99.57% <100%> (ø) ⬆️
strawberryfields/decompositions.py 100% <100%> (ø)
strawberryfields/backends/shared_ops.py 97.08% <100%> (+0.61%) ⬆️
strawberryfields/utils.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92633c7...4497434. Read the comment docs.

@josh146 josh146 merged commit e8db616 into master Apr 19, 2018
@josh146 josh146 deleted the decompositions branch July 17, 2018 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants