Skip to content

Bug / instability of inner cutoff #118

Description

@davkovacs

I am trying to fit ACE models using ACEatoms, and when I plot the dimer curves of the potentials I get the 1-body and 2-body parts behave as expected, but the ACE component of the basis does not go to 0 at the inner cutoff, but it explodes:
image
Code used to define the basis:

function create_basis(maxdeg, maxorder, maxlevels, symmetry, rin, rcut)
    """
    Args:
    maxdeg::Int 
    maxorder::Int: maximum correlation order
    maxlevels::Dict maximum degree for each cor order
    symmetry::string either \"invariant\" or \"vector\"
    rin::Float Inner cutoff
    rcut::Float Outer cutoff
    
    Returns:
    Bsite
    Vsite
    """
    weights = Dict(:l => 1.5, :n => 1.0)
    Bsel = SparseBasis(maxorder=maxorder, weight=weights, maxdegs=maxlevels, p=1.0);

    B1p = ACEatoms.ZμRnYlm_1pbasis(; species = [:O, :H], maxdeg=maxdeg,
                                   Bsel=Bsel, rin = rin, rcut = rcut, r0 = 3.0)

    ACE.init1pspec!(B1p, Bsel)
    if symmetry == "vector"
        basis = SymmetricBasis(ACE.EuclideanVector(Float64), B1p, Bsel)
    elseif symmetry == "invariant"
        basis = SymmetricBasis(ACE.Invariant(), B1p, Bsel)
    else
        @warn "Unkown symmetry, using invariant or vector"
        return nothing
    end

    cH = randn(length(basis))
    cO = randn(length(basis))

    models = Dict(:H => ACE.LinearACEModel(basis, cH),
                  :O => ACE.LinearACEModel(basis, cO))
    Vsite = ACEatoms.ACESitePotential(models)

    Bsite = ACEatoms.basis(Vsite);
    println("Creating basis of length ", length(Bsite))
    return Bsite, Vsite
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions