Skip to content

Commit

Permalink
Cosmetic fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricTravelletti committed Jan 11, 2024
1 parent 392342d commit aaa8130
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
2 changes: 0 additions & 2 deletions examples/H2.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#= Test Geometry Optimization on an aluminium supercell.
=#
using Printf
using LinearAlgebra
using DFTK
Expand Down
1 change: 0 additions & 1 deletion examples/H2_LJ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ using AtomsBase
using GeometryOptimization



bounding_box = 10.0u"angstrom" .* [[1, 0, 0.], [0., 1, 0], [0., 0, 1]]
atoms = [:H => [0, 0, 0.0]u"bohr", :H => [0, 0, 1.9]u"bohr"]
system = periodic_system(atoms, bounding_box)
Expand Down
4 changes: 2 additions & 2 deletions examples/TiAl_EmpiricalPotentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ lj = LennardJones(-1.0u"meV", 3.1u"Å", 13, 13, 6.0u"Å")
# Convert to AbstractSystem, so we have the `particles` attribute.
particles = map(data) do atom
Atom(; pairs(atom)...)
end
end
system = AbstractSystem(data; particles)

solver = OptimizationOptimJL.LBFGS()
optim_options = (f_tol=1e-8, g_tol=1e-8, iterations=10, show_trace=true)

results = minimize_energy!(system, lj; solver=solver, optim_options...)
results = minimize_energy!(system, lj; solver, optim_options...)
println(results)
1 change: 0 additions & 1 deletion src/atomsbase_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ end
@doc raw"""
Creates a new system based on ``system`` where the non clamped positions are
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 = not_clamped_mask(system)
Expand Down
7 changes: 3 additions & 4 deletions src/optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ export minimize_energy!


"""
By default we work in cartesian coordinaes.
Note that internally, when optimizing the cartesian positions, atomic units
are used.
By default we work in cartesian coordinaes.
Note that internally, when optimizing the cartesian positions, atomic units
are used.
"""
function Optimization.OptimizationFunction(system, calculator; kwargs...)
mask = not_clamped_mask(system) # mask is assumed not to change during optim.
Expand Down

0 comments on commit aaa8130

Please # to comment.