rt-tddft calculation: help to produce cube files.

47 views
Skip to first unread message

Angelo Raymond Rossi

unread,
Sep 24, 2025, 8:01:43 PMSep 24
to NWChem Forum
Hello Everyone:

The input for rt_tddft below with work to produce the following unreadable binary "cube" files:  both.ptot_ao_re.0000000001, both.ptot_ao_re.0000000002, and both.ptot_ao_re.0000000003. A snippet of the output file is given below: 

echo
start both

geometry "system" units angstroms nocenter noautoz noautosym
  O  0.00000000  -0.00001441  -0.34824012
  H -0.00000000   0.76001092  -0.93285191
  H  0.00000000  -0.75999650  -0.93290797
end
set geometry "system"

basis spherical
  * library 6-31G
end

dft
 iterations 200
 grid nodisk
 direct
 mulliken
 xc pbe0
end

task dft energy

unset dplot:*                # no spaces around the colon
dplot                              # MINIMAL DPLOT (settings only)
  title rt-density-diff
  gaussian                     # => ASCII Gaussian CUBE format
  limitxyz
  -10 10 101
  -10 10 101
  -10 10 101
# densmat both.ptot_ao_re.0000000001
# output both.cube
end

#unset rt_tddft:*
rt_tddft
  dt   0.2
  tmax 0.6                   # last_time + 2*dt
  tag  "driver"
   field "driver"
    type gaussian
    polarization z
    frequency 0.3768
    center 393.3
    width  64.8
    max    0.0001
  end

  visualization
    tstart     0.0
    tend       0.6          # last_time = tend = 0.6
    treference 0.0
    dplot                      # 
 end

 excite "system" with "driver"
end

task dft rt_tddft

.
.
.
driver      0.40000        ### Checks passed ###
driver      0.40000        ### Saved density matrix snapshot ###
driver      0.40000   0.000000000000E+000   0.000000000000E+000   1.561292702766E-013     # Applied E-field [system] (alpha spin)
driver      0.40000   0.000000000000E+000   0.000000000000E+000   1.561292702766E-013     # Applied E-field [system] (beta spin)
driver      0.40000   9.178262873922E+000     # Enuc
driver      0.40000  -1.230047523836E+002     # Ecore
driver      0.40000   4.679776641671E+001     # Ecoul
driver      0.40000  -9.272472277033E+000     # Exc(1)
driver      0.40000   0.000000000000E+000     # Exc(2)
driver      0.40000  -7.630119537001E+001     # Etot
driver      0.40000   9.521272659185E-012     # Eadded
driver      0.40000   1.552562620048E-014   3.635834538296E-005  -9.845893363333E-001     # Dipole moment [system]
driver      0.40000        ### Saved restart file ###
driver      0.40000   3.552935723405E-012     # Magnus interpol (matrix 1 of 1)
driver      0.40000                     2     # Magnus total interpolations
driver      0.60000        ### Propagation finished ###

The calculation almost works but stops before it computes cube files.  Could you please help me with this?   Does someone have a complete rt-tddft file which produces cube files?  Or could someone point out more generally what is needed to make this work.

Thanks so much for your help with this.

Kind regards,
Angelo

Edoardo Aprà

unread,
Sep 24, 2025, 9:09:17 PMSep 24
to NWChem Forum
Thanks for reporting this issue.
I have filed a github issue about it. 
A fix is in the works.

Angelo Raymond Rossi

unread,
Oct 23, 2025, 1:21:14 PM (14 days ago) Oct 23
to NWChem Forum
Dear Edoardo Apra,

Thanks for obtaining a fix for the formation of cube files during an rt-TDDFT calculation.

Is there a patch file for this problem, or is there a work-around that one can use to get cube files?  I am willing to recompile NWChem after apply the patch.
Interestingly, there is an excellent article "Attochemistry Regulation of Charge Migration, J. Phys. Chem. A 2023, 127, 1894-1900 with Kenneth Lopata as the principle
author.  Lopata and Govind are the developers of rt-TDDFT in NWChem.

I have attached the image of the graphical component of this article.  There, one can see the movement of charge density from one end of the molecule to the other end as the simulation progresses.  I think this had to be computed by computing the cube files (visual charge densities) during the simulation.  The text and supplementary information doesn't mention how this was computed.

Actually, I am somewhat surprised that the problem of computing cube files hasn't arisen previously, given that rt-TDDFT in NWChem is so popular.  I would love to be able to compute cube files as one progresses through an rt-TDDFT calculation.  Are there workarounds?  For example, can one perform a two-step calculation:  Step1 - perform the rt-TDDFT calculation
with NO DPLOT property calculation; Step2 - perform a second  rt-TDDFT calculation but invoking DPLOT?   

