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

Adds find_classical_subsystem #193

Merged
merged 6 commits into from
Sep 3, 2020
Merged

Adds find_classical_subsystem #193

merged 6 commits into from
Sep 3, 2020

Conversation

nquesada
Copy link
Collaborator

Adds the function find_classical_subsystem which finds the largest integer k so that subsystem in modes [0,1,...,k-1] is a classical state.

@nquesada nquesada requested review from josh146 and thisac and removed request for josh146 September 2, 2020 21:49
@josh146
Copy link
Member

josh146 commented Sep 3, 2020

Something strange seems to be happening with the windows builds 🤔

  TypeError: CCompiler_spawn() got an unexpected keyword argument 'env'
  Building wheel for thewalrus (setup.py): finished with status 'error'

thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/quantum.py Outdated Show resolved Hide resolved
thewalrus/quantum.py Outdated Show resolved Hide resolved
@@ -962,6 +964,30 @@ def is_classical_cov(cov, hbar=2, atol=1e-08):
return False


def find_classical_subsystem(cov, hbar=2, atol=1e-08):
"""Find the largest integer `k` so that subsystem in modes `[0,1,...,k-1]` is a classical state.
Copy link
Member

Choose a reason for hiding this comment

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

What about if modes [2, 3, .., k] is a classical subsystem (e.g., there is some offset?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In general one could consider finding a classical subsystem in a any subset of the modes. This is a a combinatorially large space and thus extremely difficult to search. This is why I just search for this particular order. If the user wants to search for [2,3,...,k] they can permute the modes...

@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #193 into master will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #193   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         1062      1075   +13     
=========================================
+ Hits          1062      1075   +13     
Impacted Files Coverage Δ
thewalrus/quantum.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

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

Copy link
Collaborator Author

@nquesada nquesada 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 the comments Josh

nquesada and others added 3 commits September 3, 2020 08:41
Co-authored-by: Josh Izaac <josh146@gmail.com>
Co-authored-by: Josh Izaac <josh146@gmail.com>
Co-authored-by: Josh Izaac <josh146@gmail.com>
@nquesada nquesada merged commit 0213fc8 into master Sep 3, 2020
@nquesada nquesada deleted the find_classical_subsystem branch September 3, 2020 15:06
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