Overview¶
The ChemicalSystem class serves as a versatile representation of a chemical system. It’s designed to handle various types of chemical structures, such as molecules, surfaces, or crystals.
See the ChemicalSystem API docs for a complete overview.
Here’s how you can initialize a ChemicalSystem object using a System Block string:
from scm.libbase import ChemicalSystem
# Initialize a Chemical System from a 'System Block' string
mol = ChemicalSystem(
"""
System
Atoms
O 0.0 0.0 0.0
H 1.0 0.0 0.0
H 0.0 1.0 0.0
End
End
""")
# Guess the bonds in the molecule based on the atomic coordinates
mol.guess_bonds()
# Translate the molecule so that the origin coincides with its center of mass
mol.translate(-mol.center_of_mass())
# Print the molecule in 'System Block' format
print(mol)