Exciton analysis after TD-DFT (using ALDA)

Anything regarding the post-processing utility (e.g. excitonic wavefunction analysis) is dealt with in this forum.

Moderators: Davide Sangalli, andrea marini, Daniele Varsano

Post Reply
harrier_class
Posts: 18
Joined: Tue May 13, 2025 4:27 pm

Exciton analysis after TD-DFT (using ALDA)

Post by harrier_class » Fri Jun 12, 2026 10:48 am

Dear Yambo team,

In the recent past, I have started to use Yambo 5.0 for my periodic system. As the system is quite large, we are inclined in using TD-DFT for calculating the absorption spectra. SInce, it would be nice to see how the excitons also behave at the first peak in the spectra, we decided to do the exciton analysis [provided by ypp], but when I use the following commands:

Code: Select all

ypp -F ypp_WF.in -e w -avehole
ypp -F ypp_WF.in -J 3D_ALDA
I get the error in l_excitons_avehole_wavefunction

Code: Select all

  
  __ __  ____ ___ ___ ____   ___
 |  |  |/    |   |   |    \ /   \
 |  |  |  o  | _   _ |  o  )     |
 |  ~  |     |  \_/  |     |  O  |
 |___, |  _  |   |   |  O  |     |
 |     |  |  |   |   |     |     |
 |____/|__|__|___|___|_____|\___/


 <---> [01] MPI/OPENMP structure, Files & I/O Directories
 <---> MPI Cores-Threads   : 1(CPU)-72(threads)
 <---> [02] Y(ambo) P(ost)/(re) P(rocessor)
 <---> [03] Core DB
 <---> :: Electrons             :  1144.00
 <---> :: Temperature           : 0.000000 [eV]
 <---> :: Lattice factors       : 32.84484  19.01644  42.76142 [a.u.]
 <---> :: K points              : 12
 <---> :: Bands                 : 1200
 <---> :: Symmetries            : 2
 <---> :: RL vectors            : 2577543
 <---> [04] K-point grid
 <---> :: Q-points   (IBZ): 12
 <---> :: X K-points (IBZ): 12
 <---> [05] CORE Variables Setup
 <---> [05.01] Unit cells
 <---> [05.02] Symmetries
 <---> [05.03] Reciprocal space
 <---> [05.04] K-grid lattice
 <---> Grid dimensions      :   2   4   2
 <---> [05.05] Energies & Occupations


 <---> [06] Excitonic Properties @ Q-index #1
[ERROR] STOP signal received while in[06] Excitonic Properties @ Q-index #1
[ERROR] ndb.BS_diago not found
~                               
Does this mean, that exciton analysis requires BSE calculation?

I am new to conducting excited state study for the periodic system, your help would be great!

Thanks.

Best regards,
Vipul Kumar Ambasta
Vipul Kumar Ambasta
MSc. student
Friedrich Alexander Universitaet
Erlangen (Germany)

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

Re: Exciton analysis after TD-DFT (using ALDA)

Post by Davide Sangalli » Fri Jun 12, 2026 11:29 am

Dear Vipul,
the procedure is correct, and it should work.

However, you need to solve tddft in transition space with the diagonalization solver, and including the flag WRbsWF in input.

After that, please check the report of your ypp run. You could find why the ndb.BS_diago is not acceptef in your case.

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
http://www.max-centre.eu/

harrier_class
Posts: 18
Joined: Tue May 13, 2025 4:27 pm

Re: Exciton analysis after TD-DFT (using ALDA)

Post by harrier_class » Mon Jun 15, 2026 8:54 pm

Dear Davide,

I appreciate your super quick response. That give me time to try out the options.

My system is not super big [572 occupied bands] and I am able to run the full diagonalization for small bands window like 500|600.

But for the band window like 500|750 [I did this, to confirm that the spectra does not change with the increasing bands], but I get the error

Code: Select all

