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

add spin irreducible operators with U(1) and SU(2) #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/MPSKitModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export c⁺, c⁻, c⁺⁺, c⁻⁻, c⁺⁻, c⁻⁺
export e_plus, e_min, e_plusplus, e_minmin, e_plusmin, e_minplus
export e_number, e_number_up, e_number_down, e_number_updown
export e⁺, e⁻, e⁺⁺, e⁻⁻, e⁺⁻, e⁻⁺
export S_e_plus, S_e_min, S_e_square, S_e_exchange
export Sₑ⁺, Sₑ⁻, Sₑ², SₑSₑ

export transverse_field_ising
export kitaev_model
Expand Down
78 changes: 78 additions & 0 deletions src/operators/fermionoperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,81 @@
end

const nꜛnꜜ = e_number_updown

"""
S_e_plus(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}; side=:L)
Sₑ⁺(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}; side=:L)

The hermitian conjugate of total spin operator for electron-like fermions.
"""
function S_e_plus end
function S_e_plus(particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector}; kwargs...)
return S_e_plus(ComplexF64, particle_symmetry, spin_symmetry; kwargs...)

Check warning on line 241 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L240-L241

Added lines #L240 - L241 were not covered by tests
end
function S_e_plus(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}; side=:L)
pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 0) => 1, (1, 1, 1 // 2) => 1,

Check warning on line 244 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L243-L244

Added lines #L243 - L244 were not covered by tests
(0, 2, 0) => 1)
vspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 1) => 1)
if side == :L
Sₑ⁺ = TensorMap(zeros, elt, pspace ← pspace ⊗ vspace)
blocks(Sₑ⁺)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= sqrt(3)/2
elseif side == :R
S = S_e_plus(elt, U1Irrep, SU2Irrep; side=:L)
F = isomorphism(storagetype(S), vspace, flip(vspace))
@planar Sₑ⁺[-1 -2; -3] := S[-2; 1 2] * τ[1 2; 3 -3] * F[3; -1]

Check warning on line 253 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L246-L253

Added lines #L246 - L253 were not covered by tests
else
throw(ArgumentError("invalid side `:$side`, expected `:L` or `:R`"))

Check warning on line 255 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L255

Added line #L255 was not covered by tests
end
return Sₑ⁺

Check warning on line 257 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L257

Added line #L257 was not covered by tests
end
const Sₑ⁺ = S_e_plus

"""
S_e_min(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}; side=:L)
Sₑ⁻(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}; side=:L)

The total spin operator for electron-like fermions.
"""
function S_e_min end
function S_e_min(particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector}; kwargs...)
return S_e_min(ComplexF64, particle_symmetry, spin_symmetry; kwargs...)

Check warning on line 269 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L268-L269

Added lines #L268 - L269 were not covered by tests
end
function S_e_min(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}; side=:L)
if side === :L
S = S_e_plus(elt, U1Irrep, SU2Irrep; side=:L)'
F = isomorphism(storagetype(S), flip(space(S, 2)), space(S, 2))
@planar Sₑ⁻[-1; -2 -3] := S[-1 1; -2] * F[-3; 1]
elseif side === :R
Sₑ⁻ = permute(S_e_plus(elt, U1Irrep, SU2Irrep; side=:L)', ((2, 1), (3,)))

Check warning on line 277 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L271-L277

Added lines #L271 - L277 were not covered by tests
else
throw(ArgumentError("invalid side `:$side`, expected `:L` or `:R`"))

Check warning on line 279 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L279

Added line #L279 was not covered by tests
end
return Sₑ⁻

Check warning on line 281 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L281

Added line #L281 was not covered by tests
end
const Sₑ⁻ = S_e_min

"""
S_e_square(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep})
Sₑ²(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep})

The total spin operator for electron-like fermions.
"""
function S_e_square(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep})
pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 0) => 1, (1, 1, 1 // 2) => 1,

Check warning on line 292 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L291-L292

Added lines #L291 - L292 were not covered by tests
(0, 2, 0) => 1)
S2 = TensorMap(zeros, elt, pspace ← pspace)
blocks(S2)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= 3/4
return S2

Check warning on line 296 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L294-L296

Added lines #L294 - L296 were not covered by tests
end
const Sₑ² = S_e_square

"""
S_e_exchange(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep})
SₑSₑ(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep})

The total spin exchange operator for electron-like fermions.
"""
function S_e_exchange(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep})
return contract_twosite(Sₑ⁺(elt, U1Irrep, SU2Irrep; side=:L), Sₑ⁻(elt, U1Irrep, SU2Irrep; side=:R))

Check warning on line 307 in src/operators/fermionoperators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators/fermionoperators.jl#L306-L307

Added lines #L306 - L307 were not covered by tests
end
const SₑSₑ = S_e_exchange
Loading