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

add triples.py file in the physics #338

Merged
merged 48 commits into from
Feb 13, 2024
Merged

add triples.py file in the physics #338

merged 48 commits into from
Feb 13, 2024

Conversation

sylviemonet
Copy link
Contributor

Context: Add a new file triples.py in the physics module to include all triples in Bargmann representations of the states and transformations.
This PR will set up the basic physics for Bargmann objects.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@sylviemonet sylviemonet added the WIP work in progress label Feb 2, 2024
@sylviemonet sylviemonet marked this pull request as draft February 2, 2024 18:20
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (312d7e2) 84.46% compared to head (d201ac9) 84.88%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #338      +/-   ##
===========================================
+ Coverage    84.46%   84.88%   +0.41%     
===========================================
  Files           66       67       +1     
  Lines         4900     5035     +135     
===========================================
+ Hits          4139     4274     +135     
  Misses         761      761              
Files Coverage Δ
mrmustard/math/backend_manager.py 98.10% <100.00%> (+0.02%) ⬆️
mrmustard/math/backend_numpy.py 100.00% <ø> (ø)
mrmustard/math/backend_tensorflow.py 100.00% <ø> (ø)
mrmustard/physics/triples.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 312d7e2...d201ac9. Read the comment docs.

Copy link
Contributor

@SamFerracin SamFerracin left a comment

Choose a reason for hiding this comment

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

The math seems correct. Just a few typos and suggestions to improve the docs.

Also:

  • If you don't add an rst file, you won't be able to see the docs
  • Unit tests are missing (hence, coverage went down)

mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
mrmustard/physics/triples.py Outdated Show resolved Hide resolved
@SamFerracin SamFerracin removed the WIP work in progress label Feb 12, 2024
@SamFerracin SamFerracin marked this pull request as ready for review February 12, 2024 14:25
Copy link
Contributor

@SamFerracin SamFerracin left a comment

Choose a reason for hiding this comment

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

This looks good to me now. Take a look and merge whenever you feel it's ready :)
Question:

  • Are we missing some tests? Especially on those functions that do something non-trivial to the input parameters to change their lengths, or on those that do the math.block thing

@sylviemonet sylviemonet requested a review from ziofil February 12, 2024 14:59
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@ziofil ziofil left a comment

Choose a reason for hiding this comment

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

Very nice 👍
For Q1 we will also need the Abc of the basis change kernels: up to you to add them to this PR or to open a separate one.

@sylviemonet sylviemonet merged commit 95d0602 into develop Feb 13, 2024
8 checks passed
@sylviemonet sylviemonet deleted the ABC_triples branch February 13, 2024 18:36
@SamFerracin SamFerracin mentioned this pull request Feb 23, 2024
SamFerracin pushed a commit that referenced this pull request Feb 28, 2024
### New features
* Added functions to generate the ``(A, b, c)`` triples for the
Fock-Bargmann representation of
several states and gates.
[(#338)](#338)

### Breaking changes

### Improvements

### Bug fixes
* Fixing a bug in `_transform_gaussian` in transformation.py that
modifies the input state's cov and means.
[(#349)](#349)
* Fixing a bug in `general_dyne` in physics/gaussian.py that returns the
wrong probability and outcomes with given projection.
[(#349)](#349)

### Documentation

### Tests

### Contributors
@SamFerracin @ziofil @sylviemonet

---------

Co-authored-by: Sebastián Duque Mesa <675763+sduquemesa@users.noreply.github.com>
Co-authored-by: JacobHast <jacobhastrup@gmail.com>
Co-authored-by: elib20 <53090166+elib20@users.noreply.github.com>
Co-authored-by: ziofil <ziofil@users.noreply.github.com>
Co-authored-by: ziofil <miatto@gmail.com>
Co-authored-by: Luke Helt <31250931+heltluke@users.noreply.github.com>
Co-authored-by: zeyueN <48225584+zeyueN@users.noreply.github.com>
Co-authored-by: Robbe De Prins <52749580+rdprins@users.noreply.github.com>
Co-authored-by: Robbe De Prins (UGent-imec) <Robbe.DePrins@UGent.be>
Co-authored-by: Yuan <16817699+sylviemonet@users.noreply.github.com>
Co-authored-by: Ryk <47638463+ryk-wolf@users.noreply.github.com>
Co-authored-by: Gabriele Gullì <120967042+ggulli@users.noreply.github.com>
Co-authored-by: Yuan Yao <yuan.yao@xanadu-Yuan-YAO.local>
Co-authored-by: Yuan Yao <yuan.yao@xanadu-infras-MacBook-Air.local>
Co-authored-by: heltluke <luke.helt@gmail.com>
Co-authored-by: Tanner Rogalsky <tanner@tannerrogalsky.com>
Co-authored-by: Jan Provazník <101715194+jan-provaznik@users.noreply.github.com>
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.

3 participants