https://github.com/juliamolsim/geometryoptimization.jl
Geometry optimization for molecular simulation
https://github.com/juliamolsim/geometryoptimization.jl
Last synced: about 1 month ago
JSON representation
Geometry optimization for molecular simulation
- Host: GitHub
- URL: https://github.com/juliamolsim/geometryoptimization.jl
- Owner: JuliaMolSim
- License: mit
- Created: 2023-09-26T17:50:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-02T21:39:24.000Z (4 months ago)
- Last Synced: 2025-02-23T14:16:46.040Z (2 months ago)
- Language: Julia
- Homepage: https://juliamolsim.github.io/GeometryOptimization.jl/
- Size: 509 KB
- Stars: 7
- Watchers: 6
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GeometryOptimization
[](https://JuliaMolSim.github.io/GeometryOptimization.jl/stable/)
[](https://JuliaMolSim.github.io/GeometryOptimization.jl/dev/)
[](https://github.com/JuliaMolSim/GeometryOptimization.jl/actions/workflows/CI.yml?query=branch%3Amain)
[](https://codecov.io/gh/JuliaMolSim/GeometryOptimization.jl)A package for optimising the structural parameters of an atomistic system,
i.e. the step usually referred to as
**geometry optimisation** or **structural relaxation**
in electronic structure theory and atomistic modelling.The package is generic in the datastructures used to represent the geometry,
the calculator used to evaluate energies and forces as well as the solver algorithm.
Generally all
[AtomsBase structures](https://github.com/JuliaMolSim/AtomsBase.jl)
and [AtomsCalculator calculators](https://github.com/JuliaMolSim/AtomsCalculators.jl)
should work out of the box.See the [documentation](https://JuliaMolSim.github.io/GeometryOptimization.jl/stable/)
for examples and further details.## Motivating example
We consider the optimisation of the bondlength of a hydrogen
molecule using a simple Lennard Jones potential:```julia
using AtomsBase
using EmpiricalPotentials
using GeometryOptimization
using LinearAlgebra
using Unitful
using UnitfulAtomic# Setup system and calculator
cell_vectors = ([10.0, 0.0, 0.0]u"Å", [0.0, 10.0, 0.0]u"Å", [0.0, 0.0, 10.0]u"Å")
system = periodic_system([:H => [0, 0, 0.0]u"bohr",
:H => [0, 0, 1.9]u"bohr"],
cell_vectors)
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)# Inspect the results
optsystem = results.system
optimised_bondlength = norm(position(optsystem[1]) - position(optsystem[2]))
```