[gpaw-users] trajectory file
Troels Kofoed Jacobsen
tkjacobsen at gmail.com
Tue Mar 2 20:04:31 CET 2010
On Tue, Mar 02, 2010 at 12:43:33PM -0600, Daniel Torres wrote:
> Hi guys!
> Im using the following Py file. I notice that the trajectory file
> generated is empty. Is this normal?
> Best regards
> Dani
[snip]
> bulk.set_calculator(calc)
> traj = PickleTrajectory('cell.traj', 'w', bulk)
> relax = QuasiNewton(bulk)
> relax.run(fmax=0.01)
> energy = bulk.get_potential_energy()
Hi Daniel
You newer attach the traj object to the optimizer, so nothing is ever
written. You can do this like:
traj = PickleTrajectory('cell.traj', 'w', bulk)
relax = QuasiNewton(bulk)
relax.attach(traj)
OR
traj = PickleTrajectory('cell.traj', 'w', bulk)
relax = QuasiNewton(bulk, trajectory = traj)
OR simply
relax = QuasiNewton(bulk, trajectory = 'cell.traj')
Unless you for some reason need access to the trajectory object, I would
recommend the last as it is by far the simplest.
Best regards
Troels Kofoed Jacobsen
More information about the gpaw-users
mailing list