Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.1 ) 
 Date: 2020/06/13 15:41
 Name: Naoya Yamaguchi
 Dear Maedeh,
I have reproduced it, and I think that it is normal.
The following are a part to set the Hamiltonian written in "Set_Hamiltonian.c":
if (SpinP_switch==3){ for (Mc_AN=1; Mc_AN<=Matomnum; Mc_AN++){ Gc_AN = M2G[Mc_AN]; Cwan = WhatSpecies[Gc_AN]; for (h_AN=0; h_AN<=FNAN[Gc_AN]; h_AN++){ Gh_AN = natn[Gc_AN][h_AN]; Hwan = WhatSpecies[Gh_AN]; for (i=0; i<Spe_Total_NO[Cwan]; i++){ for (j=0; j<Spe_Total_NO[Hwan]; j++){
if (ProExpn_VNA==0){ H[0][Mc_AN][h_AN][i][j] = F_Kin_flag*H0[0][Mc_AN][h_AN][i][j] + F_NL_flag*HNL[0][Mc_AN][h_AN][i][j]; H[1][Mc_AN][h_AN][i][j] = F_Kin_flag*H0[0][Mc_AN][h_AN][i][j] + F_NL_flag*HNL[1][Mc_AN][h_AN][i][j]; H[2][Mc_AN][h_AN][i][j] = F_NL_flag*HNL[2][Mc_AN][h_AN][i][j]; H[3][Mc_AN][h_AN][i][j] = 0.0; } else{ H[0][Mc_AN][h_AN][i][j] = F_Kin_flag*H0[0][Mc_AN][h_AN][i][j] + F_VNA_flag*HVNA[Mc_AN][h_AN][i][j] + F_NL_flag*HNL[0][Mc_AN][h_AN][i][j]; H[1][Mc_AN][h_AN][i][j] = F_Kin_flag*H0[0][Mc_AN][h_AN][i][j] + F_VNA_flag*HVNA[Mc_AN][h_AN][i][j] + F_NL_flag*HNL[1][Mc_AN][h_AN][i][j]; H[2][Mc_AN][h_AN][i][j] = F_NL_flag*HNL[2][Mc_AN][h_AN][i][j]; H[3][Mc_AN][h_AN][i][j] = 0.0; }
/* Effective Hubbard Hamiltonain  added by MJ */
if( (Hub_U_switch==1  1<=Constraint_NCS_switch) && F_U_flag==1 && 2<=SCF_iter ){ H[0][Mc_AN][h_AN][i][j] += H_Hub[0][Mc_AN][h_AN][i][j]; H[1][Mc_AN][h_AN][i][j] += H_Hub[1][Mc_AN][h_AN][i][j]; H[2][Mc_AN][h_AN][i][j] += H_Hub[2][Mc_AN][h_AN][i][j]; }
/* core hole Hamiltonain */
if (core_hole_state_flag==1){ H[0][Mc_AN][h_AN][i][j] += HCH[0][Mc_AN][h_AN][i][j]; H[1][Mc_AN][h_AN][i][j] += HCH[1][Mc_AN][h_AN][i][j]; H[2][Mc_AN][h_AN][i][j] += HCH[2][Mc_AN][h_AN][i][j]; }
} } } } }
And, the following are comments written in "Band_DFT_NonCol.c":
in case of SO_switch==0 && Hub_U_switch==0 && Constraint_NCS_switch==0 && Zeeman_NCS_switch==0 && Zeeman_NCO_switch==0
H[i ][j ].r = RH[0]; H[i ][j ].i = 0.0; H[i+NUM][j+NUM].r = RH[1]; H[i+NUM][j+NUM].i = 0.0; H[i ][j+NUM].r = RH[2]; H[i ][j+NUM].i = RH[3];
in case of SO_switch==1 or Hub_U_switch==1 or 1<=Constraint_NCS_switch or Zeeman_NCS_switch==1 or Zeeman_NCO_switch==1
H[i ][j ].r = RH[0]; H[i ][j ].i = IH[0]; H[i+NUM][j+NUM].r = RH[1]; H[i+NUM][j+NUM].i = IH[1]; H[i ][j+NUM].r = RH[2]; H[i ][j+NUM].i = RH[3] + IH[2];
Because RH[3] (H[3] in OpenMX) always looks to include only zero, changes can appear only in the imaginary part of the Hamiltonian (i.e. "iHks" in a scfout file).
Regards, Naoya Yamaguchi

Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.2 ) 
 Date: 2020/06/14 15:38
 Name: Maedeh <rasekh.maede@gmail.com>
 Dear Naoya,
