stk.Bond
- class stk.Bond(atom1, atom2, order, periodicity=(0, 0, 0))[source]
Bases:
object
Represents an atomic bond.
Examples
Changing the Atoms of a Bond
You want to substitute the atoms in the bond for other atoms. You can do this by using
with_atoms()
to create a clone of the bond, which holds the replacement atomsimport stk bond = stk.Bond(stk.C(0), stk.C(12), 2) # Replace C(0) with H(13) but keep C(12). clone = bond.with_atoms({0: stk.H(13)})
- Parameters:
atom1 (Atom) – The first atom in the bond.
atom2 (Atom) – The second atom in the bond.
order (int) – The bond order.
periodicity (tuple[int, int, int]) – The directions across which the bond is periodic. For example,
(1, 0, -1)
means that when going from atom1 to atom2 the bond is periodic across the x axis in the positive direction, is not periodic across the y axis and is periodic across the z axis in the negative direction.
Methods
Return a clone.
Get the first atom of the bond.
Get the second atom of the bond.
Get the bond order of the bond.
Get the periodicity of the bond.
Return
True
if the bond is periodic.Return a clone holding different atoms.
Return a clone holding different atom ids.
- get_atom1()[source]
Get the first atom of the bond.
- Returns:
The first atom of the bond.
- Return type:
- get_atom2()[source]
Get the second atom of the bond.
- Returns:
The second atom of the bond.
- Return type:
- get_periodicity()[source]
Get the periodicity of the bond.
- Returns:
The directions across which the bond is periodic. For example,
(1, 0, -1)
means that when going from atom1 to atom2 the bond is periodic across the x axis in the positive direction, is not periodic across the y axis and is periodic across the z axis in the negative direction.- Return type:
- is_periodic()[source]
Return
True
if the bond is periodic.- Returns:
True
if the bond is periodic.- Return type: