-
Notifications
You must be signed in to change notification settings - Fork 56
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
Hafnian modifications #333
Hafnian modifications #333
Conversation
…alrus into hafnian_modifications
Tried to correct f_loop_odd
…alrus into hafnian_modifications
…alrus into hafnian_modifications
…alrus into hafnian_modifications
…alrus into hafnian_modifications
Codecov Report
@@ Coverage Diff @@
## master #333 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 1722 1723 +1
=========================================
+ Hits 1722 1723 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some benchmarking is also needed.
@@ -261,17 +261,16 @@ def f_loop_odd(E, AX_S, XD_S, D_S, n, oddloop, oddVX_S): # pragma: no cover | |||
Returns: | |||
array: polynomial coefficients | |||
""" | |||
E_k = E.copy() | |||
|
|||
count = 0 | |||
comb = np.zeros((2, n + 1), dtype=np.complex128) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since now the power traces inherit the type of your matrix, you don't need to make this complex, I believe. Worth checking this in a separate branch before doing the change here.
thewalrus/_hafnian.py
Outdated
@@ -640,7 +640,9 @@ def loop_hafnian(A, D=None, reps=None, glynn=True): | |||
|
|||
def input_validation(A, rtol=1e-05, atol=1e-08): | |||
"""Checks that the matrix A satisfies the requirements for Hafnian calculation. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the same issue as the last time. For some reason the text editor of one of you @brandonpolymtl @JQZ1111 @benjaminlanthier @dleclerc33 is adding empty lines. This need to be corrected!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would suggest to check the wrapping settings of your editors. Also, check if the documentation is rendering correctly.
.gitignore
Outdated
@@ -26,3 +26,5 @@ docs/code/api/* | |||
.idea | |||
.mypy_cache/ | |||
.DS_Store | |||
|
|||
venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add a line at the end of the file.
venv | |
venv | |
Thinking of it again, maybe it is not a good idea to have this on the project's gitignore file — every developer can have a different name for its dev environment.
I guess the best option is to add venv
(or whatever is the name of your virtual environment) to your global gitignore file.
thewalrus/_hafnian.py
Outdated
@@ -640,7 +640,9 @@ def loop_hafnian(A, D=None, reps=None, glynn=True): | |||
|
|||
def input_validation(A, rtol=1e-05, atol=1e-08): | |||
"""Checks that the matrix A satisfies the requirements for Hafnian calculation. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would suggest to check the wrapping settings of your editors. Also, check if the documentation is rendering correctly.
Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com>
Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com>
Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com>
Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com>
Co-authored-by: Nicolas Quesada <991946+nquesada@users.noreply.github.com>
Co-authored-by: Nicolas Quesada <991946+nquesada@users.noreply.github.com>
Co-authored-by: Nicolas Quesada <991946+nquesada@users.noreply.github.com>
Co-authored-by: Nicolas Quesada <991946+nquesada@users.noreply.github.com>
Co-authored-by: Nicolas Quesada <991946+nquesada@users.noreply.github.com>
The new hafnian functions now use the Labudde method to calculate power traces instead of using diagonalization.