Skip to content

Commit 8f2ef2c

Browse files
committed
fix stupid tolerance mistake
1 parent 8aa04a1 commit 8f2ef2c

6 files changed

Lines changed: 15 additions & 10 deletions

File tree

‎test/mooncake/indexmanipulations.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ spacelist = (
5151
eltypes = (Float64,) # no complex support yet
5252

5353
@timedtestset "Mooncake - Index Manipulations: $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
54-
atol = precision(T)
55-
rtol = precision(T)
54+
atol = default_tol(T)
55+
rtol = default_tol(T)
5656
symmetricbraiding = BraidingStyle(sectortype(eltype(V))) isa SymmetricBraiding
5757

5858
symmetricbraiding && @timedtestset "add_permute!" begin

‎test/mooncake/linalg.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ spacelist = (
5151
eltypes = (Float64,) # no complex support yet
5252

5353
@timedtestset "Mooncake - LinearAlgebra: $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
54-
atol = precision(T)
55-
rtol = precision(T)
54+
atol = default_tol(T)
55+
rtol = default_tol(T)
5656

5757
C = randn(T, V[1] ⊗ V[2] ← V[5])
5858
A = randn(T, codomain(C) ← V[3] ⊗ V[4])

‎test/mooncake/planaroperations.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ spacelist = (
5252
eltypes = (Float64,) # no complex support yet
5353

5454
@timedtestset "Mooncake - PlanarOperations: $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
55-
atol = precision(T)
56-
rtol = precision(T)
55+
atol = default_tol(T)
56+
rtol = default_tol(T)
5757

5858
@timedtestset "planarcontract!" begin
5959
for _ in 1:5

‎test/mooncake/tensoroperations.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ spacelist = (
5151
eltypes = (Float64,) # no complex support yet
5252

5353
@timedtestset "Mooncake - TensorOperations: $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
54-
atol = precision(T)
55-
rtol = precision(T)
54+
atol = default_tol(T)
55+
rtol = default_tol(T)
5656
symmetricbraiding = BraidingStyle(sectortype(eltype(V))) isa SymmetricBraiding
5757

5858
symmetricbraiding && @timedtestset "tensorcontract!" begin

‎test/mooncake/vectorinterface.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ spacelist = (
5151
eltypes = (Float64,) # no complex support yet
5252

5353
@timedtestset "Mooncake - VectorInterface: $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
54-
atol = precision(T)
55-
rtol = precision(T)
54+
atol = default_tol(T)
55+
rtol = default_tol(T)
5656

5757
C = randn(T, V[1] ⊗ V[2] ← V[3] ⊗ V[4] ⊗ V[5])
5858
A = randn(T, V[1] ⊗ V[2] ← V[3] ⊗ V[4] ⊗ V[5])

‎test/setup.jl‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module TestSetup
22

33
export randindextuple, randcircshift, _repartition, trivtuple
4+
export default_tol
45
export smallset, randsector, hasfusiontensor, force_planar
56
export random_fusion
67
export sectorlist
@@ -51,6 +52,10 @@ function _repartition(p::Union{IndexTuple, Index2Tuple}, t::AbstractTensorMap)
5152
return _repartition(p, TensorKit.numout(t))
5253
end
5354

55+
# Float32 and finite differences don't mix well
56+
default_tol(::Type{<:Union{Float32, Complex{Float32}}}) = 1.0e-2
57+
default_tol(::Type{<:Union{Float64, Complex{Float64}}}) = 1.0e-5
58+
5459
# Sector utility
5560
# --------------
5661
smallset(::Type{I}) where {I <: Sector} = take(values(I), 5)

0 commit comments

Comments
 (0)