Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

MaXrd

Guides

  • MaXrd – Mathematica X-ray diffraction package

Tech Notes

  • Applying crystal data
  • Basic computations
  • Computations on reflections
  • Formulas in crystallography
  • Importing crystal data
  • Quick guide to conditions
  • References
  • Symmetry calculations
  • The association structure of crystallographic data
  • Using the rotation options

Symbols

  • AttenuationCoefficient
  • BraggAngle
  • ConstructDomains
  • CrystalDensity
  • CrystalFormulaUnits
  • CrystalPlot
  • DarwinWidth
  • DistortStructure
  • DomainPlot
  • EmbedStructure
  • ExpandCrystal
  • ExportCrystalData
  • ExtinctionLength
  • FindPixelClusters
  • GetAtomCoordinates
  • GetAtomicScatteringFactors
  • GetCrystalMetric
  • GetElements
  • GetLatticeParameters
  • GetLaueClass
  • GetScatteringCrossSections
  • GetSymmetryData
  • GetSymmetryOperations
  • ImportCrystalData
  • InputCheck
  • InterplanarSpacing
  • MergeDomains
  • MergeSymmetryEquivalentReflections
  • MillerNotationToList
  • MillerNotationToString
  • ReciprocalImageCheck
  • ReciprocalSpaceSimulation
  • ReflectionList
  • RelatedFunctionsGraph
  • ResetCrystalData
  • ResizeStructure
  • SimulateDiffractionPattern
  • StructureFactor
  • StructureFactorTable
  • SymmetryEquivalentPositions
  • SymmetryEquivalentReflections
  • SymmetryEquivalentReflectionsQ
  • SynthesiseStructure
  • SystematicAbsentQ
  • ToStandardSetting
  • TransformAtomicDisplacementParameters
  • UnitCellTransformation
  • $CrystalData
  • $GroupSymbolRedirect
  • $LaueClasses
  • $MaXrdPath
  • $MaXrdVersion
  • $PeriodicTable
  • $PointGroups
  • $SpaceGroups
  • $TransformationMatrices
Applying crystal data
2D simulation of reciprocal space
Structure factors
Atomic scattering factors
Unit cell transformation
Another tutorial covers the import of crystal data to the format used in this package. In this tutorial we will see a few examples on how to make use of that information.
The package must be loaded:
In[1]:=
Needs["StianRamsnes`MaXrd`"]
This package comes with many convenient functions that utilises the stored crystal data. They can mainly be divided into two categories: those used to extract data and those used for calculations.
GetAtomicScatteringFactors
†
returns
f+
′
f
+
″
f
for each elements of the crystal
GetCrystalMetric
return the metric
G
associated with the crystal lattice
GetLatticeParameters
return the lattice parameters associated with the crystal
GetLaueClass
returns the corresponding Laue class of the group/crystal
GetScatteringCrossSection
†
returns σ for given elements and wavelength
GetSymmetryData
extract space group information easily
GetSymmetryOperations
returns alle the symmetry operations for a point- or space group
ImportCrystalData
import crystallographic information from cif files
Functions that are mainly used for easy extraction of data.
† denotes functions that use data files located $MaXrdPath ▶ Core ▶ Data.
AttenuationCoefficient
calulate the μ abosrption factor
BraggAngle
calculate the Bragg angle, given
λ
and
hkl
CrystalDensity
calculate theoretical value for the density
DarwinWidth
‡
calculate the Darwin width of a given
hkl
ExtinctionLength
‡
calculate the extinction (Pendellösung) distance of a given
hkl
ReciprocalSpaceSimulation
simulate the reflections (nodes) of a plane in reciprocal space
StructureFactor
calculate the structure factor
F(hkl)
UnitCellTransformation
transform among alternative unit cell representations
Functions in the package which can operate on data in
$CrystalData
,
$PointGroups
or
$SpaceGroups
directly to perform calculations.
‡ denotes functions related to dynamical diffraction theory.
2D simulation of reciprocal space
With the metric information of a crystal contained in
$CrystalData
and the function for generating appropriate reflections,
ReflectionList
, one can relatively easily create a function that simulates a section of reciprocal space.
ReciprocalSpaceSimulation
is a simple function that does this. We can use
RelatedFunctionsGraph
to check which other package components it is made of:
In[2]:=
RelatedFunctionsGraph

ReciprocalSpaceSimulation

Out[2]=
The essential inputs are the crystal label – which contains the lattice specification – and the orientation details of the plane in reciprocal space. Information on the function syntax:
In[3]:=
?
ReciprocalSpaceSimulation
Out[3]=
Symbol
ReciprocalSpaceSimulation[crystal,{
L
1
,
L
2
},origin,
d
min
] plots a simulation of the reciprocal space of
crystal
, with
L
1
and
L
2
defining the layer plane centred at
origin
and
d
min
the resolution.​​ReciprocalSpaceSimulation[crystal,λ,{
L
1
,
L
2
},origin,
d
min
] plots a simulation of the reciprocal space of
crystal
at wavelength
λ
, with
L
1
and
L
2
defining the layer plane centred at
origin
and
d
min
the resolution.
From this we see that the function also requires an origin for the plane, a resolution and wavelength (if not contained along with crystal data). Let us look at some examples:
In[4]:=
ReciprocalSpaceSimulation
[​​"LithiumManganesePhosphate",1.54059,​​{{1,0,0},{0,0,1}},​​{0,2,0},1.12]​​(*the(h2l)plane*)
Out[4]=
The image above shows the
(h2l)
plane of an orthorhombic structure.
Below is an example of a hexagonal structure:
In[5]:=
ReciprocalSpaceSimulation
[​​"Zinc",0.709317,​​{{1,0,0},{0,1,0}},​​{0,0,0},0.60]​​(*the(hk0)plane*)
Out[5]=
Adjusting the resolution will have the effect of “zooming” in and out. The resolution governs which reflections we are able to see. Note that the indices of the reflections can be read from the tooltips (hover the mouse over any node).
Please see the documentation page for more example of usage.
Atomic scattering factors
The data is stored in two different ways: either as coefficients (so-called Cromer–Mann coefficients) to approximate the scattering factor with the function
For completeness, the f1f2 files are:
◼
f1f2_asf_Kissel.dat
◼
f1f2_BrennanCowan.dat
◼
f1f2_Chantler.dat
◼
f1f2_CromerLiberman.dat
◼
f1f2_EPDL97.dat
◼
f1f2_Henke.dat
◼
f1f2_Sasaki.dat
◼
f1f2_Windt.dat
◼
Organisation scheme for f0 functions (those with data point format):
◼
Organisation scheme for f1f2 functions:
where the f* functions are the corresponding interpolation functions generated, which require a wavelength input and return the value of f0, f1 or f2.
The f0 interpolation functions use interpolation order 3, while the f1f2 functions use order 1 (linear). All use the Hermite interpolation method.
Note that for all f0, f1 and f2 interpolation functions the desired scattering factor is obtained with:
After running the code above, the symbols are created. Let us check this:
Structure factors
There are also some options available:
MaXrd ▶ Kernel ▶ Data ▶ AtomicScatteringFactor
Which in the current version include:
The sources for the anomalous corrections are contained in a subfolder:
MaXrd ▶ Kernel ▶ Data ▶ AtomicScatteringFactor ▶ AnomalousCorrections
Please see the documentation page for more example of usage and elaboration on the options.
Unit cell transformation
First import the crystal data from a .cif file (in the package)
Notice how the lattice parameters have been permuted:

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com