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

Physical #447

Merged
merged 21 commits into from
Aug 5, 2024
Merged

Physical #447

merged 21 commits into from
Aug 5, 2024

Conversation

arsalan-motamedi
Copy link
Collaborator

Context:
Physicality checks added.

Description of the Change:
One can check physicality of a DM rho, or a Channel ch using rho.is_physical and/or ch.is_physical.
Moreover, one can check ch.is_TP , ch.is_CP, and DM.is_positive.

Benefits:
Clear.

Possible Drawbacks:
None.

Related GitHub Issues:
None.

@arsalan-motamedi arsalan-motamedi added the no changelog Pull request does not require a CHANGELOG entry label Jul 31, 2024
Copy link

codecov bot commented Jul 31, 2024

Codecov Report

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

Project coverage is 88.80%. Comparing base (4aeafee) to head (5c41971).

Files Patch % Lines
mrmustard/lab_dev/transformations/base.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #447      +/-   ##
===========================================
+ Coverage    88.75%   88.80%   +0.05%     
===========================================
  Files          100      100              
  Lines         6982     7024      +42     
===========================================
+ Hits          6197     6238      +41     
- Misses         785      786       +1     
Files Coverage Δ
mrmustard/lab_dev/states/base.py 96.19% <100.00%> (+0.20%) ⬆️
mrmustard/utils/settings.py 100.00% <100.00%> (ø)
mrmustard/lab_dev/transformations/base.py 97.19% <95.65%> (-0.48%) ⬇️

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 4aeafee...5c41971. Read the comment docs.

- Addressing CodeFactor's issues.
- Improving the code for is_CP and is_positive (for Channels and DMs respectively).
… ) as input for modes.

- Added the missing test for DM.is_physical
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.

Looking good so far mostly just updates to the docs

mrmustard/lab_dev/states/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/states/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/states/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/states/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/states/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/base.py 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.

Super! 💯
I agree with Anthony's suggestions.

- Adding self.ATOL in the utils of mrmustard and setting it to 1e-8. This tolerance level is used in checking the positivity conditions and CP conditions.
- Improving the code when checking chonditions in the form all(...).
mrmustard/utils/settings.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/base.py Outdated Show resolved Hide resolved
@arsalan-motamedi arsalan-motamedi merged commit 3a111fc into develop Aug 5, 2024
7 checks passed
@arsalan-motamedi arsalan-motamedi deleted the physical branch August 5, 2024 20:17
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