Skip to content

Commit d0010f2

Browse files
authored
[ITensors] Define Sy for tJ site type (#1642)
1 parent 9e63f06 commit d0010f2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/lib/SiteTypes/src/sitetypes/tj.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,13 @@ function op!(Op::ITensor, ::OpName"Sx", ::SiteType"tJ", s::Index)
183183
Op[s' => 2, s => 3] = 0.5
184184
return Op[s' => 3, s => 2] = 0.5
185185
end
186-
186+
function op!(Op::ITensor, ::OpName"Sy", ::SiteType"tJ", s::Index)
187+
Op[s' => 2, s => 3] = -0.5im
188+
return Op[s' => 3, s => 2] = 0.5im
189+
end
190+
function op!(Op::ITensor, ::OpName"Sʸ", st::SiteType"tJ", s::Index)
191+
return op!(Op, OpName("Sy"), st, s)
192+
end
187193
function op!(Op::ITensor, ::OpName"Sˣ", st::SiteType"tJ", s::Index)
188194
return op!(Op, OpName("Sx"), st, s)
189195
end

test/base/test_phys_site_types.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,10 @@ using ITensors.SiteTypes: has_fermion_string, op, siteind, siteinds, state
742742
@test Sx [0.0 0.0 0; 0 0 0.5; 0 0.5 0]
743743
Sx = Array(op(s, ""), s', s)
744744
@test Sx [0.0 0.0 0; 0 0 0.5; 0 0.5 0]
745+
Sy = Array(op(s, "Sy"), s', s)
746+
@test Sy [0.0 0.0 0; 0 0 -0.5im; 0 0.5im 0]
747+
Sy = Array(op(s, ""), s', s)
748+
@test Sy [0.0 0.0 0; 0 0 -0.5im; 0 0.5im 0]
745749
Sp = Array(op(s, "Splus"), s', s)
746750
@test Sp [0.0 0.0 0; 0 0 1.0; 0 0 0]
747751
Sp = Array(op(s, "Sp"), s', s)

0 commit comments

Comments
 (0)