Skip to content

Commit 4387f71

Browse files
committed
Minor improvements
1 parent d6ae833 commit 4387f71

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

docs/src/features.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ and runs out of the box on Linux, windows and macOS, see [Installation](@ref).
3232
## Response and response properties
3333
- Density-functional perturbation theory (DFPT)
3434
- Integration of DFPT with **algorithmic differentiation**,
35-
e.g. [Polarizability using automatic differentiation](@ref)
35+
e.g. [Elastic constants](@ref),
36+
[Polarizability using automatic differentiation](@ref)
3637
- [Phonon computations](@ref) *(preliminary implementation)*
3738

3839
## Unique features

docs/src/guide/introductory_resources.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,22 @@ see [Publications](@ref).
6767
Covers topics such as DFT, pseudos, SCF, response, ...
6868

6969
## Recordings
70+
- [Algorithmic differentiation (AD) for plane-wave DFT](https://www.youtube.com/watch?v=g6j1beYSWV4) by M. F. Herbst:
71+
45-min talk at the Institute for Pure and Applied Mathematics (IPAM)
72+
at UCLA discussing the algorithmic differentiation techniques in DFTK.
73+
7074
- [DFTK.jl: 5 years of a multidisciplinary electronic-structure code](https://www.youtube.com/watch?v=ox_j2zKOuIk) by M. F. Herbst:
7175
30-min talk at JuliaCon 2024 providing the state of DFTK 5 years after the project was started.
7276
[Slides](https://michael-herbst.com/talks/2024.07.12_5years_DFTK.pdf),
7377
[Pluto notebook](https://michael-herbst.com/talks/2024.07.12_5years_DFTK.html)
7478

75-
- [Julia for Materials Modelling](https://www.youtube.com/watch?v=dujepKxxxkg) by M. F. Herbst:
79+
- [Julia for Materials Modelling](https://www.youtube.com/watch?v=dujepKxxxkg)
80+
by M. F. Herbst (from 2023):
7681
One-hour talk providing an overview of materials modelling tools for Julia.
7782
Key features of DFTK are highlighted as part of the talk.
83+
Starts to become a little outdated
7884
[Pluto notebooks](https://mfherbst.github.io/julia-for-materials/)
7985

80-
- [DFTK: A Julian approach for simulating electrons in solids](https://www.youtube.com/watch?v=-RomkxjlIcQ) by M. F. Herbst:
81-
Pre-recorded talk for JuliaCon 2020.
82-
Assumes no knowledge about DFT and gives the broad picture of DFTK. Starts to become a little outdated.
83-
[Slides](https://michael-herbst.com/talks/2020.07.29_juliacon_dftk.pdf).
84-
8586
- [Juliacon 2021 DFT workshop](https://www.youtube.com/watch?v=HvpPMWVm8aw) by M. F. Herbst:
8687
Three-hour workshop session at the 2021 Juliacon providing a mathematical look on
8788
DFT, SCF solution algorithms as well as the integration of DFTK into the Julia

src/response/chi0.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ function construct_bandtol(Bandtol::Type, basis::PlaneWaveBasis, ψ, occupation:
575575
# Distributing the error equally across all k-points leads to (with w = sqrt(Ω / Ng))
576576
# ‖z_{nk}‖ ≤ sqrt(Ω / Ng) / (‖K v_i‖ sqrt(Nocck) ‖Re(F⁻¹ Φk)‖_{2,∞} * 2f_{nk} Nk wk)
577577
# If we bound ‖Re(F⁻¹ Φk)‖_{2,∞} from below this is sqrt(Nocc / Ω).
578+
# See also section SM6 and Table SM4 in 2505.02319.
578579
#
579580
# Note that the kernel term ||K v_i|| of 2505.02319 is dropped here as it purely arises
580581
# from the rescaling of the RHS performed in apply_χ0 above. Consequently the function
@@ -598,10 +599,13 @@ function construct_bandtol(Bandtol::Type, scfres::NamedTuple; kwargs...)
598599
end
599600

600601
function adaptive_bandtol_orbital_term_(::Type{BandtolGuaranteed}, basis, kpt, ψk, mask_k)
601-
# Orbital term ‖Re(F⁻¹ Φk)‖_{2,∞} for thik k-point
602+
# Orbital term ‖F⁻¹ Φk‖_{2,∞} for thik k-point
603+
# Note that compared to the paper we deliberately do not take the real part,
604+
# since taking the real part represents an additional approximation
605+
# (thus making the strategy less guaranteed)
602606
row_sums_squared = sum(mask_k) do n
603607
ψnk_real = @views ifft(basis, kpt, ψk[:, n])
604-
abs2.(real.(ψnk_real))
608+
abs2.(ψnk_real)
605609
end
606610
sqrt(maximum(row_sums_squared))
607611
end

src/scf/anderson.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ and returns ``xₙ₊₁``.
103103
M = stack(Pfxs) .- vec(Pfxₙ) # Mᵢⱼ = (Pfxⱼ)ᵢ - (Pfxₙ)ᵢ
104104
# We need to solve 0 = M' Pfxₙ + M'M βs <=> βs = - (M'M)⁻¹ M' Pfxₙ
105105

106+
# TODO If memory pressure is high, automatically drop old iterates here
107+
# (Note: This quickly happens in GPU scenarios)
106108
# Ensure the condition number of M stays below maxcond, else prune the history
107109
Mfac = qr(M)
108110
while size(M, 2) > 1 && cond(Mfac.R) > anderson.maxcond

src/terms/operators.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function apply!(Hψ, op::DivAgradOperator, ψ;
153153
.fourier .-= im .* G_plus_k[α] .* A∇ψ ./ 2
154154
end
155155
end
156-
# TODO Implement Matrix(op::DivAgrad)
156+
# TODO Implement Matrix(op::DivAgradOperator)
157157

158158

159159
# Optimize RFOs by combining terms that can be combined

0 commit comments

Comments
 (0)