Skip to content

Conversation

@akirakyle
Copy link
Member

Closes #192

@akirakyle akirakyle requested a review from Krastanov April 10, 2025 01:23
@codecov
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.03%. Comparing base (bb71f52) to head (8081ac6).
Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #193      +/-   ##
==========================================
+ Coverage   93.00%   93.03%   +0.02%     
==========================================
  Files          25       26       +1     
  Lines        3104     3257     +153     
==========================================
+ Hits         2887     3030     +143     
- Misses        217      227      +10     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Krastanov
Copy link
Member

Shouldn't these be methods of sigmax, sigmay, sigmaz instead? Should we implement them for FockBasis as well? If they are not methods of sigmax/y/z, should we implement them for SpinBasis(1//2)?

@akirakyle
Copy link
Member Author

There isn't a unique way to generalize the pauli operators as it depends on the properties one wants to preserve. Wikipedia has a nice overview.

Shouldn't these be methods of sigmax, sigmay, sigmaz instead?

Their implementation already generalizes them to arbitrary spin as the $J_x, J_y, J_z$ angular momentum operators which is one way to generalize the pauli operators that preserves them being hermitian. The clock and shift matrices generalize them being unitary.

Should we implement them for FockBasis as well?

I don't think so, since the generalization of clock and shift to a harmonic oscillator gives the cannonical position and momentum operators. In fact, historically it went the other way: Weyl used these matrices to give finite dimensional systems the same commutator as that of position and momentum in an oscillator.

If they are not methods of sigmax/y/z, should we implement them for SpinBasis(1//2)?

Similarly to above, I would worry a bit about confusion. In my mind, the whole difference between a spin system and an N level system is that the angular momentum operators are actual physical operations.

@Krastanov
Copy link
Member

Could you add commentary to this effect in the docstring? And a see also [sigmax](@ref)... and so on. So that the user can have an idea of why these names were chosen, etc. Including mentioning that these are also called "clock" and "shift" matrices, etc.

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

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

just adding a proper review to make my review queue a bit more organized

This is a great addition, thank you! To make it easier to navigate the difference between sigma* and pauli* could you add something based on your comments to the docstrings and add a see also that crossreferences between them.

We should also double check we are not breaking the documentation build now that we are exporting or crossreferencing new things.

@Krastanov Krastanov marked this pull request as draft April 20, 2025 03:56
@Krastanov
Copy link
Member

Thanks for the additions! Whenever you feel the new docs are ready, please feel free to merge / bump version / release.

@akirakyle akirakyle marked this pull request as ready for review April 22, 2025 03:24
@akirakyle akirakyle merged commit 24d1fbc into qojulia:master Apr 23, 2025
12 checks passed
@akirakyle akirakyle deleted the generalized-pauli branch April 23, 2025 00:44
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.

Add generalized Pauli operators

2 participants