diffpy.structure.atom¶
Provide class Atom for managing properties of an atom in structure model.
-
class
Atom
(atype=None, xyz=None, label=None, occupancy=None, anisotropy=None, U=None, Uisoequiv=None, lattice=None)¶ 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 (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 default1
. - anisotropy (bool, optional) – The flag for anisotropic thermal displacements parameters.
This overrides
anisotropy
implied by presence of the U or Uisoequiv arguments. Defaults toFalse
when not set in any other way. - U (ndarray, optional) – The 3x3 matrix of anisotropic thermal displacement parameters.
When present
anisotropy
defaults toTrue
. - Uisoequiv (float, optional) – The isotropic atomic displacement parameter. The
anisotropy
defaults toFalse
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) – Coordinate system for the fractional coordinates
xyz
. Use the absolute Cartesian system whenNone
.
-
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
-
lattice
¶ Coordinate system for the fractional coordinates
xyz
and the tensor of atomic displacement parametersU
. Use the absolute Cartesian coordinates whenNone
.Type: Lattice
-
element
= ''
-
label
= ''
-
occupancy
= 1.0
-
lattice
= None
-
msdLat
(vl)¶ Calculate mean square displacement along the lattice vector.
Parameters: vl (array_like) – The vector in lattice coordinates. Returns: float – The mean square displacement along vl.
-
msdCart
(vc)¶ Calculate mean square displacement along the Cartesian vector.
Parameters: vc (array_like) – Vector in Cartesian coordinates. Returns: float – The mean square displacement along vc.
-
xyz_cartn
¶ Atom position in absolute Cartesian coordinates.
This is computed from fractional coordinates
xyz
and the currentlattice
setup. Assignment to xyz_cartn or its components is applied on fractional coordinatesxyz
.Type: ndarray
-
anisotropy
¶ Flag for allowing anisotropic displacement parameters.
When
False
the tensor of thermal displacement parametersU
must be isotropic and only its diagonal elements are taken into account.Type: bool
-
U
¶ The 3x3 matrix of anisotropic atomic displacements.
For isotropic displacements (when
anisotropy
isFalse
) assignment to U uses only the firstUnew[0, 0]
element and the remaining components of U are adjusted to obtain isotropic tensor in the activelattice
.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 theU11
,U22
, …, orB11
,B22
, …, descriptors to set only some U components.Type: ndarray
-
U11
¶ The
U[0, 0]
component of the displacement tensorU
.When
anisotropy
isFalse
setting a new value updates entire tensor U.Type: float
-
U22
¶ The
U[1, 1]
component of the displacement tensorU
.When
anisotropy
isFalse
setting a new value updates entire tensor U.Type: float
-
U33
¶ The
U[2, 2]
component of the displacement tensorU
.When
anisotropy
isFalse
setting a new value updates entire tensor U.Type: float
-
U12
¶ The
U[0, 1]
element of the displacement tensorU
.Sets
U[1, 0]
together withU[0, 1]
. Assignment has no effect whenanisotropy
isFalse
.Type: float
-
U13
¶ The
U[0, 2]
element of the displacement tensorU
.Sets
U[2, 0]
together withU[0, 2]
. Assignment has no effect whenanisotropy
isFalse
.Type: float
-
U23
¶ The
U[1, 2]
element of the displacement tensorU
.Sets
U[2, 1]
together withU[1, 2]
. Assignment has no effect whenanisotropy
isFalse
.Type: float
-
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
-
B11
¶ The
B11
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U11
. Whenanisotropy
isFalse
setting a new value updates entire tensorU
.Type: float
-
B22
¶ The
B22
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U22
. Whenanisotropy
isFalse
setting a new value updates entire tensorU
.Type: float
-
B33
¶ The
B33
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U33
. Whenanisotropy
isFalse
setting a new value updates entire tensorU
.Type: float
-
B12
¶ The
B12
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U12
. Setting a new value updatesU
in a symmetric way. Assignment has no effect whenanisotropy
isFalse
.Type: float
-
B13
¶ The
B13
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U13
. Setting a new value updatesU
in a symmetric way. Assignment has no effect whenanisotropy
isFalse
.Type: float
-
B23
¶ The
B23
element of the Debye-Waller matrix.This is equivalent to
8 * pi**2 * U23
. Setting a new value updatesU
in a symmetric way. Assignment has no effect whenanisotropy
isFalse
.Type: float
- atype (str or Atom, optional) – The string atom type to be set as the