xrayutilities.materials package

Submodules

xrayutilities.materials.atom module

module containing the Atom class which handles the database access for atomic scattering factors and the atomic mass.

class xrayutilities.materials.atom.Atom(name, num)[source]

Bases: object

f(q, en='config')[source]

function to calculate the atomic structure factor F

Parameters:

**q: momentum transfer**

en:energy for which F should be calculated, if omitted the value from the xrayutilities configuration is used
Returns:

f (float)

f0(q)[source]
f1(en='config')[source]
f2(en='config')[source]
get_cache(prop, key)[source]

check if a cached value exists to speed up repeated database requests

Returns:

flag, result: if the flag is True then result contains the cached

result, otherwise result is None

max_cache_length = 10
set_cache(prop, key, result)[source]

set result to be cached to speed up future calls

weight
xrayutilities.materials.atom.get_key(*args)[source]

generate a hash key for several possible types of arguments

xrayutilities.materials.cif module

class xrayutilities.materials.cif.CIFFile(filename, digits=3)[source]

Bases: object

class for parsing CIF (Crystallographic Information File) files. The class aims to provide an additional way of creating material classes instead of manual entering of the information the lattice constants and unit cell structure are parsed from the CIF file

Lattice()[source]

returns a lattice object with the structure from the CIF file

Parse()[source]

function to parse a CIF file. The function reads the space group symmetry operations and the basic atom positions as well as the lattice constants and unit cell angles

SGLattice()[source]

create a SGLattice object with the structure from the CIF file

SymStruct()[source]

function to obtain the list of different atom positions in the unit cell for the different types of atoms. The data are obtained from the data parsed from the CIF file.

xrayutilities.materials.database module

module to handle the access to the optical parameters database

class xrayutilities.materials.database.DataBase(fname)[source]

Bases: object

Close()[source]

Close an opend database file.

Create(dbname, dbdesc)[source]

Creates a new database. If the database file already exists its content is delete.

required input arguments:
dbname:name of the database
dbdesc:a short description of the database
CreateMaterial(name, description)[source]

This method creates a new material. If the material group already exists the procedure is aborted.

required input arguments:
name:a string with the name of the material
description:a string with a description of the material
GetF0(q, dset='default')[source]

Obtain the f0 scattering factor component for a particular momentum transfer q.

required input argument:
q:single float value or numpy array
dset:specifies which dataset (different oxidation states) should be used
GetF1(en)[source]

Return the second, energy dependent, real part of the scattering factor for a certain energy en.

required input arguments:
en:float or numpy array with the energy
GetF2(en)[source]

Return the imaginary part of the scattering factor for a certain energy en.

required input arguments:
en:float or numpy array with the energy
Open(mode='r')[source]

Open an existing database file.

SetF0(parameters, subset='default')[source]

Save f0 fit parameters for the set material. The fit parameters are stored in the following order: c,a1,b1,.......,a4,b4

required input argument:
parameters:list or numpy array with the fit parameters
subset:specifies under which name the f0 values should be saved
SetF1F2(en, f1, f2)[source]

Set f1, f2 values for the active material.

required input arguments:
en:list or numpy array with energy in (eV)
f1:list or numpy array with f1 values
f2:list or numpy array with f2 values
SetMaterial(name)[source]

Set a particular material in the database as the actual material. All operations like setting and getting optical constants are done for this particular material.

required input arguments:
name:string with the name of the material
SetWeight(weight)[source]

Save weight of the element as float

required input argument:
weight:atomic standard weight of the element (float)
xrayutilities.materials.database.add_f0_from_intertab(db, itf)[source]

Read f0 data from International Tables of Crystallography and add it to the database.

xrayutilities.materials.database.add_f0_from_xop(db, xop)[source]

Read f0 data from f0_xop.dat and add it to the database.

xrayutilities.materials.database.add_f1f2_from_ascii_file(db, asciifile, element)[source]

Read f1 and f2 data for specific element from ASCII file (3 columns) and save it to the database.

xrayutilities.materials.database.add_f1f2_from_henkedb(db, hf)[source]

