from ase import Atoms # Create a water molecule water = Atoms('H2O', positions=[[0,0,0], [0,0,1], [0,1,0]]) # Get atomic numbers of all the atoms atomic_numbers = water.get_atomic_numbers() print(atomic_numbers) # Output: [1, 1, 8]
from ase.build import fcc111, add_adsorbate from ase import Atom, Atoms # Create a 2x2 graphene sheet with a hydrogen atom on top slab = fcc111('C', (2, 2, 1), 4) add_adsorbate(slab, Atom('H', position=(0, 0, 1.1)), 1.6) # Get atomic numbers of all the atoms atomic_numbers = slab.get_atomic_numbers() print(atomic_numbers) # Output: [6, 6, 6, 6, 1, 1, 1, 1]
import ase print(ase.__version__)This will print the version of "ase" installed, as well as information about the Python and NumPy versions used.