molfoundry.AtomId#

class molfoundry.AtomId[source]#

Bases: TSObject

Identifies a chemical element and exposes its data from the shared Atom table.

Construct one by symbol or by atomic number:

carbon = AtomId.bySymbol("C")
carbon = AtomId.byId(6)
print(carbon.protons, carbon.valenceElectrons, carbon.orbitalNames)

AtomId is also what Vertex.atomId returns. An AtomId that comes from a non-atom vertex (e.g. an electron), an unknown symbol, or an unknown atomic number is invalid: valid is False, id is available, and every element property raises LogicError.

static bySymbol(symbol)[source]#

Look up an element by symbol (e.g. "C"). Invalid if unknown.

Parameters:

symbol (str)

Return type:

AtomId

static byId(id)[source]#

Look up an element by atomic number / id (e.g. 6 -> carbon). Invalid if no element has that atomic number.

Parameters:

id (int)

Return type:

AtomId

property valid: bool#
property id: int#

The atomic number (proton count); 0 for an invalid AtomId.

property symbol: str#
property protons: int#
property electrons: int#
property standardAtomicWeight: float | None#
property mostAbundantIsotope: int | None#
property principalQuantumNumber: int#
property valenceElectrons: int#
property orbitals: List[List[int]]#

one inner list per occupied orbital, each entry a 1 (single electron) or 2 (pair).

Type:

Electron occupancy per orbital, in fill order

property orbitalNames: List[str]#

Orbital names with occupancy, e.g. ["1s2", "2s2", "2p2"].

property isotopicMasses: Dict[int, float]#

Mapping of mass number to isotopic mass. Empty when untabulated.