root / ase / test / build.py @ 4
Historique | Voir | Annoter | Télécharger (500 octet)
| 1 |
import numpy as np |
|---|---|
| 2 |
from ase import Atoms, Atom |
| 3 |
|
| 4 |
a = Atoms([Atom('Cu')])
|
| 5 |
a.positions[:] += 1.0
|
| 6 |
print a.get_positions(), a.positions
|
| 7 |
a=a+a |
| 8 |
a+=a |
| 9 |
a.append(Atom('C'))
|
| 10 |
a += Atoms([]) |
| 11 |
a += Atom('H', magmom=1) |
| 12 |
print a.get_initial_magnetic_moments()
|
| 13 |
print a[0].number |
| 14 |
print a[[0,1]].get_atomic_numbers() |
| 15 |
print a[np.array([1,1,0,0,1], bool)].get_atomic_numbers() |
| 16 |
print a[::2].get_atomic_numbers() |
| 17 |
print a.get_chemical_symbols()
|
| 18 |
del a[2] |
| 19 |
print a.get_chemical_symbols()
|
| 20 |
del a[-2:] |
| 21 |
print a.get_chemical_symbols()
|