Code to calculate the crystal field Hamiltonian of magnetic ions.
Created by Allen Scheie
Please cite Scheie, A. "PyCrystalField: Software for Calculation, Analysis, and Fitting of Crystal Electric Field Hamiltonians", J. Appl. Cryst. 54. (2021). https://doi.org/10.1107/S160057672001554X
For documentation, see here
Added ability of importCIF to handle "near-symmetries". If no rotation or mirror symmetries are found, it will search for near-rotation symmetries with continuous shape measures (CSM) in order to define the quantization (Z) axis. If no close symmetries are found, it calculates the moment of intertia tensor of the ligands and uses the principal axes to define the Z axis.
Other small bugs in importCIF were fixed as well.
Fixed bug in g tensor calculations so that Lande g factor is included in rare earth ions.
Modified importCIF to (a) import only the first phase listed in a .cif file, (b) treat the first listed rare earth ion as the central ion if none is specified, (c) import multiply defined ligand positions, outputting all possible structures, (d) allow the user to specify a certain number of ions in the coordination sphere rather than categorizing them by ion type (which is still the default).
Fixed bug in magnetization calculations so that M_y is calculated properly. (Oct 15 update introduced a bug which set J_y imaginary components to real when calculating magnetization.)
Added tables of radial integrals and spin orbit coupling constants for 3d and 4d transition ions.
Modified importCIF so that it will work for 3d transition ions, adding example (NCNF.py) showing how to do this.
Added importCIF function which imports a crystal structure from a .cif file, orients the axes along the appropriate symmetry-defined directions, and calculates a point charge model. It returns a Ligands object and a CFLevels object for further adjustments or fitting. (Currently, it only works for rare earth ions.)
Also allows the user to specify the axes if the ion is too low-symmetry for PyCrystalField to identify a custom z or y axis.
Optimized the PyCrystalField neutron spectrum function for the effective J basis so that it runs over an order of magnitude faster. Fits that previously took 40 minutes now take 4 minutes.
This code is for doing single-ion crystal field calculations on Rare Earth ions using the Stevens Operators formalism. It can also do calculations on transition metal ions, though the code has not been cross-checked in that regime. The math is based on M. Hutchings, Solid State Physics, 16 , 227 (1964).
PyCrystalField can generate a crystal electric field (CEF) Hamiltonian in two ways: (1) calculating the Hamiltonian for a given set of CEF parameters, or (2) calculating the Hamiltonian from an effective point-charge model.
From the Hamiltonian, PyCrystalField can then calculate:
- Eigenvalues (energy spectrum) and eigenvectors
- Temperature and field-dependent single-ion magnetization
- Temperature and field-dependent magnetic susceptibility
- Temperature, energy, and momentum-dependent neutron spectrum (using the dipole approximation)
PyCrystalField can also fit the crystal field Hamiltonian to data. The user can define an arbitrary ChiSquared function based on any observables (neutron data, susceptibility, magnetization, or eigenvalues) and PyCrystalField will minimize the ChiSquared function by varying a defined set of CEF parameters. Alternatively, PyCrystalField can fit effective charges of a point charge model.
All calculations can be carried out in the strong spin-orbit coupling regime (usling effective J states), the intermediate spin-orbit coupling regime (treating spin orbit interactions non-perturbatively in the L and S basis), or the weak spin-orbit coupling regime (dealing with effective l states).