Skip to content

JuliaMolSim/GeometryOptimization.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeometryOptimization

Stable Dev Build Status Coverage

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. Both relaxing atomic positions as well as the unit cell is supported.

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 and AtomsCalculator calculators should work out of the box.

See the documentation for examples and further details.

Motivating example

We consider the optimisation of the bondlength of a hydrogen molecule using a simple Lennard Jones potential:

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]))

About

Geometry optimization for molecular simulation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages