ACEsuit / ACE.jl

Parameterisation of Equivariant Properties of Particle Systems
65 stars 15 forks source link

multispecies export function #35

Closed casv2 closed 2 years ago

casv2 commented 3 years ago

Annotated with to do in export_multispecies.jl. I think the overall YAML/YACE format is taken care of, however they don't have quotes and Julia export using quotes and there seems to be no setting to change this. The C library has an option to start using quotes so worst case scenario we might have to ask them to switch.

Main thing I think left to do are:

cortner commented 3 years ago

is this dead in favour of the C interface or will we continue with it?

cortner commented 3 years ago

Hi @casv2 - should we try to wrap this up? What can I do to help?

cortner commented 3 years ago

In particular, could we push this over the line if we work together for a few hours?

casv2 commented 2 years ago

This works now

EDIT: Well it does not, something goes wrong at higher orders... Trying to figure it out now

cortner commented 2 years ago

let me know if/when this is ready

casv2 commented 2 years ago

Al and TiAl ran fine also at higher orders, but CHO just failed...? Maybe some permutation or other book keeping problem? Working on it

casv2 commented 2 years ago
function _basis_groups(inner, coeffs)
     ## grouping the basis functions
     NLZ = []
     M = []
     C = []
     Z0s = []
     for b in keys(inner.b2iAA)
        if coeffs[ inner.b2iAA[b] ] != 0
           push!(Z0s, b.z0)
           push!(NLZ, ( [b1.n for b1 in b.oneps], [b1.l for b1 in b.oneps], [b1.z for b1 in b.oneps]))
           push!(M, [b1.m for b1 in b.oneps])
           push!(C, coeffs[ inner.b2iAA[b] ])
        end
     end
     ords = length.(M)
     perm = sortperm(ords)
     NL = NLZ[perm]
     M = M[perm]
     C = C[perm]
     @assert issorted(length.(M))
     bgrps = []
     #alldone = fill(false, length(NL))
     #@show alldone
     for i = 1:length(NLZ)
        #if alldone[i]; continue; end
        nl = NLZ[i]
        z0 = Z0s[i]
        Inl = findall(NL .== Ref(nl))
        #alldone[Inl] .= true
        Mnl = M[Inl]
        Cnl = C[Inl]
        pnl = sortperm(Mnl)
        Mnl = Mnl[pnl]
        Cnl = Cnl[pnl]
        order = length(nl[1])
        push!(bgrps, Dict("n" => nl[1], "l" => nl[2], "z0" => z0, "zs" => nl[3],
                          "M" => Mnl, "C" => Cnl, "ord" => order)) #correct?
     end
     return bgrps
 end

What does alldone do here? I'm getting perfect agreement with energies and forces through LAMMPS with Julia and YACE now but only for simple bases. At some point the energies/forces start to slightly change. It seems I'm not picking the right basis functions up though, turning alldone on or off does seem to make a difference in which basis functions get picked up or not. I'm just not quite sure what it's supposed to do?

cortner commented 2 years ago

I'm afraid I don't remember this anymore. I will need to spend more time with it. Maybe I can get to it tonight. Please remind me on slack if you don't hear from me.

cortner commented 2 years ago

just a quick ping to check the status? Are we done here?

casv2 commented 2 years ago

Yes we're done here! :)

cortner commented 2 years ago

I'm guessing there is no way really to test this within Julia. So I'll just merge for now and if problems come up we will have to adress them?

casv2 commented 2 years ago

Sounds good, I've tested 2/3 species 2B+ACE's with and without repulsive cores