[salmon-user:00289] TDDFT wave functions

144 views
Skip to first unread message

Fadil Iyikanat

unread,
Mar 4, 2024, 6:57:20 AM3/4/24
to salmo...@salmon-tddft.jp
Dear Salmon users and developers,

Is it possible to print out time dependent wave functions in each time step of TDDFT calculation?

Best regards,
Fadıl

--
Dr. Fadıl İYİKANAT
ICFO-The Institute of Photonic Sciences
Av. Carl Friedrich Gauss, 3
08860 Castelldefels
Barcelona-SPAIN
Nanophotonics Theory Group
www.nanophotonics.es

Yamada Shunsuke

unread,
Mar 5, 2024, 1:52:46 AM3/5/24
to salmo...@salmon-tddft.jp

Dear Fadıl,

 

Unfortunately, SALMON does not support that option.

But I think we can obtain similar results by combining several calculations as follows (this procedure is a bit troublesome):

 

1.

Run TDDFT calculation with checkpoint_interval. With this option, SALMON prints binary data including wavefunctions at each time step. The name of the output directory is checkpoint_rt_XXXXXX, where XXXXXX is the time step.

https://salmon-tddft.jp/webmanual/current/html/input_keyword_list.html#checkpoint-interval

 

2.

Run SALMON again to convert the binary data to Gaussian cube files at certain time step. Pls modify the input file as follows:

 

&calculation

theory=dft    ! “yn_out_psi” option is available when theory=dft.

/

&control

yn_restart=’y’                                                    ! DFT calculation using input binary data.

directory_read_data=checkpoint_rt_XXXXXX ! specify directory name of the binary data.

read_gs_restart_data='wfn'                              ! read wavefunctions only.

write_gs_restart_data=no                               ! forbid printing new binary data.

/

&scf

nscf=0             ! forbid changing wavefunctions.

/

& analysis

yn_out_psi=y ! print wavefunctions. The file format is specified by format_voxel_data (default: cube).

/

 

Sincerely,

Shunsuke

 

 

 

 

差出人: Fadil Iyikanat <fadili...@gmail.com>
日付: 月曜日, 202434 20:57
宛先: salmo...@salmon-tddft.jp <salmo...@salmon-tddft.jp>
件名: [salmon-user:00289] TDDFT wave functions

Fadil Iyikanat

unread,
Mar 5, 2024, 11:54:08 AM3/5/24
to salmo...@salmon-tddft.jp
Dear Yamada,

Thank you very much for your fast reply!
I extracted the binary files with 'checkpoint_interval'.
However, when I try to run 'dft' calculation with your parameters it gives the following error;
------------------------------------------------------------------------------------------------------------------------------------------
Fatal error in PMPI_Type_create_subarray: Invalid argument, error stack:
PMPI_Type_create_subarray(327): MPI_Type_create_subarray(ndims=7, array_of_sizes=0x7fff22ca06d0, array_of_subsizes=0x7fff22ca06b0, array_of_starts=0x7fff22ca0690, order=57, MPI_DOUBLE_COMPLEX, newtype=0x7fff22ca067c) failed
PMPI_Type_create_subarray(112): Argument array_of_subsizes has value 36 but must be within [0,18] 
------------------------------------------------------------------------------------------------------------------------------------------

and the final lines of my output file are;
-----------------------------------------------------------------------
============init_ps==============
end init_ps
Maximal rho_NLCC= 0.000000000000000E+000
Maximal tau_NLCC= 0.000000000000000E+000
non-orthogonal cell: using al_vec[1,2,3]
-----------------------------------------------------------------------

My system has non-orthogonal lattice and I used the parallelization over the k-points in the tddft run.
Do you have any idea what could be the problem?

Best,
Fadıl
 

Yamada Shunsuke

unread,
Mar 5, 2024, 7:28:34 PM3/5/24
to salmo...@salmon-tddft.jp
Dear Fadıl,

The error message says that the size of an array is too large when reading the wavefunction data. But it sounds strange because you successfully finished the TDDFT calculation with GS wavefunctions... I am not sure, sorry.

I tried TDDFT wavefunction output with a very small system and it worked well (pls see an attached file). If it is not too much for you, pls retry your calculation with reduced parameters.

Sincerely,
Shunsuke




差出人: Fadil Iyikanat <fadili...@gmail.com>
送信日時: 2024年3月6日 1:52
宛先: salmo...@salmon-tddft.jp <salmo...@salmon-tddft.jp>
件名: [salmon-user:00291] Re: TDDFT wave functions
 
inputfile

Yamada Shunsuke

unread,
Mar 5, 2024, 8:49:34 PM3/5/24
to salmo...@salmon-tddft.jp
Dear Fadıl,

Perhaps, 'nstate' is the cause of the error. Could you try the same calculation but with nstate = # of occupied states? (i.e. = nelec/2 for spin-unpolarized state)

The checkpoint data contains TDDFT wavefunctions corresponding to the occupied orbitals only. If 'nstate' contains unoccupied states also, SALMON intends to read undefined arrays of the unoccupied states and may fail.

Sincerely,
Shunsuke


差出人: Yamada Shunsuke <yamada....@qst.go.jp>
送信日時: 2024年3月6日 9:27
宛先: salmo...@salmon-tddft.jp <salmo...@salmon-tddft.jp>
件名: [salmon-user:00292] Re: TDDFT wave functions
 

Fadil Iyikanat

unread,
Mar 6, 2024, 4:36:33 AM3/6/24
to salmo...@salmon-tddft.jp
Dear Yamada,

