Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge InteratomicBasisPotentials.jl into InteratomicPotentials.jl + Updates from PotentialLearning.jl #50

Merged
merged 77 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
69ef874
Initial commit
dallasfoster Feb 3, 2022
afd9e09
Update ACE export
dallasfoster Feb 11, 2022
87a6605
Update ace.jl
dallasfoster Feb 11, 2022
b661eb0
bump version 0.1.1
dallasfoster Feb 11, 2022
4b57a0d
Updates to match InteratomicPotentials.jl v0.2
dallasfoster Apr 26, 2022
d638b2e
bump v0.1.2
dallasfoster Apr 26, 2022
bcf9b14
Add performance test, fix minor bugs
dallasfoster May 7, 2022
0f848c4
Update manifest
dallasfoster May 7, 2022
aeab749
add .gitignore
jrdegreeff Apr 28, 2022
fc2ec2b
InteratomicPotentials v0.2 interface
jrdegreeff Apr 28, 2022
12e9957
Merge pull request #1 from cesmix-mit/dev
jrdegreeff May 7, 2022
2c005e2
Update to v0.2.0
dallasfoster May 9, 2022
0b14846
Merge pull request #2 from cesmix-mit/documentation
dallasfoster May 9, 2022
3951c99
Update documentation
dallasfoster May 9, 2022
bfe1134
Merge pull request #3 from cesmix-mit/documentation
dallasfoster May 9, 2022
5541318
Add workflows
dallasfoster May 9, 2022
ac922b5
Merge pull request #4 from cesmix-mit/documentation
dallasfoster May 9, 2022
d9c6df7
Add JuliaMolSim to workflow registries.
dallasfoster May 9, 2022
680a8fa
Merge pull request #5 from cesmix-mit/documentation
dallasfoster May 9, 2022
2b6a9df
Update index.md
dallasfoster May 9, 2022
c71d6e0
Merge pull request #6 from cesmix-mit/documentation
dallasfoster May 9, 2022
05f7b8a
Update docs
dallasfoster May 9, 2022
99b0e4f
Merge pull request #7 from cesmix-mit/documentation
dallasfoster May 9, 2022
1c037b1
Update energy_and_force functionality for ACE model.
dallasfoster Jun 13, 2022
6a78b5e
update tests
dallasfoster Jul 13, 2022
31bdc6b
Update manifest
dallasfoster Jul 13, 2022
e0de9b7
Merge pull request #8 from cesmix-mit/v0.2.1_updates
dallasfoster Jul 13, 2022
b1e61e1
Update CI.yml
dallasfoster Jul 13, 2022
1f74ec9
Merge pull request #10 from cesmix-mit/CI-patch2
dallasfoster Jul 14, 2022
df2bde5
Update ACE, SNAP, add LinearBasisPotentials and Neural Network Basis…
dallasfoster Sep 30, 2022
0a3803f
Update Linear and Neural Network Basis Potential types / structures
dallasfoster Sep 30, 2022
7cdff00
Update manifest
dallasfoster Sep 30, 2022
08e75fb
Merge pull request #11 from cesmix-mit/v0.2.1_updates
dallasfoster Sep 30, 2022
8a99bc3
Update Project.toml
dallasfoster Sep 30, 2022
5452093
Merge branch 'main' of https://github.com/cesmix-mit/InteratomicBasis…
dallasfoster Sep 30, 2022
c307c94
Update api according to InteratomicPotentials
dallasfoster Oct 6, 2022
6831fe1
Accelerating ACE wrapper
emmanuellujan May 12, 2023
b802a47
Addressing review
emmanuellujan May 16, 2023
df2a8ad
bump v0.2.4
emmanuellujan May 18, 2023
11cb013
Merge pull request #12 from cesmix-mit/accelerate-ace1-wrapper
emmanuellujan May 18, 2023
f0f5e25
update AtomsBase dependency
swyant Jul 12, 2023
db944b9
fixing cell conversion issue for non-orthog systems
swyant Jul 17, 2023
dd4fd57
Merge pull request #13 from cesmix-mit/sw/fix_ace_nonorthog
swyant Aug 15, 2023
ccd048b
Merge remote-tracking branch 'IBP/main' into IP_IBP
emmanuellujan Nov 30, 2023
47500d5
Fixing merge
emmanuellujan Nov 30, 2023
a233cf4
Update of LJCluster example
emmanuellujan Nov 30, 2023
4fb019b
update of benchmarks
emmanuellujan Nov 30, 2023
bd23b50
Small improvements in benchmarks.
emmanuellujan Dec 1, 2023
b13ba10
Update of neural basis potentials for energies.
emmanuellujan Dec 1, 2023
8f8d3a0
Address windows error.
emmanuellujan Dec 1, 2023
04d1e72
remove log file
emmanuellujan Dec 4, 2023
2653c1c
Update of NNBasisPotential
emmanuellujan Dec 5, 2023
fddcd3b
Update of doc. conf. file.
emmanuellujan Dec 5, 2023
8c87b02
Update of doc. conf. file.
emmanuellujan Dec 5, 2023
149ce71
Update of doc. conf. file.
emmanuellujan Dec 5, 2023
d2aa6f2
Update of examples in doc.
emmanuellujan Dec 5, 2023
b84c3f9
Test if windows error is related to v1.8
emmanuellujan Dec 6, 2023
c3ef5dd
Test if windows error is related to v1.8
emmanuellujan Dec 6, 2023
e461996
New NNBP test
emmanuellujan Dec 6, 2023
f859afe
Adding type conversion argument in compute descriptor functions.
emmanuellujan Dec 6, 2023
6b37df8
improving neural network basis potential test
emmanuellujan Dec 6, 2023
a5490b5
New ACE constructor
emmanuellujan Dec 7, 2023
439943c
Update of linear basis potential with intercept.
emmanuellujan Dec 7, 2023
97f5230
Update of basis potentials functions
emmanuellujan Dec 8, 2023
ce15acc
Update of basis and linear potentials.
emmanuellujan Dec 8, 2023
a4f8f73
Small update of linear basis potentials.
emmanuellujan Dec 8, 2023
01a7886
Force calculation in linear potential, and change in force argument d…
emmanuellujan Dec 9, 2023
6099bb7
Small fix
emmanuellujan Dec 9, 2023
3f94925
Small improvements in linear basis potential
emmanuellujan Dec 11, 2023
fe3758c
Update of readme.
emmanuellujan Dec 15, 2023
5ac88ba
Removing T as parameter.
emmanuellujan Dec 15, 2023
93964b6
Update of ACE constructor.
emmanuellujan Dec 15, 2023
b386df0
Removing castings.
emmanuellujan Dec 16, 2023
2bff47b
β0 as vector to allow update
emmanuellujan Dec 16, 2023
95bbc08
Typo
emmanuellujan Dec 16, 2023
5aaf245
Update of potential_energy function for NNBasisPotential.
emmanuellujan Dec 20, 2023
adc4b1a
bump version to 0.2.7
emmanuellujan Jan 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ set_parameters(lj, (ϵ = 2.0 * 1u"eV", σ = 1.0 * 1u"Å")) # Set parameters (re

