from ase import Atoms from ase.build import fcc111 # create an initial crystal structure atoms = fcc111('Au', size=(3,3,3)) # add a new single atom at position (0, 0, 5) new_atom = Atoms('Ne', positions=[(0, 0, 5)]) atoms.append(new_atom) # print the new structure print(atoms)
# create an initial crystal structure atoms = fcc111('Pt', size=(4,4,4)) # add four new oxygen atoms in a tetrahedral arrangement new_atoms = Atoms('O4', positions=[(0, 0, 3), (0, 3, 0), (3, 0, 0), (3, 3, 3)]) atoms.append(new_atoms) # print the new structure print(atoms)This code creates an fcc platinum (Pt) crystal structure with dimensions of 4x4x4 unit cells. It then adds four oxygen (O) atoms in a tetrahedral arrangement and prints the resulting structure. Once again, ASE is being used to import Atoms and fcc111 from ase.build.