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

Rescale fock_tensor #107

Merged
merged 5 commits into from Dec 23, 2019
Merged

Rescale fock_tensor #107

merged 5 commits into from Dec 23, 2019

Conversation

nquesada
Copy link
Collaborator

Improves the numerical stability of the fock_tensor function by rescaling the matrix whose batch hafnians are needed. That way one does not need to rescale the value of the matrix elements after they have been calculated. This is done by passing an extra argument to state_vector.

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

💯 Approved in person (@nquesada, I left two small corrections)

@@ -501,6 +501,9 @@ def state_vector(mu, cov, post_select=None, normalize=False, cutoff=5, hbar=2, c
relation :math:`[\x,\p]=i\hbar`.
check_purity (bool): if ``True``, the purity of the Gaussian state is checked
before calculating the state vector.
choi_r (float or None): Value of the two-mode squeezing parameter used in Choi-Jamiolkoski
trick in `fock_tensor`. This variable is only used when `state_vector` is called
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
trick in `fock_tensor`. This variable is only used when `state_vector` is called
trick in :func:`~.fock_tensor`. This keyword argument should only be used when ``state_vector`` is called

@@ -501,6 +501,9 @@ def state_vector(mu, cov, post_select=None, normalize=False, cutoff=5, hbar=2, c
relation :math:`[\x,\p]=i\hbar`.
check_purity (bool): if ``True``, the purity of the Gaussian state is checked
before calculating the state vector.
choi_r (float or None): Value of the two-mode squeezing parameter used in Choi-Jamiolkoski
trick in `fock_tensor`. This variable is only used when `state_vector` is called
by `fock_tensor`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
by `fock_tensor`.
by :func:`~.fock_tensor`.

@nquesada nquesada changed the title Res scale hermite Rescale fock_tensor Dec 23, 2019
@codecov
Copy link

codecov bot commented Dec 23, 2019

Codecov Report

Merging #107 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   97.73%   97.74%   +<.01%     
==========================================
  Files          12       12              
  Lines         884      885       +1     
==========================================
+ Hits          864      865       +1     
  Misses         20       20
Impacted Files Coverage Δ
thewalrus/quantum.py 100% <100%> (ø) ⬆️
thewalrus/_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 b9a95c9...55e9abf. Read the comment docs.

@nquesada nquesada merged commit f53727e into master Dec 23, 2019
@nquesada nquesada deleted the res_scale_hermite branch December 23, 2019 18:31
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.

None yet

2 participants