From 08eed79602c10241eff280502b1216fe4a408b0e Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Fri, 20 Dec 2024 21:40:31 +0100 Subject: [PATCH 1/2] Enable empirical potentials --- docs/Project.toml | 1 + docs/src/examples/tial_lj.md | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 2b5a01c..c3aa404 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -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" diff --git a/docs/src/examples/tial_lj.md b/docs/src/examples/tial_lj.md index e0724fe..17648c9 100644 --- a/docs/src/examples/tial_lj.md +++ b/docs/src/examples/tial_lj.md @@ -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 @@ -13,8 +12,7 @@ nothing ``` Setup calculator: -```julia -## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5 +```@example tial using Unitful using UnitfulAtomic @@ -23,8 +21,7 @@ nothing ``` Minimise energy: -```julia -## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5 +```@example tial using GeometryOptimization GO = GeometryOptimization @@ -33,8 +30,6 @@ results.energy ``` Final structure: -```julia -## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5 - +```@example tial results.system ``` From 477e45bd36be1f9f31724e15ae265626b5728b35 Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Wed, 1 Jan 2025 12:37:26 +0100 Subject: [PATCH 2/2] Update readme --- README.md | 6 +++++- docs/src/examples/tial_lj.md | 13 ++++++++++++- docs/src/index.md | 5 ++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59e19f2..e27b328 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/src/examples/tial_lj.md b/docs/src/examples/tial_lj.md index 17648c9..9fc5fc6 100644 --- a/docs/src/examples/tial_lj.md +++ b/docs/src/examples/tial_lj.md @@ -16,7 +16,18 @@ Setup calculator: 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 ``` diff --git a/docs/src/index.md b/docs/src/index.md index 25fb893..f4faf04 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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)