Skip to content

Commit

Permalink
Drop deprecated features and a round of docs updating (#994)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Aug 17, 2024
1 parent 93496a2 commit d132f17
Show file tree
Hide file tree
Showing 108 changed files with 882 additions and 610 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup Julia stable
uses: julia-actions/setup-julia@v1
with:
version: '1.9'
version: '1.10'
arch: x64
if: ${{ matrix.mode == 'stable' }}
- name: Setup Julia nightly
Expand Down
38 changes: 0 additions & 38 deletions .gitlab-ci.yml

This file was deleted.

9 changes: 7 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"
[weakdeps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
GeometryOptimization = "673bf261-a53d-43b9-876f-d3c1fc8329c2"
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Expand All @@ -60,6 +61,7 @@ wannier90_jll = "c5400fa0-8d08-52c2-913f-1e3f656c1ce9"
[extensions]
DFTKCUDAExt = "CUDA"
DFTKGenericLinearAlgebraExt = "GenericLinearAlgebra"
DFTKGeometryOptimizationExt = "GeometryOptimization"
DFTKIntervalArithmeticExt = "IntervalArithmetic"
DFTKJLD2Ext = "JLD2"
DFTKJSON3Ext = "JSON3"
Expand All @@ -72,6 +74,7 @@ DFTKWriteVTKExt = "WriteVTK"
AbstractFFTs = "1"
Artifacts = "1"
AtomsBase = "0.3.1"
AtomsBuilder = "0.1"
AtomsCalculators = "0.2"
Brillouin = "0.5.14"
CUDA = "5"
Expand All @@ -83,6 +86,7 @@ FFTW = "1.5"
ForwardDiff = "0.10"
GPUArraysCore = "0.1"
GenericLinearAlgebra = "0.3"
GeometryOptimization = "0.1"
Interpolations = "0.14, 0.15"
IntervalArithmetic = "0.20"
IterTools = "1"
Expand Down Expand Up @@ -118,11 +122,12 @@ Unitful = "1"
UnitfulAtomic = "1"
Wannier = "0.3.2"
WriteVTK = "1"
julia = "1.9"
julia = "1.10"
wannier90_jll = "3.1"

[extras]
ASEconvert = "3da9722f-58c2-4165-81be-b4d7253e8fd2"
AtomsBuilder = "f5cc8831-eeb7-4288-8d9f-d6c1ddb77004"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
AtomsIO = "1692102d-eeb4-4df9-807b-c9517f998d44"
AtomsIOPython = "9e4c859b-2281-48ef-8059-f50fe53c37b0"
Expand All @@ -148,4 +153,4 @@ WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"
wannier90_jll = "c5400fa0-8d08-52c2-913f-1e3f656c1ce9"

[targets]
test = ["Test", "TestItemRunner", "ASEconvert", "Aqua", "AtomsIO", "AtomsIOPython", "CUDA", "CUDA_Runtime_jll", "ComponentArrays", "DoubleFloats", "FiniteDiff", "FiniteDifferences", "GenericLinearAlgebra", "IntervalArithmetic", "JLD2", "JSON3", "Logging", "Plots", "QuadGK", "Random", "KrylovKit", "Wannier", "WriteVTK", "wannier90_jll"]
test = ["Test", "TestItemRunner", "ASEconvert", "AtomsBuilder", "Aqua", "AtomsIO", "AtomsIOPython", "CUDA", "CUDA_Runtime_jll", "ComponentArrays", "DoubleFloats", "FiniteDiff", "FiniteDifferences", "GenericLinearAlgebra", "GeometryOptimization", "IntervalArithmetic", "JLD2", "JSON3", "Logging", "Plots", "QuadGK", "Random", "KrylovKit", "Wannier", "WriteVTK", "wannier90_jll"]
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Density-functional toolkit

| **Documentation** | **Build Status** | **License** |
|:--------------------------------------------------------------------------------- |:----------------------------------------------- |:-------------------------------- |
| [![][docs-img]][docs-url] [![][ddocs-img]][ddocs-url] [![][chat-img]][chat-url] | [![][ci-img]][ci-url] [![][cigpu-img]][cigpu-url] [![][ccov-img]][ccov-url] | [![][license-img]][license-url] |
| **Documentation** | **Build Status** | **License** |
|:------------------------------------------------------------------------------- |:----------------------------------------------- |:-------------------------------- |
| [![][docs-img]][docs-url] [![][ddocs-img]][ddocs-url] [![][chat-img]][chat-url] | [![][ci-img]][ci-url] [![][ccov-img]][ccov-url] | [![][license-img]][license-url] |

[ddocs-img]: https://img.shields.io/badge/docs-dev-blue.svg
[ddocs-url]: https://docs.dftk.org/dev
Expand All @@ -18,9 +18,6 @@
[ci-img]: https://github.com/JuliaMolSim/DFTK.jl/workflows/CI/badge.svg?branch=master&event=push
[ci-url]: https://github.com/JuliaMolSim/DFTK.jl/actions

[cigpu-img]: https://git.uni-paderborn.de/herbstm/DFTK.jl/badges/master/pipeline.svg?key_text=GPU%20CI
[cigpu-url]: https://git.uni-paderborn.de/herbstm/DFTK.jl/-/pipelines

[ccov-img]: https://codecov.io/gh/JuliaMolSim/DFTK.jl/branch/master/graph/badge.svg?token=A23M0VZ8PQ
[ccov-url]: https://codecov.io/gh/JuliaMolSim/DFTK.jl

Expand All @@ -46,7 +43,7 @@ For getting started with DFTK, see [our documentation](https://docs.dftk.org):
- [Tutorial](https://docs.dftk.org/stable/guide/tutorial/)
- [Basic DFT examples](https://docs.dftk.org/stable/examples/metallic_systems/)

Note that at least **Julia 1.9** is required.
Note that at least **Julia 1.10** is required.

## Support and citation
DFTK is mostly developed as part of academic research.
Expand Down
20 changes: 14 additions & 6 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
build/
site/
src/examples/
src/guide/tutorial.md
src/guide/tutorial.ipynb
src/guide/periodic_problems.ipynb
src/guide/periodic_problems.md
src/ecosystem/atomsbase.ipynb
src/ecosystem/atomsbase.md
src/ecosystem/atomscalculators.ipynb
src/ecosystem/atomscalculators.md
src/ecosystem/input_output.ipynb
src/ecosystem/input_output.md
src/ecosystem/wannier.ipynb
src/ecosystem/wannier.md
src/guide/atomic_chains.ipynb
src/guide/atomic_chains.md
src/guide/self_consistent_field.ipynb
src/guide/self_consistent_field.md
src/guide/discretisation.ipynb
src/guide/discretisation.md
src/guide/periodic_problems.ipynb
src/guide/periodic_problems.md
src/guide/self_consistent_field.ipynb
src/guide/self_consistent_field.md
src/guide/tutorial.ipynb
src/guide/tutorial.md
src/tricks/scf_checkpoints.ipynb
src/tricks/scf_checkpoints.md
/Artifacts.toml
7 changes: 6 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
ASEconvert = "3da9722f-58c2-4165-81be-b4d7253e8fd2"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
AtomsCalculators = "a3e0e189-c65a-42c1-833c-339540406eb1"
AtomsBuilder = "f5cc8831-eeb7-4288-8d9f-d6c1ddb77004"
AtomsIO = "1692102d-eeb4-4df9-807b-c9517f998d44"
AtomsIOPython = "9e4c859b-2281-48ef-8059-f50fe53c37b0"
Brillouin = "23470ee3-d0df-4052-8b1a-8cbd6363e7f0"
DFTK = "acf6eb54-70d9-11e9-0013-234b7a5f5337"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GeometryOptimization = "673bf261-a53d-43b9-876f-d3c1fc8329c2"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Expand All @@ -19,7 +22,6 @@ Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
Expand All @@ -30,3 +32,6 @@ wannier90_jll = "c5400fa0-8d08-52c2-913f-1e3f656c1ce9"

[compat]
Documenter = "~1.5"
AtomsBuilder = "0.1"
AtomsCalculators = "0.2"
GeometryOptimization = "0.1"
11 changes: 7 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ PAGES = [
"Ecosystem integration" => [
# This concerns the discussion of interfaces, IO and integration
# options we have
"examples/atomsbase.jl",
"examples/input_output.jl",
"examples/wannier.jl",
"ecosystem/atomsbase.jl",
"ecosystem/atomscalculators.jl",
"ecosystem/input_output.jl",
"ecosystem/atomistic_simulation_environment.md",
"ecosystem/wannier.jl",
],
"Tips and tricks" => [
# Resolving convergence issues, what solver to use, improving performance or
Expand Down Expand Up @@ -80,6 +82,7 @@ PAGES = [
],
"Developer resources" => [
"developer/setup.md",
"developer/testsystem.md",
"developer/conventions.md",
"developer/style_guide.md",
"developer/data_structures.md",
Expand All @@ -93,7 +96,7 @@ PAGES = [

# Files from the /examples folder that need to be copied over to the docs
# (typically images, input or data files etc.)
EXAMPLE_ASSETS = ["examples/Fe_afm.pwi", "examples/Si.extxyz"]
EXAMPLE_ASSETS = [] # Specify e.g. as "examples/Fe_afm.pwi"

#
# Configuration and setup
Expand Down
2 changes: 1 addition & 1 deletion docs/src/assets/0_pregenerate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let
atoms = [ElementPsp(:Si; psp)]
positions = [zeros(3)]

model = model_LDA(lattice, atoms, positions; temperature=1e-2)
model = model_DFT(lattice, atoms, positions; functionals=LDA(), temperature=1e-2)
basis = PlaneWaveBasis(model; Ecut, kgrid=[8, 8, 8])
self_consistent_field(basis; tol=1e-8)
end
Expand Down
39 changes: 15 additions & 24 deletions docs/src/developer/data_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@

```@setup data_structures
using DFTK
a = 10.26 # Silicon lattice constant in Bohr
lattice = a / 2 * [[0 1 1.];
[1 0 1.];
[1 1 0.]]
Si = ElementPsp(:Si; psp=load_psp("hgh/lda/Si-q4"))
atoms = [Si, Si]
positions = [ones(3)/8, -ones(3)/8]
model = model_LDA(lattice, atoms, positions)
kgrid = [4, 4, 4]
Ecut = 15
basis = PlaneWaveBasis(model; Ecut, kgrid)
using AtomsBuilder
system = attach_psp(bulk(:Si); Si="hgh/lda/si-q4")
model = model_DFT(system; functionals=LDA())
basis = PlaneWaveBasis(model; Ecut=15, kgrid=[4, 4, 4])
scfres = self_consistent_field(basis; tol=1e-4);
```

Expand Down Expand Up @@ -64,20 +56,19 @@ the definition of the above terms in the
By mixing and matching these terms, the user can create custom models
not limited to DFT. Convenience constructors are provided for common cases:

- `model_LDA`: LDA model using the
[Teter parametrisation](https://doi.org/10.1103/PhysRevB.54.1703)
- `model_DFT`: Assemble a DFT model using
any of the LDA or GGA functionals of the
[libxc](https://tddft.org/programs/libxc/functionals/) library,
for example:
- `model_DFT`: Assemble a DFT model using any of the LDA or GGA functionals of the
[libxc](https://libxc.gitlab.io/functionals/) library, for example:
```
model_DFT(lattice, atoms, positions, [:gga_x_pbe, :gga_c_pbe])
model_DFT(lattice, atoms, positions, :lda_xc_teter93)
model_DFT(lattice, atoms, positions; functionals=LDA())
model_DFT(lattice, atoms, positions; functionals=[:lda_x, :lda_c_pw])
model_DFT(lattice, atoms, positions; functionals=[:gga_x_pbe, :gga_c_pbe])
```
where the latter is equivalent to `model_LDA`.
Specifying no functional is the reduced Hartree-Fock model:
For common functional combinations DFTK additionally offers shorthands.
E.g. in the above example specifying [`LDA`](@ref) expands to
`[:lda_x, :lda_c_pw]`, such that the first two examples are identical.
Note, that specifying no functional is the reduced Hartree-Fock model:
```
model_DFT(lattice, atoms, positions, [])
model_DFT(lattice, atoms, positions; functionals=[])
```
- `model_atomic`: A linear model, which contains no electron-electron interaction
(neither Hartree nor XC term).
Expand All @@ -95,7 +86,7 @@ of `PlaneWaveBasis`, the latter is controlled by the
cutoff energy parameter `Ecut`:

```@example data_structures
PlaneWaveBasis(model; Ecut, kgrid)
PlaneWaveBasis(model; Ecut=15, kgrid=[4, 4, 4])
```

The `PlaneWaveBasis` by default uses symmetry to reduce the number of
Expand Down
34 changes: 0 additions & 34 deletions docs/src/developer/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,37 +58,3 @@ At the time of writing dropping a file `LocalPreferences.toml` in DFTK's root fo
[DFTK]
precompile_workload = false
```
## Running the tests
We use [TestItemRunner](https://github.com/julia-vscode/TestItemRunner.jl) to manage the
tests. It reduces the risk to have undefined behavior by preventing tests from being run in
global scope.
Moreover, it allows for greater flexibility by providing ways to launch a specific subset of
the tests.
For instance, to launch core functionality tests, one can use
```julia
using TestEnv # Optional: automatically installs required packages
TestEnv.activate() # for tests in a temporary environment.
using TestItemRunner
cd("test") # By default, the following macro runs everything from the parent folder.
@run_package_tests filter = ti -> :core ∈ ti.tags
```
Or to only run the tests of a particular file `serialisation.jl` use
```julia
@run_package_tests filter = ti -> occursin("serialisation.jl", ti.filename)
```
If you need to write tests, note that you can create modules with `@testsetup`. To use
a function `my_function` of a module `MySetup` in a `@testitem`, you can import it with
```julia
using .MySetup: my_function
```
It is also possible to use functions from another module within a module. But for this the
order of the modules in the `setup` keyword of `@testitem` is important: you have to add the
module that will be used before the module using it. From the latter, you can then use it
with
```julia
using ..MySetup: my_function
```
10 changes: 4 additions & 6 deletions docs/src/developer/symmetries.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,22 @@ lattice = a / 2 * [[0 1 1.];
Si = ElementPsp(:Si; psp=load_psp("hgh/lda/Si-q4"))
atoms = [Si, Si]
positions = [ones(3)/8, -ones(3)/8]
Ecut = 5
kgrid = [4, 4, 4]
```
Let us demonstrate this in practice.
We consider silicon, setup appropriately in the `lattice`, `atoms` and `positions`
objects as in [Tutorial](@ref) and to reach a fast execution, we take a small `Ecut` of `5`
and a `[4, 4, 4]` Monkhorst-Pack grid.
First we perform the DFT calculation disabling symmetry handling
```@example symmetries
model_nosym = model_LDA(lattice, atoms, positions; symmetries=false)
basis_nosym = PlaneWaveBasis(model_nosym; Ecut, kgrid)
model_nosym = model_DFT(lattice, atoms, positions; functionals=LDA(), symmetries=false)
basis_nosym = PlaneWaveBasis(model_nosym; Ecut=5, kgrid=[4, 4, 4])
scfres_nosym = @time self_consistent_field(basis_nosym, tol=1e-6)
nothing # hide
```
and then redo it using symmetry (the default):
```@example symmetries
model_sym = model_LDA(lattice, atoms, positions)
basis_sym = PlaneWaveBasis(model_sym; Ecut, kgrid)
model_sym = model_DFT(lattice, atoms, positions; functionals=LDA())
basis_sym = PlaneWaveBasis(model_sym; Ecut=5, kgrid=[4, 4, 4])
scfres_sym = @time self_consistent_field(basis_sym, tol=1e-6)
nothing # hide
```
Expand Down
Loading

0 comments on commit d132f17

Please sign in to comment.