SHG error

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

SHG error

Post by Sunxl »

Dear all,
I used the latest version 2.1 of Lumen to calculate the SHG of the entire process. I calculated the SHG spectrum within the frequency range of 1-2 eV. I found that there was a positive-negative oscillation between adjacent frequency points. However, this issue did not occur when I used Yambo 5.3. Are these two software the same? My output files are attached.
shg.png
shg.png (155.86 KiB) Viewed 629 times
Attachments
ouput.zip
(84.72 KiB) Downloaded 20 times
Dr. sunxl
Beijing Computing Science Research Center, China.
User avatar
claudio
Posts: 25
Joined: Sat Oct 25, 2025 11:27 am

Re: SHG error

Post by claudio »

Dear Sunxl

please put your inputs DFT and Lumen in the forum, I will try to reproduce your error
and fix it

best
Claudio
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
Sunxl
Posts: 12
Joined: Mon Dec 29, 2025 2:59 am
Location: China

Re: SHG error

Post by Sunxl »

Dear claudio,

I have attached the input and output files for DFT. The material I am calculating is an anti-ferromagnetic system. Both Yambo 5.3 and Lumen 2.1 have shown positive and negative oscillation issues, but the ferromagnetic systems I calculated before were normal.

Best,
sunxl
Attachments
input-dft-shg.zip
(186.63 KiB) Downloaded 22 times
Dr. sunxl
Beijing Computing Science Research Center, China.
User avatar
claudio
Posts: 25
Joined: Sat Oct 25, 2025 11:27 am

Re: SHG error

Post by claudio »

Dear sunxl

we found a bug, we will fix in the next days and let you know

best
Claudio
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
Sunxl
Posts: 12
Joined: Mon Dec 29, 2025 2:59 am
Location: China

Re: SHG error

Post by Sunxl »

Dear Claudio,
Thank you very much for your answer.

Under another post, you provided me with a fix version of Lumen, I conducted a calculation of the single-particle spectrum, and it still showed oscillations. Furthermore, for the previous version, I have calculated the calculation for ferromagnetic materials including the soc. Although I'm not sure if the numerical values of the results are correct, it seems that the spectrum is continuously changing. The output file is attached. I wonder if this result is reliable?

If a version applicable to magnetic systems that incorporate SOC computing is released, please let me know. Thank you.

Best,
sunxl
Attachments
correct.zip
(69.45 KiB) Downloaded 5 times
Dr. sunxl
Beijing Computing Science Research Center, China.
Davide
Posts: 22
Joined: Mon Dec 29, 2025 8:50 am

Re: SHG error

Post by Davide »

Dear sunxl,
Sunxl wrote: found that there was a positive-negative oscillation between adjacent frequency points. However, this issue did not occur when I used Yambo 5.3
Sunxl wrote: Thu Sep 03, 2026 4:33 am Both Yambo 5.3 and Lumen 2.1 have shown positive and negative oscillation issues, but the ferromagnetic systems I calculated before were normal.
was yambo-5.3 correct, or showing the same issue of lumen 2.1 ?

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: 12
Joined: Mon Dec 29, 2025 2:59 am
Location: China

Re: SHG error

Post by Sunxl »

Dear Davide,

I used two systems, one ferromagnetic system and one antiferromagnetic system. I calculated the SHG using the yambo5.3master and lumen2.1 versions respectively. I found that only the SHG spectrum obtained from the tested ferromagnetic system was continuously changing, which seemed to be a normal result but it was uncertain whether the result was correct. The SHG results obtained from the remaining three cases were oscillatory and jumping between adjacent frequency points. The input and output files of the four results are placed in the attachment. You can use these two systems for testing.

Best,
sunxl
Attachments
system2-AFM.zip
(156.54 KiB) Downloaded 6 times
system1-FM.zip
(124.92 KiB) Downloaded 7 times
Dr. sunxl
Beijing Computing Science Research Center, China.
Davide
Posts: 22
Joined: Mon Dec 29, 2025 8:50 am

Re: SHG error

Post by Davide »

In the folder system1-FM I see two subfolders:

Code: Select all

system1-FM-lumen2.1-wrong  system1-FM-yambo5.3master-correct
However, the lumen2.1-wrong contains shg-bse with NaN in the final output, while yambo5.3master-correct contains only shg-ipa

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: 12
Joined: Mon Dec 29, 2025 2:59 am
Location: China

Re: SHG error

Post by Sunxl »

Dear Davide,

The issue does not appear to be specific to the BSE calculation, since it can also be reproduced at the IPA level.
To make the comparison consistent, I performed IPA calculations for both systems using Yambo 5.3-master and Lumen 2.1, respectively, while keeping the calculation setup otherwise the same.

For the FM system, the non-zero SHG component (yxx) gives a normal spectrum with Yambo 5.3-master, whereas the corresponding Lumen 2.1 calculation produces NaN values.
For the AFM system, the non-zero (xxx) component shows the same positive-negative oscillations between adjacent frequency points in both Yambo 5.3-master and Lumen 2.1.

Therefore, the anomalous behavior does not seem to originate simply from the choice between IPA and BSE. It may instead be related to the treatment of magnetic systems with SOC, although the FM and AFM cases may not necessarily have the same origin. I have attached the corresponding IPA test results for both systems.


Best,
sunxl
Attachments
system2-AFM.zip
(108.63 KiB) Downloaded 4 times
system1-FM.zip
(81.37 KiB) Downloaded 4 times
Dr. sunxl
Beijing Computing Science Research Center, China.
Davide
Posts: 22
Joined: Mon Dec 29, 2025 8:50 am

Re: SHG error

Post by Davide »

Thanks. Just one last check. Do you get NaN also with the bug-fixes of Lumen ?

In case we will add this to the list of open issues, and reply here as soon as we are able to reproduce the issue and eventually fix it.

Best,
D.


P.S.: One more thing. Please add a signature in the settings of your user in the forum.
Davide Sangalli, PhD
Piazza Leonardo Da Vinci, 32, 20133 – Milano
CNR, Istituto di Struttura della Materia (ISM)
https://sites.google.com/view/davidesangalli
Post Reply