Skip to content

Commit

Permalink
Make IterativeSolvers optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Mar 15, 2020
1 parent f3c0a8d commit 438e3a6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Libxc = "66e17ffc-8502-11e9-23b5-c9248d0eb96d"
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
Expand All @@ -26,7 +25,6 @@ Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Expand Down
1 change: 0 additions & 1 deletion examples/gross_pitaevskii.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using DFTK
using Plots
using LinearAlgebra
Plots.pyplot() # Use PyPlot backend for unicode support

Ecut = 4000
# Nonlinearity : energy C ∫ρ^α
Expand Down
1 change: 0 additions & 1 deletion examples/magnesium_pbe.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using DFTK
using Plots
Plots.pyplot() # Use PyPlot backend for unicode support

# Calculation parameters
kgrid = [4, 4, 4] # k-Point grid
Expand Down
10 changes: 10 additions & 0 deletions src/DFTK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using Printf
using Markdown
using LinearAlgebra
using Interpolations
using Requires

include("common/asserting.jl")
export unit_to_au
Expand Down Expand Up @@ -150,4 +151,13 @@ export load_atoms
include("external/etsf_nanoquanta.jl")
include("external/abinit.jl")

function __init__()
# Use requires to only include eigen/diag_lobpcg_itsolve.jl once
# IterativeSolvers has been loaded (via a "using" or an "import")
# See https://github.com/JuliaPackaging/Requires.jl for details.
@require IterativeSolvers="42fd0dbc-a981-5370-80f2-aaf504508153" begin
include("eigen/diag_lobpcg_itsolve.jl")
end
end

end # module DFTK
1 change: 0 additions & 1 deletion src/eigen/diag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,4 @@ end

# The actual implementations using the above primitives
include("diag_lobpcg_hyper.jl")
include("diag_lobpcg_itsolve.jl")
include("diag_full.jl")
2 changes: 1 addition & 1 deletion test/diag_compare.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ using DFTK
test_solver(reference, diag_full, PreconditionerTPA)
test_solver(reference, diag_full, PreconditionerNone)
test_solver(reference, lobpcg_hyper, PreconditionerTPA)
test_solver(reference, lobpcg_itsolve, PreconditionerTPA)
# test_solver(reference, lobpcg_itsolve, PreconditionerTPA)
end

0 comments on commit 438e3a6

Please sign in to comment.