-
Notifications
You must be signed in to change notification settings - Fork 15
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
Proper implementation of scaling function #68
Comments
@cortner I just found this issue and was wondering what is going on with s = ACE.scaling(db.basis.BB[2], rlap_scal) Now this doesn't work any more because the type of the first argument is ACE.scaling(dB.basis.BB[2].models[1], rlap_scal) is a valid argument for
Do you happen to know what is going on? And is there perhaps a 1 line fix that would allow me to keep using IPfitting and |
@cortner if you had time could you please give me some hints how to fix this? Or whether it requires more substantial work? |
sorry I missed this and thanks for the reminder. It should work. Can you post a short script so I can reproduce the error? (and which packages and package versions???) |
Here is a little code that I would like to fix, but currently gives and error on the main branch of ACE, ACEatoms. Basically the scaling is not implemented for some of the functions in ACE (and is not implemented for using ACE, ACEatoms
using ACE: SymmetricBasis
function create_basis(maxdeg, maxorder, maxlevels, symmetry)
"""
symmetry is either "invariant" or "vector"
"""
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 = 0.65, rcut = 4.5, r0 = 3.0,
pin = 2)
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
maxdeg = 8
maxorder = 2
maxlevels = Dict("default" => 8,
1 => 8,
2 => 6)
Bsite2, Vsite2 = create_basis(maxdeg, maxorder, maxlevels, "invariant");
s = ACE.scaling(Bsite2, 1.0)
Bsite2, Vsite2 = create_basis(maxdeg, maxorder, maxlevels, "vector");
s = ACE.scaling(Bsite2, 1.0) |
I'm trying to reproduce with latest ACE and running into the weirdest bug here - I'll need to sort this out and then will come back to the scaling issue. |
ok - so back to @davkovacs 's problem -- the issue is that in ACE.jl I assumed the species basis will use symbols, but it actually uses atomic number. I will put something mildly hacky together now, and we leave this issue open for the future. |
@davkovacs --- I've now made ACEatoms and ACE interoperable on the implementation of the scal_H = ACE.scaling(Bsite2.models[1], 1)
scal_O = ACE.scaling(Bsite2.models[8], 1) and then putting them together in the right fashion, whatever the ordering of the basis is? But let me know if it isn't clear and I can get back to it. I've tagged ACEatoms 0.0.11 and ACE 0.12.32, which you need to use now. |
I have created a pull request implementing this to ACEatoms. |
The text was updated successfully, but these errors were encountered: