Skip to content

Property value and Variables

Every PhysicalProperty exposes a value quantity for its main data. value holds the dependent quantity that the property represents, expressed in its natural unit: the energy for a TotalEnergy, the force for Forces, the permittivity for Permittivity, the eigenvalues for ElectronicEigenvalues. When defining a new property, value is the quantity the property is named for and computes, not one of its axes or an auxiliary label. The base leaves value abstract (value = None); each concrete property overrides it with a Quantity whose type, unit, and shape are specific to that property — its definition co-varies with the class, as ElectronicEigenvalues, MolecularOrbitals, and SpectralProfile all do.

The independent variables a property varies over are not stored in value. They are modeled as Variables subsections — Energy, Frequency, KMesh, Temperature, and the other subclasses in variables.py — each discretized by n_points and points. These grids set the shape of value: an ElectronicDensityOfStates carries its energy grid as an Energy subsection, and value is the density of states evaluated on that grid.

A single physical dimension can play either role depending on the property, so decide by whether the quantity is a prescribed grid or a computed result. Energy is an independent axis for an ElectronicDensityOfStates (a grid the DOS is sampled on, hence a Variables subsection) but a dependent result for ElectronicEigenvalues (a computed eigenvalue, hence value). MolecularOrbitals follows the eigenvalue case: its value is the orbital energies over the n_mo orbital index, with occupations carried as a companion quantity, mirroring ElectronicEigenvalues.

Auxiliary per-point quantities — occupations alongside eigenvalues, error estimates, symmetry labels — stay as their own quantities on the section rather than being folded into value. Reserve value for the one quantity the property is defined to represent.