Thank you so much. your explanation gave me the point.
I also found some explanations in the Analysis_example file of OpenMX ver.3.9. I was using version 3.8. Now everything makes sense.
kind regards, Maedeh

Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.3 ) 
 Date: 2020/06/16 16:28
 Name: Maedeh <rasekh.maede@gmail.com>
 Dear Naoya,
Hi,
I was trying to build the Hamiltonians of the same example that I posted before using the recipe we have in "analysis_example" file:
For SpinP_switch=3, the matrix elements are given by
upup: Hks[0] + I*iHks[0] updown: Hks[2] + I*(Hks[3]+iHks[2]) downup: Hks[2]  I*(Hks[3]+iHks[2]) downdown: Hks[1] + I*iHks[1]
Following this recipe will not give a Hermitian H00 (onsite Hamiltonian) for sure, one must transposeconjugate, not only conjugate. Following this recipe for hopping Hamiltonians like H10 (hopping to the right) and H_10 (hopping to the left), for a simple example on paper, I can get a Hermitian Bloch Hamiltonian at the end, ie: Hk=H10*exp(ik*a)+H_10*exp((iK*a)).
However, looking into the "Hamiltonian_Band_NC" file, I see that you guys first build the H11, H12, H22 blocks of the Bloch Hamiltonian H(k) and then calculate H21 block by the conjugate transpose of H12. This seems to me as forcing the Hamiltonian to be Hermitian while missing hopping elements like downup hopping for H10 and H_10. Or is it the same in the end?.
On the other hand, in case of real space H10, for instance, if we build the spinmixing leftdown (downup) block of Hamiltonian by transpose conjugate of the rightup block (updown), in the leftdown block of Hamiltonian (again for a simple example like the cell I have tried to show bellow) we will have hopping between atom 1 in center cell and atom 2 of right neighbor which does not make sense to me. So, in summary, I would like to know how to build downup blocks for the real space hopping Hamiltonians so I do not have to force hermiticity on the final Bloch Hamiltonian H(k).
    .1 .2  .1 .2  .1 .2    
Thanks for your help in advance. kind regards, Maedeh

Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.4 ) 
 Date: 2020/06/16 17:47
 Name: Naoya Yamaguchi
 Dear Maedeh,
