Skip to content

Commit cca91cc

Browse files
committed
Add some checks on type stability
1 parent 7863a9b commit cca91cc

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Random = "1"
4343
Statistics = "1"
4444
TensorKit = "0.14.6"
4545
TensorOperations = "5"
46+
TestExtras = "0.3"
4647
VectorInterface = "0.4, 0.5"
4748
Zygote = "0.6, 0.7"
4849
julia = "1.10"
@@ -53,6 +54,7 @@ FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
5354
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
5455
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
5556
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
57+
TestExtras = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"
5658

5759
[targets]
58-
test = ["Test", "SafeTestsets", "ChainRulesTestUtils", "FiniteDifferences", "QuadGK"]
60+
test = ["Test", "TestExtras", "SafeTestsets", "ChainRulesTestUtils", "FiniteDifferences", "QuadGK"]

test/ctmrg/fixed_iterscheme.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Test
1+
using Test, TestExtras
22
using Accessors
33
using Random
44
using LinearAlgebra
@@ -37,7 +37,7 @@ atol = 1e-5
3737
env_conv1, = leading_boundary(CTMRGEnv(psi, ComplexSpace(χenv)), psi, ctm_alg)
3838

3939
# do extra iteration to get SVD
40-
env_conv2, info = ctmrg_iteration(n, env_conv1, ctm_alg)
40+
env_conv2, info = @constinferred ctmrg_iteration(n, env_conv1, ctm_alg)
4141
env_fix, signs = gauge_fix(env_conv1, env_conv2)
4242
@test calc_elementwise_convergence(env_conv1, env_fix) 0 atol = atol
4343

@@ -47,7 +47,7 @@ atol = 1e-5
4747
ctm_alg_fix = @set ctm_alg_fix.projector_alg.trscheme = notrunc()
4848

4949
# do iteration with FixedSVD
50-
env_fixedsvd, = ctmrg_iteration(n, env_conv1, ctm_alg_fix)
50+
env_fixedsvd, = @constinferred ctmrg_iteration(n, env_conv1, ctm_alg_fix)
5151
env_fixedsvd = fix_global_phases(env_conv1, env_fixedsvd)
5252
@test calc_elementwise_convergence(env_conv1, env_fixedsvd) 0 atol = atol
5353
end

test/ctmrg/flavors.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Test
1+
using Test, TestExtras
22
using Random
33
using TensorKit
44
using MPSKit
@@ -17,10 +17,10 @@ projector_algs = [:halfinfinite, :fullinfinite]
1717
# compute environments
1818
Random.seed!(32350283290358)
1919
psi = InfinitePEPS(2, χbond; unitcell)
20-
env_sequential, = leading_boundary(
20+
env_sequential, = @constinferred leading_boundary(
2121
CTMRGEnv(psi, ComplexSpace(χenv)), psi; alg=:sequential, projector_alg
2222
)
23-
env_simultaneous, = leading_boundary(
23+
env_simultaneous, = @constinferred leading_boundary(
2424
CTMRGEnv(psi, ComplexSpace(χenv)), psi; alg=:simultaneous, projector_alg
2525
)
2626

0 commit comments

Comments
 (0)