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

Update to support SF v0.11 #3

Merged
merged 20 commits into from
Jul 11, 2019
Merged

Update to support SF v0.11 #3

merged 20 commits into from
Jul 11, 2019

Conversation

josh146
Copy link
Member

@josh146 josh146 commented Jul 6, 2019

No description provided.

@josh146 josh146 requested a review from co9olguy July 7, 2019 14:38
@codecov
Copy link

codecov bot commented Jul 7, 2019

Codecov Report

Merging #3 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master     #3     +/-   ##
=======================================
  Coverage     100%   100%             
=======================================
  Files          11      5      -6     
  Lines        1493    299   -1194     
=======================================
- Hits         1493    299   -1194
Impacted Files Coverage Δ
sfopenboson/auxillary.py 100% <ø> (ø) ⬆️
sfopenboson/ops.py 100% <100%> (ø) ⬆️
sfopenboson/_version.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 2f87f67...fd71981. Read the comment docs.

Copy link
Member

@co9olguy co9olguy left a comment

Choose a reason for hiding this comment

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

Nice 👍, left a couple questions.

setup.py Outdated Show resolved Hide resolved
numeric_level = getattr(logging, logLevel.upper(), 10)
# defaults
TOL = 1e-2
HBAR = 2
Copy link
Member

Choose a reason for hiding this comment

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

worthwhile using an unconventional value here (to help detect bugs)?

Copy link
Member

Choose a reason for hiding this comment

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

or will you leave that up to travis?

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually changed this to HBAR = 1.7 as in SF, and discovered that a huge majority of the tests have hbar = 2 assumptions built into them 🤦‍♂ I didn't want to go out of scope, but I'll make a new issue to fix that.

assert np.allclose(state.fock_prob([1, 1]), exp[1], rtol=tol)
assert np.allclose(state.fock_prob([0, 2]), exp[2], rtol=tol)

def test_1x2_quadrature_operators(self, eng, tol):
Copy link
Member

Choose a reason for hiding this comment

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

new test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, noticed it wasn't being tested previously, and GitHub/Codecov wouldn't pass the coverage checks without it

self.H = bose_hubbard(1, 2, self.J, self.U)
self.Hquad = get_quad_operator(self.H, hbar=self.hbar)

def test_hbar_outside_context(self):
Copy link
Member

Choose a reason for hiding this comment

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

no longer need these hbar tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this is because of the change in how hbar is handled in SF v0.11; hbar is no longer part of the engine/program context, but a separate global variable.

"""Test S2gate produces correct cov and means"""
self.logTestName()
# NOTE: There is currently a bug in strawberry fields,
Copy link
Member

Choose a reason for hiding this comment

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

nice!

@josh146 josh146 merged commit b7ebd31 into master Jul 11, 2019
@josh146 josh146 deleted the sfv0.11_update branch July 11, 2019 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants