ACEsuit / ACE.jl

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

WIP: beyond O3(l, m) symmetry #46

Closed cortner closed 3 years ago

cortner commented 3 years ago

This PR will enable us to have 1p basis functions with multple Ylm components and put in place the infrastructure to decide how to symmetrize in those cases. E.g. If I have

Yl1m1(rr1) Yl2m2(rr2)

then it depends on whether or not the rotation of rr1, rr2 are coupled or not how to symmetrize. An application is magnetism where spin-orbit coupling is usually very weak i.e. one can symmetrize over O3 otimes O3 and make only a very small modelling error.

CC: @MatthiasSachs and @zhanglw0521 -> it would be useful if you familiarize yourself and let me know if you have comments.

CC: @bs544 -> it will probably be a few more days, but once this is done, we have fix the ACEmag repository and start implementing a correct model for magnetism. I will initially only implement O3O3 i.e. r, s are NOT coupled, but it should be relatively straightforward to also include spin-orbit coupling if this is of interest. In fact this is the more canonical symmetry from my perspective and I want to get it done soon-ish anyhow.

cortner commented 3 years ago

the last commit provides a seemingly working version of the symmetry needed for the magnetism project. More tests to perform, but maybe ready soon to merge and tag so we can start implementing the corresponding model.

cortner commented 3 years ago

This now seems to be all working ok - tests pass. I'd be grateful though if somebody would be willing to review this:

@bs544 -> Do you agree that the following test correctly captures the symmetry you envisioned?

ord = 5
maxdeg = 7
basis = SymmetricBasis(φ, B1p, O3(:lr, :mr) ⊗ O3(:ls, :ms), ord, maxdeg; Deg = D)
@show length(basis) 

for ntest = 1:30
   cfg = ACEConfig(rand(MagState, nX))
   Qr = ACE.Random.rand_rot() * ACE.Random.rand_refl()
   Qs = ACE.Random.rand_rot() * ACE.Random.rand_refl()
   cfg_rs = ACEConfig( shuffle( [MagState(rr = Qr * X.rr, ss = Qs * X.ss) for X in cfg] ) )
   B = evaluate(basis, cfg)
   B_rs = evaluate(basis, cfg_rs)
   print_tf(@test(B ≈ B_rs))
end

@MatthiasSachs and/or @zhanglw0521 would you be willing to look at symmbasis.jl, especially this part

   # loop through AA basis, but skip most of them ...
   for (iAA, AA) in enumerate(AAspec)
      # determine whether we need to compute coupling coefficients for this 
      # basis function or whether it will be included in a different 
      # coco computation? 
      if !is_refbasisfcn(symgrp, AA)
         continue 
      end 
      # compute the cocos 
      U, AAcols = coupling_coeffs(symgrp, AA, rotc)

and then the file symmetrygroups where this is implemented, in order to familiarize yourselves with this - but again if you have any thoughts on this I'd be grateful.

bs544 commented 3 years ago

@bs544 -> Do you agree that the following test correctly captures the symmetry you envisioned?

@cortner yes, without spin orbit coupling the energy should be invariant to the rotation and inversion of each of the spins and positions.