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

quadrature repr in CircuitComponent #399

Merged
merged 32 commits into from
May 27, 2024
Merged

quadrature repr in CircuitComponent #399

merged 32 commits into from
May 27, 2024

Conversation

ziofil
Copy link
Collaborator

@ziofil ziofil commented May 10, 2024

  • Adds quadrature representation at the level of CircuitComponent: since it's a single-wire operation it always exists.

  • Simplifies having to check for representation type when extracting data by creating a common abstraction scalar which means c for Bargmann and array for Fock, and data which is triple for Bargmann and array for Fock. This way we simplify lots of useless ifs and isinstance checks.

@ziofil ziofil added WIP work in progress no changelog Pull request does not require a CHANGELOG entry labels May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

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

Project coverage is 87.61%. Comparing base (90a259a) to head (3b9b0b0).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #399      +/-   ##
===========================================
- Coverage    87.63%   87.61%   -0.02%     
===========================================
  Files           81       81              
  Lines         6129     6154      +25     
===========================================
+ Hits          5371     5392      +21     
- Misses         758      762       +4     
Files Coverage Δ
mrmustard/lab_dev/circuit_components.py 96.25% <100.00%> (+0.12%) ⬆️
mrmustard/lab_dev/states/base.py 96.46% <100.00%> (-0.09%) ⬇️
mrmustard/math/tensor_wrappers/xptensor.py 70.90% <ø> (ø)
mrmustard/physics/ansatze.py 95.08% <100.00%> (-0.06%) ⬇️
mrmustard/physics/converters.py 100.00% <100.00%> (ø)
mrmustard/physics/representations.py 97.67% <85.18%> (-1.81%) ⬇️

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 90a259a...3b9b0b0. Read the comment docs.

@sylviemonet
Copy link
Contributor

Except for the two TODOs rename thing, this PR looks nice to me! (happy to move the quadrature thing into CircuitComponent directly.

Please fix them and it is good to go!

ziofil and others added 3 commits May 14, 2024 11:02
Co-authored-by: Yuan YAO <16817699+sylviemonet@users.noreply.github.com>
@ziofil ziofil removed the WIP work in progress label May 14, 2024
@ziofil
Copy link
Collaborator Author

ziofil commented May 22, 2024

@elib20 can I get an approval when you have a minute?

Copy link
Contributor

@elib20 elib20 left a comment

Choose a reason for hiding this comment

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

Thanks for waiting! I have a few questions.

mrmustard/lab_dev/circuit_components.py Show resolved Hide resolved
mrmustard/lab_dev/circuit_components.py Show resolved Hide resolved
mrmustard/lab_dev/circuit_components.py Outdated Show resolved Hide resolved
mrmustard/physics/representations.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/circuit_components.py Show resolved Hide resolved
Copy link
Contributor

@elib20 elib20 left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments! I'm approving, but left a couple remaining comments/questions to be addressed in future.

mrmustard/lab_dev/circuit_components.py Show resolved Hide resolved
mrmustard/lab_dev/circuit_components.py Show resolved Hide resolved
@ziofil ziofil merged commit 405cfd6 into develop May 27, 2024
7 checks passed
@ziofil ziofil deleted the mm1_more_repr branch May 27, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Pull request does not require a CHANGELOG entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants