Skip to content

Commit 09913fb

Browse files
authored
Enable empirical potentials (#23)
1 parent f87dd6a commit 09913fb

4 files changed

Lines changed: 26 additions & 12 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ using UnitfulAtomic
3535
# Setup system and calculator
3636
system = isolated_system([:H => [0, 0, 0.0]u"bohr",
3737
:H => [0, 0, 1.9]u"bohr"])
38-
calc = LennardJones(-1.17u"hartree", 0.743u"angstrom", 1, 1, 0.6u"nm")
38+
39+
zH = 1
40+
emins = Dict((zH, zH) => -1.17u"hartree", )
41+
rmins = Dict((zH, zH) => 0.743u"Å", )
42+
calc = LennardJones(emins, rmins, 5.0u"Å")
3943

4044
# Run the geometry optimisation
4145
results = minimize_energy!(system, calc)

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ 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"
910
GeometryOptimization = "673bf261-a53d-43b9-876f-d3c1fc8329c2"
1011
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1112
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"

docs/src/examples/tial_lj.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
TODO Write some text motivating this example
44

55
Setup system:
6-
```julia
7-
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
6+
```@example tial
87
using AtomsIO
98
using EmpiricalPotentials
109
@@ -13,18 +12,27 @@ nothing
1312
```
1413

1514
Setup calculator:
16-
```julia
17-
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
15+
```@example tial
1816
using Unitful
1917
using UnitfulAtomic
2018
21-
calc = LennardJones(-1.0u"meV", 3.1u"Å", 13, 13, 6.0u"Å")
19+
# Note: These are completely made up parameters,
20+
# please do not use in production
21+
rcut = 5.0u"Å"
22+
zAl = atomic_number(ChemicalSpecies(:Al))
23+
zTi = atomic_number(ChemicalSpecies(:Ti))
24+
emins = Dict( (zAl, zAl) => -1.0u"eV",
25+
(zAl, zTi) => -1.234u"eV",
26+
(zTi, zTi) => -0.345u"eV" )
27+
rmins = Dict( (zAl, zAl) => 2.7u"Å",
28+
(zAl, zTi) => 3.2u"Å",
29+
(zTi, zTi) => 3.0u"Å" )
30+
calc = LennardJones(emins, rmins, rcut)
2231
nothing
2332
```
2433

2534
Minimise energy:
26-
```julia
27-
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
35+
```@example tial
2836
using GeometryOptimization
2937
GO = GeometryOptimization
3038
@@ -33,8 +41,6 @@ results.energy
3341
```
3442

3543
Final structure:
36-
```julia
37-
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
38-
44+
```@example tial
3945
results.system
4046
```

docs/src/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ using UnitfulAtomic
2525
# Setup system and calculator
2626
system = isolated_system([:H => [0, 0, 0.0]u"bohr",
2727
:H => [0, 0, 1.9]u"bohr"])
28-
calc = LennardJones(-1.17u"hartree", 0.743u"angstrom", 1, 1, 0.6u"nm")
28+
zH = 1
29+
emins = Dict((zH, zH) => -1.17u"hartree", )
30+
rmins = Dict((zH, zH) => 0.743u"Å", )
31+
calc = LennardJones(emins, rmins, 5.0u"Å")
2932

3033
# Run the geometry optimisation (using verbosity=1 to print the progress)
3134
results = minimize_energy!(system, calc; verbosity=1)

0 commit comments

Comments
 (0)