[gpaw-users] a write problem

Christian Glinsvad christian.glinsvad at fysik.dtu.dk
Wed Jan 19 16:52:26 CET 2011


Yuelin Li wrote:
> See below. Thanks.
> 
> On 1/19/2011 2:27, Christian Glinsvad wrote:
>> That's really just a sanity check that the .ftd file contains data up 
>> to the same time "t" as the .gpw file was propagated to. You can just 
>> go ahead and comment out the line in GPAW which raises the error (cf. 
>> the traceback) 
> 
> I do not think I know how to do this and if I want to do this at my 
> current level of understanding of the code ...
> 

Nevermind then; I went ahead and implemented the change for you (r7568).
As I mentioned, this difference won't matter when you're just extracting
the density fourier transform data but is important when you wish to
resume the time propagation to add more data e.g. like this:


from gpaw.tddft import TDDFT
from gpaw.tddft.fourier import DensityFourierTransform

time_step = 4.0                  # 1 attoseconds = 0.041341 autime
iterations = 5000                # 5000 x 4 as => 20 fs
frequencies = [4.26,6.27,13.0, \
                16.9,18.1,19.9]   # Pre-determined peak frequencies in eV
sigma = 0.05                     # Width of Gaussian envelope in

# Read restart file with result of previous propagation
td_calc = TDDFT('bda_td.gpw')

# Create and attach Fourier transform observer
obs = DensityFourierTransform(timestep, frequencies, sigma)
obs.initialize(td_calc)

# Read previous result of the corresponding Fourier transformations
obs.read('bda_fourier.ftd')

# Propagate more, appending the time-dependent dipole moment to the
# already existing 'bda_dm.dat' and use 'bda_td2.gpw' as restart file
td_calc.propagate(time_step, iterations, 'bda_dm.dat', 'bda_td2.gpw')

# Save result of the improved Fourier transformations to an .ftd file
obs.write('bda_fourier2.ftd')

>> or use a compatible .ftd and .gpw file. 
> 
> The files are compatible from the same run.

Actually 'bda_gs.gpw' is time=0 because propagation starts from it
whereas 'bda_fourier.ftd' is time>0 because it's the result of
propagation from time=0 to some larger time. In the BDA-example given,
'bda_td.gpw' contains a periodic dump of the TDDFT calculator, but it is
advised to end with calc.write('bda_td.gpw', mode='all') to make sure
you have saved the very last propagation step.

> Here is the complete screen dump
> ylli at ubuntu:~/Documents/TDDFT$ ./extract_ftd.py bda_fourier.ftd bda_gs.gpw
> Usage:
>     extract_ftd.py FTDFILE GPWFILE
> 
> Arguments:
>         FTDFILE    Fourier transformed density tar-file.
>         GPWFILE    GPAW calculation tar-file (optional).
> 
> ERROR: Time is incompatible.
> ylli at ubuntu:~/Documents/TDDFT$
> 
>> The latter option is of course only intended to be a requirement if 
>> you're resuming both TDDFT and density fourier transform in order to 
>> continue propagating.
>>

Regards
Christian Glinsvad


More information about the gpaw-users mailing list