|
1 | 1 | @testsetup module SetupCTMRG |
2 | 2 | using Reexport |
3 | 3 | @reexport using TensorKit, TensorRenormalizationGroups, TestExtras, CircularArrays |
| 4 | +@reexport import TensorRenormalizationGroups.KrylovKit.initialize |
4 | 5 | end |
5 | 6 |
|
6 | 7 | @testitem "Corner Methods" setup = [SetupCTMRG] begin |
|
34 | 35 |
|
35 | 36 | @test scalartype(corners) == ComplexF64 |
36 | 37 |
|
37 | | - @test ITC.chispace(corners) == s |
| 38 | + @test TRGroups.chispace(corners) == s |
38 | 39 | end |
39 | 40 |
|
40 | 41 | @testitem "CTMRG" setup = [SetupCTMRG] begin |
|
52 | 53 |
|
53 | 54 | alg = CTMRG(; verbose=false, bonddim=1, randinit=false) |
54 | 55 |
|
55 | | - uc = ITC.ensure_contractable(net) |
| 56 | + uc = TRGroups.ensure_contractable(net) |
56 | 57 |
|
57 | 58 | @testset "Initialization" verbose = true begin |
58 | | - ten = @constinferred(ITC.inittensors(uc, alg)) |
| 59 | + ten = @constinferred(TRGroups.inittensors(uc, alg)) |
59 | 60 |
|
60 | 61 | st = @constinferred(initialize(uc, alg)) |
61 | 62 |
|
|
65 | 66 |
|
66 | 67 | for sp in convert.(ProductSpace, domain(ta)) |
67 | 68 | for ch in convert.(ProductSpace, (ℂ^2, sp, ℂ^6)) |
68 | | - eiso = @constinferred(ITC.get_embedding_isometry(sp, ch)) |
| 69 | + eiso = @constinferred(TRGroups.get_embedding_isometry(sp, ch)) |
69 | 70 |
|
70 | 71 | @test codomain(eiso) == sp |
71 | 72 | @test domain(eiso) == ch |
72 | 73 | end |
73 | | - riso = @constinferred(ITC.get_removal_isometry(sp)) |
| 74 | + riso = @constinferred(TRGroups.get_removal_isometry(sp)) |
74 | 75 |
|
75 | 76 | @test codomain(riso) == sp |
76 | 77 | @test domain(riso) == one(sp) |
77 | 78 | end |
78 | 79 |
|
79 | | - c_raw = @constinferred(ITC.initcorners(uc, chi)) |
80 | | - e_raw = @constinferred(ITC.initedges(uc, chi)) |
| 80 | + c_raw = @constinferred(TRGroups.initcorners(uc, chi)) |
| 81 | + e_raw = @constinferred(TRGroups.initedges(uc, chi)) |
81 | 82 |
|
82 | | - @constinferred(ITC.randomize_if_zero!(c_raw)) |
83 | | - @constinferred(ITC.randomize_if_zero!(e_raw)) |
| 83 | + @constinferred(TRGroups.randomize_if_zero!(c_raw)) |
| 84 | + @constinferred(TRGroups.randomize_if_zero!(e_raw)) |
84 | 85 |
|
85 | 86 | C1, C2, C3, C4 = c_raw |
86 | 87 | T1, T2, T3, T4 = c_raw |
@@ -111,18 +112,18 @@ end |
111 | 112 | end |
112 | 113 |
|
113 | 114 | @testset "Error calculation" verbose = true begin |
114 | | - corn = ITC.initcorners(uc, chi) |
| 115 | + corn = TRGroups.initcorners(uc, chi) |
115 | 116 | state = initialize(uc, alg) |
116 | 117 |
|
117 | | - Ss = @constinferred(ITC.initerror(state.primary)) |
| 118 | + Ss = @constinferred(TRGroups.initerror(state.primary)) |
118 | 119 | Ss_old = deepcopy(Ss) |
119 | 120 |
|
120 | | - @test isa(@constinferred(ITC.ctmerror!(Ss, corn)), AbstractFloat) |
| 121 | + @test isa(@constinferred(TRGroups.ctmerror!(Ss, corn)), AbstractFloat) |
121 | 122 | # Singular values should have updated: |
122 | 123 | @test Ss !== Ss_old |
123 | 124 | # Should get zero error with corners unchanged: |
124 | 125 | C1, C2, C3, C4 = corn |
125 | | - @test @constinferred(ITC.boundaryerror!(Ss[1], C1)) ≈ zero.(eltype.(C1)) |
| 126 | + @test @constinferred(TRGroups.boundaryerror!(Ss[1], C1)) ≈ zero.(eltype.(C1)) |
126 | 127 |
|
127 | 128 | end |
128 | 129 | end |
0 commit comments