About G-vectors

Concerns any physical issues arising during the setup step (-i option). This includes problems with symmetries, k/q-point sets, and so on. For technical problems (running in parallel, etc), refer to the Technical forum.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, Daniele Varsano

User avatar
Davide Sangalli
Posts: 614
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: About G-vectors

Post by Davide Sangalli » Mon May 11, 2015 3:21 pm

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 time-reversal
! are not introduced the coupling part of the BSE (and maybe also other parts
! of the code) must access an ad-hoc 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_shells-1
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
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

hlee
Posts: 29
Joined: Mon Jul 15, 2013 2:09 pm

Re: About G-vectors

Post by hlee » Thu Jul 23, 2015 2:54 am

Dear all:

I have the same problems But, when I use the double-precision-version 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 single-precision-version of p2y and yambo in Yambo v4.0.1 rev. 89, MaxGvecs is automatically reduced to the smaller value than the number of G-vectors from DFT databases.
3) when I construct DFT databases and run initialization using the double-precision-version of p2y and yambo in Yambo v4.0.1 rev. 89, MaxGvecs is equally set to the number of G-vectors from DFT databases.

Regards.
Dr. Hyungjun Lee
Institute of Theoretical Physics, EPFL

User avatar
Daniele Varsano
Posts: 3816
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: About G-vectors

Post by Daniele Varsano » Thu Jul 23, 2015 8:33 am

Dear Hyungjun,
many thanks for reporting, so I presume there is a rounding problem we will inspect very soon.
Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

User avatar
Davide Sangalli
Posts: 614
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: About G-vectors

Post by Davide Sangalli » Thu Jul 23, 2015 8:59 am

Dear Hyungjun,
just to have an idea. How many G-vectors do you have in total ?

D.
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

hlee
Posts: 29
Joined: Mon Jul 15, 2013 2:09 pm

Re: About G-vectors

Post by hlee » Thu Jul 23, 2015 4:21 pm

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 double-precision-version of Yambo v4.0.1 rev. 89.
As can be found, in the single-precision-version, the following line is automatically added to r_setup input file.

MaxGvecs= 90981 RL # [INI] Max number of G-vectors planned to use

Regards.

1. From single-precision-version
...
[RD./SAVE//ns.db1]------------------------------------------
Bands : 5000
K-points : 4
G-vectors [RL space]: 420987
Components [wavefunctions]: 52706
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF G-vectors : 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 G-vectors planned to use

2. From double-precision-version
...
[RD./SAVE//ns.db1]------------------------------------------
Bands : 5000
K-points : 4
G-vectors [RL space]: 420987
Components [wavefunctions]: 52706
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF G-vectors : 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

User avatar
Davide Sangalli
Posts: 614
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: About G-vectors

Post by Davide Sangalli » Thu Jul 23, 2015 6:33 pm

Dear Hyungjun,
I've been able to reproduce the problem on a small system using a hug cut-off.

As a quick solution, to work in single precision, you can replace the constant 1.E-5 with 1.E-4 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
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

hlee
Posts: 29
Joined: Mon Jul 15, 2013 2:09 pm

Re: About G-vectors

Post by hlee » Thu Jul 23, 2015 7:39 pm

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
K-points : 13
G-vectors [RL space]: 421941
Components [wavefunctions]: 52868
Symmetries [spatial]: 12
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 64.00000
WF G-vectors : 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 G-vectors planned to use

As can be seen in the above line, MaxGvecs has been set to the smaller value of 20535 RL than the previously-reset value.

Regards.
Dr. Hyungjun Lee
Institute of Theoretical Physics, EPFL

hlee
Posts: 29
Joined: Mon Jul 15, 2013 2:09 pm

Re: About G-vectors

Post by hlee » Tue Aug 18, 2015 2:57 pm

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.
Dr. Hyungjun Lee
Institute of Theoretical Physics, EPFL

User avatar
Davide Sangalli
Posts: 614
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: About G-vectors

Post by Davide Sangalli » Tue Aug 18, 2015 3:34 pm

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.
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

mfilip
Posts: 4
Joined: Thu May 22, 2014 6:57 pm

Re: About G-vectors

Post by mfilip » Sun Feb 11, 2018 5:26 pm

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 G-vectors 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
Post-Doctoral Research Assistant
University of Oxford,
Department of Materials


[RD./SAVE//ns.db1]------------------------------------------
Bands : 1500
K-points : 6
G-vectors [RL space]: 54601
Components [wavefunctions]: 6855
Symmetries [spatial+T-rev]: 4
Spinor components : 2
Spin polarizations : 1
Temperature [ev]: 0.000000
Electrons : 44.00000
WF G-vectors : 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 G-vectors planned to use

Post Reply