-
Notifications
You must be signed in to change notification settings - Fork 5
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
WIP: Sphericart integration #83
Conversation
What do you mean by "the old interface"? The interface should remain the same only the backend - i.e. the code that generates the basis will be sphericart? |
I think all your points are very doable and should be done. Thank you for picking this up. |
Sorry that was a typo - yes I mean backend. |
Something like this should give a correct scaling up to a sign. This comes from the Condon-Shortley Sign Convention. Is there a better way to fix this other than modifying the sign at the end of the output directly? function generate_Flms(L::Integer; normalisation = :p4ml, T = Float64)
Flm = OffsetMatrix(zeros(L+1, L+1), (-1, -1))
for l = 0:L
Flm[l, 0] = sqrt(2)
for m = 1:l
Flm[l, m] = Flm[l, m-1] / sqrt((l+m) * (l+1-m))
end
end
return Flm
end |
Are you saying that you need to rescale the Ylm output vector by a sign after the computation, and this cannot be done at the stage of precomputing the Flms? |
Yes exactly. |
this is unfortunate. But do we really care about the sign convention? |
@DexuanZhou -- what do you think? Can you also ask Huajie? (i can't find his github name right now) |
Sorry I just saw this message. In our current simulation of Schrodinger equations, I think the sign convention is not a problem, we will be happy as long as it is a complete basis. But I am not sure whether this could become an issue in future project. For example, when we consider some symmetry of the system and evaluate the Clebsch-Gordan coefficients? |
Using it as a one-particle basis function, I agree with Huajie that the sign convention shouldn't matter much. The only potential issue arises when we compare with chemical basis functions, where they might express one-particle basis as f = a_1f_1+a_2f_2+a_3f_3. In such cases, we need to be very careful to ensure that the coefficients align properly; for instance, adjusting coefficients to -a1, a2, and a3 as needed. |
My point is, if the sign convention proves difficult to reconcile, we can compensate for it by adjusting the coefficients in the combination of basis functions. This ensures that the overall wave function aligns with the chemical basis functions for comparison purposes. |
That sound to me like we should try to recover the correct signs. I'll discuss with Jerry. |
... on the other hand we can just fix the signs in the clebsch-gordans ... |
this PR seems to have gone stale. What shall we do? |
I remember there is a normalization to be fixed before merging, but for this reason this can only be done on
|
So exactly what is needed at the Sphericart end? |
We didn't arrive at a conclusion but we decide to make a issue on that end to discuss it (which I forgot to, sorry about that). I just skim over the code again, it make sense to me just to scale the output in |
Let's discuss at our next meeting what we should do. |
Please double-check whether #84 makes this PR obsolete and if you agree, then please close it. |
This PR aims at integrating SpheriCart https://github.com/lab-cosmo/sphericart to p4ml. Todo list that I come up with but feel free to update edit. This also fixes a bug that the current real solid harmonics returns
NaN
when an (approximately) zero vector is given or does not evaluate.If we want to retire the old backend entirely (though this sounds to me too ambitious):
normlization = :p4ml
which recovers the previous normalizationCC @zhanglw0521 @TSGut