httk.atomistic.models.species.species¶
Species definition for httk-atomistic, mirroring the OPTIMADE species entry.
Attributes¶
Classes¶
A chemical species occupying one or more sites, mirroring the OPTIMADE |
Module Contents¶
- type httk.atomistic.models.species.species.ExactInput = fractions.Fraction | int | float | decimal.Decimal | str¶
- type httk.atomistic.models.species.species.PrecisionInput = ExactInput | None¶
- type httk.atomistic.models.species.species.DecorationInput = fractions.Fraction | int | str | None¶
- class httk.atomistic.models.species.species.Species(name, chemical_symbols, concentration, mass=None, original_name=None, attached=None, nattached=None, concentration_precision=None, charges=None, spins=None, labels=None)[source]¶
Bases:
httk.atomistic.models.species.backend.SpeciesBackendA chemical species occupying one or more sites, mirroring the OPTIMADE
speciesobject.A species has a
name(unique within a structure; it need not be a chemical symbol), a list ofchemical_symbolscomposing it, and a matching list of non-negativeconcentrationvalues. Concentrations on represented sites must lie in[0, 1]; an unrepresented species may instead carry an aggregate implicit-atom count. Each chemical symbol is an element symbol, or one of the pseudo-symbols"X"(unknown) or"vacancy". The optionalmass,attached,nattached, andoriginal_namefields carry the remaining OPTIMADE species information;attachedandnattachedmust be given together and share their length.charges,spins, andlabelsare optional aligned decorations. An all-Nonedecoration is canonicalized toNone. Repeated chemical symbols are accepted only when the complete decoration distinguishes them.- Parameters:
name (str) – The species name.
chemical_symbols (collections.abc.Sequence[str]) – The constituent chemical symbols.
concentration (collections.abc.Sequence[ExactInput]) – The constituent occupancies.
mass (collections.abc.Sequence[float | int] | None) – The constituent masses, if stated.
original_name (str | None) – The source name, if stated.
attached (collections.abc.Sequence[str] | None) – The attached constituent symbols, if stated.
nattached (collections.abc.Sequence[int] | None) – The counts corresponding to
attached, if stated.concentration_precision (collections.abc.Sequence[PrecisionInput] | None) – The precision of each occupancy, if stated.
charges (collections.abc.Sequence[DecorationInput] | None) – The charge decoration, if stated.
spins (collections.abc.Sequence[DecorationInput] | None) – The spin decoration, if stated.
labels (collections.abc.Sequence[str | None] | None) – The label decoration, if stated.
- concentration: tuple[fractions.Fraction, ...] = ()¶
- concentration_precision: tuple[fractions.Fraction | None, ...] | None = None¶
- charges: tuple[fractions.Fraction | None, ...] | None = None¶
Assigned charge numbers for the constituents, or
Noneif unstated.A
Noneelement means the charge of that constituent is unstated; whole-Nonemeans no constituent charges are stated. Values use elementary-charge units, for example a formal oxidation state.- Returns:
The constituent charges, or
Nonewhen unstated.
- spins: tuple[fractions.Fraction | None, ...] | None = None¶
Idealized signed spins assigned to the constituents, or
Noneif unstated.A
Noneelement means the spin of that constituent is unstated; whole-Nonemeans no constituent spins are stated. This is distinct from a calculated site magnetic moment.- Returns:
The constituent spins, or
Nonewhen unstated.
- labels: tuple[str | None, ...] | None = None¶
Free-form per-constituent labels, or
Noneif unstated.A
Noneelement means that constituent has no stated label; whole-Nonemeans no constituent labels are stated.- Returns:
The constituent labels, or
Nonewhen unstated.
- property normalized: bool¶
Whether the stated concentration interval contains one.
- Returns:
Whether the concentrations are normalized within their precision.
- Return type:
- property normalization_status: str¶
Report the concentration normalization status.
- Returns:
exact,within_precision, oroutside_precision.- Return type:
- property normalization_diagnostic: Any¶
Return a structured normalization diagnostic when needed.
- Returns:
The diagnostic, or
Nonewhen the concentrations are normalized.- Return type:
Any
- property is_single_element: bool¶
Whether this species is a single, unattached, real chemical element.
True only for a species composed of exactly one element symbol (not
"X"or"vacancy") with no attached particles. Such species are the ones that can be represented as a bare atomic number in the primitive representation.- Returns:
Whether this is a single real element.
- Return type:
- without_charges()[source]¶
Return an EXPLICIT lossy projection that drops declared oxidation states.
The other species fields, including spins and labels, are preserved. A species without declared charges is returned by identity.
- Returns:
A charge-free species, or this species when already charge-free.
- Return type: