About Gvectors
Moderators: Davide Sangalli, Daniele Varsano, andrea.ferretti
 Davide Sangalli
 Posts: 339
 Joined: Tue May 29, 2012 4:49 pm
 Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
 Contact:
Re: About Gvectors
Dear Miguel,
my guess is that the responsible could be the subroutine "src/setup/eval_minus_G.F", in particular check the end of the subroutine where, since your system does not have the inversion symmetry, you can find the following procedure. Can you check that ?
Regards,
D.
ng_closed=ng_in_shell(n_g_shells)
!
! Andrea [12/10/2011]: when the symmetries are removed using ypp
! or when, for any reason, both the spatial inversion and the timereversal
! are not introduced the coupling part of the BSE (and maybe also other parts
! of the code) must access an adhoc table of the G vectors evaluated in eval_minus_G.
! However if the inversion symmetry is not used here the eval_minus_G routine
! will fail as the shells are not closed anymore with respect to the inversion.
!
if (inv_index<0) then
allocate(minus_G(ng_closed))
call eval_minus_G()
do while ( count(minus_G==0)>0 )
n_g_shells=n_g_shells1
ng_closed=ng_in_shell(n_g_shells)
call eval_minus_G()
enddo
ng_in_shell(:n_g_shells)=ng_in_shell_TMP(:n_g_shells)
endif
!
E_of_shell(:n_g_shells)=E_of_shell_TMP(:n_g_shells)
my guess is that the responsible could be the subroutine "src/setup/eval_minus_G.F", in particular check the end of the subroutine where, since your system does not have the inversion symmetry, you can find the following procedure. Can you check that ?
Regards,
D.
ng_closed=ng_in_shell(n_g_shells)
!
! Andrea [12/10/2011]: when the symmetries are removed using ypp
! or when, for any reason, both the spatial inversion and the timereversal
! are not introduced the coupling part of the BSE (and maybe also other parts
! of the code) must access an adhoc table of the G vectors evaluated in eval_minus_G.
! However if the inversion symmetry is not used here the eval_minus_G routine
! will fail as the shells are not closed anymore with respect to the inversion.
!
if (inv_index<0) then
allocate(minus_G(ng_closed))
call eval_minus_G()
do while ( count(minus_G==0)>0 )
n_g_shells=n_g_shells1
ng_closed=ng_in_shell(n_g_shells)
call eval_minus_G()
enddo
ng_in_shell(:n_g_shells)=ng_in_shell_TMP(:n_g_shells)
endif
!
E_of_shell(:n_g_shells)=E_of_shell_TMP(:n_g_shells)
Davide Sangalli, PhD
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/

 Posts: 29
 Joined: Mon Jul 15, 2013 2:09 pm
Re: About Gvectors
Dear all:
I have the same problems But, when I use the doubleprecisionversion of Yambo (I test Yambo v4.0.1 rev. 89), this problem disappears.
In summary,
1) my DFT calculations had been done with ecutwfc=220 Ry. in Quantum ESPRESSO scf (nscf) run.
2) when I construct DFT databases and run initialization using the singleprecisionversion of p2y and yambo in Yambo v4.0.1 rev. 89, MaxGvecs is automatically reduced to the smaller value than the number of Gvectors from DFT databases.
3) when I construct DFT databases and run initialization using the doubleprecisionversion of p2y and yambo in Yambo v4.0.1 rev. 89, MaxGvecs is equally set to the number of Gvectors from DFT databases.
Regards.
I have the same problems But, when I use the doubleprecisionversion of Yambo (I test Yambo v4.0.1 rev. 89), this problem disappears.
In summary,
1) my DFT calculations had been done with ecutwfc=220 Ry. in Quantum ESPRESSO scf (nscf) run.
2) when I construct DFT databases and run initialization using the singleprecisionversion of p2y and yambo in Yambo v4.0.1 rev. 89, MaxGvecs is automatically reduced to the smaller value than the number of Gvectors from DFT databases.
3) when I construct DFT databases and run initialization using the doubleprecisionversion of p2y and yambo in Yambo v4.0.1 rev. 89, MaxGvecs is equally set to the number of Gvectors from DFT databases.
Regards.
Dr. Hyungjun Lee
Institute of Theoretical Physics, EPFL
Institute of Theoretical Physics, EPFL
 Daniele Varsano
 Posts: 2315
 Joined: Tue Mar 17, 2009 2:23 pm
 Contact:
Re: About Gvectors
Dear Hyungjun,
many thanks for reporting, so I presume there is a rounding problem we will inspect very soon.
Best,
Daniele
many thanks for reporting, so I presume there is a rounding problem we will inspect very soon.
Best,
Daniele
Dr. Daniele Varsano
S3CNR Institute of Nanoscience and MaX Center, Italy
MaX  Materials design at the Exascale
http://www.nano.cnr.it
http://www.maxcentre.eu/
S3CNR Institute of Nanoscience and MaX Center, Italy
MaX  Materials design at the Exascale
http://www.nano.cnr.it
http://www.maxcentre.eu/
 Davide Sangalli
 Posts: 339
 Joined: Tue May 29, 2012 4:49 pm
 Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
 Contact:
Re: About Gvectors
Dear Hyungjun,
just to have an idea. How many Gvectors do you have in total ?
D.
just to have an idea. How many Gvectors do you have in total ?
D.
Davide Sangalli, PhD
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/

 Posts: 29
 Joined: Mon Jul 15, 2013 2:09 pm
Re: About Gvectors
Dear Daniele and Davide:
Thank you very much for your reply.
The number of G vectors is 420987.
For reference, I attached below the parts of r_setup from both single and doubleprecisionversion of Yambo v4.0.1 rev. 89.
As can be found, in the singleprecisionversion, the following line is automatically added to r_setup input file.
MaxGvecs= 90981 RL # [INI] Max number of Gvectors planned to use
Regards.
1. From singleprecisionversion
...
[RD./SAVE//ns.db1]
Bands : 5000
Kpoints : 4
Gvectors [RL space]: 420987
Components [wavefunctions]: 52706
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF Gvectors : 57753
Max atoms/species : 3
No. of atom species : 2
Magnetic symmetries : no
 S/N 005194  v.04.00.01 r.0088 
...
.Input file : (none)
 BoseTemp= 0.000000 eV # Bosonic Temperature
 MaxGvecs= 90981 RL # [INI] Max number of Gvectors planned to use
2. From doubleprecisionversion
...
[RD./SAVE//ns.db1]
Bands : 5000
Kpoints : 4
Gvectors [RL space]: 420987
Components [wavefunctions]: 52706
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF Gvectors : 57753
Max atoms/species : 3
No. of atom species : 2
Magnetic symmetries : no
 S/N 001476  v.04.00.01 r.0088 
...
.Input file : (none)
 BoseTemp= 0.000000 eV # Bosonic Temperature
Thank you very much for your reply.
The number of G vectors is 420987.
For reference, I attached below the parts of r_setup from both single and doubleprecisionversion of Yambo v4.0.1 rev. 89.
As can be found, in the singleprecisionversion, the following line is automatically added to r_setup input file.
MaxGvecs= 90981 RL # [INI] Max number of Gvectors planned to use
Regards.
1. From singleprecisionversion
...
[RD./SAVE//ns.db1]
Bands : 5000
Kpoints : 4
Gvectors [RL space]: 420987
Components [wavefunctions]: 52706
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF Gvectors : 57753
Max atoms/species : 3
No. of atom species : 2
Magnetic symmetries : no
 S/N 005194  v.04.00.01 r.0088 
...
.Input file : (none)
 BoseTemp= 0.000000 eV # Bosonic Temperature
 MaxGvecs= 90981 RL # [INI] Max number of Gvectors planned to use
2. From doubleprecisionversion
...
[RD./SAVE//ns.db1]
Bands : 5000
Kpoints : 4
Gvectors [RL space]: 420987
Components [wavefunctions]: 52706
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF Gvectors : 57753
Max atoms/species : 3
No. of atom species : 2
Magnetic symmetries : no
 S/N 001476  v.04.00.01 r.0088 
...
.Input file : (none)
 BoseTemp= 0.000000 eV # Bosonic Temperature
Dr. Hyungjun Lee
Institute of Theoretical Physics, EPFL
Institute of Theoretical Physics, EPFL
 Davide Sangalli
 Posts: 339
 Joined: Tue May 29, 2012 4:49 pm
 Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
 Contact:
Re: About Gvectors
Dear Hyungjun,
I've been able to reproduce the problem on a small system using a hug cutoff.
As a quick solution, to work in single precision, you can replace the constant 1.E5 with 1.E4 at line 90 of the file src/setup/G_shells_finder.F
> call to degeneration_fider
and recompile the code.
Hope it helps,
D.
I've been able to reproduce the problem on a small system using a hug cutoff.
As a quick solution, to work in single precision, you can replace the constant 1.E5 with 1.E4 at line 90 of the file src/setup/G_shells_finder.F
> call to degeneration_fider
and recompile the code.
Hope it helps,
D.
Davide Sangalli, PhD
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/

 Posts: 29
 Joined: Mon Jul 15, 2013 2:09 pm
Re: About Gvectors
Dear Davide:
Thank you very much for your quick fix.
However, it doesn't solve the problem.
I tested this fix in the system with slightly larger G vectors than my previous one.
Below are the part of r_setup.
...
[RD./SAVE//ns.db1]
Bands : 3500
Kpoints : 13
Gvectors [RL space]: 421941
Components [wavefunctions]: 52868
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF Gvectors : 60382
Max atoms/species : 3
No. of atom species : 2
Magnetic symmetries : no
 S/N 007644  v.04.00.01 r.0088 
...
.Input file : (none)
 BoseTemp= 0.000000 eV # Bosonic Temperature
 MaxGvecs= 20535 RL # [INI] Max number of Gvectors planned to use
As can be seen in the above line, MaxGvecs has been set to the smaller value of 20535 RL than the previouslyreset value.
Regards.
Thank you very much for your quick fix.
However, it doesn't solve the problem.
I tested this fix in the system with slightly larger G vectors than my previous one.
Below are the part of r_setup.
...
[RD./SAVE//ns.db1]
Bands : 3500
Kpoints : 13
Gvectors [RL space]: 421941
Components [wavefunctions]: 52868
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF Gvectors : 60382
Max atoms/species : 3
No. of atom species : 2
Magnetic symmetries : no
 S/N 007644  v.04.00.01 r.0088 
...
.Input file : (none)
 BoseTemp= 0.000000 eV # Bosonic Temperature
 MaxGvecs= 20535 RL # [INI] Max number of Gvectors planned to use
As can be seen in the above line, MaxGvecs has been set to the smaller value of 20535 RL than the previouslyreset value.
Regards.
Dr. Hyungjun Lee
Institute of Theoretical Physics, EPFL
Institute of Theoretical Physics, EPFL

 Posts: 29
 Joined: Mon Jul 15, 2013 2:09 pm
Re: About Gvectors
Dear Davide:
Do you still investigate this issue? Since my system requires large plane waves, I hope that this issue be fixed in the future release.
Regards.
Do you still investigate this issue? Since my system requires large plane waves, I hope that this issue be fixed in the future release.
Regards.
Dr. Hyungjun Lee
Institute of Theoretical Physics, EPFL
Institute of Theoretical Physics, EPFL
 Davide Sangalli
 Posts: 339
 Joined: Tue May 29, 2012 4:49 pm
 Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
 Contact:
Re: About Gvectors
Dear Hyungjun,
indeed we discussed the issue at one of the last developers skype meetings.
We scheduled to fix it in future releases, but I cannot promise anything about how long it will take ...
Best,
D.
indeed we discussed the issue at one of the last developers skype meetings.
We scheduled to fix it in future releases, but I cannot promise anything about how long it will take ...
Best,
D.
Davide Sangalli, PhD
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/
CNRISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
http://www.ism.cnr.it/en/davidesangallicv/
http://www.maxcentre.eu/

 Posts: 4
 Joined: Thu May 22, 2014 6:57 pm
Re: About Gvectors
Dear Yambo developers
I am trying to run a GW calculation on InSb and I have also noticed that the maximum number of Gvectors set at initialization is much smaller than the number of Gvectors in the DFT calculation. As you can see below the total number of Gvectors is 54601 while the number of Gvectors used in the GW calculation is 749.
I have followed this thread as I am experiencing the same problem with Yambo  I have tested this with versions 4.2.1 and 4.1.1. I already tried the simple fix in G_shells_finder.F mentioned earlier, but this has not fixed the problem
I haven't seen any other discussion on this topic other than this thread  so my apologies if this has already been solved elsewhere. I would appreciate it if you could give me a bit of guidance on this.
Please do let me know if you need more information from me.
Many thanks for your help,
Marina Filip
PostDoctoral Research Assistant
University of Oxford,
Department of Materials
[RD./SAVE//ns.db1]
Bands : 1500
Kpoints : 6
Gvectors [RL space]: 54601
Components [wavefunctions]: 6855
Symmetries [spatial+Trev]: 4
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 44.00000
WF Gvectors : 7799
Max atoms/species : 1
No. of atom species : 2
Magnetic symmetries : no
 S/N 002766  v.04.02.01 r.00110 
[RD./SAVE//ns.wf]
Fragmentation :yes
Bands in each block : 1500
Blocks : 1
 S/N 002766  v.04.02.01 r.00000 
[RD./SAVE//ndb.kindx]
Fragmentation :no
Polarization last K : 6
QP states : 1 6
X grid is uniform :yes
BS scattering :no
COLL scattering :no
 S/N 002766  v.04.02.01 r.00000 
[RD./SAVE//ns.kb_pp_pwscf]
Fragmentation :yes
 S/N 002766  v.04.02.01 r.00000 
r_setup:
 Yambo: An ab initio tool for excited state calculations
 A. Marini, C. Hogan, M. Gr"uning, D. Varsano
 Computer Physics Communications 180, 1392 (2009).

.Input file : yambo.in
 setup # [R INI] Initialization
 BoseTemp= 0.000000 eV # Bosonic Temperature
 MaxGvecs= 749 RL # [INI] Max number of Gvectors planned to use
I am trying to run a GW calculation on InSb and I have also noticed that the maximum number of Gvectors set at initialization is much smaller than the number of Gvectors in the DFT calculation. As you can see below the total number of Gvectors is 54601 while the number of Gvectors used in the GW calculation is 749.
I have followed this thread as I am experiencing the same problem with Yambo  I have tested this with versions 4.2.1 and 4.1.1. I already tried the simple fix in G_shells_finder.F mentioned earlier, but this has not fixed the problem
I haven't seen any other discussion on this topic other than this thread  so my apologies if this has already been solved elsewhere. I would appreciate it if you could give me a bit of guidance on this.
Please do let me know if you need more information from me.
Many thanks for your help,
Marina Filip
PostDoctoral Research Assistant
University of Oxford,
Department of Materials
[RD./SAVE//ns.db1]
Bands : 1500
Kpoints : 6
Gvectors [RL space]: 54601
Components [wavefunctions]: 6855
Symmetries [spatial+Trev]: 4
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 44.00000
WF Gvectors : 7799
Max atoms/species : 1
No. of atom species : 2
Magnetic symmetries : no
 S/N 002766  v.04.02.01 r.00110 
[RD./SAVE//ns.wf]
Fragmentation :yes
Bands in each block : 1500
Blocks : 1
 S/N 002766  v.04.02.01 r.00000 
[RD./SAVE//ndb.kindx]
Fragmentation :no
Polarization last K : 6
QP states : 1 6
X grid is uniform :yes
BS scattering :no
COLL scattering :no
 S/N 002766  v.04.02.01 r.00000 
[RD./SAVE//ns.kb_pp_pwscf]
Fragmentation :yes
 S/N 002766  v.04.02.01 r.00000 
r_setup:
 Yambo: An ab initio tool for excited state calculations
 A. Marini, C. Hogan, M. Gr"uning, D. Varsano
 Computer Physics Communications 180, 1392 (2009).

.Input file : yambo.in
 setup # [R INI] Initialization
 BoseTemp= 0.000000 eV # Bosonic Temperature
 MaxGvecs= 749 RL # [INI] Max number of Gvectors planned to use