|
1 | 1 | module TestSetup |
2 | 2 |
|
3 | 3 | export smallset, randsector, hasfusiontensor, force_planar |
| 4 | +export random_fusiontree, safe_tensor_product |
4 | 5 | export sectorlist |
5 | | -export Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, VSU₂U₁, Vfib |
| 6 | +export Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, VSU₂U₁, Vfib, VIB_diag, VIB_M |
6 | 7 |
|
7 | 8 | using Random |
8 | 9 | using TensorKit |
@@ -75,6 +76,34 @@ function force_planar(tsrc::TensorMap{<:Any, <:GradedSpace}) |
75 | 76 | return tdst |
76 | 77 | end |
77 | 78 |
|
| 79 | +function random_fusiontree(I::Type{<:Sector}, N::Int) # for fusion tree tests |
| 80 | + in = nothing |
| 81 | + out = nothing |
| 82 | + while in === nothing |
| 83 | + out = ntuple(n -> randsector(I), N) |
| 84 | + try |
| 85 | + in = rand(collect(⊗(out...))) |
| 86 | + catch e |
| 87 | + if isa(e, ArgumentError) |
| 88 | + in = nothing |
| 89 | + else |
| 90 | + rethrow(e) |
| 91 | + end |
| 92 | + end |
| 93 | + end |
| 94 | + return out |
| 95 | +end |
| 96 | + |
| 97 | +# for fusion tree merge test |
| 98 | +function safe_tensor_product(x::I, y::I) where {I<:Sector} |
| 99 | + tp = x ⊗ y |
| 100 | + if isempty(tp) |
| 101 | + return nothing |
| 102 | + else |
| 103 | + return tp |
| 104 | + end |
| 105 | +end |
| 106 | + |
78 | 107 | sectorlist = ( |
79 | 108 | Z2Irrep, Z3Irrep, Z4Irrep, Z3Irrep ⊠ Z4Irrep, |
80 | 109 | U1Irrep, CU1Irrep, SU2Irrep, |
@@ -160,6 +189,26 @@ Vfib = ( |
160 | 189 | Vect[FibonacciAnyon](:I => 2, :τ => 3), |
161 | 190 | Vect[FibonacciAnyon](:I => 2, :τ => 2), |
162 | 191 | ) |
163 | | -#TODO: add IsingBimodule spaces |
| 192 | + |
| 193 | +C0, C1 = IsingBimodule(1, 1, 0), IsingBimodule(1, 1, 1) |
| 194 | +D0, D1 = IsingBimodule(2, 2, 0), IsingBimodule(2, 2, 1) |
| 195 | +M, Mop = IsingBimodule(1, 2, 0), IsingBimodule(2, 1, 0) |
| 196 | +VIB_diag = ( |
| 197 | + Vect[IsingBimodule](C0 => 1, C1 => 2), |
| 198 | + Vect[IsingBimodule](C0 => 2, C1 => 1), |
| 199 | + Vect[IsingBimodule](C0 => 3, C1 => 1), |
| 200 | + Vect[IsingBimodule](C0 => 2, C1 => 3), |
| 201 | + Vect[IsingBimodule](C0 => 3, C1 => 2) |
| 202 | +) |
| 203 | + |
| 204 | +# not a random ordering! designed to make V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5 work (tensors) |
| 205 | +# while V1 ⊗ V2 ← V4 isn't empty (factorizations) |
| 206 | +VIB_M = ( |
| 207 | + Vect[IsingBimodule](C0 => 1, C1 => 2), |
| 208 | + Vect[IsingBimodule](M => 3), |
| 209 | + Vect[IsingBimodule](C0 => 2, C1 => 3), |
| 210 | + Vect[IsingBimodule](M => 4), |
| 211 | + Vect[IsingBimodule](D0 => 3, D1 => 4) |
| 212 | +) |
164 | 213 |
|
165 | 214 | end |
0 commit comments