Read f1 and f2 data from Henke database and add it to the database.

xrayutilities.materials.database.add_f1f2_from_kissel(db, kf)[source]

Read f1 and f2 data from Henke database and add it to the database.

xrayutilities.materials.database.add_mass_from_NIST(db, nistfile)[source]

Read atoms standard mass and save it to the database. The mass of the natural isotope mixture is taken from the NIST data!

xrayutilities.materials.database.init_material_db(db)[source]

xrayutilities.materials.elements module

xrayutilities.materials.lattice module

module handling crystal lattice structures. A Lattice consists of unit cell parameters and a LatticeBase. It offers methods to calculate the reciprocal space position of Bragg peaks and their structure factor.

xrayutilities.materials.lattice.AlGaAsLattice(aal, aga, aas, a, x)[source]
xrayutilities.materials.lattice.BCCLattice(aa, a)[source]
xrayutilities.materials.lattice.BCTLattice(aa, a, c)[source]
xrayutilities.materials.lattice.BaddeleyiteLattice(aa, ab, a, b, c, beta)[source]
xrayutilities.materials.lattice.CsClLattice(aa, ab, a)[source]
xrayutilities.materials.lattice.CubicFm3mBaF2(aa, ab, a)[source]
xrayutilities.materials.lattice.CubicLattice(a, base=None)[source]

Returns a Lattice object representing a cubic lattice.

Parameters:

**a: lattice parameter**

base:instance of LatticeBase, representing the internal structure of the unit cell
Returns:

an instance of Lattice class

xrayutilities.materials.lattice.DiamondLattice(aa, a)[source]
xrayutilities.materials.lattice.FCCLattice(aa, a)[source]
xrayutilities.materials.lattice.FCCSharedLattice(aa, ab, occa, occb, a)[source]
xrayutilities.materials.lattice.GeTeRhombohedral(aa, ab, a, ang, x=0.237)[source]
xrayutilities.materials.lattice.HCPLattice(aa, a, c)[source]
xrayutilities.materials.lattice.Hexagonal3CLattice(aa, ab, a, c)[source]
xrayutilities.materials.lattice.Hexagonal4HLattice(aa, ab, a, c, u=0.1875, v1=0.25, v2=0.4375)[source]
xrayutilities.materials.lattice.Hexagonal6HLattice(aa, ab, a, c)[source]
xrayutilities.materials.lattice.HexagonalLattice(a, c, base=None)[source]

Returns a Lattice object representing a hexagonal lattice.

Parameters:

**a: lattice parameter a**

c:lattice parameter c
base:instance of LatticeBase, representing the internal structure of the unit cell
Returns:

an instance of Lattice class

xrayutilities.materials.lattice.LaB6Lattice(aa, ab, a, oa=1, ob=1, ba=0, bb=0)[source]
class xrayutilities.materials.lattice.Lattice(a1, a2, a3, base=None)[source]

Bases: object

class Lattice: This object represents a Bravais lattice. A lattice consists of a base and unit cell defined by three vectors.

ApplyStrain(eps)[source]

Applies a certain strain on a lattice. The result is a change in the base vectors. The full strain matrix (3x3) needs to be given. .. note:: Note: NO elastic response of the material will be considered!

requiered input arguments:
eps:a 3x3 matrix independent strain components
GetPoint(*args)[source]

determine lattice points with indices given in the argument

Examples

>>> xu.materials.Si.lattice.GetPoint(0,0,4)
array([  0.     ,   0.     ,  21.72416])

or

>>> xu.materials.Si.lattice.GetPoint((1,1,1))
array([ 5.43104,  5.43104,  5.43104])
ReciprocalLattice()[source]
UnitCellVolume()[source]

function to calculate the unit cell volume of a lattice (angstrom^3)

a
a1
a2
a3
alpha
b
beta
c
gamma
class xrayutilities.materials.lattice.LatticeBase(*args, **keyargs)[source]

Bases: list

The LatticeBase class implements a container for a set of points that form the base of a crystal lattice. An instance of this class can be treated as a simple container object.

append(atom, pos, occ=1.0, b=0.0)[source]

