vibeqc.SmearingOptions

class vibeqc.SmearingOptions(temperature=0.0, flavor='fermi-dirac', mp_order=1, source='explicit', reason='')[source]

Bases: object

Canonical user-facing smearing configuration.

temperature is the electronic energy k_B T in Hartree (matching the v0.4.0 contract on the C++ options surface). temperature == 0.0 disables smearing — drivers fast-path on it.

flavor selects the occupation function. "fermi-dirac" is the only flavor implemented at v0.10.x; "methfessel-paxton" (M6) and "marzari-vanderbilt" (M7) construct without erroring so user code can pre-stage settings, but apply_smearing raises NotImplementedError until the relevant milestone lands.

mp_order is the Hermite-polynomial order for Methfessel-Paxton; ignored for other flavors.

source and reason mirror SmearingResolution so SCF logs can say “preset:metal” or “explicit:kelvin” rather than just a number.

Parameters:
__init__(temperature=0.0, flavor='fermi-dirac', mp_order=1, source='explicit', reason='')
Parameters:
Return type:

None

Methods

__init__([temperature, flavor, mp_order, ...])

from_legacy_kwarg(smearing_temperature, *[, ...])

Build from the v0.4.0 smearing_temperature: float kwarg.

from_user([value, unit, flavor, mp_order, ...])

Resolve user-facing temperature input to canonical options.

Attributes

enabled

True when smearing is active (temperature > 0).

flavor

mp_order

reason

source

temperature

temperature: float = 0.0
flavor: str = 'fermi-dirac'
mp_order: int = 1
source: str = 'explicit'
reason: str = ''
property enabled: bool

True when smearing is active (temperature > 0).

classmethod from_legacy_kwarg(smearing_temperature, *, flavor='fermi-dirac', mp_order=1)[source]

Build from the v0.4.0 smearing_temperature: float kwarg.

This is the internal driver-side constructor that bridges the legacy C++ option field to the new Python dataclass without involving the user. No deprecation warning here — the warning fires at the user-facing kwarg boundary.

Parameters:
  • smearing_temperature (float)

  • flavor (str)

  • mp_order (int)

Return type:

SmearingOptions

classmethod from_user(value=0.0, *, unit='hartree', flavor='fermi-dirac', mp_order=1, metallic=None, band_gap_hartree=None, n_electrons=None)[source]

Resolve user-facing temperature input to canonical options.

Accepts everything resolve_smearing_temperature accepts (numeric width, "1000 K", "0.1 eV", "metal", "auto", etc.).

Parameters:
Return type:

SmearingOptions