-
Notifications
You must be signed in to change notification settings - Fork 125
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
[SiteTypes] Add S2 operator for S=1 and update code style #1502
Conversation
Hm, when I rerun JuliaFormatter on the code it doesn't make any changes, yet it failed the Format Check. This also happened to me another time recently. I wonder if the formatting styles are out of sync between the CI and the code repo somehow? Or maybe these are just one-offs. |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1502 +/- ##
===========================================
- Coverage 78.05% 60.84% -17.21%
===========================================
Files 148 148
Lines 9679 9634 -45
===========================================
- Hits 7555 5862 -1693
- Misses 2124 3772 +1648 ☔ View full report in Codecov by Sentry. |
What version of JuliaFormatter.jl do you have locally? Maybe you are using an older version locally. The CI formatting suggestion looks correct to me: julia> using JuliaFormatter
julia> format_text("1."; style=DefaultStyle())
"1.0"
julia> format_text("1."; style=BlueStyle())
"1.0"
julia> import Pkg; Pkg.status("JuliaFormatter")
Status `~/.julia/environments/v1.10/Project.toml`
[98e50ef6] JuliaFormatter v1.0.56 See:
|
I resolved the formatter issue, thanks. I didn't realize about the aliases – nice pattern. |
Of course one could envision many improvements to this system, like maybe a more unified way of handling spin operators since e.g. some of the aliases are repeated a bit, but I think this PR is a good "maintenance" sort of PR. |
Yeah it would be good to step back and be a bit more systematic about the operator definitions code but that can be done in future work. |
Thanks! |
This PR fixes #1501 by defining the "S2" (aka "S²") operator for the "S=1" SiteType. It also updates the code for "S=1" operator definitions to use the
op
matrices approach rather than theop!
functions. A unit test was added for the "S2" operator.