Unit cells, PBC and supercells
Set boundary conditions, repeat a physical structure or display more periodic images. Open Style > Cell. Choose the operation according to whether the exported ASE structure should change.
Cell and periodic boundary conditions
Under Style → Cell, inspect the six lattice parameters, style the drawn cell and set replication. In Edit, enter all three cell vectors and PBC flags. Setting a cell does not scale Cartesian atom coordinates. Wrap maps atoms into periodic directions of their own current frame.
Wrap, repetition and fractional translation use each affected frame’s own cell. Set Unit Cell assigns the entered cell and PBC to every editable frame. Use a single-frame document if other frames should retain different cells.
Align the cell with Cartesian axes
In Edit, choose Align a with +X and ab with XY in Style → Cell or
Build → Cell matrix. Open Axes in the left sidebar to find the same action
under Display & guides. You can also right-click a cell edge or lattice
axis, select the viewport’s angle between a and +X, or search Find tools for
to_new_cell. The compass at the lower left shows the lattice axes and the
angle between a and +X. Auto displays the compass when a differs
from +X or the ab plane is tilted from XY. Show and Hide override Auto.

The operation places a along +X and b in the XY plane, with a positive Y component. A left-handed cell is reflected so c has a positive Z component. A slab with a zero, nonperiodic c retains that zero vector. The atoms follow the transformed cell and wrap along periodic directions. Decimal places rounds the cell entries to 13 places by default. Clear the field to keep full precision.
Each editable frame uses its own cell, and one Undo restores the trajectory. An invalid cell, incompatible constraint, loaded volumetric grid or active relaxation can prevent alignment. Python API
Displayed and physical supercells
Display replication
The displayed supercell repeats visual instances for inspection, measurement, styling, and composition. It is saved as a display setting. In View, replicas can be selected and hidden independently. In Edit, replica selection resolves to the unique base atom.
Display replication does not change len(atoms), coordinates, constraints,
or the exported physical structure.
Physical supercell
Use the physical replication/commit action when the ASE object must contain the repeated atoms. Diagonal repetitions and general integer 3×3 supercell matrices are validated against cell rank, atom-count limits, arrays, labels, and supported constraints. This is a topology-changing Edit operation and is added to history. Check directional and cross-boundary restraints after materializing the new cell. Constraint behavior.
Visual and physical translation
Visual translation changes only where the rendered scene appears. It can be Cartesian or fractional and is stored with display settings.
Build → Rigid translation changes selected or all ASE coordinates in the current frame or all frames. Semantic
translate-alldefaults to all frames without changing the cell. Fractional vectors use the full non-orthogonal cell matrix.
Use visual translation for composition/alignment and physical translation when the saved coordinates themselves must move.
Cell operations: choose the correct one
Goal |
GUI/API state |
Changes ASE data? |
|---|---|---|
Show repeated images |
Replicate cell / |
No |
Visually offset atoms and overlays |
translation controls / |
No |
Put selected COM at scene origin |
Selection COM to Origin |
No |
Move selected or all atoms but keep cell |
Build → Rigid translation / |
Yes |
Wrap into the cell |
Wrap Atoms Into Cell / |
Yes for the affected frame(s) |
Make diagonal repeats the real cell |
Set Supercell as Cell / |
Yes |
Apply a general integer cell transform |
Build → Cell matrix / |
Yes |
Align a with +X and ab with XY |
Build → Cell matrix / |
Yes across editable frames |
Replace the cell without moving atoms |
Set Unit Cell / |
Cell/PBC only |
In View, wrap affects the active displayed frame. In Edit, trajectory-wide physical cell and translation operations operate on editable frames and are recorded as one user action. General non-diagonal cell transforms are rejected while volumetric grids are loaded because preserving those samples would require an explicit interpolation choice.
Example: compare displayed and physical repeats
Download graphene_hbn_commensurate.traj. Open it with File > Open, or run this in the folder containing the download:
v_ase gui graphene_hbn_commensurate.traj
In View, set displayed replication to
2 × 2 × 1and inspect the cell edges.The physical atom count is unchanged: these are visible periodic copies.
Return display replication to
1 × 1 × 1, switch to Edit and apply a physical diagonal supercell matrix with entries2, 2, 1.The physical atom count is now four times the input count, and both in-plane cell vectors double. Export the structure to retain that physical repetition.
A periodic bilayer provides a clear input for cell and replication exercises.