add new Atom to the lattice base

Parameters:

**atom: atom object to be added**

pos:position of the atom
occ:occupancy (default=1.0)
b:b-factor of the atom used as exp(-b*q**2/(4*pi)**2) to reduce the intensity of this atom (only used in case of temp=0 in StructureFactor and chi calculation)
xrayutilities.materials.lattice.MagnetiteLattice(aa, ab, ac, a, x=0.255)[source]
xrayutilities.materials.lattice.MonoclinicLattice(a, b, c, beta, base=None)[source]

Returns a Lattice object representing a hexagonal lattice.

Parameters:

**a: lattice parameter a**

b:lattice parameter b
c:lattice parameter c
beta:monoclinic unit cell angle beta (deg)
base:instance of LatticeBase, representing the internal structure of the unit cell
Returns:

an instance of Lattice class

xrayutilities.materials.lattice.NaumanniteLattice(aa, ab, a, b, c)[source]
xrayutilities.materials.lattice.NiAsLattice(aa, ab, a, c, biso=0.0)[source]
xrayutilities.materials.lattice.OrthorhombicLattice(a, b, c, base=None)[source]

Returns a Lattice object representing a tetragonal lattice.

Parameters:

**a: lattice parameter a**

b:lattice parameter b
c:lattice parameter c
base:instance of LatticeBase, representing the internal structure of the unit cell
Returns:

an instance of Lattice class

xrayutilities.materials.lattice.PerovskiteTypeRhombohedral(aa, ab, ac, a, ang)[source]
xrayutilities.materials.lattice.QuartzLattice(aa, ab, a, b, c)[source]
xrayutilities.materials.lattice.RockSaltLattice(aa, ab, a)[source]

creates the primitive unit cell of a RockSalt structure. For the more commonly used cubic reprentation see RockSalt_Cubic_Lattice

xrayutilities.materials.lattice.RockSalt_Cubic_Lattice(aa, ab, a)[source]
xrayutilities.materials.lattice.RutileLattice(aa, ab, a, c, u)[source]
xrayutilities.materials.lattice.SiGeLattice(asi, age, a, xge)[source]
xrayutilities.materials.lattice.TetragonalIndiumLattice(aa, a, c)[source]
xrayutilities.materials.lattice.TetragonalLattice(a, c, base=None)[source]

Returns a Lattice object representing a tetragonal lattice.

Parameters:

**a: lattice parameter a**

c:lattice parameter c
base:instance of LatticeBase, representing the internal structure of the unit cell
Returns:

an instance of Lattice class

xrayutilities.materials.lattice.TetragonalTinLattice(aa, a, c)[source]
xrayutilities.materials.lattice.TriclinicLattice(a, b, c, alpha, beta, gamma, base=None)[source]
xrayutilities.materials.lattice.TrigonalR3mh(aa, a, c)[source]
xrayutilities.materials.lattice.WurtziteLattice(aa, ab, a, c, u=0.375, biso=0.0)[source]
xrayutilities.materials.lattice.ZincBlendeLattice(aa, ab, a)[source]

xrayutilities.materials.material module

Classes decribing materials. Materials are devided with respect to their crystalline state in either Amorphous or Crystal types. While for most materials their crystalline state is defined few materials are also included as amorphous which can be useful for calculation of their optical properties.

class xrayutilities.materials.material.Alloy(matA, matB, x)[source]

Bases: xrayutilities.materials.material.Crystal

alloys two materials from the same crystal system. If the materials have the same space group the Wyckoff positions within the unit cell will also reflect the alloying.

RelaxationTriangle(hkl, sub, exp)[source]

function which returns the relaxation triangle for a Alloy of given composition. Reciprocal space coordinates are calculated using the user-supplied experimental class

Parameters:

**hkl** : Miller Indices

sub:substrate material or lattice constant (Instance of Crystal class or float)
exp:Experiment class from which the Transformation object and ndir are needed
Returns:

**qy,qz** : reciprocal space coordinates of the corners of the relaxation

triangle

static check_compatibility(matA, matB)[source]
static lattice_const_AB(latA, latB, x, name='')[source]

