neutronpy.crystal.Material

class neutronpy.crystal.Material(crystal)[source]

Class for the Material being supplied for the structure factor calculation

Parameters:
data : dictionary

data is a dictionary containing all of the atoms and their positions, with optional occupancy and variances in positions (dpos), which may be used for Debye-Waller factor. This dictionary has the format:

{'name': str,
 'composition': [{'ion': str,
                  'pos': [float, float, float],
                  'Uiso': float,
                  'Uaniso': matrix(3,3)
                  'occupancy': float}],
 'massNorm': bool,
 'formulaUnits': float,
 'lattice': {'abc': [float, float, float],
             'abg': [float, float, float]}
The following are valid options for the data dictionary:
‘name’ : str

Name of the structure

‘composition’ : list of dicts

For each atom in the unit cell, you must provide:

‘ion’ : str

Name of the atom. Needed for mass and scattering length

‘pos’ : list of 3 floats

x, y, z position of the atom within the unit cell in normalized units

‘dpos’ : list of 3 floats

x, y, z displacements of the atom, for Debye-Waller factor, in normalized units

‘occupancy’ : float

Occupancy of the site, e.g. if atoms only partially occupy this site

‘Uiso’ : bool

Include Debye-Waller in calculation with isotropic U

‘Uaniso’ : bool

Include Debye-Waller in calculation with anisotropic U

‘massNorm’ : bool

Normalize calculations to the square-root of the mass of atoms. This is useful for the calculation of the coherent one-phonon inelastic cross-section, which is dependent on a nuclear structure factor in which the nuclear scattering length is normalized by the square-root of the mass, i.e. \(\bar{b}_d/\sqrt{M_d}\), see Eq. 4.88 in “Theory of neutron scattering from condensed matter, Volume 1” by Stephen W. Lovesey.

‘formulaUnits’ : float

Number of formula units to use in the calculation

‘lattice’ : dict

‘abc’ : lattice constants of unit cell

‘abg’ : lattice angles of unit cell

‘space_group’ : str or int

Hermann–Mauguin symbol or international space group number

Returns:
output : object

Material Object defining a single crystal.

Attributes:
volume

Volume of the unit cell in Å3

total_scattering_cross_section

Returns total scattering cross-section of unit cell

a

First lattice constant in Angstrom

b

Second lattice constant in Angstrom

c

Third lattice constant in Angstrom

astar

First inverse lattice constant in inverse Angstrom

bstar

Second inverse lattice constant in inverse Angstrom

cstar

Third inverse lattice constant in inverse Angstrom

alpha

First lattice angle in degrees

beta

Second lattice angle in degrees

gamma

Third lattice angle in degrees

alpha_rad

First lattice angle in radians

beta_rad

Second lattice angle in radians

gamma_rad

Third lattice angle in radians

alphastar

First inverse lattice angle in degrees

betastar

First inverse lattice angle in degrees

gammastar

First inverse lattice angle in degrees

alphastar_rad

First inverse lattice angle in radians

betastar_rad

Second inverse lattice angle in radians

gammastar_rad

Third inverse lattice angle in radians

abg_rad

Lattice angles in radians returned in list

reciprocal_abc

Reciprocal lattice constants in inverse Angstrom returned in list

reciprocal_abg

Reciprocal lattice angles in degrees returned in list

reciprocal_abg_rad

Reciprocal lattice angles in radians returned in list

lattice_type

Type of lattice determined by the provided lattice constants and angles

volume

Volume of the unit cell in Å3

reciprocal_volume

Volume of the reciprocal unit cell in (Å-1)3

G

Metric tensor of the real space lattice

Gstar

Metric tensor of the reciprocal lattice

Bmatrix

Cartesian basis matrix in reciprocal units such that

Umatrix

Rotation matrix that rotates the sample’s reference frame into the spectrometer’s

UBmatrix

Orientation matrix of the sample

u

First orientation vector

v

Second orientation vector

Methods

calc_nuc_str_fac(hkl) Calculates the structural form factor of the material.
calc_mag_str_fac() Calculates magnetic structure factor
calc_mag_int_vec() Calculates magnetic interaction vector
calc_incoh_elas_xs([mass]) Calculates the incoherent elastic cross section.
calc_optimal_thickness([energy, transmission]) Calculates the optimal sample thickess to avoid problems with extinction, multiple coherent scattering and absorption.
plot_unit_cell() Plots the unit cell and atoms of the material.
get_angle_between_planes(v1, v2) Returns the angle \(\phi\) between two reciprocal lattice vectors (or planes as defined by the vectors normal to the plane).
get_d_spacing(hkl) Returns the d-spacing of a given reciprocal lattice vector.
get_q(hkl) Returns the magnitude of Q for a given reciprocal lattice vector in Å-1.
get_two_theta(hkl, wavelength) Returns the detector angle 2𝜃 for a given reciprocal lattice vector and incident wavelength.
get_phi(Q) Get out-of-plane scattering angle.
N_atoms(mass) Number of atoms in the defined Material, given the mass of the sample.
apply_scattering_rules  
find_equivalent_positions  
find_site_multiplicity  
generate_hkl_positions