Thank you, again.

Kind regards,

Angelo
jpca3c00568-abstract-image.png

Edoardo Aprà

unread,
Oct 23, 2025, 4:00:51 PM (14 days ago) Oct 23
to NWChem Forum
The fix for this problem will appear in the upcoming 7.3.0 release.
We should be able to get 7.3.0 out later this week.

Angelo Raymond Rossi

unread,
Oct 26, 2025, 9:40:48 AM (11 days ago) Oct 26
to NWChem Forum
Dear Edoardo,

I downloaded NWChem 7.3.0 and compiled it.

The test deck for rt-TDDFT that I provided earlier now works to produce cube files!  HOOOORAY!!!!  

Thank you for fixing this problem.

Regards
Angelo

Angelo Raymond Rossi

unread,
Oct 31, 2025, 4:25:11 PM (6 days ago) Oct 31
to NWChem Forum

Hello Again.

As I stated in my last message, NWChem does produce cube files, but there are still some issues ... I think.
Here is my input file:
rt_job.movecsecho
start rt_job


geometry "system" units angstroms nocenter noautoz noautosym
  O  0.00000000  -0.00001441  -0.34824012
  H -0.00000000   0.76001092  -0.93285191
  H  0.00000000  -0.75999650  -0.93290797
end
set geometry "system"

basis
  * library 6-31G
end

dft
  xc pbe0
end

task dft energy

unset dplot:*                 # no spaces around the colon
dplot                         # MINIMAL DPLOT (settings only)
  title rt-density-diff
  gaussian                    # => ASCII Gaussian CUBE format
  limitxyz
  -5 5 50
  -5 5 50
  -5 5 50
   vectors rt_job.movecs
end

rt_tddft

  print dipole field energy convergence charge
  nprints *
  tag "hope"
  dt   0.20
  tmax 20.4                   # last_time + 2*dt

  field "driver"
    type gaussian
    polarization zrt_job.ptot_ao_re.0000000001

    frequency 0.3768
    center 393.3
    width  64.8
    max    0.0001
  end

  excite "system" with "driver"

  visualization
    tstart     0.0
    tend       2.2    # last_time + dt; frames through 20.0
    treference 0.0
    dplot             # post-process density matrices into cube files after propagation
  end
end

task dft rt_tddft

It provides these files:
density_subgs.0000000001.cube
...
density_subgs.0000000011.cube

and 

rt_job.ptot_ao_re.0000000001
...
rt_job.ptot_ao_re.0000000012

All the cube files look like this:

Cube file generated by NWChem
 t =  0.0000000E+00 au =  0.0000000E+00 fs
    3   -9.448633   -9.448633   -9.448633
   51    0.377945    0.000000    0.000000
   51    0.000000    0.377945    0.000000
   51    0.000000    0.000000    0.377945
    8    8.000000    0.000000   -0.000027   -0.658078
    1    1.000000    0.000000    1.436212   -1.762834
    1    1.000000    0.000000   -1.436185   -1.762940
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
  0.00000E+00  0.00000E+00  0.00000E+00
...
...

i.e. there are all zeros after the coordinates.

Can you help me with this?  

I tried many DPLOT    ...  END  possibilities.

I am probably making an obvious mistake.  Any help you can provide would be great.

Kind regards,

Angelo

Angelo Raymond Rossi

unread,
Oct 31, 2025, 4:25:37 PM (6 days ago) Oct 31
to NWChem Forum
I also tried forming a cube file from one density file:

echo
start rt_job_plot


geometry "system" units angstroms nocenter noautoz noautosym
  O  0.00000000  -0.00001441  -0.34824012
  H -0.00000000   0.76001092  -0.93285191
  H  0.00000000  -0.75999650  -0.93290797
end
set geometry "system"

basis
  * library 6-31G
end

dft
  xc pbe0
end

task dft energy

unset dplot:*                 # no spaces around the colon
dplot                         # MINIMAL DPLOT (settings only)
  title rt-density
  gaussian                    # => ASCII Gaussian CUBE format
  limitxyz
  -5 5 50
  -5 5 50
  -5 5 50
   spin total
   densmat rt_job.ptot_ao_re.0000000001
   output rt_job_ptot_01.cube
end

task dplot

and this produced a correct cube file.

Regards,

Angelo
rt_job_ptot_01.png
Reply all
Reply to author
Forward
0 new messages