Import and process scalar fields
Inspect grid geometry, precision and integrals, or combine compatible fields. Use Analyze → Fields after opening Cube, CHGCAR or another supported field. Objects → Fields lists actual datasets and planes and opens their isosurface and plane property controls. See Isosurfaces or Planes for display details.
Supported inputs
Open these directly or add them to an existing document:
VASP
CHG/CHGCARcharge density;VASP
PARCHGpartial density;VASP
LOCPOTpotential;VASP
ELFCARelectron-localization field;Gaussian Cube; and
XSF
DATAGRID_3D, including Quantum ESPRESSOpp.xexports.
VASP stems accept ., _, or - calculation suffixes, including
PARCHG_band_12, LOCPOT.vacuum, and CHGCAR-difference. Use an explicit
reader for an ambiguous filename:
v_ase gui GRID --format CHGCAR
v_ase gui charge.dat --format qe-cube
v_ase gui potential.dat --format qe-xsf
Opening a volumetric file creates the associated atomic structure and one or more scalar dataset descriptors. In an existing document, use Analyze → Fields → Add Grid Data or Objects → Fields → Import field.
Choose precision before import
Import precision and the CLI option select storage precision while reading:
v_ase gui CHGCAR --volumetric-precision fp32
v_ase gui CHGCAR --volumetric-precision fp64
Python exposes the same choice:
from v_ase.visualize import view
view("CHGCAR", volumetric_precision="fp64")
FP32 is the lower-memory default.
FP64 preserves double-precision input and uses twice the grid memory.
Changing a display control later does not convert the stored dataset. Verify the descriptor’s precision and backend memory size after loading.
Dataset state
Each dataset has a stable ID and reports scientific metadata including:
source name and canonical format;
quantity, component, units, and precision;
grid dimensions, cell, origin, and PBC;
endpoint convention and memory bytes;
minimum, maximum, mean, and integral; and
fixed 256-bin raw and absolute-value histograms.
Histogram counts sum to the source voxel count and remain unchanged when isosurface, plane, camera, color, or opacity settings change. Select datasets by ID rather than list position when automating a multi-grid document. A multi-configuration VASP CHG opens as a trajectory with its fields associated with their source frames. To attach it to a trajectory already open, use Analyze → Fields → Add Grid Data. Its first configuration attaches to the current frame, and later configurations attach to successive frames. Each field must match its target frame’s cell and PBC. The import stops if there are too few frames or any target is incompatible.
Interpret the integral
VASP charge grids are divided by cell volume on import; their integral equals
the average raw grid value (the electron count for an ordinary total-charge
grid). LOCPOT values retain eV and are not divided by volume. Cube and XSF
retain their reported/native scalar units; do not infer an electron count from
an unlabeled field. For a density in electrons/bohr³, convert the samples to
electrons/ų before multiplying by the ų volume. Check VASP total charge
against the calculation’s NELECT. VASP CHGCAR definition.
For noncollinear VASP calculations, the three magnetization grids follow the
spinor basis set by SAXIS. v_ase labels them in file order. Convert them
before reporting Cartesian components if a rotated spin axis was used.
VASP spin-coordinate convention.
Ordinary standalone Cube files default to finite axes and record that
assumption. CASTEP Cube exports retain their recognized periodic convention.
Choose a Cube scalar grid reader with known axes in File → Open, or
pass pbc=[...] to read_volumetric_file in Python. XSF retains each named
DATAGRID_3D in file order and uses structural PBC when available. An
unmarked grid attached to a compatible structure inherits its PBC.
Endpoint-exclusive grids use equal voxel weights. For endpoint-inclusive grids,
periodic closing planes are excluded once, while finite axes use trapezoidal
half weights at both endpoints. The determinant of the complete triclinic cell
supplies the volume Jacobian. mean is the arithmetic mean of stored samples;
it need not equal the integration-weighted mean on an endpoint-inclusive grid.
Source grids are immutable analysis inputs
Isovalue changes, Gaussian smearing, mesh smoothing, color, opacity, and planar sampling operate on display products. They do not replace the stored FP32/FP64 scalar field, its integral, or the arrays used in a linear combination.
Example: verify field subtraction without changing the grid
Download graphene-pi.cube. Open the same file as two datasets,
A and B, so their cell, origin and grid match exactly.
Open Analyze → Fields → Combine. Set A to + Add and B to − Subtract, both with Scale 1. Since these are copies of one file, confirm their matching native scalar units.
Create a new derived dataset; preserve both sources.
Check that the resulting range and integral are zero within roundoff.
A zero field has no nonzero signed isosurface. This is a useful consistency exercise; a scientific difference density requires appropriately defined full-system and fragment calculations on a compatible grid.
The analytic source field before the subtraction exercise; this is not the zero-field result.
Combine compatible datasets
Combination accumulates bounded slabs in FP64 and rounds once to the requested output precision. FP32 remains the memory-saving default when all inputs are FP32; import FP64 before subtraction when small differences matter. Converting an already rounded FP32 source later cannot recover lost input digits.
Open Analyze → Fields → Combine, or Objects → Fields → Combine fields…. Choose + Add, − Subtract, or Exclude for each dataset. Scale multiplies the selected term, with 1 as the default. For A + B − C, add A and B, subtract C, and verify the displayed expression before choosing Combine Fields. For A + B − 0.5 × C, enter 0.5 in C’s Scale field.
A common charge-density difference uses one positive and two negative terms:
Δρ = ρ_combined - ρ_fragment_A - ρ_fragment_B
Grid dimensions, PBC flags, endpoint convention and unit strings must match. For cell components the comparison allows an absolute tolerance of 10⁻⁶ Å and a relative tolerance of 10⁻⁶. Origins have an absolute tolerance of 10⁻⁶ Å. The values at matching indices are combined directly without resampling. Frame-bound inputs must belong to one trajectory frame. A combination may also use a field with no frame binding. The result retains the common frame binding. Its surface and planes hide when another frame is displayed.
To compare fields computed at different configurations, open a separate single-frame reference document. Import each co-registered field separately from a single-configuration file into that document. Those imports stay frame-independent, so you can combine the fields on the common grid. Check origin, cell, PBC, units and physical alignment before comparing.
Cube and XSF use file_native for unspecified units. Combining such fields
requires explicit confirmation that their physical quantities and units
match. Use the matching-units checkbox in the inspector,
assume_compatible=True in Python, or assume_compatible: true in REST.
The quantity is reported as a charge-density difference only for a
verified charge-density subtraction.
With no requested precision, a combination promotes to FP64
if any input is FP64; otherwise it remains FP32. The new dataset receives its
own stable ID, descriptor, and histogram. The inspector selects the result.
If the result crosses zero, its initial surface uses both signs, and the
Positive (+) color and Negative (−) color controls style the lobes
independently. Source datasets remain available.
Cell, replication, and reset behavior
Visual display.supercell repeats the isosurface and planes with the atoms
without changing stored data. Visual translation moves atoms, bonds,
constraints, surfaces, and planes together.
Set Supercell as Cell physically repeats atoms and every stored volumetric grid for a diagonal integer repetition, with one atomic Undo entry. A general non-diagonal cell matrix is rejected while grids are loaded because an explicit scientific interpolation policy would be required.
After a materialized diagonal supercell, RESET COORDS restores the original atoms, cell, and scalar grids together. Undo/Redo preserves the atom/grid pairing.
Save and export volumetric work
Reopening a project restores and samples all visible saved planes before the document reports ready, so its first render includes the same planar rasters.
A .vase project retains stored datasets, precision, current frame, visual
settings, and supported analysis state without pickle. A project-embedded HTML
save contains the complete validated .vase plus a browser-ready view.
Lightweight HTML contains the rendered/view-only scene but is not a lossless
editable scalar-grid interchange.
For a figure with isosurfaces or sampled planes, export a PNG or lossless WebP from the Render Area. A project HTML poster can show the field, and its embedded project restores it in v_ase. The standalone interactive HTML scene does not reconstruct field meshes or plane rasters after the poster disappears.
Limits and failure behavior
A scalar array must be three-dimensional with at least two samples per axis.
The default source-grid ceiling is 134,217,728 points. Override
V_ASE_MAX_VOLUMETRIC_POINTSonly after confirming available memory.The default surface safety ceiling is 2,000,000 triangles per surface.
Smearing is limited to 0–8 voxels; smoothing to 0–30 passes.
Semantic surface step is 1, 2, or 4; plane resolution is 128, 256, 512, or 1024.
Dataset removal requires an exact stable ID.
Relative semantic paths cannot escape the GUI launch directory.
Constant fields remain stored but cannot produce an isosurface crossing.
A mismatched linear combination or invalid plane edit is rejected without partially mutating the document.