Skip to content

Commit

Permalink
Modify Graded{<:Abelian}(::Spin) so that it matches the bases of `m…
Browse files Browse the repository at this point in the history
…atrix(::SpinIndex)`.
  • Loading branch information
waltergu committed Dec 27, 2024
1 parent 467df4c commit 7b83462
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/QuantumSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ Decompose a local spin space into an Abelian graded space that preserves 1, 2) n
@inline Graded{ℤ₁}(spin::Spin) = Graded{ℤ₁}(0=>Int(2*totalspin(spin)+1))
function Graded{𝕊ᶻ}(spin::Spin)
S = totalspin(spin)
return Graded{𝕊ᶻ}(sz=>1 for sz in -S:1:S)
return Graded{𝕊ᶻ}(sz=>1 for sz in -S:1:S)'
end

## Permutation
Expand Down
2 changes: 1 addition & 1 deletion test/QuantumSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ end
@testset "Grad Spin" begin
spin = Spin{3//2}()
@test Graded(spin) == Graded{ℤ₁}(spin) == Graded{ℤ₁}(0=>4)
@test Graded{𝕊ᶻ}(spin) == Graded{𝕊ᶻ}(-3//2=>1, -1//2=>1, 1//2=>1, 3//2=>1)
@test Graded{𝕊ᶻ}(spin) == Graded{𝕊ᶻ}(-3//2=>1, -1//2=>1, 1//2=>1, 3//2=>1)'
end

@testset "Spin operator" begin
Expand Down

0 comments on commit 7b83462

Please sign in to comment.