Abort(594434) on node 11 (rank 11 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x15315429a700, rbuf=0x15379036b860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(738791938) on node 23 (rank 23 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x14e25d768440, rbuf=0x14e898817860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(403247618) on node 12 (rank 12 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x14998b69b740, rbuf=0x149fc0bc7860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(134812162) on node 21 (rank 21 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x14c0d1a60440, rbuf=0x14c7061c7860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(134812162) on node 13 (rank 13 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x14d70ca9b700, rbuf=0x14dd48337860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(604574210) on node 28 (rank 28 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x152103360480, rbuf=0x152736dc3860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(269029890) on node 15 (rank 15 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x151bfff99700, rbuf=0x1522361c77c0, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(738791938) on node 31 (rank 31 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x14ec5abdf440, rbuf=0x14f29499b860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(671683074) on node 14 (rank 14 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x14d51fca1700, rbuf=0x14db5c6df860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(67703298) on node 29 (rank 29 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x14c890b46440, rbuf=0x14cecd163860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 Abort(537465346) on node 30 (rank 30 in comm 0): Fatal error in PMPI_Allreduce: Invalid count, error stack: PMPI_Allreduce(390): MPI_Allreduce(sbuf=0x149000845440, rbuf=0x14963ce6f860, count=-1593462720, datatype=MPI_COMPLEX, op=MPI_SUM, comm=MPI_COMM_WORLD) failed PMPI_Allreduce(332): Negative count, value is -1593462720 [2026-06-15T18:11:08.565] error: *** STEP 3682133.0 ON f0701 CANCELLED AT 2026-06-15T18:11:08 DUE to SIGNAL Killed *** srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
This was the input file used by me

Code: Select all


optics                           # [R] Linear Response optical properties
bss                              # [R] BSE solver
bse                              # [R][BSE] Bethe Salpeter Equation.
tddft                            # [R][K] Use TDDFT kernel
X_Threads=0                      # [OPENMP/X] Number of threads for response functions
DIP_Threads=0                    # [OPENMP/X] Number of threads for dipoles
K_Threads=0                      # [OPENMP/BSK] Number of threads for response functions
BSEmod= "coupling"               # [BSE] resonant/retarded/coupling
BSKmod= "ALDA"                   # [BSE] IP/Hartree/HF/ALDA/SEX/BSfxc
BSSmod= "d"                      # [BSS] (h)aydock/(d)iagonalization/(s)lepc/(i)nversion/(t)ddft`
BSENGexx= 3          Ry    # [BSK] Exchange components
BSEprop= "abs"                   # [BSS] abs/kerr/magn/dichr trace
% BSEQptR
 1 | 1 |                             # [BSK] Transferred momenta range
%
% BSEBands
  500  | 750 |                       # [BSK] Bands range
%
% BEnRange
  0.00000 | 6.00000 |         eV    # [BSS] Energy range
%
% BDmRange
 0.100000 | 0.100000 |         eV    # [BSS] Damping range
%
BEnSteps= 100                    # [BSS] Energy steps
% BLongDir
 1.000000 | 1.000000 | 1.000000 |        # [BSS] [cc] Electric Field
%
BS_ROLEs= "k eh t"
BS_CPU= "1 4 4"                 # 1 * 4 * 4 = 16 total MPI tasks
BS_nCPU_LinAlg_DIAGO= 4         # Perfectly structures an efficient 4x4 ScaLAPACK matrix grid
BS_nCPU_LinAlg_INV= 4


Can this be due to the fact that my system is large for running full diagonaliation? If yes, I also looked into using the Lanczos-Haydock solver [for the spectra} followed by SLEPc solver [for doing excitons analysis] ,and it seems possible to that way [Source: Yambo tutorials] . But I am not sure if thats recommended for the tddft? Can you help me know that?


Your inputs will be of great help.

PS: I use Yambo 5.0.4, I tried to get Yambo 5.3/5.4 running, but they just give me Segmentation error, I am still not able to figure that out.

--
Best regards,
Vipul
Vipul Kumar Ambasta
MSc. student
Friedrich Alexander Universitaet
Erlangen (Germany)

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

Re: Exciton analysis after TD-DFT (using ALDA)

Post by Daniele Varsano » Tue Jun 16, 2026 9:46 am

Dear Vipul,

It seems you have a problem with MPI, but it is not clear what can be the problem. If you could add report/log file could help to spot it.

If you want to analyze the excitation composition you can use the slepc solver. Note the Haydock will not allow the analysis as eigenvector are not calculated. Actually this is the best solution if you need to analyse the low energy excitations only.

You can anyway use Haydock to verify your spectrum is converged.

Yes, updating to a more recent release is highly suggested.

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/

harrier_class
Posts: 18
Joined: Tue May 13, 2025 4:27 pm

Re: Exciton analysis after TD-DFT (using ALDA)

Post by harrier_class » Tue Jun 16, 2026 10:29 am

Dear Dr, Varsano,

I appreciate your quick response.

I tried with Haydock, its pretty fast and the spectra looks good too [when I compare with the spectra from the reciprocal space]. And yes we are interested only in the low energy excitations. I will give Slpec also a try after the calculations using the Haydock.

Thanks a lot.

PS: Modules in my HPC are getting updated, fingers are crossed that the new version of Yambo works after that.

--
Best regards,
Vipul
Vipul Kumar Ambasta
MSc. student
Friedrich Alexander Universitaet
Erlangen (Germany)

harrier_class
Posts: 18
Joined: Tue May 13, 2025 4:27 pm

Re: Exciton analysis after TD-DFT (using ALDA)

Post by harrier_class » Fri Jun 19, 2026 4:04 pm

Dear Yambo team,

I am happy to share that I managed to run the ypp module for the postprocessing to get the oscillator strengths and energies. I did the TDDFT in the transition space using the following input file:

Code: Select all

optics                           # [R] Linear Response optical properties
bss                              # [R] BSE solver
bse                              # [R][BSE] Bethe Salpeter Equation.
tddft                            # [R][K] Use TDDFT kernel
X_Threads=0                      # [OPENMP/X] Number of threads for response functions
DIP_Threads=0                    # [OPENMP/X] Number of threads for dipoles
K_Threads=0                      # [OPENMP/BSK] Number of threads for response functions
BSEmod= "coupling"               # [BSE] resonant/retarded/coupling
BSKmod= "ALDA"                   # [BSE] IP/Hartree/HF/ALDA/SEX/BSfxc
BSSmod= "d"                      # [BSS] (h)aydock/(d)iagonalization/(s)lepc/(i)nversion/(t)ddft`
BSENGexx= 1          Ry    # [BSK] Exchange components
BSEprop= "abs"                   # [BSS] abs/kerr/magn/dichr trace
% BSEQptR
 1 | 1 |                             # [BSK] Transferred momenta range
%
% BSEBands
  500  | 650 |                       # [BSK] Bands range
%
% BEnRange
  0.50000 | 3.00000 |         eV    # [BSS] Energy range
%
% BDmRange
 0.100000 | 0.100000 |         eV    # [BSS] Damping range
%
BEnSteps= 50                    # [BSS] Energy steps
% BLongDir
 1.000000 | 1.000000 | 1.000000 |        # [BSS] [cc] Electric Field
%
BS_ROLEs= "k eh t"
BS_CPU= "1 8 4"                 # 1 * 4 * 4 = 16 total MPI tasks
BS_nCPU_LinAlg_DIAGO= 16         # Perfectly structures an efficient 4x4 ScaLAPACK matrix grid
BS_nCPU_LinAlg_INV= 16

WRbsWF                        # [BSS] Write to disk excitonic the WFs

Now, when I use the command srun ypp -e s -b 1

I get the output file o.exc_qpt1_I_sorted , which looks like this

Code: Select all

#    E [ev]             Strength           Index
#
     7.84664536        0.999999940         42.0000000
    -7.84662533        0.999815822         23.0000000
    -7.32365274        0.352347076         125.000000
     7.32347918        0.351318806         150.000000
     8.41400337        0.176599964         6.00000000
    -8.41401386        0.176591456         8.00000000
    -8.18088627        0.161645308         10.0000000
     8.18084431        0.161626339         14.0000000
    -7.28460646        0.156009689         145.000000
     7.28476143        0.155227438         167.000000
    -7.32554913        0.154779419         123.000000
     7.32608366        0.146017507         148.000000
    -7.62941790        0.145263121         47.0000000
     7.62975693        0.144787446         84.0000000
    -7.41174507        0.136917681         80.0000000
    ......

Is the negative value is due to the 'coupling' mode and can I safely choose to ignore the negative values?

Further, when I do

Code: Select all

srun ypp -F ypp_WF.in -e w -avehole
I see that in the ypp_WF.in, there is an option called EHdensity= "h" # Calculate (h)ole/(e)lectron density from BSE wave-function. I understand that choosing "e" will give the average electron density, In that case, should I also change the avehole to other option? Or 'avehole' is just an option to show that average values wil be calculated?

PS: Please note that I am using the Yambo 5.0.4, hopefully in the coming days, I can move to the latest versio of Yambo.


Thanks a lot for all your support.

--
Best regards,
Vipul
Vipul Kumar Ambasta
MSc. student
Friedrich Alexander Universitaet
Erlangen (Germany)

harrier_class
Posts: 18
Joined: Tue May 13, 2025 4:27 pm

Re: Exciton analysis after TD-DFT (using ALDA)

Post by harrier_class » Fri Jun 19, 2026 8:21 pm

Dear Yambo team,

Since, I run some calculation to get the excitonic visualizations for avehole. I see that it takes very long time [no update after 4 hours]. Would you suggest me to do convergence tests for the FFTGvecs as 1 Ry to ..... n Ry.


Current default value for FFTGvecs is ::: FFTGvecs= 339675 RL # [FFT] Plane-waves

In the last Yambo online school from Czech Republic, I was suggeted to keep as default value. But since my system is large, it might need some special attention.

I appreciate your quick responses. With your quick help, I will be able to have nice results for my Master thesis project.

Thanks in advance.

--
Best regards,
Vipul
Vipul Kumar Ambasta
MSc. student
Friedrich Alexander Universitaet
Erlangen (Germany)

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

Re: Exciton analysis after TD-DFT (using ALDA)

Post by Davide Sangalli » Sun Jun 21, 2026 10:53 pm

Dear Vipul,
unfortunately the subroutine for plotting excitons in real space is not at all effciient.

You can find some comments on why this happens here: https://gitlab.com/lumen-code/lumen/-/m ... quests/238

Options you have:
a) there is a yambopy implementation which is more efficient. You can try it.
b) If you want to stick to ypp, you can try a lumen releases from 2.0 on. It is significantly faster. Non need to re-run the BSE. Just use ypp from the release
https://www.lumen-code.org/wiki/index.p ... ease_notes

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
http://www.max-centre.eu/

Post Reply