33[ ![ Stable] ( https://img.shields.io/badge/docs-stable-blue.svg )] ( https://JuliaMolSim.github.io/GeometryOptimization.jl/stable/ )
44[ ![ Dev] ( https://img.shields.io/badge/docs-dev-blue.svg )] ( https://JuliaMolSim.github.io/GeometryOptimization.jl/dev/ )
55[ ![ Build Status] ( https://github.com/JuliaMolSim/GeometryOptimization.jl/actions/workflows/CI.yml/badge.svg?branch=main )] ( https://github.com/JuliaMolSim/GeometryOptimization.jl/actions/workflows/CI.yml?query=branch%3Amain )
6- [ ![ Coverage] ( https://codecov.io/gh/JuliaMolSim/GeometryOptimization.jl/branch/master /graph/badge.svg )] ( https://codecov.io/gh/JuliaMolSim/GeometryOptimization.jl )
6+ [ ![ Coverage] ( https://codecov.io/gh/JuliaMolSim/GeometryOptimization.jl/branch/main /graph/badge.svg )] ( https://codecov.io/gh/JuliaMolSim/GeometryOptimization.jl )
77
88A package for optimising the structural parameters of an atomistic system,
99i.e. the step usually referred to as
@@ -29,22 +29,24 @@ molecule using a simple Lennard Jones potential:
2929using AtomsBase
3030using EmpiricalPotentials
3131using GeometryOptimization
32+ using LinearAlgebra
3233using Unitful
3334using UnitfulAtomic
3435
3536# Setup system and calculator
36- system = isolated_system ([:H => [0 , 0 , 0.0 ]u " bohr" ,
37- :H => [0 , 0 , 1.9 ]u " bohr" ])
38-
37+ cell_vectors = ([10.0 , 0.0 , 0.0 ]u " Å" , [0.0 , 10.0 , 0.0 ]u " Å" , [0.0 , 0.0 , 10.0 ]u " Å" )
38+ system = periodic_system ([:H => [0 , 0 , 0.0 ]u " bohr" ,
39+ :H => [0 , 0 , 1.9 ]u " bohr" ],
40+ cell_vectors)
3941zH = 1
4042emins = Dict ((zH, zH) => - 1.17 u " hartree" , )
41- rmins = Dict ((zH, zH) => 0.743 u " Å" , )
43+ rmins = Dict ((zH, zH) => 0.743 u " Å" , )
4244calc = LennardJones (emins, rmins, 5.0 u " Å" )
4345
4446# Run the geometry optimisation
4547results = minimize_energy! (system, calc)
4648
4749# Inspect the results
48- optimised = results. system
49- bondlength = norm (position (optimised [1 ]) - position (optimised [2 ]))
50+ optsystem = results. system
51+ optimised_bondlength = norm (position (optsystem [1 ]) - position (optsystem [2 ]))
5052```
0 commit comments