method to calculated the interpolation of lattice parameters and unit cell angles of the Alloy. By default linear interpolation between the value of material A and B is performed.

Parameters:

**latA, latB: property (lattice parameter/angle) of material A and B.**

A property can be a scalar or vector.

x:fraction of material B in the alloy.
name:label of the property which is interpolated. Can be ‘a’, ‘b’, ‘c’, ‘alpha’, ‘beta’, or ‘gamma’.
x
class xrayutilities.materials.material.Amorphous(name, density, atoms=None, cij=None)[source]

Bases: xrayutilities.materials.material.Material

amorphous materials are described by this class

beta(en='config')[source]

function to calculate the imaginary part of the deviation of the refractive index from 1 (n=1-delta+i*beta)

Parameters:

**en: x-ray energy eV, if omitted the value from the xrayutilities**

configuration is used

Returns:

beta (float)

chi0(en='config')[source]

calculates the complex chi_0 values often needed in simulations. They are closely related to delta and beta (n = 1 + chi_r0/2 + i*chi_i0/2 vs. n = 1 - delta + i*beta)

delta(en='config')[source]

function to calculate the real part of the deviation of the refractive index from 1 (n=1-delta+i*beta)

Parameters:

**en: x-ray energy eV, if omitted the value from the xrayutilities**

configuration is used

Returns:

delta (float)

static parseChemForm(cstring)[source]

Parse a string containing a simple chemical formula and transform it to a list of elements together with their relative atomic fraction. e.g. ‘H2O’ -> [(H, 2/3), (O, 1/3)], where H and O are the Element objects of Hydrogen and Oxygen. Note that every chemical element needs to start with a capital letter! Complicated formulas containing bracket are not supported!

Parameters:**cstring: string containing the chemical fomula**
Returns:list of tuples with chemical element and atomic fraction
xrayutilities.materials.material.Cij2Cijkl(cij)[source]

Converts the elastic constants matrix (tensor of rank 2) to the full rank 4 cijkl tensor.

required input arguments:
cij:(6,6) cij matrix as a numpy array
return value:
cijkl:(3,3,3,3) cijkl tensor as numpy array
xrayutilities.materials.material.Cijkl2Cij(cijkl)[source]

Converts the full rank 4 tensor of the elastic constants to the (6,6) matrix of elastic constants.

required input arguments:
cijkl:(3,3,3,3) cijkl tensor as numpy array
return value:
cij:(6,6) cij matrix as a numpy array
class xrayutilities.materials.material.Crystal(name, lat, cij=None, thetaDebye=None)[source]

Bases: xrayutilities.materials.material.Material

Crystalline materials are described by this class

ApplyStrain(strain)[source]

Applies a certain strain on the lattice of the material. The result is a change in the base vectors of the real space as well as reciprocal space lattice. The full strain matrix (3x3) needs to be given. Note: NO elastic response of the material will be considered!

B
GetMismatch(mat)[source]

Calculate the mismatch strain between the material and a second material

Q(*hkl)[source]

Return the Q-space position for a certain material.

Parameters:

**hkl: list or numpy array with the Miller indices**

(or Q(h,k,l) is also possible)

StructureFactor(q, en='config', temp=0)[source]

calculates the structure factor of a material for a certain momentum transfer and energy at a certain temperature of the material

Parameters:

**q: vectorial momentum transfer (vectors as list,tuple**

or numpy array are valid)

en:energy in eV, if omitted the value from the xrayutilities configuration is used
temp:temperature used for Debye-Waller-factor calculation
Returns:

the complex structure factor

StructureFactorForEnergy(q0, en, temp=0)[source]

calculates the structure factor of a material for a certain momentum transfer and a bunch of energies

Parameters:

**q0: vectorial momentum transfer (vectors as list,tuple**

or numpy array are valid)

en:list, tuple or array of energy values in eV
temp:temperature used for Debye-Waller-factor calculation
Returns:

complex valued structure factor array

StructureFactorForQ(q, en0='config', temp=0)[source]

calculates the structure factor of a material for a bunch of momentum transfers and a certain energy

