Skip to content

Commit ddbc1e3

Browse files
committed
some units, leftunits and isunits
1 parent a20612f commit ddbc1e3

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/algorithms/excitation/chepigaansatz.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ end
3535

3636
function excitations(
3737
H, alg::ChepigaAnsatz, ψ::FiniteMPS, envs = environments(ψ, H);
38-
sector = one(sectortype(ψ)), num::Int = 1, pos::Int = length(ψ) ÷ 2
38+
sector = leftunit), num::Int = 1, pos::Int = length(ψ) ÷ 2
3939
)
4040
1 pos length(ψ) || throw(ArgumentError("invalid position $pos"))
41-
sector == one(sector) || error("not yet implemented for charged excitations")
41+
isunit(sector) || error("not yet implemented for charged excitations")
4242

4343
# add random offset to kickstart Krylov process:
4444
AC = ψ.AC[pos]
@@ -100,10 +100,10 @@ end
100100

101101
function excitations(
102102
H, alg::ChepigaAnsatz2, ψ::FiniteMPS, envs = environments(ψ, H);
103-
sector = one(sectortype(ψ)), num::Int = 1, pos::Int = length(ψ) ÷ 2
103+
sector = leftunit), num::Int = 1, pos::Int = length(ψ) ÷ 2
104104
)
105105
1 pos length(ψ) - 1 || throw(ArgumentError("invalid position $pos"))
106-
sector == one(sector) || error("not yet implemented for charged excitations")
106+
isunit(sector) || error("not yet implemented for charged excitations")
107107

108108
# add random offset to kickstart Krylov process:
109109
@plansor AC2[-1 -2; -3 -4] := ψ.AC[pos][-1 -2; 1] * ψ.AR[pos + 1][1 -4; -3]

src/states/quasiparticle_state.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ end
3535
#constructors
3636
function LeftGaugedQP(
3737
datfun, left_gs, right_gs = left_gs;
38-
sector = one(sectortype(left_gs)), momentum = 0.0
38+
sector = leftunit(left_gs), momentum = 0.0
3939
)
4040
# find the left null spaces for the TNS
4141
excitation_space = Vect[typeof(sector)](sector => 1)
@@ -56,7 +56,7 @@ function LeftGaugedQP(
5656
end
5757
function LeftGaugedQP(
5858
datfun, left_gs::MultilineMPS, right_gs::MultilineMPS = left_gs;
59-
sector = one(sectortype(left_gs)), momentum = 0.0
59+
sector = leftunit(left_gs), momentum = 0.0
6060
)
6161
# not sure why this is needed for type stability
6262
Tresult = leftgaugedqptype(eltype(parent(left_gs)), typeof(momentum))
@@ -69,7 +69,7 @@ end
6969

7070
function RightGaugedQP(
7171
datfun, left_gs, right_gs = left_gs;
72-
sector = one(sectortype(left_gs)), momentum = 0.0
72+
sector = leftunit(left_gs), momentum = 0.0
7373
)
7474
# find the left null spaces for the TNS
7575
excitation_space = Vect[typeof(sector)](sector => 1)
@@ -226,7 +226,7 @@ auxiliarysector(state::QP) = only(sectors(auxiliaryspace(state)))
226226
eachsite(state::QP) = eachsite(state.left_gs)
227227

228228
istopological(qp::QP) = qp.left_gs !== qp.right_gs
229-
istrivial(qp::QP) = !istopological(qp) && isone(auxiliarysector(qp))
229+
istrivial(qp::QP) = !istopological(qp) && isunit(auxiliarysector(qp))
230230

231231
Base.copy(a::QP) = copy!(similar(a), a)
232232
Base.copyto!(a::QP, b::QP) = copy!(a, b)

src/utility/plotting.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function transferplot end
119119
sector_formatter = string
120120
)
121121
if sectors === nothing
122-
sectors = [one(sectortype(h.args[1]))]
122+
sectors = [unit(sectortype(h.args[1]))]
123123
end
124124

125125
for sector in sectors

test/algorithms.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ module TestAlgorithms
10571057
FiniteMPS(physicalspace(H), maxVspaces[2:(end - 1)]), H; verbosity = 0
10581058
)
10591059
E₀ = expectation_value(gs, H)
1060-
@test E₀ first(vals_dense[one(U1Irrep)])
1060+
@test E₀ first(vals_dense[unit(U1Irrep)])
10611061

10621062
for (sector, vals) in vals_dense
10631063
# ED tests
@@ -1074,7 +1074,7 @@ module TestAlgorithms
10741074
Es, Bs = excitations(H, QuasiparticleAnsatz(; tol), gs; sector, num = 1)
10751075
Es = Es .+ E₀
10761076
# first excited state is second eigenvalue if sector is trivial
1077-
@test Es[1] vals[isone(sector) ? 2 : 1] atol = 1.0e-8
1077+
@test Es[1] vals[isunit(sector) ? 2 : 1] atol = 1.0e-8
10781078
end
10791079

10801080
# shifted charges tests

test/multifusion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module TestMultifusion
3232
P = Vect[I](D0 => 1, D1 => 1)
3333
X = zeros(T, P P)
3434
for (s, f) in fusiontrees(X)
35-
isone(only(f.uncoupled)) ? X[s, f] .= g : X[s, f] .= -g
35+
isunit(only(f.uncoupled)) ? X[s, f] .= g : X[s, f] .= -g
3636
end
3737
ZZ = zeros(T, P^2 P^2)
3838
for (s, f) in fusiontrees(ZZ)

0 commit comments

Comments
 (0)