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

Upated Indexing from 1 -> 0 #602

Merged
merged 18 commits into from
Jun 3, 2024

Conversation

anushkrishnav
Copy link
Contributor

@anushkrishnav anushkrishnav commented May 30, 2024

Description

Fixes #168
Moving Permute system index offset from 0->1

Changes

Update the code

the docs and tests would be updated once the solution is approved

Checklist

  • Use ruff for errors related to code style and formatting.
  • Verify all previous and newly added unit tests pass in pytest.
  • Check the documentation build does not lead to any failures. Sphinx build can be checked locally for any failures related to your PR
  • Use linkcheck to check for broken links in the documentation
  • Use doctest to verify the examples in the function docstrings work as expected.

@purva-thakre
Copy link
Collaborator

purva-thakre commented May 30, 2024

the docs and tests would be updated once the solution is approved

Can you go ahead and make changes to the unit tests and doc examples? It's difficult to see how the new changes would work successfully otherwise.

@anushkrishnav
Copy link
Contributor Author

anushkrishnav commented May 30, 2024

Yes I am on it right now
@purva-thakre
for some reason pytest throws the error below

_____________________________________________________________________________ ERROR collecting toqito/perms/tests/test_unique_perms.py _____________________________________________________________________________
ImportError while importing test module '/Users/anushkrishnav/Documents/toqito/toqito/perms/tests/test_unique_perms.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
toqito/perms/__init__.py:3: in <module>
    from toqito.perms.unique_perms import unique_perms
E   ModuleNotFoundError: No module named 'toqito'

@anushkrishnav
Copy link
Contributor Author

fixed it by setting
PYTHONPATH=. pytest

@purva-thakre
Copy link
Collaborator

fixed it by setting PYTHONPATH=. pytest

This depends on how your local virtual environment is setup.

@anushkrishnav
Copy link
Contributor Author

I have updated the tests, there is one case that's failing which is the 16x16 check part from that all the other cases are working well not sure whats going wrong, is there a way to verify what the right result would be ?

Copy link

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.1%. Comparing base (220b94f) to head (a0be190).
Report is 272 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #602   +/-   ##
======================================
  Coverage    98.1%   98.1%           
======================================
  Files         162     162           
  Lines        3108    3112    +4     
  Branches      760     759    -1     
======================================
+ Hits         3050    3054    +4     
  Misses         37      37           
  Partials       21      21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@purva-thakre
Copy link
Collaborator

there is one case that's failing which is the 16x16 check part

Which one are you talking about? Can you link it?

@anushkrishnav
Copy link
Contributor Author

anushkrishnav commented May 31, 2024

there is one case that's failing which is the 16x16 check part

Which one are you talking about? Can you link it?

@purva-thakre Solved the problem, all cases have passed now, made a small mistake That I have fixed it , and the code should now work across all these cases, I have made the change in the codes that uses perm from 1 to do from 0 as well

Copy link
Collaborator

@purva-thakre purva-thakre left a comment

Choose a reason for hiding this comment

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

Getting close to merging this!

I suggested some minor changes and also requested a clarification on a change you made.

toqito/perms/permutation_operator.py Outdated Show resolved Hide resolved
toqito/perms/permutation_operator.py Show resolved Hide resolved
toqito/perms/tests/test_permute_systems.py Outdated Show resolved Hide resolved
toqito/perms/tests/test_permute_systems.py Outdated Show resolved Hide resolved
toqito/states/brauer.py Outdated Show resolved Hide resolved
@anushkrishnav
Copy link
Contributor Author

Will work on the change requests shortly , I think the comment was removed by mistake @purva-thakre

@vprusso
Copy link
Owner

vprusso commented Jun 2, 2024

Great, thanks for continuing to work on those changes, and feel free to let us know if you have any additional questions, @anushkrishnav !

@anushkrishnav
Copy link
Contributor Author

Great, thanks for continuing to work on those changes, and feel free to let us know if you have any additional questions, @anushkrishnav !

No problem, I am just waiting for the review, It was fun working !

toqito/channels/partial_trace.py Outdated Show resolved Hide resolved
toqito/channels/partial_transpose.py Outdated Show resolved Hide resolved
toqito/nonlocal_games/quantum_hedging.py Outdated Show resolved Hide resolved
toqito/perms/antisymmetric_projection.py Outdated Show resolved Hide resolved
toqito/perms/permute_systems.py Outdated Show resolved Hide resolved
toqito/perms/swap.py Outdated Show resolved Hide resolved
toqito/perms/symmetric_projection.py Outdated Show resolved Hide resolved
toqito/state_opt/optimal_clone.py Outdated Show resolved Hide resolved
anushkrishnav and others added 3 commits June 3, 2024 21:28
Co-authored-by: Purva Thakre <66048318+purva-thakre@users.noreply.github.com>
Co-authored-by: Purva Thakre <66048318+purva-thakre@users.noreply.github.com>
@purva-thakre
Copy link
Collaborator

Congrats on the bounty @anushkrishnav !

@purva-thakre purva-thakre merged commit 8646d6a into vprusso:master Jun 3, 2024
15 of 18 checks passed
@anushkrishnav
Copy link
Contributor Author

Congrats on the bounty @anushkrishnav !

Thank you !!!

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.

Refactor: Permute systems index offset
3 participants