Parameters:

**q: vectorial momentum transfers;**

list of vectores (list, tuple or array) of length 3 e.g.: (Si.Q(0,0,4),Si.Q(0,0,4.1),...) or numpy.array([Si.Q(0,0,4),Si.Q(0,0,4.1)])

en0:energy value in eV, if omitted the value from the xrayutilities configuration is used
temp:temperature used for Debye-Waller-factor calculation
Returns:

complex valued structure factor array

a
a1
a2
a3
alpha
b
beta(en='config')[source]

function to calculate the imaginary part of the deviation of the refractive index from 1 (n=1-delta+i*beta)

Parameters:

**en: x-ray energy eV, if omitted the value from the xrayutilities**

configuration is used

Returns:

beta (float)

c
chi0(en='config')[source]

calculates the complex chi_0 values often needed in simulations. They are closely related to delta and beta (n = 1 + chi_r0/2 + i*chi_i0/2 vs. n = 1 - delta + i*beta)

chih(q, en='config', temp=0, polarization='S')[source]

calculates the complex polarizability of a material for a certain momentum transfer and energy

Parameters:

**q: momentum transfer in (1/A)**

en:xray energy in eV, if omitted the value from the xrayutilities configuration is used
temp:temperature used for Debye-Waller-factor calculation
polarization:either ‘S’ (default) sigma or ‘P’ pi polarization
Returns:

(abs(chih_real),abs(chih_imag)) complex polarizability

dTheta(Q, en='config')[source]

function to calculate the refractive peak shift

Parameters:

**Q: momentum transfer (1/A)**

en:x-ray energy (eV), if omitted the value from the xrayutilities configuration is used
Returns:
deltaTheta:peak shift in degree
delta(en='config')[source]

function to calculate the real part of the deviation of the refractive index from 1 (n=1-delta+i*beta)

Parameters:

**en: x-ray energy eV, if omitted the value from the xrayutilities**

configuration is used

Returns:

delta (float)

density

calculates the mass density of an material from the mass of the atoms in the unit cell.

Returns:mass density in kg/m^3
distances()[source]

function to obtain distances of atoms in the crystal up to the unit cell size (largest value of a,b,c is the cut-off)

returns a list of tuples with distance d and number of occurence n [(d1,n1),(d2,n2),...]

Note

Note: if the base of the material is empty the list will be empty

environment(*pos, **kwargs)[source]

Returns a list of neighboring atoms for a given position within the the unit cell.

Parameters:

**pos: list or numpy array with the fractional coordinated in the**

unit cell

**keyword arguments:**

maxdist:maximum distance wanted in the list of neighbors :(default: 7)
Returns:

list of tuples with (distance,atomType,multiplicity) giving distance

(sorted) and type of neighboring atoms together with the amount of atoms at the given distance

classmethod fromCIF(ciffilename)[source]

Create a Crystal from a CIF file. Name and

Parameters:**ciffilename: filename of the CIF file**
Returns:Crystal instance
gamma
planeDistance(*hkl)[source]

determines the lattice plane spacing for the planes specified by (hkl)

Parameters:

**h,k,l: Miller indices of the lattice planes given either as**

list,tuple or seperate arguments

Returns:
d:the lattice plane spacing as float

Examples

>>> xu.materials.Si.planeDistance(0,0,4)
1.3577600000000001

or

>>> xu.materials.Si.planeDistance((1,1,1))
3.1356124059796255
class xrayutilities.materials.material.CubicAlloy(matA, matB, x)[source]

Bases: xrayutilities.materials.material.Alloy

ContentBasym(q_inp, q_perp, hkl, sur)[source]

function that determines the content of B in the alloy from the reciprocal space position of an asymmetric peak.

Parameters:

**q_inp** : inplane peak position of reflection hkl of

the alloy in reciprocal space

q_perp:perpendicular peak position of the reflection hkl of the alloy in reciprocal space
hkl:Miller indices of the measured asymmetric reflection
sur:Miller indices of the surface (determines the perpendicular direction)
Returns:

content, [a_inplane, a_perp, a_bulk_perp(x), eps_inplane, eps_perp]:

