molecule = Atoms('2N', positions=[(0., 0., 0.), (0., 0., d)]) molecule.calc = EMT() e_N2 = molecule.get_potential_energy() add_adsorbate(slab, molecule, h, 'ontop') constraint = FixAtoms(mask=[a.symbol != 'N' for a in slab]) slab.set_constraint(constraint) dyn = Q...
这里使用ASE直接给出的脚本,在Au(111)表面随机生成各种结构的Au2Ag2团簇,一共二十个: # initialization_ga.pyfromase.ga.dataimportPrepareDBfromase.ga.startgeneratorimportStartGeneratorfromase.ga.utilitiesimportclosest_distances_generatorfromase.ga.utilitiesimportget_all_atom_typesfromase.constraintsimportFixAtoms...
mol.set_constraint(fix)print('-> The atoms with following labels are fixed:\n{0}'.format(...
默认值是scale_atoms=False,表示单元格更改时笛卡尔坐标保持不变。 >>> W.set_cell(slab.cell, scale_atoms=True) >>> zmin = W.positions[:, 2].min() >>> zmax = slab.positions[:, 2].max() >>> W.positions += (0, 0, zmax - zmin + 1.5) 最后我们将水复制到平板上: >>> interface...
mol.set_initial_charges(charges=[total_charges/total_atoms,]*total_atoms)mol.set_initial_...
distances.append(atoms.positions[1, 2] - atoms.positions[0, 2]) ax = plt.gca() ax.plot(distances, energies) ax.set_xlabel('Distance [Å]') ax.set_ylabel('Total energy [eV]') plt.show() from ase import Atoms from gpaw import GPAW ...
atoms = Atoms('H2O', positions=[[0, 0, 0], [0.757, 0.586, 0]]) ``` 上述代码创建了一个表示H2O分子的Atoms对象,并指定了两个氢原子和一个氧原子的坐标。 2.计算能量和力 使用ASE,我们可以方便地计算原子结构的能量和力。下面的代码演示了如何使用ASE进行能量和力的计算。 ```python from ase.cal...
positions[resort] self.atoms.cell = atoms.cell imm = self.parameters.get('magmom', [0 for atom in self.atoms]) self.atoms.set_initial_magnetic_moments(imm) self.results['energy'] = energy self.results['forces'] = forces[self.resort] self.results['stress'] = stress self.results['...
positions[resort] self.atoms.cell = atoms.cell imm = self.parameters.get('magmom', [0 for atom in self.atoms]) self.atoms.set_initial_magnetic_moments(imm) self.results['energy'] = energy self.results['forces'] = forces[self.resort] self.results['stress'] = stress self.results['...
slab.set_calculator(EMT())e_slab = slab.get_potential_energy()molecule = Atoms('2N', positions=[(0., 0., 0.), (0., 0., d)])molecule.set_calculator(EMT())e_N2 = molecule.get_potential_energy()add_adsorbate(slab, molecule, h, 'ontop')constraint = FixAtoms(mask=[a...