SST Lab Dokuwiki Header header picture






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 <list_of_atoms.html#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()

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()

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
>>> e.mass
>>> Element(99).name

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 import names
>>> names[5:11]
['Boron', 'Carbon', 'Nitrogen', 'Oxygen', 'Fluorine', 'Neon']

Another example:

>>> ru = elements['Ru']
>>> ru['state']
>>> a = ru['a']
>>> c = ru['c/a'] * a
ab_initio/atomオブジェクト.txt · 最終更新: 2020/08/17 15:58 by kimi