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

Rich wires #523

Merged
merged 53 commits into from
Jan 13, 2025
Merged

Rich wires #523

merged 53 commits into from
Jan 13, 2025

Conversation

ziofil
Copy link
Collaborator

@ziofil ziofil commented Nov 14, 2024

Wires have been challenging to maintain due to evolving requirements.

This PR introduces a better abstraction for Wire that stores a collection of QuantumWire and ClassicalWire dataclasses. Metadata can be added to these dataclasses without modifying the Wires object’s handling of indices and dictionaries. Many methods, like __matmul__, are greatly simplified.

@ziofil ziofil added the no changelog Pull request does not require a CHANGELOG entry label Nov 14, 2024
@ziofil ziofil added the WIP work in progress label Nov 14, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 99.56140% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.19%. Comparing base (4d61a52) to head (7b4494b).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
mrmustard/physics/wires.py 99.36% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #523      +/-   ##
===========================================
- Coverage    90.20%   90.19%   -0.02%     
===========================================
  Files          102      102              
  Lines         6321     6314       -7     
===========================================
- Hits          5702     5695       -7     
  Misses         619      619              
Files with missing lines Coverage Δ
mrmustard/lab_dev/circuit_components.py 98.44% <100.00%> (ø)
...ustard/lab_dev/circuit_components_utils/b_to_ps.py 100.00% <100.00%> (ø)
...mustard/lab_dev/circuit_components_utils/b_to_q.py 100.00% <100.00%> (ø)
...tard/lab_dev/circuit_components_utils/trace_out.py 100.00% <100.00%> (ø)
mrmustard/lab_dev/circuits.py 94.93% <100.00%> (ø)
mrmustard/lab_dev/states/dm.py 95.75% <100.00%> (+0.10%) ⬆️
mrmustard/lab_dev/states/ket.py 98.63% <100.00%> (+0.03%) ⬆️
mrmustard/lab_dev/states/number.py 100.00% <100.00%> (ø)
mrmustard/lab_dev/states/quadrature_eigenstate.py 100.00% <100.00%> (ø)
mrmustard/lab_dev/states/sauron.py 100.00% <ø> (ø)
... and 6 more

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 4d61a52...7b4494b. Read the comment docs.

@ziofil ziofil removed the WIP work in progress label Nov 27, 2024
mrmustard/physics/wires.py Outdated Show resolved Hide resolved
mrmustard/physics/wires.py Outdated Show resolved Hide resolved
mrmustard/physics/wires.py Outdated Show resolved Hide resolved
@apchytr apchytr requested a review from aplund December 6, 2024 15:01
.gitignore Outdated Show resolved Hide resolved
mrmustard/lab_dev/circuit_components.py Show resolved Hide resolved
mrmustard/lab_dev/circuits.py Show resolved Hide resolved
mrmustard/physics/wires.py Show resolved Hide resolved
mrmustard/physics/wires.py Show resolved Hide resolved
mrmustard/physics/wires.py Show resolved Hide resolved
mrmustard/physics/wires.py Show resolved Hide resolved
mrmustard/physics/wires.py Show resolved Hide resolved
Copy link
Collaborator

@apchytr apchytr left a comment

Choose a reason for hiding this comment

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

Awesome job Filippo!

@ziofil ziofil merged commit a4dfcd8 into develop Jan 13, 2025
10 checks passed
@ziofil ziofil deleted the rich_wires branch January 13, 2025 17:18
ziofil added a commit that referenced this pull request Jan 22, 2025
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.

3 participants