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

The 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) – The fractional coordinates within the associated lattice. By default [0, 0, 0].

  • label (str, Optional) – The 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) – The 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, default “”.

Type:

str

xyz

The fractional coordinates in the associated lattice.

Type:

numpy.ndarray

label

The 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, default “”.

Type:

str

occupancy

The fractional occupancy of this atom, default 1.0.

Type:

float

lattice

The coordinate system for the fractional coordinates xyz and the tensor of atomic displacement parameters U. Use the absolute Cartesian coordinates when None as the default.

Type:

Lattice

Note

Cannot use both U and Uisoequiv arguments at the same time.

property B11

The B11 element of the Debye-Waller matrix, as a float

This is equivalent to 8 * pi**2 * U11. When anisotropy is False setting a new value updates entire tensor U.

property B12

The B12 element of the Debye-Waller matrix, as a float

This is equivalent to 8 * pi**2 * U12. Setting a new value updates U in a symmetric way. Assignment has no effect when anisotropy is False.

property B13

The B13 element of the Debye-Waller matrix, as a float

This is equivalent to 8 * pi**2 * U13. Setting a new value updates U in a symmetric way. Assignment has no effect when anisotropy is False.

property B22

The B22 element of the Debye-Waller matrix, as a float

This is equivalent to 8 * pi**2 * U22. When anisotropy is False setting a new value updates entire tensor U.

property B23

The B23 element of the Debye-Waller matrix, as a float

This is equivalent to 8 * pi**2 * U23. Setting a new value updates U in a symmetric way. Assignment has no effect when anisotropy is False.

property B33

The B33 element of the Debye-Waller matrix, as a float

This is equivalent to 8 * pi**2 * U33. When anisotropy is False setting a new value updates entire tensor U.

property Bisoequiv

The Debye-Waller isotropic displacement or an equivalent value, as a float.

This equals 8 * pi**2 * Uisoequiv. Setting a new value rescales U tensor to yield equivalent direction-average of Debye-Waller displacements.

property U

The 3x3 matrix of anisotropic atomic displacements, as a ndarray.

For isotropic displacements (when anisotropy is False) assignment to U uses only the first Unew[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.

property U11

The U[0, 0] component of the displacement tensor U, as a float

When anisotropy is False setting a new value updates entire tensor U.

property U12

The U[0, 1] element of the displacement tensor U, as a float

Sets U[1, 0] together with U[0, 1]. Assignment has no effect when anisotropy is False.

property U13

The U[0, 2] element of the displacement tensor U, as a float

Sets U[2, 0] together with U[0, 2]. Assignment has no effect when anisotropy is False.

property U22

The U[1, 1] component of the displacement tensor U, as a float

When anisotropy is False setting a new value updates entire tensor U.

property U23

The U[1, 2] element of the displacement tensor U, as a float

Sets U[2, 1] together with U[1, 2]. Assignment has no effect when anisotropy is False.

property U33

The U[2, 2] component of the displacement tensor U, as a float

When anisotropy is False setting a new value updates entire tensor U.

property Uisoequiv

The isotropic displacement parameter or an equivalent value, as a float.

Setting a new value rescales tensor U so it yields equivalent direction-averaged displacements.

property anisotropy

The flag for allowing anisotropic displacement parameters, as a bool.

When False the tensor of thermal displacement parameters U must be isotropic and only its diagonal elements are taken into account.

element = ''
label = ''
lattice = None
msdCart(vc)

This function has been deprecated and will be removed in version 4.0.0.

Please use diffpy.structure.Atom.msd_cart instead.

msdLat(vl)

This function has been deprecated and will be removed in version 4.0.0.

Please use diffpy.structure.Atom.msd_latt instead.

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

msd_latt(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
property x

The fractional coordinate x, same as xyz[0], as a float

property xyz_cartn

Atom position in absolute Cartesian coordinates, as a numpy.ndarray.

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.

property y

The fractional coordinate y, same as xyz[1], as a float

property z

The fractional coordinate z, same as xyz[2], as a float