SHG error

Description of your first forum.
Sunxl
Posts: 13
Joined: Mon Dec 29, 2025 2:59 am
Location: China

Re: SHG error

Post by Sunxl »

Dear Davide,

I performed additional tests using the fixed version of Lumen.

For the FM system, the problem seems to be fixed. The SHG calculation no longer gives NaN values, and the non-zero (yxx) component obtained with the fixed version of Lumen agrees with the result from Yambo 5.3-master.

However, for the AFM system, the problem is still present. Using the fixed version of Lumen, the non-zero (xxx) component still shows strong positive-negative oscillations between adjacent frequency points, similar to what I observed previously.

Thank you for the reminder. I have added my signature now.

Best,
sunxl
Attachments
lumen-fix.zip
(92.74 KiB) Downloaded 2015 times
Dr. sunxl
Beijing Computing Science Research Center, China.
User avatar
claudio
Posts: 26
Joined: Sat Oct 25, 2025 11:27 am

Re: SHG error

Post by claudio »

Dear sunxl

we fixed another bug in the code, now should be fine.
I tested on your system with smaller k-points grid (9 6 1) and few bands (71 - 78).
in attachment the plots and inputs.

Please download the bug-fixes again now it should be fine

best
Claudio
Attachments
SHG_TEST.tgz
(102.33 KiB) Downloaded 1976 times
shg_xxx.png
shg_xxx.png (18.09 KiB) Viewed 41434 times
Img_EPS.png
Img_EPS.png (15.66 KiB) Viewed 41434 times
Claudio Attaccalite
[CNRS/ Aix-Marseille Université/ CINaM laborarory / TSN department
Campus de Luminy – Case 913
13288 MARSEILLE Cedex 09
web site: http://www.attaccalite.com
Davide
Posts: 23
Joined: Mon Dec 29, 2025 8:50 am

Re: SHG error

Post by Davide »

Dear all,
let me also clarify that this was not strictly a "code bug", but rather an issue related to the theoretical definition of the Berry phase polarization, which is defined up to a periodic term. The oscillations were due to jumps of one period in the polarization, which so far was not occurring in other systems, and the fix (by Claudio) addressed this.

Best,
D.
Davide Sangalli, PhD
Piazza Leonardo Da Vinci, 32, 20133 – Milano
CNR, Istituto di Struttura della Materia (ISM)
https://sites.google.com/view/davidesangalli
Sunxl
Posts: 13
Joined: Mon Dec 29, 2025 2:59 am
Location: China

Re: SHG error

Post by Sunxl »

Dear caludio,

Thank you very much! I will re-download the new fix version for testing.

Best,
sunxl
Dr. sunxl
Beijing Computing Science Research Center, China.
Post Reply