From bbd2020201428b32da292188c998596501c4b318 Mon Sep 17 00:00:00 2001 From: ZongYongyue Date: Mon, 5 Aug 2024 14:13:36 +0800 Subject: [PATCH 1/4] add spin irreducible operators --- src/operators/fermionoperators.jl | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/operators/fermionoperators.jl b/src/operators/fermionoperators.jl index 67ee7c3..d0bea58 100644 --- a/src/operators/fermionoperators.jl +++ b/src/operators/fermionoperators.jl @@ -229,3 +229,35 @@ function e_number_updown(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) end const nꜛnꜜ = e_number_updown + +function S_e(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) + pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 0) => 1, (1, 1, 1 // 2) => 1, + (0, 2, 0) => 1) + vspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 1, 1) => 1) + S = TensorMap(zeros, elt, pspace ← pspace ⊗ vspace) + blocks(S)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= sqrt(3)/2 + return n +end + +const Sₑ = S_e + +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, + (0, 2, 0) => 1) + S2 = TensorMap(zeros, elt, pspace ← pspace) + blocks(S2)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= 3/4 + return n +end + +const Sₑ² = S_e_square + +function S_e_exchange(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) + pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 0) => 1, (1, 1, 1 // 2) => 1, + (0, 2, 0) => 1) + SS = TensorMap(zeros, elt, pspace ⊗ pspace ← pspace ⊗ pspace) + S = S_e(elt, U1Irrep, SU2Irrep) + @planar SS[-1 -2; -3 -4]:= S[-1;-3 1]*permute(S',((2,1),(3,)))[1 -2; -4] + return SS +end + +const S_e_exchange = SₑSₑ \ No newline at end of file From adec3f769028ad98c2616a1c4843222dbdb01273 Mon Sep 17 00:00:00 2001 From: ZongYongyue Date: Mon, 5 Aug 2024 14:21:08 +0800 Subject: [PATCH 2/4] add S_e,S_e_square,S_e_exchange --- src/operators/fermionoperators.jl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/operators/fermionoperators.jl b/src/operators/fermionoperators.jl index d0bea58..0b47f3f 100644 --- a/src/operators/fermionoperators.jl +++ b/src/operators/fermionoperators.jl @@ -233,10 +233,10 @@ const nꜛnꜜ = e_number_updown function S_e(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 0) => 1, (1, 1, 1 // 2) => 1, (0, 2, 0) => 1) - vspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 1, 1) => 1) + vspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 1) => 1) S = TensorMap(zeros, elt, pspace ← pspace ⊗ vspace) blocks(S)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= sqrt(3)/2 - return n + return S end const Sₑ = S_e @@ -246,17 +246,14 @@ function S_e_square(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) (0, 2, 0) => 1) S2 = TensorMap(zeros, elt, pspace ← pspace) blocks(S2)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= 3/4 - return n + return S2 end const Sₑ² = S_e_square function S_e_exchange(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) - pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 0) => 1, (1, 1, 1 // 2) => 1, - (0, 2, 0) => 1) - SS = TensorMap(zeros, elt, pspace ⊗ pspace ← pspace ⊗ pspace) S = S_e(elt, U1Irrep, SU2Irrep) - @planar SS[-1 -2; -3 -4]:= S[-1;-3 1]*permute(S',((2,1),(3,)))[1 -2; -4] + @planar SS[-1 -2; -3 -4] := S[-1;-3 1]*permute(S',((2,1),(3,)))[1 -2; -4] return SS end From a6ff2bd4c1b5c48fab3cb5329133c5e41978e140 Mon Sep 17 00:00:00 2001 From: ZongYongyue Date: Tue, 6 Aug 2024 11:39:56 +0800 Subject: [PATCH 3/4] change spin operator to MPSKitModels style --- src/operators/fermionoperators.jl | 71 ++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/src/operators/fermionoperators.jl b/src/operators/fermionoperators.jl index 0b47f3f..f16b67c 100644 --- a/src/operators/fermionoperators.jl +++ b/src/operators/fermionoperators.jl @@ -230,17 +230,64 @@ end const nꜛnꜜ = e_number_updown -function S_e(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) +""" + 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...) +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, (0, 2, 0) => 1) vspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0, 0, 1) => 1) - S = TensorMap(zeros, elt, pspace ← pspace ⊗ vspace) - blocks(S)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= sqrt(3)/2 - return S + 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] + else + throw(ArgumentError("invalid side `:$side`, expected `:L` or `:R`")) + end + return Sₑ⁺ end +const Sₑ⁺ = S_e_plus -const Sₑ = S_e +""" + 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...) +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,))) + else + throw(ArgumentError("invalid side `:$side`, expected `:L` or `:R`")) + end + return Sₑ⁻ +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, (0, 2, 0) => 1) @@ -248,13 +295,15 @@ function S_e_square(elt::Type{<:Number}, ::Type{U1Irrep}, ::Type{SU2Irrep}) blocks(S2)[fℤ₂(1) ⊠ U1Irrep(1) ⊠ SU2Irrep(1 // 2)] .= 3/4 return S2 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}) - S = S_e(elt, U1Irrep, SU2Irrep) - @planar SS[-1 -2; -3 -4] := S[-1;-3 1]*permute(S',((2,1),(3,)))[1 -2; -4] - return SS + return contract_twosite(Sₑ⁺(elt, U1Irrep, SU2Irrep; side=:L), Sₑ⁻(elt, U1Irrep, SU2Irrep; side=:R)) end - -const S_e_exchange = SₑSₑ \ No newline at end of file +const SₑSₑ = S_e_exchange \ No newline at end of file From 9077a7bf3ac3a884940295d96115923927fa2e48 Mon Sep 17 00:00:00 2001 From: ZongYongyue Date: Tue, 6 Aug 2024 11:40:52 +0800 Subject: [PATCH 4/4] export spin operators --- src/MPSKitModels.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/MPSKitModels.jl b/src/MPSKitModels.jl index 2426ab8..9bf2c7a 100644 --- a/src/MPSKitModels.jl +++ b/src/MPSKitModels.jl @@ -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