vibeqc.write_xsf_volume¶
- vibeqc.write_xsf_volume(path, system, *, data, name='scalar', origin=None, span=None)[source]¶
Write a periodic XSF file with a single 3D scalar grid.
- Parameters:
system (vibeqc._vibeqc_core.PeriodicSystem) – Crystal structure.
data (ndarray) – Scalar values on a 3D grid, shape
(n1, n2, n3). By default the grid is assumed to span exactly one unit cell with origin at the lattice origin (the most common case for densities).name (str) – Tag used in the
BEGIN_DATAGRID_3D_<name>block; pick something descriptive like"density"or"mo_homo".origin (ndarray | None) – Bohr coordinates of the (0, 0, 0) voxel. Defaults to (0, 0, 0).
span (ndarray | None) –
(3, 3)matrix; rows are the three spanning vectors of the grid in bohr. Defaults to the lattice vectors.
- Return type:
Notes
XSF expects the grid to be a fully-periodic sample — the value at voxel (n1−1, j, k) repeats voxel (0, j, k). When you build the grid with
vibeqc.LatticeCell()etc., remember to not include the duplicate boundary point.