Skip to content

Commit e3f0dfd

Browse files
authored
Merge pull request #18 from JuliaMolSim/ab05
2 parents aa4f914 + c711593 commit e3f0dfd

File tree

6 files changed

+29
-34
lines changed

6 files changed

+29
-34
lines changed

Project.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GeometryOptimization"
22
uuid = "673bf261-a53d-43b9-876f-d3c1fc8329c2"
33
authors = ["JuliaMolSim community"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
@@ -19,9 +19,10 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
1919
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"
2020

2121
[compat]
22-
AtomsBase = "0.3"
23-
AtomsBuilder = "0.1"
24-
AtomsCalculators = "0.2"
22+
ASEconvert = "0.1.8"
23+
AtomsBase = "0.5"
24+
AtomsBuilder = "0.2.2"
25+
AtomsCalculators = "0.2.3"
2526
DocStringExtensions = "0.9"
2627
LineSearches = "7"
2728
Optimization = "3"

docs/Project.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ AtomsCalculators = "a3e0e189-c65a-42c1-833c-339540406eb1"
66
AtomsIO = "1692102d-eeb4-4df9-807b-c9517f998d44"
77
DFTK = "acf6eb54-70d9-11e9-0013-234b7a5f5337"
88
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
9-
EmpiricalPotentials = "38527215-9240-4c91-a638-d4250620c9e2"
109
GeometryOptimization = "673bf261-a53d-43b9-876f-d3c1fc8329c2"
1110
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1211
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"
1312
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
1413
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"
1514

1615
[compat]
17-
ASEconvert = "0.1"
18-
DFTK = "0.6"
19-
Documenter = "~1.5"
20-
EmpiricalPotentials = "0.1"
16+
ASEconvert = "0.1.8"
17+
DFTK = "0.7"
18+
Documenter = "~1.8"

docs/src/examples/aluminium_dftk.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,22 @@ system = rattle!(bulk(:Al; cubic=true), 0.2u"Å")
1515
Next we create a calculator employing the
1616
[density-functional toolkit](https://dftk.org/)
1717
to compute energies and forces at using the LDA density functional.
18+
As pseudopotentials we use the [PseudoDojo](http://pseudo-dojo.org) as available
19+
in the [PseudoPotentialData](https://github.com/JuliaMolSim/PseudoPotentialData.jl/)
20+
package.
1821
```@example dftk-aluminium
1922
using DFTK
23+
using PseudoPotentialData
2024
21-
model_kwargs = (; functionals=[:lda_x, :lda_c_pw], temperature=1e-3)
25+
pseudopotentials = PseudoFamily("dojo.nc.sr.lda.v0_4_1.oncvpsp3.standard.upf")
26+
model_kwargs = (; functionals=LDA(), temperature=1e-3, pseudopotentials)
2227
basis_kwargs = (; kgrid=(3, 3, 3), Ecut=10.0)
2328
scf_kwargs = (; mixing=KerkerMixing())
2429
calc = DFTKCalculator(; model_kwargs, basis_kwargs, scf_kwargs)
25-
nothing
26-
```
27-
28-
We attach pseudopotentials to the aluminium system,
29-
i.e. we tell DFTK, that each aluminium atom should be modelled using
30-
a pseudopotential rather than the full Coulomb potential.
31-
32-
```@example dftk-aluminium
33-
system = attach_psp(system; Al="hgh/lda/al-q3")
34-
nothing
3530
```
3631

3732
!!! info "Crude computational parameters"
38-
Note, that these numerical parameters are chosen rather crudely in order
33+
Note, that the numerical parameters above are chosen rather crudely in order
3934
to give a fast runtime on CI systems. For production calculations one would
4035
require larger computational parameters.
4136

docs/src/examples/other_solvers.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ to compute energies and forces at using the LDA density functional.
1111

1212
```@example other-solvers
1313
using DFTK
14+
using PseudoPotentialData
1415
15-
model_kwargs = (; functionals=[:lda_x, :lda_c_pw])
16+
pseudopotentials = PseudoFamily("dojo.nc.sr.lda.v0_4_1.oncvpsp3.standard.upf")
17+
model_kwargs = (; functionals=LDA(), pseudopotentials)
1618
basis_kwargs = (; kgrid=(1, 1, 1), Ecut=20.0)
17-
scf_kwargs = (; tol=1e-6)
18-
calc = DFTKCalculator(; model_kwargs, basis_kwargs, scf_kwargs)
19-
nothing
19+
calc = DFTKCalculator(; model_kwargs, basis_kwargs)
2020
```
2121

2222
and we build the hydrogen molecular system,
@@ -31,7 +31,6 @@ bounding_box = [[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 10.0]]u"Å"
3131
system = periodic_system([:H => [0, 0, 1.]u"bohr",
3232
:H => [0, 0, 3.]u"bohr"],
3333
bounding_box)
34-
system = attach_psp(system; H="hgh/lda/h-q1")
3534
nothing
3635
```
3736

docs/src/examples/tial_lj.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,38 @@
33
TODO Write some text motivating this example
44

55
Setup system:
6-
```@example tial
7-
using AtomsBase
6+
```julia
7+
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
88
using AtomsIO
99
using EmpiricalPotentials
10-
using GeometryOptimization
11-
GO = GeometryOptimization
1210

1311
system = load_system(joinpath(pkgdir(EmpiricalPotentials), "data/TiAl-1024.xyz"))
1412
nothing
1513
```
1614

1715
Setup calculator:
18-
```@example tial
16+
```julia
17+
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
1918
using Unitful
2019
using UnitfulAtomic
20+
2121
calc = LennardJones(-1.0u"meV", 3.1u"Å", 13, 13, 6.0u"Å")
2222
nothing
2323
```
2424

2525
Minimise energy:
2626
```julia
27-
## TODO: Should run as @example once EmpiricalPotentials is compatible
27+
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
28+
using GeometryOptimization
29+
GO = GeometryOptimization
2830

2931
results = minimize_energy!(system, calc, GO.OptimCG(); maxiters=10, verbosity=1)
3032
results.energy
3133
```
3234

3335
Final structure:
3436
```julia
35-
## TODO: Should run as @example once EmpiricalPotentials is compatible
37+
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
3638

3739
results.system
3840
```

src/clamping_updating_positions.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ updated to the ones provided (in the order in which they appear in the system).
3131
"""
3232
function update_not_clamped_positions(system, positions::AbstractVector{<:Unitful.Length})
3333
mask = [!get(atom, :clamped, false) for atom in system]
34-
new_positions = deepcopy(position(system))
34+
new_positions = deepcopy(position(system, :))
3535
new_positions[mask] = reinterpret(reshape, SVector{3, eltype(positions)},
3636
reshape(positions, 3, :))
3737
update_positions(system, new_positions)

0 commit comments

Comments
 (0)