ACEsuit / ACE.jl

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

scaling_N for RPI basis #17

Closed casv2 closed 3 years ago

casv2 commented 3 years ago

I think this function takes the PI basis functions, finds the orders and then maps to some order_weights which we can control using a dictionary D. Does this make sense? (to be placed in /src/rpi/rpi_basis.jl)

function scaling_N(basis::RPIBasis, p, D; a2b = abs)
   wwpi = scaling(basis.pibasis, p)
   wwrpi = zeros(Float64, length(basis))
   for iz0 = 1:numz(basis)
      pibasis_fncs = collect(keys(basis.pibasis.inner[iz0].b2iAA))
      orders = order.(pibasis_fncs)
      order_weights = [D[order] for order in orders]
      wwpi_iz0 = order_weights .* wwpi[basis.pibasis.inner[iz0].AAindices]
      wwrpi[basis.Bz0inds[iz0]] = a2b.(basis.A2Bmaps[iz0]) * wwpi_iz0
   end
   return wwrpi
end

with usage being

D = Dict(1 => 0.1,
    2 => 0.5,
     3 => 0.1,
     4 => 100.00)

ACE.RPI.scaling_N(rpi_basis, 2, D)

I think this returns a scaling vector the size of the rpi_basis, but with scaled laplacian coefficients according to the interaction order.