Skip to content

Commit

Permalink
fix symmetric a_plus/a_min
Browse files Browse the repository at this point in the history
  • Loading branch information
20akshay00 authored and lkdvos committed Feb 2, 2024
1 parent 3e9c07e commit 7a61d81
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/operators/bosonoperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ end
function a_plus(elt::Type{<:Number}, ::Type{U1Irrep}; cutoff::Integer=5, side=:L)
pspace = U1Space(n => 1 for n in 0:cutoff)
if side === :L
vspace = U1Space(-1 => 1)
vspace = U1Space(1 => 1)
a⁺ = TensorMap(zeros, elt, pspace pspace vspace)
for (f1, f2) in fusiontrees(a⁺)
c₁, c₂ = f1.uncoupled[1], f2.uncoupled[1]
if c₁.charge + 1 == c₂.charge
if c₁.charge == c₂.charge + 1
a⁺[f1, f2] .= -sqrt(c₁.charge)
end
end
elseif side === :R
vspace = U1Space(+1 => 1)
vspace = U1Space(-1 => 1)
a⁺ = TensorMap(zeros, elt, vspace pspace pspace)
for (f1, f2) in fusiontrees(a⁺)
c₁, c₂ = f1.uncoupled[2], f2.uncoupled[1]
if c₁.charge + 1 == c₂.charge
if c₁.charge == c₂.charge + 1
a⁺[f1, f2] .= -sqrt(c₁.charge)
end
end
Expand Down Expand Up @@ -65,20 +65,20 @@ end
function a_min(elt::Type{<:Number}, ::Type{U1Irrep}; cutoff::Integer=5, side=:L)
pspace = U1Space(n => 1 for n in 0:cutoff)
if side === :L
vspace = U1Space(1 => 1)
vspace = U1Space(-1 => 1)
a⁻ = TensorMap(zeros, elt, pspace pspace vspace)
for (f1, f2) in fusiontrees(a⁻)
c₁, c₂ = f1.uncoupled[1], f2.uncoupled[1]
if c₁.charge == c₂.charge + 1
if c₁.charge + 1 == c₂.charge
a⁻[f1, f2] .= -sqrt(c₂.charge)
end
end
elseif side === :R
vspace = U1Space(-1 => 1)
vspace = U1Space(1 => 1)
a⁻ = TensorMap(zeros, elt, vspace pspace pspace)
for (f1, f2) in fusiontrees(a⁻)
c₁, c₂ = f1.uncoupled[2], f2.uncoupled[1]
if c₁.charge == c₂.charge + 1
if c₁.charge + 1 == c₂.charge
a⁻[f1, f2] .= -sqrt(c₂.charge)
end
end
Expand Down

0 comments on commit 7a61d81

Please sign in to comment.