====== Atomクラスオブジェクト ======
AtomクラスオブジェクトはListOfAtomsクラスオブジェクトの基本構成要素で、1個の原子の情報を保持する。コンストラクタAtomを用いて
from ASE import Atom
a1 = Atom('Al')
a2 = Atom(Z = 13)
a3 = Atom('Al', (0, 0, 0), tag = 0, magmom = 0.0)
a4 = Atom(Z = 13, position = (0, 0, 0), tag = 0, magmom = 0.0)
atom1 = Atom('Al', (0, 0, 0))
d = Atom('H', (0.5, 0.5, 0.5), mass=2)
silicon = Atom(position=(2.38, 2.38, 0), Z=14) # same is a1
のようにインスタンスを生成する。コンストラクタの第1引数はAtomオブジェクトの原子の元素記号、第2引数は座標を表すタペルである。
これ以外にも表にあるキーワード情報を生成時に付加することもできる。
ASE defines a python class called ``Atom``. It is the basic building
block of a `ListOfAtoms `_. From a python script,
atoms are created like this:
The first argument to the constructor of an ``Atom`` object is the
chemical symbol, and the second argument is the position. The
position can be any numerical sequence of length three. The
properties of an atom can also be set using keywords like it is done
in the ``a2`` example. The following keywords can be used:
^ keyword ^ 諸元 ^ type ^ デフォルト値 ^ 問合せmethod ^
| ''symbol'' | 元素記号 | 文字列 | (必須/自動設定) | ''GetChemicalSymbol'' |
| ''position'' | 座標 | 3成分タペル | ''(0, 0, 0)'' | ''GetCartesianPosition'' |
| ''Z'' | 原子番号 | 整数 | (必須/自動設定) | ''GetAtomicNumber'' |
| ''mass'' | 質量 | 実数 | 自動設定 | ''GetMass'' |
| ''tag'' | タグ | 整数 | ''0'' | ''GetTag'' |
| ''momentum'' | 運動量 | 3成分タペル | ''(0, 0, 0)'' | ''GetCartesianMomentum'' |
| ''velocity'' | 速度 | 3成分タペル | ''(0, 0, 0)'' | ''GetCartesianVelocity'' |
| ''magmom'' | 磁気モーメント | 実数 | ''0'' | ''GetMagneticMoment'' |
元素記号(''symbol'')と原子番号(''Z'')のどちらかを必ず指定しなければいけない。一方を指定すれば自動的にもう一方も設定される。
質量には元素に応じて原子量が設定される。他の値は「ゼロ」に設定される。
>>> a1.GetMass()
28.0855
Here we used one of the ''Get'' methods from the last column. An atom
also has the corresponding ''Set'' methods, like
''SetCartesianVelocity'' and ''SetMass'':
>>> a1.SetCartesianVelocity((0, 0, 0.1))
There is also a method for calculating the kinetic energy of an atom:
>>> a1.GetKineticEnergy()
0.14042750000000004
An atom also has two methods for interacting with a force calculator:
''GetCartesianForce()'' and ''SetCartesianForce(force)''.
===== ChemicalElements module =====
The ''ChemicalElements'' module defines an function ''Element()'' that
can take an atomic number or a chemical symbol as argument:
>>> from ASE.ChemicalElements import Element
>>> e = Element('Fe')
>>> e.number
26
>>> e.mass
55.847000000000001
>>> Element(99).name
'Einsteinium'
The ''Element()'' function returns a special object with the following
attributes: ''symbol'', ''number'', ''name'' and, if it makes sence,
also ''mass'', ''covalent_radius'', ''cpk_color'' and ''crystal_structure''.
The individual properties are also avilable as lists:
>>> from ASE.ChemicalElements.name import names
>>> names[5:11]
['Boron', 'Carbon', 'Nitrogen', 'Oxygen', 'Fluorine', 'Neon']
Another example:
>>> ru = elements['Ru']
>>> ru['state']
'hcp'
>>> a = ru['a']
>>> c = ru['c/a'] * a