1+ function _ground_state_degeneracy (tm:: AbstractTensorMap{E, S, N, N} ) where {E, S, N}
2+ D, _ = eig_full (tm)
3+ D = D / tr (D)
4+ evs = filter (! iszero, abs .(D. data))
5+ entropy = - sum (evs .* log .(ev))
6+ return exp (entropy)
7+ end
8+
19"""
210 ground_state_degeneracy(T::AbstractTensorMap, unitcell=1)
311
@@ -6,45 +14,28 @@ using the eigenvalues of the transfer matrix. The GSD is the exponential
614of the Shannon entropy of the normalized eigenvalue spectrum.
715"""
816function ground_state_degeneracy (T:: AbstractTensorMap , unitcell:: Int = 1 )
9- indices = Vector {NTuple{4, Int}} (undef, unitcell)
10- for i in 1 : unitcell
11- indices[i] = (i, - i, - (i + unitcell), i + 1 )
12- end
13- indices[end ] = (unitcell, - unitcell, - (unitcell + unitcell), 1 )
14-
15- Ts = fill (T, unitcell)
16- Tcontracted = ncon (Ts, indices)
17-
18- outinds = ntuple (i -> i, unitcell)
19- ininds = ntuple (i -> unitcell + i, unitcell)
20- Tcontracted = permute (Tcontracted, (outinds, ininds))
21-
22- D, _ = eig_full (Tcontracted)
23- D = D / tr (D)
24- vals = filter (! iszero, abs .(D. data))
25- S = 0.0
26- for v in vals
27- ev = abs (v)
28- if ev > 0
29- S -= ev * log (ev)
30- end
31- end
32- return exp (S)
17+ tm = _row_transfer_matrix (T, unitcell)
18+ return _ground_state_degeneracy (tm)
3319end
3420
3521"""
36- ground_state_degeneracy(TA::AbstractTensorMap, TB::AbstractTensorMap; unitcell=1)
37-
38- Compute the GSD from a two-site unit cell (TA, TB). Builds an effective
39- single-site tensor and delegates to the single-tensor method.
22+ ground_state_degeneracy(TA::AbstractTensorMap, TB::AbstractTensorMap)
23+
24+ Compute the GSD for a checkerboard network (TA, TB) from the 2-column transfer matrix
25+ ```
26+ ┌-┐ ┌-┐
27+ 1'--A-------B---3'
28+ | | | |
29+ | | | |
30+ | | | |
31+ 2'--B-------A---4'
32+ └-┘ └-┘
33+ ```
4034"""
41- function ground_state_degeneracy (TA:: AbstractTensorMap , TB:: AbstractTensorMap ; unitcell:: Int = 1 )
42- norm_const = area_term (TA, TB)
43- T1 = TA / abs (norm_const)^ (1 / 4 )
44- T2 = TB / abs (norm_const)^ (1 / 4 )
45- @tensor T_unit[- 1 - 2 ; - 3 - 4 ] := T1[- 1 1 ; 3 2 ] * T2[2 6 ; 4 - 3 ] *
46- T2[- 2 3 ; 1 5 ] * T1[5 4 ; 6 - 4 ]
47- return ground_state_degeneracy (T_unit, unitcell)
35+ function ground_state_degeneracy (TA:: AbstractTensorMap , TB:: AbstractTensorMap )
36+ @tensor tm[- 1 - 2 ; - 3 - 4 ] := TA[- 1 1 ; 3 2 ] * TB[2 6 ; 4 - 3 ] *
37+ TB[- 2 3 ; 1 5 ] * TA[5 4 ; 6 - 4 ]
38+ return _ground_state_degeneracy (tm)
4839end
4940
5041ground_state_degeneracy (scheme:: TNRScheme ; unitcell:: Int = 1 ) = ground_state_degeneracy (scheme. T, unitcell)
@@ -55,10 +46,10 @@ function ground_state_degeneracy(scheme::BTRG; unitcell::Int = 1)
5546 return ground_state_degeneracy (T_unit, unitcell)
5647end
5748
58- ground_state_degeneracy (scheme:: LoopTNR ; unitcell :: Int = 2 ) = ground_state_degeneracy (scheme. TA, scheme. TB; unitcell )
49+ ground_state_degeneracy (scheme:: LoopTNR ) = ground_state_degeneracy (scheme. TA, scheme. TB)
5950
6051"""
61- gu_wen_ratio(T::AbstractTensorMap)
52+ gu_wen_ratio(T::AbstractTensorMap{E, S, 2, 2}) where {E, S}
6253
6354Compute the Gu-Wen ratios (X1, X2) from a single network tensor.
6455The Gu-Wen ratios are related to the ground state degeneracy and
@@ -68,7 +59,7 @@ the scaling dimensions.
6859* [Zheng-Cheng Gu & Xiao-Gang Wen. PhysRevB.80.155131](@cite gu2009)
6960* [Satoshi Morita et al. arxiv:2512.03395](@cite morita2025)
7061"""
71- function gu_wen_ratio (T:: AbstractTensorMap )
62+ function gu_wen_ratio (T:: AbstractTensorMap{E, S, 2, 2} ) where {E, S}
7263 one_norm = norm (@tensor T[1 2 ; 2 1 ])
7364 two_norm_X1 = norm (@tensor T[1 2 ; 2 3 ] * T[3 4 ; 4 1 ])
7465 two_norm_X2 = norm (@tensor T[1 2 ; 3 4 ] * T[4 3 ; 2 1 ])
@@ -78,11 +69,13 @@ function gu_wen_ratio(T::AbstractTensorMap)
7869end
7970
8071"""
81- gu_wen_ratio(TA::AbstractTensorMap, TB::AbstractTensorMap)
72+ gu_wen_ratio(TA::AbstractTensorMap{E, S, 2, 2}, TB::AbstractTensorMap{E, S, 2, 2}) where {E, S}
8273
83- Compute the Gu-Wen ratios (X1, X2) from a two-site unit cell (TA, TB).
74+ Compute the Gu-Wen ratios (X1, X2) for a checkerboard network (TA, TB).
8475"""
85- function gu_wen_ratio (TA:: AbstractTensorMap , TB:: AbstractTensorMap )
76+ function gu_wen_ratio (
77+ TA:: AbstractTensorMap{E, S, 2, 2} , TB:: AbstractTensorMap{E, S, 2, 2}
78+ ) where {E, S}
8679 one_norm = norm (
8780 @tensor opt = true TA[1 2 ; 3 4 ] * TB[4 5 ; 6 1 ] *
8881 TB[7 3 ; 2 8 ] * TA[8 6 ; 5 7 ]
0 commit comments