## Potential Types

All interatomic potentials listed in this project are subtypes of `ArbitraryPotential`. At this point, as of v2.0, there are two branches of potentials: `EmpiricalPotential` and `MixedPotentials`. A potential called `BasisPotential` is also defined.
All interatomic potentials listed in this project are subtypes of `ArbitraryPotential`. There are three types of potentials currently implemented: `EmpiricalPotential`, `BasisPotential`, and combination potentials via `MixedPotentials`.

`EmpiricalPotential`s include two-body potentials like `BornMayer`, `LennardJones`. `MixedPotential` is a convenience type for allowing the linear combination of potentials. An example would be:
```julia
Expand Down
27 changes: 11 additions & 16 deletions src/BasisPotentials/basis_potentials.jl
emmanuellujan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -13,52 +13,47 @@ end

function potential_energy(
s::AbstractSystem,
bp::BasisPotential;
T = Float64
bp::BasisPotential
)
B = compute_local_descriptors(s, bp.basis, T = T)
B = compute_local_descriptors(s, bp.basis)
e = potential_energy(B, bp)
return e
end

function force(
s::AbstractSystem,
bp::BasisPotential;
T = Float64
bp::BasisPotential
)
dB = compute_force_descriptors(s, bp.basis, T = T)
dB = compute_force_descriptors(s, bp.basis)
f = force(dB, bp) # * FORCE_UNIT
return f
end

function energy_and_force(
s::AbstractSystem,
bp::BasisPotential;
T = Float64
bp::BasisPotential
)
B = compute_local_descriptors(s, bp.basis, T = T)
B = compute_local_descriptors(s, bp.basis)
e = potential_energy(B, bp) # * ENERGY_UNIT
dB = compute_force_descriptors(s, bp.basis, T = T)
dB = compute_force_descriptors(s, bp.basis)
f = force(dB, bp) # * FORCE_UNIT
(; e, f)
end

function virial_stress(
s::AbstractSystem,
bp::BasisPotential;
T = Float64
bp::BasisPotential
)
W = compute_virial_descriptors(s, bp, T = T)
W = compute_virial_descriptors(s, bp)
v = virial_stress(W, bp)
return v
end

function virial(
s::AbstractSystem,
lbp::BasisPotential;
T = Float64
lbp::BasisPotential
)
return sum(virial_stress(s, lbp, T = T))
return sum(virial_stress(s, lbp))
end

# Specific basis potential functions for computing energy, forces, and virials
Expand Down
15 changes: 7 additions & 8 deletions src/BasisPotentials/linear_potential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
Type covering interatomic potentials that produce energies and forces as a linear function of the basis descriptors. Typical examples include vanilla ACE/SNAP. Each struct contains the parameters of the potential, `β', and the basis system being used, `basis'.
"""
struct LBasisPotential{T} <: LinearBasisPotential{NamedTuple{(:β, :β0)}, NamedTuple{()}}
β :: Vector{T}
β0 :: T
basis :: BasisSystem
β::Vector{T}
β0::Vector{T}
emmanuellujan marked this conversation as resolved.
Show resolved Hide resolved
basis::BasisSystem
end

function LBasisPotential(
basis :: BasisSystem;
T = Float64
basis :: BasisSystem
)
return LBasisPotential{T}(zeros(T, length(basis)), zeros(T, 1)[1], basis)
return LBasisPotential(zeros(length(basis)), zeros(1), basis)
end

# Get all energies and forces for basis potential
Expand All @@ -23,14 +22,14 @@ function potential_energy(
lbp::LBasisPotential{T}
) where T<: Real
G = compute_global_descriptors(B, lbp)
return lbp.β0 + G ⋅ lbp.β
return lbp.β0[1] + G ⋅ lbp.β
end

function force(
dB::Vector{Vector{Vector{T}}},
lbp::LBasisPotential{T}
) where T<: Real
f = [[dB_atom_comp' ⋅ lb.β for dB_atom_comp in dB_atom]
f = [[dB_atom_comp' ⋅ lbp.β for dB_atom_comp in dB_atom]
for dB_atom in dB]
return f
end
Expand Down
4 changes: 2 additions & 2 deletions src/BasisPotentials/nn_potential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ end

function potential_energy(
B::Vector{Vector{T}},
s::Vector{Symbol},
nnbp::NNBasisPotential
) where T<: Real
species = keys(nnbp.nns) # atomic_symbol.(A.particles)
return sum([nnbp.nns[s](d) for (s, d) in zip(species, B)])[1]
return sum([nnbp.nns[s](d) for (s, d) in zip(s, B)])[1]
end

function force(
Expand Down
37 changes: 20 additions & 17 deletions src/BasisSystems/ACE/ace.jl
emmanuellujan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ struct ACE <: BasisSystem
species :: Vector{Symbol}
body_order :: Int
polynomial_degree :: Int
rcutoff :: Real
wL :: Real
csp :: Real
r0 :: Real
rcutoff :: Real
rpib :: ACE1.RPIBasis
end

function ACE(species, body_order, polynomial_degree, wL, csp, r0, rcutoff)
function ACE(species, body_order, polynomial_degree, rcutoff;
wL = 1.5, csp = 1.0, r0 = 2.5)
rpib = ACE1.rpi_basis(;
species = species,
N = body_order - 1,
Expand All @@ -25,11 +26,12 @@ function ACE(species, body_order, polynomial_degree, wL, csp, r0, rcutoff)
rcut = rcutoff,
pin = 0,
)
return ACE(species, body_order, polynomial_degree, wL, csp, r0, rcutoff, rpib)
return ACE(species, body_order, polynomial_degree,
rcutoff, wL, csp, r0, rpib)
end

function ACE(; species = [:X], body_order = 4, polynomial_degree = 6,
wL = 1.5, csp = 1.0, r0 = 2.5, rcutoff = 5.0)
rcutoff = 5.0, wL = 1.5, csp = 1.0, r0 = 2.5)
rpib = ACE1.rpi_basis(;
species = species,
N = body_order - 1,
Expand All @@ -40,7 +42,8 @@ function ACE(; species = [:X], body_order = 4, polynomial_degree = 6,
rcut = rcutoff,
pin = 0,
)
return ACE(species, body_order, polynomial_degree, wL, csp, r0, rcutoff, rpib)
return ACE(species, body_order, polynomial_degree,
rcutoff, wL, csp, r0, rpib)
end

function get_rpi(ace)
Expand All @@ -67,39 +70,39 @@ function convert_system_to_atoms(system::AbstractSystem)
return Atoms(X = positions, P = velocities, M = masses, Z = atomic_number, cell = cell, pbc = pbc)
end

function compute_local_descriptors(A::AbstractSystem, ace::ACE; T = Float64)
return [ T.(site_energy(ace.rpib, convert_system_to_atoms(A), i))
function compute_local_descriptors(A::AbstractSystem, ace::ACE)
return [ site_energy(ace.rpib, convert_system_to_atoms(A), i)
for i = 1:length(A)]
end

function compute_force_descriptors(A::AbstractSystem, ace::ACE; T = Float64)
function compute_force_descriptors(A::AbstractSystem, ace::ACE)
ftemp = ACE1.forces(ace.rpib, convert_system_to_atoms(A))
f = [zeros(T, 3, length(ace)) for i = 1:length(A)]
f = [zeros(3, length(ace)) for i = 1:length(A)]
for i = 1:length(A)
for j = 1:3
for k = 1:length(ace)
f[i][j, k] = T.(ftemp[k][i][j])
f[i][j, k] = ftemp[k][i][j]
end
end
end
return f
end

function compute_virial_descriptors(A::AbstractSystem, ace::ACE; T = Float64)
function compute_virial_descriptors(A::AbstractSystem, ace::ACE)
Wtemp = ACE1.virial(ace.rpib, convert_system_to_atoms(A))
W = zeros(T, 6, length(ace))
W = zeros(6, length(ace))
for k = 1:length(ace)
count = 1
for (i, j) in zip( [1, 2, 3, 3, 3, 2], [1, 2, 3, 2, 1, 1])
W[count, k] = T.(Wtemp[k][i, j])
W[count, k] = Wtemp[k][i, j]
count +=1
end
end
return W
end

function compute_all_descriptors(A::AbstractSystem, ace::ACE; T = Float64)
return compute_local_descriptors(A, ace; T = T),
compute_force_descriptors(A, ace; T = T),
compute_virial_descriptors(A, ace; T = T)
function compute_all_descriptors(A::AbstractSystem, ace::ACE)
return compute_local_descriptors(A, ace),
compute_force_descriptors(A, ace),
compute_virial_descriptors(A, ace)
end
46 changes: 23 additions & 23 deletions src/BasisSystems/SNAP/snap.jl
emmanuellujan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function compute_local_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
num_coeff = get_num_snap_coeffs(snap.twojmax, length(snap.species), snap.chem_flag)

# Initialize SNAP Bispectrum, dBispectrum, and Stress arrays
B = [zeros(T, num_coeff) for i = 1:length(A)]
B = [zeros(num_coeff) for i = 1:length(A)]

for (i, ai) in enumerate(A)
i_element = findall(x->x==Symbol(atomic_symbol(ai)), snap.species)[1]
Expand All @@ -118,20 +118,20 @@ function compute_local_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
compute_zi(snap, runtime_arrays)
compute_bi(snap, runtime_arrays)

B[i] = T.(runtime_arrays.blist)
B[i] = runtime_arrays.blist
end
return B
end

function compute_force_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
function compute_force_descriptors(A::AbstractSystem, snap::SNAP)
number_of_particles = length(A.particles)
# Produce NeighborList
nnlist = neighborlist(A, snap)
# Get number of coefficients
num_coeff = get_num_snap_coeffs(snap.twojmax, length(snap.species), snap.chem_flag)

# Initialize SNAP Bispectrum, dBispectrum, and Stress arrays
dB = [zeros(T, 3, num_coeff*length(snap.species)) for i = 1:number_of_particles]
dB = [zeros(3, num_coeff*length(snap.species)) for i = 1:number_of_particles]

for (i, ai) in enumerate(A.particles)
i_element = findall(x->x==atomic_symbol(A, i), snap.species)[1]
Expand All @@ -158,23 +158,23 @@ function compute_force_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
compute_duidrj(rij, wj, rcut, jj, snap, runtime_arrays)
compute_dbidrj(j_element, snap, runtime_arrays)

dB[ii][:, (i_offset+1):(num_coeff+i_offset)] += T.(runtime_arrays.dblist')
dB[jj][:, (i_offset+1):(num_coeff+i_offset)] -= T.(runtime_arrays.dblist')
dB[ii][:, (i_offset+1):(num_coeff+i_offset)] += runtime_arrays.dblist'
dB[jj][:, (i_offset+1):(num_coeff+i_offset)] -= runtime_arrays.dblist'

end
end
return dB
end

function compute_virial_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
function compute_virial_descriptors(A::AbstractSystem, snap::SNAP)
number_of_particles = length(A.particles)
# Produce NeighborList
nnlist = neighborlist(A, snap)
# Get number of coefficients
num_coeff = get_num_snap_coeffs(snap.twojmax, length(snap.species), snap.chem_flag)

# Initialize SNAP Bispectrum, dBispectrum, and Stress arrays
W = [zeros(T, 6, num_coeff*length(snap.species)) for i = 1:number_of_particles]
W = [zeros(6, num_coeff*length(snap.species)) for i = 1:number_of_particles]

for (i, ai) in enumerate(A.particles)
i_element = findall(x->x==Symbol(ai.element.symbol), snap.species)[1]
Expand Down Expand Up @@ -206,34 +206,34 @@ function compute_virial_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
xi, yi, zi = ustrip.(A.particles[ii].position)
xj, yj, zj = ustrip.(A.particles[jj].position)

W[ii][:, (i_offset+1):(num_coeff+i_offset)] += T.(reshape([runtime_arrays.dblist[:, 1]*xi;
W[ii][:, (i_offset+1):(num_coeff+i_offset)] += reshape([runtime_arrays.dblist[:, 1]*xi;
runtime_arrays.dblist[:, 2]*yi;
runtime_arrays.dblist[:, 3]*zi;
runtime_arrays.dblist[:, 2]*zi;
runtime_arrays.dblist[:, 1]*zi;
runtime_arrays.dblist[:, 1]*yi], num_coeff, 6))
W[jj][:, (i_offset+1):(num_coeff+i_offset)] -= T.(reshape([runtime_arrays.dblist[:, 1]*xj;
runtime_arrays.dblist[:, 1]*yi], num_coeff, 6)
W[jj][:, (i_offset+1):(num_coeff+i_offset)] -= reshape([runtime_arrays.dblist[:, 1]*xj;
runtime_arrays.dblist[:, 2]*yj;
runtime_arrays.dblist[:, 3]*zj;
runtime_arrays.dblist[:, 2]*zj;
runtime_arrays.dblist[:, 1]*zj;
runtime_arrays.dblist[:, 1]*yj], num_coeff, 6))
runtime_arrays.dblist[:, 1]*yj], num_coeff, 6)
end
end
return sum(W)
end

function compute_all_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
function compute_all_descriptors(A::AbstractSystem, snap::SNAP)
number_of_particles = length(A.particles)
# Produce NeighborList
nnlist = neighborlist(A, snap)
# Get number of coefficients
num_coeff = get_num_snap_coeffs(snap.twojmax, length(snap.species), snap.chem_flag)

# Initialize SNAP Bispectrum, dBispectrum, and Stress arrays
B = [zeros(T, num_coeff) for i = 1:number_of_particles]
dB = [zeros(T, 3, num_coeff*length(snap.species)) for i = 1:number_of_particles]
W = [zeros(T, 6, num_coeff*length(snap.species)) for i = 1:number_of_particles]
B = [zeros(num_coeff) for i = 1:number_of_particles]
dB = [zeros(3, num_coeff*length(snap.species)) for i = 1:number_of_particles]
W = [zeros(6, num_coeff*length(snap.species)) for i = 1:number_of_particles]
for (i, ai) in enumerate(A)
i_element = findall(x->x==Symbol(ai.atomic_symbol), snap.species)[1]

Expand All @@ -243,7 +243,7 @@ function compute_all_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
compute_zi(snap, runtime_arrays)
compute_bi(snap, runtime_arrays)

B[i] = T.(runtime_arrays.blist)
B[i] = runtime_arrays.blist

i_offset = num_coeff * (i_element - 1)
# Compute Forces and Stresses
Expand All @@ -261,24 +261,24 @@ function compute_all_descriptors(A::AbstractSystem, snap::SNAP; T = Float64)
compute_duidrj(rij, wj, rcut, ind+1, snap, runtime_arrays)
compute_dbidrj(j_element, snap, runtime_arrays)

dB[ii][:, (i_offset+1):(num_coeff+i_offset)] += T.(runtime_arrays.dblist')
dB[jj][:, (i_offset+1):(num_coeff+i_offset)] -= T.(runtime_arrays.dblist')
dB[ii][:, (i_offset+1):(num_coeff+i_offset)] += runtime_arrays.dblist'
dB[jj][:, (i_offset+1):(num_coeff+i_offset)] -= runtime_arrays.dblist'

xi, yi, zi = ustrip.(position(A[ii]))
xj, yj, zj = ustrip.(position(A[jj]))

W[ii][:, (i_offset+1):(num_coeff+i_offset)] += T.(reshape([runtime_arrays.dblist[:, 1]*xi;
W[ii][:, (i_offset+1):(num_coeff+i_offset)] += reshape([runtime_arrays.dblist[:, 1]*xi;
runtime_arrays.dblist[:, 2]*yi;
runtime_arrays.dblist[:, 3]*zi;
runtime_arrays.dblist[:, 2]*zi;
runtime_arrays.dblist[:, 1]*zi;
runtime_arrays.dblist[:, 1]*yi], num_coeff, 6)')
W[jj][:, (i_offset+1):(num_coeff+i_offset)] -= T.(reshape([runtime_arrays.dblist[:, 1]*xj;
runtime_arrays.dblist[:, 1]*yi], num_coeff, 6)'
W[jj][:, (i_offset+1):(num_coeff+i_offset)] -= reshape([runtime_arrays.dblist[:, 1]*xj;
runtime_arrays.dblist[:, 2]*yj;
runtime_arrays.dblist[:, 3]*zj;
runtime_arrays.dblist[:, 2]*zj;
runtime_arrays.dblist[:, 1]*zj;
runtime_arrays.dblist[:, 1]*yj], num_coeff, 6)')
runtime_arrays.dblist[:, 1]*yj], num_coeff, 6)'
end
end
return B, dB, sum(W)
Expand Down
7 changes: 4 additions & 3 deletions test/ACE/ace_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ using Unitful
using UnitfulAtomic
using InteratomicPotentials

r0 = 2.0
position0 = @SVector [1.0, 0.0, 0.0]
element = :Ar
atom1 = Atom(element, position0 * u"Å")
Expand All @@ -19,8 +18,10 @@ box = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
bcs = [Periodic(), Periodic(), Periodic()]
system = FlexibleSystem(atoms, box * u"Å", bcs)

ace = ACE( species = [:Ar], body_order = 2, polynomial_degree = 8,
wL = 1.0, csp = 1.0, r0 = 0.4, rcutoff = 2.0)
ace = ACE( species = [:Ar],
body_order = 2,
polynomial_degree = 8,
rcutoff = 2.0)
@test isa(ace, BasisSystem)
e = sum(compute_local_descriptors(system, ace))
@test isa(e, AbstractVector)
Expand Down
6 changes: 4 additions & 2 deletions test/NNBP/nnbp_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ system = FlexibleSystem(atoms, box * u"Å", bcs)
# Compose Neural ACE ###########################################################

# Define basis system
basis = ACE( species = [:Ar], body_order = 3, polynomial_degree = 3,
wL = 1.0, csp = 1.0, r0 = 0.4, rcutoff = 2.0)
basis = ACE( species = [:Ar],
body_order = 3,
polynomial_degree = 3,
rcutoff = 2.0)
n_desc = 5

# Define neural network besis potential
Expand Down
Loading