A comprehensive Mathematica package for crystallographic computations, MaXrd, has been developed. It comprises space group representations based on International Tables for Crystallography, volume A together with scattering factors from XOP and cross sections from xraylib. Featured functionalities include calculation of structure factors, linear absorption coefficients and crystallographic transformations. The crystal data used by MaXrd is normally generated from external cif files.
The package comes with a dynamic documentation seamlessly integrated with the Mathematica system, including code, examples, details and options. From the onset, minimal Mathematica experience is required to make use of the package. It may be a helpful supplement in research and teaching where crystallography and X-ray diffraction are essential. Although Mathematica is a proprietary software, all the code of this package is open source. It may easily be extended to cover user-specific applications.
The article Using Mathematica as a platform for crystallographic computing was published in the Journal of Applied Crystallography in February 2019 (Ramsnes, S., Larsen, H. B. & Thorkildsen, G. (2019). J. Appl. Cryst. 52, 214–218). In 2020, an update article MaXrd updated with emphasis on model construction and reciprocal-space simulations (Ramsnes, S. P., Larsen, H. B. & Thorkildsen, G. (2020). J. Appl. Cryst. 53, 1620–1624) was published in the same journal.
An overview of the available functions can be found in the wiki. The main documentation is accessible in Mathematica once the package is installed. Some of the highlights and newest features are listed below:
Core crystallographic information can be be read from cif
files using ImportCrystalData
.
Data will persist in the local $UserBaseDirectory
, readily accessible with $CrystalData
.
The simple but convenient function CrystalPlot
can visualise the structure.
Symmetry-related functions can be used for basic operations on reflections and positions, and also to grow the asymmetric unit into an arbitrary large structure.
Essentials of the International Tables, vol. A are stored in $SpaceGroups
.
There is also UnitCellTransformation
for changing between equivalent cell descriptions.
Written with inclusion compounds in mind, EmbedStructure
is ideal for merging guest entities with a host structure at random, sequential or conditional positions.
Rotations and/or translations can be executed prior to placement with the same freedom.
The user can also specify a displacement field to shift everything by a relative amount with DistortStructure
.
Structural pieces can be sewn together automatically with SynthesiseStructure
, which is particularly useful when working with multiple domains.
When the model is complete, SimulateDiffractionPattern
can be applied to render images through DISCUS or DIFFUSE.
Download the latest paclet file and install it, or install from the web directly:
PacletInstall["https://github.com/Stianpr20/MaXrd/releases/download/3.0.0/MaXrd-3.0.0.paclet"]
The latest version of MaXrd is 3.0.0, which is compatible with Mathematica version 12.1 and above. It was built using the PacletTools in Mathematica 13.0.1.
Clone, fork or download the repository if you want to develop on the package.
Load the package with:
<< MaXrd`
If you want MaXrd to launch automatically on startup, first open the Wolfram Language Documentation Center. This can be done from the file menu: Help -> Wolfram Documentation
. Scroll to the bottom and click on Add-ons and Packages. Click on the disclosure triangle next to MaXrd to open the cell and then the same for Manage. Make sure the option Startup is selected.
To access the package documentation, open the Wolfram Documentation in Mathematica after installing it and search for «MaXrd» or any related content.
Any comments or feedback are welcome. Submit an issue in the repository.