pwtools.crys.Trajectory.get_ase_atoms

Trajectory.get_ase_atoms()[source]

Return ASE Atoms object.

Obviously, you must have ASE installed. We use scaled_positions=self.coords_frac, so only self.cell must be in [Ang].

Parameters:

**kwds – additional keywords passed to the Atoms() constructor.

Notes

By default, we use Atoms(...,pbc=False) to avoid pbc-wrapping atoms.scaled_positions (we don’t want that for MD structures, for instance). If you need the pbc flag in your Atoms object, then use:

>>> # Note that the `pbc` flag is passed to ase.Atoms, so you can use
>>> # whatever that accepts, like pbc=[1,1,1] etc.
>>> atoms=struct.get_ase_atoms(pbc=True)
>>> # or
>>> atoms=struct.get_ase_atoms()
>>> atoms.set_pbc(True)

but then, scaled_positions will be wrapped by ASE and I’m not sure if atoms.positions is updated in that case. Please test that – I don’t use ASE much.