neutronpy.crystal.material.Material¶
-
class
neutronpy.crystal.material.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: volumeVolume of the unit cell in Å3
total_scattering_cross_sectionReturns total scattering cross-section of unit cell
aFirst lattice constant in Angstrom
bSecond lattice constant in Angstrom
cThird lattice constant in Angstrom
astarFirst inverse lattice constant in inverse Angstrom
bstarSecond inverse lattice constant in inverse Angstrom
cstarThird inverse lattice constant in inverse Angstrom
alphaFirst lattice angle in degrees
betaSecond lattice angle in degrees
gammaThird lattice angle in degrees
alpha_radFirst lattice angle in radians
beta_radSecond lattice angle in radians
gamma_radThird lattice angle in radians
alphastarFirst inverse lattice angle in degrees
betastarFirst inverse lattice angle in degrees
gammastarFirst inverse lattice angle in degrees
alphastar_radFirst inverse lattice angle in radians
betastar_radSecond inverse lattice angle in radians
gammastar_radThird inverse lattice angle in radians
abg_radLattice angles in radians returned in list
reciprocal_abcReciprocal lattice constants in inverse Angstrom returned in list
reciprocal_abgReciprocal lattice angles in degrees returned in list
reciprocal_abg_radReciprocal lattice angles in radians returned in list
lattice_typeType of lattice determined by the provided lattice constants and angles
volumeVolume of the unit cell in Å3
reciprocal_volumeVolume of the reciprocal unit cell in (Å-1)3
GMetric tensor of the real space lattice
GstarMetric tensor of the reciprocal lattice
BmatrixCartesian basis matrix in reciprocal units such that
UmatrixRotation matrix that rotates the sample’s reference frame into the spectrometer’s
UBmatrixOrientation matrix of the sample
uFirst orientation vector
vSecond 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