stk.Atom
- class stk.Atom(id, atomic_number, charge=0)[source]
Bases:
object
An abstract base class for atoms.
A subclass is made for each element. The name of each subclass is the periodic table symbol of that element.
Atoms of a particular element can be made with this class or with the subclass representing that element.
Examples
Initialization.
Initialization of an
Atom
can happen in one of two ways. The atom can be initialized through theAtom
class or through the class representing the element.import stk # h0 is an instance of the H class. h0 = stk.Atom(id=0, atomic_number=1) # h1 is also an instance of the H class. h1 = stk.H(id=1)
When the class corresponding to the element is used directly, the
atomic_number
is not provided. Here are a few more examples.# Both he0 and he1 are instances of the He class. he0 = stk.Atom(id=2, atomic_number=2) he1 = stk.He(id=3) # Both c0 and c1 are instances of the # C class. c0 = stk.Atom(id=4, atomic_number=6) c1 = stk.C(id=5)
Initialize an
Atom
.- Parameters:
Methods
Return a clone.
Get the atomic number of the atom.
Get the charge of the atom.
Get the id of the atom.
Get a clone but with a different id.