-
Notifications
You must be signed in to change notification settings - Fork 27
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
separated ket dm from base #510
Conversation
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨Explore these optional code suggestions:
|
Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>
Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #510 +/- ##
===========================================
+ Coverage 89.33% 89.41% +0.07%
===========================================
Files 87 89 +2
Lines 5984 6029 +45
===========================================
+ Hits 5346 5391 +45
Misses 638 638
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments but looks great thanks!
User description
Context:
The file
mrmustard/lab_dev/states/base.py
was 1200+ lines long and it was hard to navigate.Description of the Change:
DM
andKet
are now defined in their own files.Benefits:
Ket
orDM
)states/base.py
now is more abstractPossible Drawbacks:
Some minor code duplication because e.g.
DM
cannot useKet.random
in its ownrandom
method anymore (unless we allow for imports in methods).PR Type
enhancement
Description
Ket
andDM
classes frombase.py
into their own modules,ket.py
anddm.py
.Ket
andDM
from their new modules.__init__.py
for clarity and specificity.Changes walkthrough 📝
13 files
__init__.py
Refactor import statements for clarity and specificity
mrmustard/lab_dev/states/init.py
wildcard imports.
Ket
andDM
classes.base.py
Refactor base state class to remove Ket and DM
mrmustard/lab_dev/states/base.py
Ket
andDM
class definitions from the file.ket
anddm
modules.from_phase_space
method return type.coherent.py
Update import for Ket class in coherent state
mrmustard/lab_dev/states/coherent.py
Ket
from the newket
module.displaced_squeezed.py
Update import for Ket class in displaced squeezed state
mrmustard/lab_dev/states/displaced_squeezed.py
Ket
from the newket
module.dm.py
Create DM class in a separate module
mrmustard/lab_dev/states/dm.py
DM
class.ket.py
Create Ket class in a separate module
mrmustard/lab_dev/states/ket.py
Ket
class.number.py
Update import for Ket class in number state
mrmustard/lab_dev/states/number.py
Ket
from the newket
module.quadrature_eigenstate.py
Update import for Ket class in quadrature eigenstate
mrmustard/lab_dev/states/quadrature_eigenstate.py
Ket
from the newket
module.sauron.py
Update import for Ket class in Sauron state
mrmustard/lab_dev/states/sauron.py
Ket
from the newket
module.squeezed_vacuum.py
Update import for Ket class in squeezed vacuum state
mrmustard/lab_dev/states/squeezed_vacuum.py
Ket
from the newket
module.thermal.py
Update import for DM class in thermal state
mrmustard/lab_dev/states/thermal.py
DM
from the newdm
module.two_mode_squeezed_vacuum.py
Update import for Ket class in two-mode squeezed vacuum state
mrmustard/lab_dev/states/two_mode_squeezed_vacuum.py
Ket
from the newket
module.vacuum.py
Update import for Ket class in vacuum state
mrmustard/lab_dev/states/vacuum.py
Ket
from the newket
module.1 files
test_ansatz.py
Update import for DM class in test cases
tests/test_physics/test_ansatz.py
DM
from the newdm
module.