diffpy.structure.atom
Provide class Atom for managing properties of an atom in structure model.
- class diffpy.structure.atom.Atom(atype=None, xyz=None, label=None, occupancy=None, anisotropy=None, U=None, Uisoequiv=None, lattice=None)[source]
Bases:
object
Storage of structure information relevant for a single atom.
This class manages atom information such as element symbol, position in fractional and Cartesian coordinates, atomic displacement parameters and so forth.
- Parameters:
atype (str or Atom, Optional) – The string atom type to be set as the element attribute. By default an empty string. When of the Atom type, create a copy of atype and adjust it per other arguments.
xyz (numpy.ndarray, Optional) – Fractional coordinates within the associated lattice. By default
[0, 0, 0]
.label (str, Optional) – A unique string label for referring to this Atom. By default an empty string.
occupancy (float, Optional) – The initial occupancy of this atom, by default
1
.anisotropy (bool, Optional) – The flag for anisotropic thermal displacements parameters. This overrides anisotropy implied by presence of the U or Uisoequiv arguments. Defaults to
False
when not set in any other way.U (numpy.ndarray, Optional) – The 3x3 matrix of anisotropic thermal displacement parameters. When present anisotropy defaults to
True
.Uisoequiv (float, Optional) – The isotropic atomic displacement parameter. The anisotropy defaults to
False
when present. Only one of the U and Uisoequiv arguments may be provided at the same time. Assume zero atomic displacements when U and Uisoequiv are unset.lattice (Lattice, Optional) – Coordinate system for the fractional coordinates xyz. Use the absolute Cartesian system when
None
.
- element
The string type of the atom. An element or ion symbol.
- Type:
str
- xyz
The fractional coordinates in the associated lattice.
- Type:
numpy.ndarray
- label
A unique string label referring to this atom, for example, “C_1”. The label can be used to reference this atom when contained in a Structure object.
- Type:
str
- occupancy
The fractional occupancy of this atom.
- Type:
float
- lattice
Coordinate system for the fractional coordinates xyz and the tensor of atomic displacement parameters U. Use the absolute Cartesian coordinates when
None
.- Type:
Note
Cannot use both U and Uisoequiv arguments at the same time.
- property B11
The
B11
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U11
. When anisotropy isFalse
setting a new value updates entire tensor U.- Type:
float
- property B12
The
B12
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U12
. Setting a new value updates U in a symmetric way. Assignment has no effect when anisotropy isFalse
.- Type:
float
- property B13
The
B13
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U13
. Setting a new value updates U in a symmetric way. Assignment has no effect when anisotropy isFalse
.- Type:
float
- property B22
The
B22
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U22
. When anisotropy isFalse
setting a new value updates entire tensor U.- Type:
float
- property B23
The
B23
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U23
. Setting a new value updates U in a symmetric way. Assignment has no effect when anisotropy isFalse
.- Type:
float
- property B33
The
B33
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U33
. When anisotropy isFalse
setting a new value updates entire tensor U.- Type:
float
- property Bisoequiv
The Debye-Waller isotropic displacement or an equivalent value.
This equals
8 * pi**2 * Uisoequiv
. Setting a new value rescales U tensor to yield equivalent direction-average of Debye-Waller displacements.- Type:
float
- property U
The 3x3 matrix of anisotropic atomic displacements.
For isotropic displacements (when anisotropy is
False
) assignment to U uses only the firstUnew[0, 0]
element and the remaining components of U are adjusted to obtain isotropic tensor in the active lattice.Note
Elements of the U tensor such as
U[0, 1]
should be considered read-only as setting them directly leads to undefined behavior. Use the U11, U22, …, or B11, B22, …, descriptors to set only some U components.- Type:
numpy.ndarray
- property U11
The
U[0, 0]
component of the displacement tensor U.When anisotropy is
False
setting a new value updates entire tensor U.- Type:
float
- property U12
The
U[0, 1]
element of the displacement tensor U.Sets
U[1, 0]
together withU[0, 1]
. Assignment has no effect when anisotropy isFalse
.- Type:
float
- property U13
The
U[0, 2]
element of the displacement tensor U.Sets
U[2, 0]
together withU[0, 2]
. Assignment has no effect when anisotropy isFalse
.- Type:
float
- property U22
The
U[1, 1]
component of the displacement tensor U.When anisotropy is
False
setting a new value updates entire tensor U.- Type:
float
- property U23
The
U[1, 2]
element of the displacement tensor U.Sets
U[2, 1]
together withU[1, 2]
. Assignment has no effect when anisotropy isFalse
.- Type:
float
- property U33
The
U[2, 2]
component of the displacement tensor U.When anisotropy is
False
setting a new value updates entire tensor U.- Type:
float
- property Uisoequiv
The isotropic displacement parameter or an equivalent value.
Setting a new value rescales tensor U so it yields equivalent direction-averaged displacements.
- Type:
float
- property anisotropy
Flag for allowing anisotropic displacement parameters.
When
False
the tensor of thermal displacement parameters U must be isotropic and only its diagonal elements are taken into account.- Type:
bool
- element = ''
Default values of element.
- Type:
str
- label = ''
Default values of label.
- Type:
str
- lattice = None
Default values of lattice.
- Type:
None
- msdCart(vc)[source]
Calculate mean square displacement along the Cartesian vector.
- Parameters:
vc (array_like) – Vector in Cartesian coordinates.
- Returns:
The mean square displacement along vc.
- Return type:
float
- msdLat(vl)[source]
Calculate mean square displacement along the lattice vector.
- Parameters:
vl (array_like) – The vector in lattice coordinates.
- Returns:
The mean square displacement along vl.
- Return type:
float
- occupancy = 1.0
Default values of occupancy.
- Type:
float
- property x
fractional coordinate x, same as
xyz[0]
.- Type:
float
- property xyz_cartn
Atom position in absolute Cartesian coordinates.
This is computed from fractional coordinates xyz and the current lattice setup. Assignment to xyz_cartn or its components is applied on fractional coordinates xyz.
- Type:
numpy.ndarray
- property y
fractional coordinate y, same as
xyz[1]
.- Type:
float
- property z
fractional coordinate z, same as
xyz[2]
.- Type:
float