[gpaw-users] a write problem
Yuelin Li
ylli at aps.anl.gov
Wed Jan 19 17:36:18 CET 2011
Thanks. Now it worked, though not much to see for this example. Best. Yuelin
On 1/19/2011 9:52, Christian Glinsvad wrote:
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20110119/2b6f8193/attachment.html
More information about the gpaw-users
mailing list