Changing nstate to nelec/2 actually worked.
The code prints the wave function with the desired time steps.
Thank you very much!

Best,
Fadıl

Yamada Shunsuke

unread,
Dec 3, 2024, 11:54:55 PM12/3/24
to salmo...@salmon-tddft.jp
Dear Iwasa-san,

I think the cause of the problem originates from the yn_periodic=n option (isolated mode).
In the isolated mode, the wavefunction array is defined as a real value array in ground-state calculation but a complex value array in real-time calculation.
If SALMON reads a checkpoint data of RT mode with GS mode, array conversion will fail.
A solution may be using yn_periodic=y or changing the code…

Sincerely,
Shunsuke Yamada



差出人: T. Iwasa <tiw...@sci.hokudai.ac.jp>
送信日時: Wednesday, December 4, 2024 12:57:10 PM
宛先: salmo...@salmon-tddft.jp <salmo...@salmon-tddft.jp>
件名: [salmon-user:00320] Re: TDDFT wave functions
 
Dear Yamada-san,

I did the  same thing to get time-dependent wavefunction using C2H2, inputs of which are taken from the samples/exercise_01 and 02 with only modifications suggested below.

Although the calculation seems fine, the cube file has some error, as the wavefunctions are found around the edge of the cube box, while the molecule is at the center of the box as attached fig. The cube files obtained with a ground state calculation before RT calculations look fine, the wavefunction is distributed around the molecule as expected.

Could you please give any suggestions?

Here are the detail of the compilation.
SALMON 2.2.0
python ../configure.py FC=mpiifort CC=mpiicc --enable-libxc --with-libxc=/home/iwasa/build/SALMON-v.2.2.0/libxc610_make
compiler: oneapi 2021.7

Libxc 6.1.0
calculation is done with OpenMP

Best regards,
Takeshi Iwasa


> 2024/03/06 10:48、Yamada Shunsuke <yamada....@qst.go.jp>のメール:

>
> Dear Fadıl,
> Perhaps, 'nstate' is the cause of the error. Could you try the same calculation but with nstate = # of occupied states? (i.e. = nelec/2 for spin-unpolarized state)
>
> The checkpoint data contains TDDFT wavefunctions corresponding to the occupied orbitals only. If 'nstate' contains unoccupied states also, SALMON intends to read undefined arrays of the unoccupied states and may fail.
>
> Sincerely,
> Shunsuke
>
> 差出人: Yamada Shunsuke <yamada....@qst.go.jp>
> 送信日時: 2024年3月6日 9:27
> 宛先: salmo...@salmon-tddft.jp <salmo...@salmon-tddft.jp>
> 件名: [salmon-user:00292] Re: TDDFT wave functions
>  Dear Fadıl,
>
> The error message says that the size of an array is too large when reading the wavefunction data. But it sounds strange because you successfully finished the TDDFT calculation with GS wavefunctions... I am not sure, sorry.
>
> I tried TDDFT wavefunction output with a very small system and it worked well (pls see an attached file). If it is not too much for you, pls retry your calculation with reduced parameters.
>
> Sincerely,
> Shunsuke
>
>
>

T. Iwasa

unread,
Dec 3, 2024, 11:54:59 PM12/3/24
to salmo...@salmon-tddft.jp
PastedGraphic-1.png

T. Iwasa

unread,
Dec 4, 2024, 2:08:28 AM12/4/24
to salmo...@salmon-tddft.jp
Dear Yamada-san

Thank you for the reply, it works.

I did the same thing with yn_periodic=“y”, and now it works fine, although the cube file looks like attached. We may shift the position of molecule so that the molecule come to the box center or add some changes to the code in the future.

Best,

T. Iwasa

PastedGraphic-1.png

SIYUAN LI

unread,
Feb 9, 2025, 8:18:04 PMFeb 9
to salmo...@salmon-tddft.jp
Dear Yamada-san,

This is Li Siyuan from the University of Tokyo. Thank you so much for your method to obtain the wave functions during the real time calculation.

After running the DFT calculation for the binary data in TDDFT as you mentioned, I got a series of cube files named as psi_kXXXX_obXX_spin1_real(image).cube. I just sum up the value given by each K point on a specific orbital to get the orbital function but the results show asymmetry in the wavefunction of the graphene orthogonal unit cell in my case. I am not sure whether I lost something important or not. The attachment are the input and output file for DFT calculation.

Have a nice day!

Best regards,
Li Siyuan
phi_GS.log
phi_gs.inp

SIYUAN LI

unread,
Feb 11, 2025, 3:05:25 AMFeb 11
to salmo...@salmon-tddft.jp
Dear Yamada-san,

Thank you so much for your suggestion and code. I will try it in my case.

Best regards,
Li Siyuan

2025年2月10日 9:23,Yamada Shunsuke <yamada....@qst.go.jp> 写道:

Dear Li-san,

Thank you for the question. At first glance, your input file looks OK. The atomic coordinates and r-grid seem to be appropriate to maintain the symmetry.
I am not sure but the asymmetry might be due to the very sparse r-grid and its position when plotting the voxel data.
For smoothing and visualizing voxel data, pls see the following thread:

Sincerely,
Shunsuke

差出人: SIYUAN LI <lisiyua...@gmail.com>
送信日時: 2025年2月6日 12:15
宛先: salmo...@salmon-tddft.jp <salmo...@salmon-tddft.jp>
件名: [salmon-user:00325] Re: TDDFT wave functions
 
Reply all
Reply to author
Forward
0 new messages