Skip to content

Commit 15ea5c0

Browse files
committed
Change in testing
- Kwarg use_nlcc=false has been added for all meta_gga tests; - Kwarg spin_polarization=:none added to anyonic test, to avoid failure from @Assert length(basis.kpoints) == 1; - Tolerance for condition number in wigner_d_matrix increased to 100, neq decreased to 2*l+2.
1 parent 0d69edd commit 15ea5c0

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/common/spherical_harmonics.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function wigner_d_matrix(l::Integer, Wcart::AbstractMatrix{T}) where {T}
6464
return D .= 1
6565
end
6666
rng = Xoshiro(1234)
67-
neq = 4*(2*l+1)
67+
neq = (2*l+2) # This value should work for p and d orbitals, but can be increased if needed
6868
for m1 in -l:l
6969
b = Vector{T}(undef, neq)
7070
A = Matrix{T}(undef, neq, 2*l+1)
@@ -78,7 +78,7 @@ function wigner_d_matrix(l::Integer, Wcart::AbstractMatrix{T}) where {T}
7878
end
7979
end
8080
κ = cond(A)
81-
@assert κ < 10.0 "The Wigner matrix computation is badly conditioned. κ(A)=$(κ)"
81+
@assert κ < 100.0 "The Wigner matrix computation is badly conditioned. κ(A)=$(κ)"
8282
D[m1+l+1,:] = A\b
8383
end
8484

test/hamiltonian_consistency.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ using Logging
55
using DFTK: mpi_sum
66
using LinearAlgebra
77
using ..TestCases: silicon
8-
using PseudoPotentialData
9-
testcase = silicon
8+
testcase = silicon
109

1110
function test_matrix_repr_operator(hamk, ψk; atol=1e-8)
1211
for operator in hamk.operators
@@ -94,17 +93,17 @@ end
9493
test_consistency_term(ExternalFromFourier(X -> abs(norm(X))))
9594
test_consistency_term(LocalNonlinearity-> ρ^2))
9695
test_consistency_term(Hartree())
97-
test_consistency_term(Hubbard(DFTK.OrbitalManifold(;species=:Si, label="3P"), 10))
96+
test_consistency_term(Hubbard(DFTK.OrbitalManifold(;species=:Si, label="3P"), 0.01), )
9897
test_consistency_term(Ewald())
9998
test_consistency_term(PspCorrection())
10099
test_consistency_term(Xc([:lda_xc_teter93]))
101100
test_consistency_term(Xc([:lda_xc_teter93]), spin_polarization=:collinear)
102101
test_consistency_term(Xc([:gga_x_pbe]), spin_polarization=:collinear)
103-
test_consistency_term(Xc([:mgga_x_tpss]))
104-
test_consistency_term(Xc([:mgga_x_scan]))
105-
test_consistency_term(Xc([:mgga_c_scan]), spin_polarization=:collinear)
106-
test_consistency_term(Xc([:mgga_x_b00]))
107-
test_consistency_term(Xc([:mgga_c_b94]), spin_polarization=:collinear)
102+
test_consistency_term(Xc([:mgga_x_tpss]; use_nlcc=false))
103+
test_consistency_term(Xc([:mgga_x_scan]; use_nlcc=false))
104+
test_consistency_term(Xc([:mgga_c_scan]; use_nlcc=false), spin_polarization=:collinear)
105+
test_consistency_term(Xc([:mgga_x_b00]; use_nlcc=false))
106+
test_consistency_term(Xc([:mgga_c_b94]; use_nlcc=false), spin_polarization=:collinear)
108107

109108
let
110109
a = 6
@@ -114,6 +113,6 @@ end
114113
test_consistency_term(Magnetic(Apot); kgrid=[1, 1, 1], kshift=[0, 0, 0],
115114
lattice=[a 0 0; 0 a 0; 0 0 0], Ecut=20)
116115
test_consistency_term(DFTK.Anyonic(2, 3.2); kgrid=[1, 1, 1], kshift=[0, 0, 0],
117-
lattice=[a 0 0; 0 a 0; 0 0 0], Ecut=20)
116+
lattice=[a 0 0; 0 a 0; 0 0 0], Ecut=20, spin_polarization=:none)
118117
end
119118
end

test/hubbard.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Test Wigner matrices on Silicon symmetries" setup=[TestCases] begin
1+
@testitem "Test Wigner matrices" setup=[TestCases] begin
22
using DFTK
33
using PseudoPotentialData
44
using LinearAlgebra

0 commit comments

Comments
 (0)