﻿# ASE stress Voigt order must be mapped before tensor reshaping

ASE stress Voigt order must be mapped before tensor reshaping. A focused scientific-computing guide with the documented mechanism, a reproducible validation scenario, evidence and operational limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/science-ase-stress-voigt-order-tensor/
Language: en

ASE stress output uses a documented Voigt component order by default. A learning pipeline that assumes another ordering can train against permuted shear components while every array still has the expected length. Converting a compact stress vector into a tensor requires a named component mapping, not an arbitrary reshape or a convention borrowed from another scientific library.

## The scientific interface

The Atoms.get_stress interface gives the order xx, yy, zz, yz, xz, xy or a full matrix when the corresponding option is selected. The inspected stress conversion implementation explicitly maps normal and shear entries. Stress and strain compact conventions also should not be assumed interchangeable merely because both use Voigt terminology. Tensor symmetry does not identify the intended permutation by itself. An isotropic or diagonal-only fixture can conceal a wrong shear ordering because the affected values may be equal or absent.

## Implementation details

Record component order, units and stress convention in the target schema. Use the supported full-matrix result or a reviewed explicit conversion, keeping the inverse transformation testable. Preserve any constraint or kinetic contribution options that affect what stress is returned. Do not normalize components independently without retaining how the physical tensor is reconstructed. When importing another calculator's output, validate its convention rather than renaming its vector as ASE stress. Keep per-configuration and per-atom quantities separate, since similar shapes and names do not establish the same physical target.

## A constructed validation case

Construct a symmetric stress tensor with distinct normal and shear values. Compare the declared compact representation with the supported full-matrix form and a reviewed round trip. Add a deliberately different Voigt ordering and a strain-conversion misuse as negative cases. Acceptance requires correct component identity and reconstruction, not just symmetry or a vector of the expected length. Preserve the exact convention with the fixture so a future model export cannot silently change shear labels while passing ordinary shape validation.

## Numerical and data limits

Correct Voigt mapping does not validate a force field, physical state or stress calibration. Those require separate scientific checks. It establishes the representation of the training target so a component permutation is not mistaken for model error, anisotropy or unstable scientific GPU inference.

## Primary references

[ASE Atoms numerical and structural properties](https://docs.ase-lib.org/ase/atoms.html); [ASE stress tensor and Voigt conversion implementation](https://gitlab.com/ase/ase/-/raw/master/ase/stress.py).

This is a proposed scientific-interface validation, not an executed Retrivium benchmark. Preserve the implementation version and unresolved outcomes; interface documentation does not establish the accuracy or performance of a scientific model.

## Related reading

[CHGNet energy: distinguish per-atom predictions from ASE total energy](/journal/fg2-chgnet-intensive-energy-ase-total-conversion/); [Tensor axes in a language model: batch, sequence and hidden width](/journal/tensor-axes-batch-sequence-hidden/).
