XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
99 stars 54 forks source link

Off diagonal #383

Closed nquesada closed 2 months ago

nquesada commented 4 months ago

A somewhat more numerically stable coherence calculation of the density matrix.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 98.36066% with 1 lines in your changes are missing coverage. Please review.

:exclamation: No coverage uploaded for pull request base (internal_modes@7c63905). Click here to learn what that means.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## internal_modes #383 +/- ## ================================================= Coverage ? 99.95% ================================================= Files ? 33 Lines ? 2227 Branches ? 0 ================================================= Hits ? 2226 Misses ? 1 Partials ? 0 ``` | [Files](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [thewalrus/\_hafnian.py](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?src=pr&el=tree&filepath=thewalrus%2F_hafnian.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL19oYWZuaWFuLnB5) | `100.00% <ø> (ø)` | | | [thewalrus/internal\_modes/\_\_init\_\_.py](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?src=pr&el=tree&filepath=thewalrus%2Finternal_modes%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL2ludGVybmFsX21vZGVzL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [thewalrus/internal\_modes/pnr\_statistics.py](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?src=pr&el=tree&filepath=thewalrus%2Finternal_modes%2Fpnr_statistics.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL2ludGVybmFsX21vZGVzL3Bucl9zdGF0aXN0aWNzLnB5) | `100.00% <100.00%> (ø)` | | | [thewalrus/internal\_modes/utils.py](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?src=pr&el=tree&filepath=thewalrus%2Finternal_modes%2Futils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL2ludGVybmFsX21vZGVzL3V0aWxzLnB5) | `100.00% <ø> (ø)` | | | [thewalrus/internal\_modes/fock\_density\_matrices.py](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?src=pr&el=tree&filepath=thewalrus%2Finternal_modes%2Ffock_density_matrices.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL2ludGVybmFsX21vZGVzL2ZvY2tfZGVuc2l0eV9tYXRyaWNlcy5weQ==) | `98.57% <98.24%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [7c63905...621e982](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/383?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI).
nquesada commented 2 months ago

@rachelchadwick this worked! Looking fwd to see this branch merged!

rachelchadwick commented 2 months ago

@rachelchadwick this worked! Looking fwd to see this branch merged!

@nquesada But it seems to fail with a segmentation fault most of the time. That's not something I want to merge into main for sure.

rachelchadwick commented 2 months ago

Ok I've run it several times now with no problem so the segmentation error seems to have fixed itself too. So unless there are any objections I'll merge this one into internal_modes tomorrow.