XanaduAI / MrMustard

A differentiable bridge between phase space and Fock space
https://mrmustard.readthedocs.io/
Apache License 2.0
78 stars 27 forks source link

Stable Fock conversion #471

Closed ziofil closed 2 months ago

ziofil commented 2 months ago

This PR introduces a few reworkings of some of our basic numba algorithms:

So far: [x] 1.8x faster implementation of vanilla [x] corresponding vanilla_vjp (only 1.2x faster) [x] 40x faster (🚀!) version of vanilla_stable [x] 10x faster version of vanilla_stable_batched

Also renames the setting from USE_VANILLA_AVERAGE to STABLE_FOCK_CONVERSION (much clearer)

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.55%. Comparing base (d6e0d9d) to head (f64eac1). Report is 1 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #471 +/- ## =========================================== + Coverage 89.52% 89.55% +0.03% =========================================== Files 102 101 -1 Lines 7408 7384 -24 =========================================== - Hits 6632 6613 -19 + Misses 776 771 -5 ``` | [Files with missing lines](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [mrmustard/math/backend\_numpy.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?src=pr&el=tree&filepath=mrmustard%2Fmath%2Fbackend_numpy.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL21hdGgvYmFja2VuZF9udW1weS5weQ==) | `100.00% <100.00%> (ø)` | | | [mrmustard/math/backend\_tensorflow.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?src=pr&el=tree&filepath=mrmustard%2Fmath%2Fbackend_tensorflow.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL21hdGgvYmFja2VuZF90ZW5zb3JmbG93LnB5) | `100.00% <ø> (ø)` | | | [mrmustard/math/lattice/steps.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?src=pr&el=tree&filepath=mrmustard%2Fmath%2Flattice%2Fsteps.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL21hdGgvbGF0dGljZS9zdGVwcy5weQ==) | `37.03% <100.00%> (+0.97%)` | :arrow_up: | | [mrmustard/math/lattice/strategies/vanilla.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?src=pr&el=tree&filepath=mrmustard%2Fmath%2Flattice%2Fstrategies%2Fvanilla.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL21hdGgvbGF0dGljZS9zdHJhdGVnaWVzL3ZhbmlsbGEucHk=) | `100.00% <100.00%> (ø)` | | | [mrmustard/utils/settings.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?src=pr&el=tree&filepath=mrmustard%2Futils%2Fsettings.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL3V0aWxzL3NldHRpbmdzLnB5) | `100.00% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?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/MrMustard/pull/471?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [d6e0d9d...f64eac1](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/471?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).