>upup: Hks[0] + I*iHks[0] >updown: Hks[2] + I*(Hks[3]+iHks[2]) >downup: Hks[2]  I*(Hks[3]+iHks[2]) >downdown: Hks[1] + I*iHks[1]
>Following this recipe will not give a Hermitian H00 (onsite Hamiltonian) for sure, one must transposeconjugate, not only conjugate.
According to the explanation in "analysis_example.c", although a Hamiltonian seems to satisfy only complex conjugate but this explanation is done in terms of spin indices, each element must satisfy the transpose conjugate condition in the Hamiltonian matrix "H". As you may know, the Hamiltonian "H" is prepared by following Eq. (28) in the following technical note: http://www.openmxsquare.org/tech_notes/tech11_2.pdf And, it is clear that H in Eq. (28) satisfies the transpose conjugate condition (Hks or iHks corresponds "h" in Eq. (28).).
>However, looking into the "Hamiltonian_Band_NC" file, I see that you guys first build the H11, H12, H22 blocks of the Bloch Hamiltonian H(k) and then calculate H21 block by the conjugate transpose of H12. This seems to me as forcing the Hamiltonian to be Hermitian while missing hopping elements like downup hopping for H10 and H_10. Or is it the same in the end?.
Do you mean "H11, H12, H22" is H_{upup}, H_{updown} and H_{downdown}? I think that the treatment that H_{downup} is prepared by taking the transpose conjugate of H_{updown} has no influence on getting the correct solution while considering that the Hamiltonian is Hermitian.
>On the other hand, in case of real space H10, for instance, if we build the spinmixing leftdown (downup) block of Hamiltonian by transpose conjugate of the rightup block (updown), in the leftdown block of Hamiltonian (again for a simple example like the cell I have tried to show bellow) we will have hopping between atom 1 in center cell and atom 2 of right neighbor which does not make sense to me. So, in summary, I would like to know how to build downup blocks for the real space hopping Hamiltonians so I do not have to force hermiticity on the final Bloch Hamiltonian H(k).
I think that the operation of the conjugate transpose is done only for H, not h in Eq. (28), and the Hamiltonian you mean such as H10 corresponds h. You can get downup (updown) elements from Hks[2] and iHks[2] by checking correspondence.
Regards, Naoya Yamaguchi

Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.5 ) 
 Date: 2020/06/16 20:57
 Name: T. Ozaki
 Hi,
How to construct the Hamiltonian for the noncollinear calculation can be found in Hamiltonian_Band_NC.c.
In the routine, one can confirm the cases for 1. /* nonspinorbit coupling and nonLDA+U */ 2. /* spinorbit coupling or LDA+U */
and at the nearly end of code, you see the following part:
/****************************************************** the full complex matrix of H ******************************************************/
for (i=1; i<=NUM; i++){ for (j=1; j<=NUM; j++){ H[j+NUM][i].r = H[i][j+NUM].r; H[j+NUM][i].i = H[i][j+NUM].i; } }
which sets the downup block elements and guarantees the Hermicity.
Regards,
TO

Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.6 ) 
 Date: 2020/06/17 15:30
 Name: Maedeh <rasekh.maede@gmail.com>
 Dear Naoya and prof. Ozaki,
Thanks for your quick response.
let me try to make my saying more clear:
let's forget H(k) for a moment. I want to talk about submatrices:
each h matrix should have this form:
h= (upup updown) (downup downdown)
we have the information about these three spinblocks: upup, updown, downdown and "analysis_example" file says that I should build downup block so: downup: Hks[2]  I*(Hks[3]+iHks[2])
following this recipe is not giving me a hermitian h00 Hamiltonian (ie. onsite Hamiltonian).
let's go further, following this recipe to build h10 (hopping matrix to the right in a onedimensional system) and h_10 (hopping matrix to the left) is not giving me a Hermitian Hk=h10*exp(ik*a)+h_10*exp((iK*a)).
so my question is: how should I build the spin downup block for hopping matrices before creating the Bloch Hamiltonian? This must be possible and I have the impression that the result at the end is not the same.
Best regards, Maedeh

Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.7 ) 
 Date: 2020/06/17 19:44
 Name: Naoya Yamaguchi
 Dear Maedeh,
In the noncollinear case, As the spin index doesn't appear in the full Hamiltonian matrix "H", downup elements are obtained just by taking the transpose conjugate. H(k)ji=H(k)ij*=(Σexp(iRn・k)h(Rn)ij)*=Σexp(iRn・k)h(Rn)ij* And, H(k)ji=Σexp(iRn・k)h(Rn)ji Then, h(Rn)ji=h(Rn)ij* As such, you may get downup elements of "h" by the above relation.
Regards, Naoya Yamaguchi

Re: HS.Fileoutzero imaginary part of spin mixing (spin=3) while including soc ( No.8 ) 
 Date: 2020/06/18 04:09
 Name: Maedeh <rasekh.maede@gmail.com>
 Dear Naoya;
Yes, you are right. Thank you.
Best regards, Maedeh

