11
22# using Pkg; Pkg.activate(@__DIR__() * "/..")
3+ # using TestEnv; TestEnv.activate()
34
45# #
56
@@ -8,7 +9,7 @@ using AtomsCalculators, EmpiricalPotentials, AtomsCalculatorsUtilities,
89 AtomsBuilder
910
1011using AtomsBase: AbstractSystem
11- using LinearAlgebra: dot, norm, I
12+ using LinearAlgebra: dot, norm, I, Symmetric
1213using AtomsCalculators: potential_energy, forces
1314using EmpiricalPotentials: cutoff_radius, StillingerWeber
1415ACT = AtomsCalculatorsUtilities. Testing
@@ -24,7 +25,7 @@ D = JSON.parsefile(joinpath(@__DIR__(), "data", "test_sw.json"))
2425tests = D[" tests" ]
2526
2627# the argument t should be a tests[i]
27- function read_test(t:: Dict )
28+ function read_test(t:: AbstractDict )
2829 Rs = SVector{3 , Float64}. (t[" Rs" ])
2930 Zs = Int.(t[" Zs" ])
3031 z0 = Int(t[" z0" ])
@@ -118,7 +119,7 @@ for t in tests
118119 P = convert_blockmat(Pblock)
119120 @test P' ≈ P
120121 # compute spectrum and check it is what we expect
121- λ = eigvals(P )
122+ λ = real.( eigvals(Symmetric(P)) )
122123 # rotation-invariance should give three zero eigenvalues
123124 # but with innerstab = 0.1 those become 0.1. The tests show that
124125 # this is not true which must mean that the precon is not
@@ -127,4 +128,3 @@ for t in tests
127128 # but at least all evals must be >= 0.1 enforced by construction
128129 @test all(λ .>= 0.1 - sqrt(eps(Float64)))
129130end
130-
0 commit comments