the content of B in the alloy determined from the input variables and the lattice constants calculated from the reciprocal space positions as well as the strain (eps) of the layer

ContentBsym(q_perp, hkl, inpr, asub, relax)[source]

function that determines the content of B in the alloy from the reciprocal space position of a symetric peak. As an additional input the substrates lattice parameter and the degree of relaxation must be given

Parameters:

**q_perp** : perpendicular peak position of the reflection

hkl of the alloy in reciprocal space

hkl:Miller indices of the measured symmetric reflection (also defines the surface normal
inpr:Miller indices of a Bragg peak defining the inplane reference direction
asub:substrate lattice constant
relax:degree of relaxation (needed to obtain the content from symmetric reciprocal space position)
Returns:

**content** : the content of B in the alloy determined from the input

variables

xrayutilities.materials.material.CubicElasticTensor(c11, c12, c44)[source]

Assemble the 6x6 matrix of elastic constants for a cubic material from the three independent components of a cubic crystal

Parameters:

**c11,c12,c44: independent components of the elastic tensor of cubic**

materials

Returns:

6x6 matrix with elastic constants

xrayutilities.materials.material.HexagonalElasticTensor(c11, c12, c13, c33, c44)[source]

Assemble the 6x6 matrix of elastic constants for a hexagonal material from the five independent components of a hexagonal crystal

Parameters:

**c11,c12,c13,c33,c44: independent components of the elastic tensor of**

a hexagonal material

Returns:

6x6 matrix with elastic constants

class xrayutilities.materials.material.Material(name, cij=None)[source]

Bases: object

base class for all Materials. common properties of amorphous and crystalline materials are described by this class from which Amorphous and Crystal are derived from.

absorption_length(en='config')[source]

wavelength dependent x-ray absorption length defined as mu = lambda/(2*pi*2*beta) with lambda and beta as the x-ray wavelength and complex part of the refractive index respectively.

Parameters:**en: energy of the x-rays (in eV, optional)**
Returns:the absorption length in um
beta(en='config')[source]
chi0(en='config')[source]

calculates the complex chi_0 values often needed in simulations. They are closely related to delta and beta (n = 1 + chi_r0/2 + i*chi_i0/2 vs. n = 1 - delta + i*beta)

critical_angle(en='config', deg=True)[source]

calculate critical angle for total external reflection

Parameters:

**en: energy of the x-rays, if omitted the value from the**

xrayutilities configuration is used

deg:return angle in degree if True otherwise radians (default:True)
Returns:

Angle of total external reflection

delta(en='config')[source]
density
idx_refraction(en='config')[source]

function to calculate the complex index of refraction of a material in the x-ray range

Parameters:

**en: energy of the x-rays, if omitted the value from the**

xrayutilities configuration is used

Returns:

n (complex)

lam
mu
nu
xrayutilities.materials.material.PseudomorphicMaterial(sub, layer, relaxation=0, trans=None)[source]

This function returns a material whos lattice is pseudomorphic on a particular substrate material. The two materials must have similar unit cell definitions for the algorithm to work correctly, i.e. it does not work for combiniations of materials with different lattice symmetry.

Parameters:

**sub: substrate material**

layer:bulk material of the layer
relaxation:degree of relaxation 0: pseudomorphic, 1: relaxed :(default: 0)
trans:Transformation which transforms lattice directions into a surface orientated coordinate frame (x,y inplane, z out of plane). If None a (001) surface geometry of a cubic material is assumed.
Returns:

An instance of Crystal holding the new pseudomorphically

strained material.

xrayutilities.materials.material.WZTensorFromCub(c11ZB, c12ZB, c44ZB)[source]

Determines the hexagonal elastic tensor from the values of the cubic elastic tensor under the assumptions presented in Phys. Rev. B 6, 4546 (1972), which are valid for the WZ <-> ZB polymorphs.

Parameters:

**c11,c12,c44: independent components of the elastic tensor of cubic**

materials

Returns:

6x6 matrix with elastic constants

Implementation according to a patch submitted by Julian Stangl

xrayutilities.materials.material.index_map_ij2ijkl(ij)[source]
xrayutilities.materials.material.index_map_ijkl2ij(i, j)[source]

xrayutilities.materials.predefined_materials module

class xrayutilities.materials.predefined_materials.AlGaAs(x)[source]

Bases: xrayutilities.materials.material.CubicAlloy

class xrayutilities.materials.predefined_materials.SiGe(x)[source]

Bases: xrayutilities.materials.material.CubicAlloy

static lattice_const_AB(latA, latB, x, **kwargs)[source]

method to calculate the lattice parameter of the SiGe alloy with composition Si_{1-x}Ge_x

xrayutilities.materials.spacegrouplattice module

module handling crystal lattice structures. A SGLattice consists of a space group number and the position of atoms specified as Wyckoff positions along with their parameters. Depending on the space group symmetry only certain parameters of the resulting instance will be settable! A cubic lattice for example allows only to set its ‘a’ lattice parameter but none of the other unit cell shape parameters.

class xrayutilities.materials.spacegrouplattice.RangeDict[source]

Bases: dict

class xrayutilities.materials.spacegrouplattice.SGLattice(sgrp, *args, **kwargs)[source]

Bases: object

lattice object created from the space group number and corresponding unit cell parameters. atoms in the unit cell are specified by their Wyckoff position and their free parameters.

this replaces the deprecated Lattice class

ApplyStrain(eps)[source]

Applies a certain strain on a lattice. The result is a change in the base vectors. The full strain matrix (3x3) needs to be given. .. note:: Note: Here you specify the strain and not the stress -> NO elastic

response of the material will be considered!
Parameters:**eps: a 3x3 matrix with all strain components**
GetPoint(*args)[source]

determine lattice points with indices given in the argument

Examples

>>> xu.materials.Si.lattice.GetPoint(0,0,4)
array([  0.     ,   0.     ,  21.72416])

or

>>> xu.materials.Si.lattice.GetPoint((1,1,1))
array([ 5.43104,  5.43104,  5.43104])
GetQ(*args)[source]

determine the reciprocal lattice points with indices given in the argument

UnitCellVolume()[source]

function to calculate the unit cell volume of a lattice (angstrom^3)

a
alpha
b
base()[source]

generator of atomic position within the unit cell.

beta
c
classmethod convert_to_P1(sglat)[source]

create a P1 equivalent of the given SGLattice instance.

Parameters:

**sglat: space group lattice instance to be converted to P1.**

Returns:

SGLattice instance with the same properties as sglat, however in the P1

setting.

classmethod fromLattice(lat, verbose=True)[source]

create a SGLattice from an old Lattice instance. Since the space-group is not known it will always be 1 (triclinic). This is helper routine to make the transition period for users easier. It will be removed in the next major release!

Parameters:**lat: deprecated Lattice instance**
Returns:SGLattice instance with the same properties as lat
gamma
isequivalent(hkl1, hkl2, equalq=False)[source]

primitive way of determining if hkl1 and hkl2 are two crystallographical equivalent pairs of Miller indices

Parameters:

**hkl1,2: Miller indices to be checked for equivalence**

equalq:If False the length of the two q-vactors will be compared. If True it is assumed that the length of the q-vectors of hkl1 and hkl2 is equal!
Returns:

True or False

class xrayutilities.materials.spacegrouplattice.WyckoffBase(*args, **kwargs)[source]

Bases: list

The WyckoffBase class implements a container for a set of Wyckoff positions that form the base of a crystal lattice. An instance of this class can be treated as a simple container object.

append(atom, pos, occ=1.0, b=0.0)[source]

add new Atom to the lattice base

Parameters:

**atom: atom object to be added**

pos:Wyckoff position of the atom, along with its parameters. :Examples: (‘2i’, (0.1, 0.2, 0.3)), or ‘1a’
occ:occupancy (default=1.0)
b:b-factor of the atom used as exp(-b*q**2/(4*pi)**2) to reduce the intensity of this atom (only used in case of temp=0 in StructureFactor and chi calculation)

xrayutilities.materials.wyckpos module

Module contents