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

Rectangular gkp #668

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Rectangular gkp #668

wants to merge 10 commits into from

Conversation

elib20
Copy link
Collaborator

@elib20 elib20 commented Dec 17, 2021

Context: Currently, strawberryfields only supports square lattice GKP states. The simplest more general type of GKP states are rectangular lattice GKP states (instead of peak spacing by sqrt(pi) in q quadrature, it's sqrt(alpha*sqrt(pi)). This allows for, e.g. GKP sensor states.

Description of the Change: Adds the ability to initialize rectangular GKP states to the bosonic and fock backends.

Benefits: Wider class of states to simulate.

Possible Drawbacks:

Related GitHub Issues:

- Adds a parameter, alpha, to specify peak spacing of the GKP state
- Modifies both fock and bosonic backends
@elib20 elib20 changed the title Rect gkp Rectangular gkp Dec 17, 2021
@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #668 (0d6c810) into master (7ee0dd4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #668   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files          75       75           
  Lines        9029     9035    +6     
=======================================
+ Hits         8875     8881    +6     
  Misses        154      154           
Impacted Files Coverage Δ
...trawberryfields/backends/bosonicbackend/backend.py 100.00% <100.00%> (ø)
strawberryfields/backends/fockbackend/backend.py 100.00% <100.00%> (ø)
strawberryfields/backends/fockbackend/circuit.py 98.41% <100.00%> (ø)
strawberryfields/backends/fockbackend/ops.py 95.26% <100.00%> (ø)
strawberryfields/ops.py 98.30% <100.00%> (ø)

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 7ee0dd4...0d6c810. Read the comment docs.

Copy link
Collaborator

@ilan-tz ilan-tz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! Good thinking to add more flexibility in choice of GKP state for the user.

tests/backend/test_bosonic_backend.py Show resolved Hide resolved
strawberryfields/backends/fockbackend/ops.py Show resolved Hide resolved
strawberryfields/backends/fockbackend/ops.py Show resolved Hide resolved
tests/backend/test_bosonic_backend.py Outdated Show resolved Hide resolved
tests/backend/test_bosonic_backend.py Show resolved Hide resolved
tests/backend/test_bosonic_backend.py Show resolved Hide resolved
tests/backend/test_bosonic_backend.py Show resolved Hide resolved
tests/backend/test_bosonic_backend.py Outdated Show resolved Hide resolved
@elib20 elib20 requested a review from josh146 December 22, 2021 14:36
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.

3 participants