Skip to content

Commit

Permalink
Enable empirical potentials (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst authored Jan 1, 2025
1 parent f87dd6a commit 09913fb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ using UnitfulAtomic
# Setup system and calculator
system = isolated_system([:H => [0, 0, 0.0]u"bohr",
:H => [0, 0, 1.9]u"bohr"])
calc = LennardJones(-1.17u"hartree", 0.743u"angstrom", 1, 1, 0.6u"nm")

zH = 1
emins = Dict((zH, zH) => -1.17u"hartree", )
rmins = Dict((zH, zH) => 0.743u"Å", )
calc = LennardJones(emins, rmins, 5.0u"Å")

# Run the geometry optimisation
results = minimize_energy!(system, calc)
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AtomsCalculators = "a3e0e189-c65a-42c1-833c-339540406eb1"
AtomsIO = "1692102d-eeb4-4df9-807b-c9517f998d44"
DFTK = "acf6eb54-70d9-11e9-0013-234b7a5f5337"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
EmpiricalPotentials = "38527215-9240-4c91-a638-d4250620c9e2"
GeometryOptimization = "673bf261-a53d-43b9-876f-d3c1fc8329c2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"
Expand Down
26 changes: 16 additions & 10 deletions docs/src/examples/tial_lj.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
TODO Write some text motivating this example

Setup system:
```julia
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
```@example tial
using AtomsIO
using EmpiricalPotentials
Expand All @@ -13,18 +12,27 @@ nothing
```

Setup calculator:
```julia
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
```@example tial
using Unitful
using UnitfulAtomic
calc = LennardJones(-1.0u"meV", 3.1u"Å", 13, 13, 6.0u"Å")
# Note: These are completely made up parameters,
# please do not use in production
rcut = 5.0u"Å"
zAl = atomic_number(ChemicalSpecies(:Al))
zTi = atomic_number(ChemicalSpecies(:Ti))
emins = Dict( (zAl, zAl) => -1.0u"eV",
(zAl, zTi) => -1.234u"eV",
(zTi, zTi) => -0.345u"eV" )
rmins = Dict( (zAl, zAl) => 2.7u"Å",
(zAl, zTi) => 3.2u"Å",
(zTi, zTi) => 3.0u"Å" )
calc = LennardJones(emins, rmins, rcut)
nothing
```

Minimise energy:
```julia
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5
```@example tial
using GeometryOptimization
GO = GeometryOptimization
Expand All @@ -33,8 +41,6 @@ results.energy
```

Final structure:
```julia
## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5

```@example tial
results.system
```
5 changes: 4 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ using UnitfulAtomic
# Setup system and calculator
system = isolated_system([:H => [0, 0, 0.0]u"bohr",
:H => [0, 0, 1.9]u"bohr"])
calc = LennardJones(-1.17u"hartree", 0.743u"angstrom", 1, 1, 0.6u"nm")
zH = 1
emins = Dict((zH, zH) => -1.17u"hartree", )
rmins = Dict((zH, zH) => 0.743u"Å", )
calc = LennardJones(emins, rmins, 5.0u"Å")

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

0 comments on commit 09913fb

Please sign in to comment.