Global Q6 calculation using orientorder/atom

Dear All,

I want to calculate global Q6 order parameter for 3D LJ and Yukawa system. I use compute q6 all orientorder/atom degrees 1 6 nnn 12 components 6.

Through c_q6[2:27], I have access to the real and imaginary part of normalized Ybar_lm, I am not sure how to get the non-normalized values of each component. And, how to calculate the global Q6. I appreciate if someone can give me the relationship between c_q6[2:27] and globale Q6.

I also tried to compare the local Q6 through summation over Ybar_lm with lammps calculated one ave(c_q6[1]), however, they did not match.

Here is the commands I used:

compute q6 all orientorder/atom degrees 1 6 nnn 12 components 6

# not sure if I should use (4*PI/13) coefficient here?

variable selfRealq6 atom (c_q6[1]*(c_q6[2]+c_q6[4]+c_q6[6]+c_q6[8]+c_q6[10]+c_q6[12]+c_q6[14]+c_q6[16]+c_q6[18]+c_q6[20]+c_q6[22]+c_q6[24]+c_q6[26]))

variable selfImagq6 atom (c_q6[1]*(c_q6[3]+c_q6[5]+c_q6[7]+c_q6[9]+c_q6[11]+c_q6[13]+c_q6[15]+c_q6[17]+c_q6[19]+c_q6[21]+c_q6[23]+c_q6[25]+c_q6[27]))

compute aveRealq6 sol reduce ave v_selfRealq6[*]

compute aveImagq6 sol reduce ave v_selfImagq6[*]

fix 4 sol ave/time 100 1 100 c_aveRealq6[] c_aveImagq6[] file GlobalQ6RealImag.dat ave running

variable normq6 atom c_q6[1]

variable sqRealq6 atom (c_q6[1]*(c_q6[2]+c_q6[4]+c_q6[6]+c_q6[8]+c_q6[10]+c_q6[12]+c_q6[14]+c_q6[16]+c_q6[18]+c_q6[20]+c_q6[22]+c_q6[24]+c_q6[26])/(1))^2

variable sqImagq6 atom (c_q6[1]*(c_q6[3]+c_q6[5]+c_q6[7]+c_q6[9]+c_q6[11]+c_q6[13]+c_q6[15]+c_q6[17]+c_q6[19]+c_q6[21]+c_q6[23]+c_q6[25]+c_q6[27])/(1))^2

variable selfnormQ6 atom sqrt(v_sqRealq6+v_sqImagq6)

compute cselfnormQ6 sol reduce ave v_selfnormQ6[*]

variable meanQ6 equal c_cselfnormQ6

compute cmeanq6 sol reduce ave c_q6[1]

variable meanq6 equal c_cmeanq6

fix 2 sol ave/time 1000 1 1000 c_cmeanq6 c_cselfnormQ6[*] file LocalQ6.dat ave running overwrite

fix framemeanq sol print 1000 “{meanq6} {meanQ6}” screen yes #file frameMeanOP.dat

Basically, the values of meanq6 (Local order using mean of c_q6[1]) and meanQ6 (Local order using square of sum of Y_lm components) are not matching.

Any help is highly appreciated.

Thanks,

Alireza