diff --git a/Project.toml b/Project.toml index 6294249..bdd08cf 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeometryOptimization" uuid = "673bf261-a53d-43b9-876f-d3c1fc8329c2" authors = ["JuliaMolSim community"] -version = "0.1.0" +version = "0.1.1" [deps] AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a" @@ -19,9 +19,10 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a" [compat] -AtomsBase = "0.3" -AtomsBuilder = "0.1" -AtomsCalculators = "0.2" +ASEconvert = "0.1.8" +AtomsBase = "0.5" +AtomsBuilder = "0.2.2" +AtomsCalculators = "0.2.3" DocStringExtensions = "0.9" LineSearches = "7" Optimization = "3" diff --git a/docs/Project.toml b/docs/Project.toml index e242681..0bd1f18 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -6,7 +6,6 @@ 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" @@ -14,7 +13,6 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a" [compat] -ASEconvert = "0.1" -DFTK = "0.6" -Documenter = "~1.5" -EmpiricalPotentials = "0.1" +ASEconvert = "0.1.8" +DFTK = "0.7" +Documenter = "~1.8" diff --git a/docs/src/examples/aluminium_dftk.md b/docs/src/examples/aluminium_dftk.md index abe2985..7fbf621 100644 --- a/docs/src/examples/aluminium_dftk.md +++ b/docs/src/examples/aluminium_dftk.md @@ -15,27 +15,22 @@ system = rattle!(bulk(:Al; cubic=true), 0.2u"Å") Next we create a calculator employing the [density-functional toolkit](https://dftk.org/) to compute energies and forces at using the LDA density functional. +As pseudopotentials we use the [PseudoDojo](http://pseudo-dojo.org) as available +in the [PseudoPotentialData](https://github.com/JuliaMolSim/PseudoPotentialData.jl/) +package. ```@example dftk-aluminium using DFTK +using PseudoPotentialData -model_kwargs = (; functionals=[:lda_x, :lda_c_pw], temperature=1e-3) +pseudopotentials = PseudoFamily("dojo.nc.sr.lda.v0_4_1.oncvpsp3.standard.upf") +model_kwargs = (; functionals=LDA(), temperature=1e-3, pseudopotentials) basis_kwargs = (; kgrid=(3, 3, 3), Ecut=10.0) scf_kwargs = (; mixing=KerkerMixing()) calc = DFTKCalculator(; model_kwargs, basis_kwargs, scf_kwargs) -nothing -``` - -We attach pseudopotentials to the aluminium system, -i.e. we tell DFTK, that each aluminium atom should be modelled using -a pseudopotential rather than the full Coulomb potential. - -```@example dftk-aluminium -system = attach_psp(system; Al="hgh/lda/al-q3") -nothing ``` !!! info "Crude computational parameters" - Note, that these numerical parameters are chosen rather crudely in order + Note, that the numerical parameters above are chosen rather crudely in order to give a fast runtime on CI systems. For production calculations one would require larger computational parameters. diff --git a/docs/src/examples/other_solvers.md b/docs/src/examples/other_solvers.md index 17f5299..c1a8e70 100644 --- a/docs/src/examples/other_solvers.md +++ b/docs/src/examples/other_solvers.md @@ -11,12 +11,12 @@ to compute energies and forces at using the LDA density functional. ```@example other-solvers using DFTK +using PseudoPotentialData -model_kwargs = (; functionals=[:lda_x, :lda_c_pw]) +pseudopotentials = PseudoFamily("dojo.nc.sr.lda.v0_4_1.oncvpsp3.standard.upf") +model_kwargs = (; functionals=LDA(), pseudopotentials) basis_kwargs = (; kgrid=(1, 1, 1), Ecut=20.0) -scf_kwargs = (; tol=1e-6) -calc = DFTKCalculator(; model_kwargs, basis_kwargs, scf_kwargs) -nothing +calc = DFTKCalculator(; model_kwargs, basis_kwargs) ``` and we build the hydrogen molecular system, @@ -31,7 +31,6 @@ bounding_box = [[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 10.0]]u"Å" system = periodic_system([:H => [0, 0, 1.]u"bohr", :H => [0, 0, 3.]u"bohr"], bounding_box) -system = attach_psp(system; H="hgh/lda/h-q1") nothing ``` diff --git a/docs/src/examples/tial_lj.md b/docs/src/examples/tial_lj.md index 19525da..e0724fe 100644 --- a/docs/src/examples/tial_lj.md +++ b/docs/src/examples/tial_lj.md @@ -3,28 +3,30 @@ TODO Write some text motivating this example Setup system: -```@example tial -using AtomsBase +```julia +## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5 using AtomsIO using EmpiricalPotentials -using GeometryOptimization -GO = GeometryOptimization system = load_system(joinpath(pkgdir(EmpiricalPotentials), "data/TiAl-1024.xyz")) nothing ``` Setup calculator: -```@example tial +```julia +## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5 using Unitful using UnitfulAtomic + calc = LennardJones(-1.0u"meV", 3.1u"Å", 13, 13, 6.0u"Å") nothing ``` Minimise energy: ```julia -## TODO: Should run as @example once EmpiricalPotentials is compatible +## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5 +using GeometryOptimization +GO = GeometryOptimization results = minimize_energy!(system, calc, GO.OptimCG(); maxiters=10, verbosity=1) results.energy @@ -32,7 +34,7 @@ results.energy Final structure: ```julia -## TODO: Should run as @example once EmpiricalPotentials is compatible +## TODO: Should run as @example once EmpiricalPotentials is compatible with AB 0.5 results.system ``` diff --git a/src/clamping_updating_positions.jl b/src/clamping_updating_positions.jl index 77262fa..8f1931e 100644 --- a/src/clamping_updating_positions.jl +++ b/src/clamping_updating_positions.jl @@ -31,7 +31,7 @@ updated to the ones provided (in the order in which they appear in the system). """ function update_not_clamped_positions(system, positions::AbstractVector{<:Unitful.Length}) mask = [!get(atom, :clamped, false) for atom in system] - new_positions = deepcopy(position(system)) + new_positions = deepcopy(position(system, :)) new_positions[mask] = reinterpret(reshape, SVector{3, eltype(positions)}, reshape(positions, 3, :)) update_positions(system, new_positions)