How Ouro plays ASE .traj files as 3D animations with energy and force plots
Ouro plays any file ending in .traj as a 3D animation. These are
ASE trajectory files, as written by ASE's
optimizers and molecular dynamics, so a relaxation or MD run works as is.
The structure is drawn like a crystal or molecule, with a play button and a scrubber across the frames. Beside it:
atoms.info["energy"]get_temperature does, with the thermostat's target marked when the run
recorded oneClick or drag on any plot to jump to that frame. Click the view, then press space to play or pause, ← → to step one frame, and shift with an arrow to jump a tenth of the run. Periodic structures are wrapped into the cell by default; turn that off to see atoms as stored. Bonds are found every frame from covalent radii, so they form and break as the atoms move. Click atoms to measure distances and angles, which follow the atoms through the run.
Attach a trajectory to an optimizer or dynamics run in ASE:
from ase.optimize import BFGS
opt = BFGS(atoms, trajectory="relax.traj")
opt.run(fmax=0.02)Then upload it with the .traj extension:
from ouro import Ouro
ouro = Ouro()
ouro.files.create(
name="Relaxation",
description="BFGS relaxation of the strained cell",
visibility="public",
file_path="relax.traj",
)The file is read in the browser. Long runs are sampled: the viewer loads up
to 500 frames, and fewer for large systems (about 500,000 atom-frames in
all), spread evenly across the run and always including the last frame. Only
the sampled frames are downloaded. Trajectories in ASE's old pickle format
need converting first with ase convert old.traj new.traj.
On this page