arXiv is now an independent nonprofit! Learn more
License: CC BY-NC-ND 4.0
arXiv:2608.05918v1 [cond-mat.mtrl-sci] 06 Aug 2026

Jsymm: A Python package for symmetry analysis of exchange tensors in magnetic Hamiltonians

Alexander S. Sergeev Sergey V. Streltsov M.V. Lomonosov Moscow State University, Moscow, Russia M.N. Mikheev Institute of Metal Physics, Ural Branch of Russian Academy of Sciences, 620137 Ekaterinburg, Russia
Abstract

Symmetries of a crystal often restrict its physical properties. In particular, they determine possible forms of the tensors that describe interatomic exchange interaction, which governs a wide range of magnetic phenomena. Computationally demanding first-principles calculations of the exchange tensors can be greatly simplified by taking the symmetry constraints into account. Here, we present Jsymm, a Python package that derives the most general symmetry-compatible form of the exchange tensors directly from the crystallographic data. For any bond formed by magnetic ions, Jsymm produces the tensors of the Dzyaloshinskii–Moriya and anisotropic Heisenberg exchange interaction in symbolic form, as well as the tensors for all other bonds related to it by symmetry. This reduces the number of independent model parameters, dramatically lowering the computational cost of the ab initio calculations and preventing unphysical results arising from symmetry violations. The package accepts standard CIF files and provides a web interface in addition to an interactive text mode and a Python library. We demonstrate its utility on La2CuO4 and α\alpha-Fe2O3, reproducing known symmetry constraints and revealing additional relations between components of the exchange tensors of different bonds.

PROGRAM SUMMARY

Program Title: Jsymm
Developer’s repository link: https://github.com/jTraceless/jsymm
Licensing provisions: MIT License
Programming language: Python
Supplementary material:
Nature of the problem: A tensor describing the anisotropic exchange interaction between two magnetic moments has nine independent components. Even a relatively small unit cell of a crystal can contain tens of such pairs. Finding all their parameters in brute force ab initio calculations is costly and inefficient. The task can be simplified by imposing symmetry constraints on the exchange tensors. However, these restrictions are to be imposed for each crystal in an ad hoc manner. One has to identify symmetries for each bond and to find all other bonds related to it by symmetry operations, and then to compute appropriate tensors. This can become an onerous exercise in crystallography and linear algebra, which can easily lead to incomplete or incorrect results.
Solution method: Given a CIF file describing the structure of a crystal and a set of interatomic bonds of interest, Jsymm first analyses the action of the crystal symmetries on the bonds, finding their stabilizer subgroups and orbits. For a representative bond in each orbit, Jsymm computes the symmetry-allowed exchange tensors using projection on the subspace of the trivial representation of the stabilizer subgroup in the vector space of exchange tensor matrices. Finally, Jsymm finds the set of symmetry-compatible exchange tensors for all bonds in each orbit. This gives a set of symbolic matrices for the most general exchange tensors allowed by symmetry for the crystal.
Additional comments:

keywords:
crystal symmetry , exchange interaction , symmetry-compatible tensors , spin Hamiltonians , Python
journal: Computer Physics Communications

1 Introduction

The Heisenberg model [1, 2] has become one of the key Hamiltonians used to describe the magnetic properties of various materials with localized magnetic moments. For a pair of spins, the isotropic Heisenberg exchange interaction has the form

H(𝐒i,𝐒j)=Jiso𝐒i𝐒j=JisoαSiαSjα,H(\mathbf{S}_{i},\mathbf{S}_{j})=J^{\mathrm{iso}}\,\mathbf{S}_{i}\cdot\mathbf{S}_{j}=J^{\mathrm{iso}}\sum_{\alpha}S_{i}^{\alpha}S_{j}^{\alpha}, (1)

where α\alpha runs over the coordinates x,y,zx,y,z. Although initially the coupling parameter JisoJ^{\mathrm{iso}} was introduced as a scalar, it was soon realized [3] that the exchange interaction can be rather anisotropic and should instead be described by a tensor:

H(𝐒i,𝐒j)=𝐒iTJ𝐒j=αβSiαJαβSjβ,H(\mathbf{S}_{i},\mathbf{S}_{j})=\mathbf{S}_{i}^{T}J\mathbf{S}_{j}=\sum_{\alpha\beta}S^{\alpha}_{i}J^{\alpha\beta}S^{\beta}_{j}, (2)

where α,β=x,y,z\alpha,\beta=x,y,z. Both the presence of the off-diagonal elements in the exchange matrix and the difference between its diagonal entries are extremely important: they determine not only the temperature and field dependence of magnetic properties, but are also responsible for various physical effects such as the inverse Dzyaloshinskii–Moriya effect (one of the key mechanisms of multiferroicity) [4], the formation of chiral magnetic textures, and possible realization of Kitaev spin liquids [5, 6].

While the exchange matrix is one of the key factors defining the magnetic properties of solids, its calculation using ab initio approaches is rather challenging. Various methods have been proposed, including the Green’s function technique [7, 8], the so-called four-state method [9], and approaches based on the computation of total energies for different magnetic configurations [10] (see also reviews [11, 12, 13]). However, exchange interactions can have a long-range character and even the calculation of all isotropic exchanges JisoJ^{\mathrm{iso}} can be quite time-consuming. Moreover, different methods may yield different and sometimes conflicting results.

Including spin–orbit coupling, which is necessary for computing the off-diagonal elements of the exchange tensor, substantially complicates the self-consistency procedure and slows down convergence. Together with on-site Coulomb repulsion (Hubbard UU) it also leads to the formation of local minima of energy functional, often causing the calculations to become trapped in such states and leading to incorrect results as a consequence. Thus, evaluating all elements of the exchange tensor, even for a limited set of nearest neighbors, becomes a remarkably complex problem.

The number of parameters to be calculated can be substantially reduced if the symmetry of the system is taken into account [14, 15]. In many cases, knowledge of the point group allows one to restrict the problem to the calculation of just a few matrix elements of the exchange tensor. In this work, we present Jsymm, a Python package that allows one to find the form of symmetry-compatible exchange tensors for any set of bonds in a crystal of interest, using only crystallographic information from a cif file (such files are available in public databases). The article is organized as follows. We start by describing a mathematical algorithm for finding the symmetry constraints in Sec. 2. In Sec. 3 we discuss the details of how the algorithm is implemented. Sec. 4 provides examples of working with the package. Finally, we demonstrate the results of the symmetry analysis for several physical examples in Sec. 5, and conclude in Sec. 6.

2 Symmetry constraints on exchange tensors

Consider a bond consisting of two magnetic ions with exchange interaction described by Eq. (2). We decompose the exchange tensor into symmetric and antisymmetric parts:

H(𝐒i,𝐒j)=𝐒iTΓ𝐒j+𝐃[𝐒i×𝐒j].H(\mathbf{S}_{i},\mathbf{S}_{j})=\mathbf{S}_{i}^{T}\Gamma\mathbf{S}_{j}+\mathbf{D}\cdot[\mathbf{S}_{i}\times\mathbf{S}_{j}]. (3)

Here, the symmetric part is given by Γ=12(J+JT)\Gamma=\frac{1}{2}(J+J^{T}) and the antisymmetric part is represented by a three-dimensional vector 𝐃\mathbf{D} describing the Dzyaloshinskii–Moriya interaction (DMI). Although the symmetric part includes the isotropic exchange, Jiso=13tr(Γ)J^{\mathrm{iso}}=\frac{1}{3}\operatorname{tr}(\Gamma), we will refer to Γ\Gamma as the symmetric anisotropic exchange in what follows.

In a crystal, symmetry operations can interchange atoms and transform their spins. Since the full Hamiltonian must be invariant under this action, the symmetries can severely restrict the possible form of the exchange matrices. The symmetry constraints come in two forms:

  • 1.

    The tensors of each individual bond must be invariant under the action of the symmetry elements that map the bond to itself.

  • 2.

    If a symmetry element maps one bond into another, their tensors must be compatible with this action.

The first kind of constraints affects only the anisotropic exchange tensors, 𝐃\mathbf{D} and the traceless part of Γ\Gamma. For the DM exchange interaction, these constraints are known as the “Moriya rules” [16]. But even if such constraints are absent, there can be non-trivial relations of the second kind. In particular, the isotropic exchange JisoJ^{\mathrm{iso}} must have the same value for all bonds related by symmetry operations.

Our goal is to determine for a given set of bonds the most general form of 𝐃\mathbf{D} and Γ\Gamma allowed by crystal symmetry. To this end, we first examine the action of symmetry elements on the exchange matrices, then consider the action on the bonds in the context of the periodic lattice, and finally determine the desired invariant form of exchange matrices both for an individual bond and for all other bonds related to it by the symmetry operations.

2.1 Symmetry element action on exchange tensors

To find the constraints imposed by symmetry on the exchange tensors of a bond, we first need to understand how these tensors are transformed under the action of symmetry elements. Recall that spins transform as axial vectors:

g𝐒=det(Rg)Rg𝐒,g\cdot\mathbf{S}=\det(R_{g})R_{g}\mathbf{S}, (4)

where gg is a symmetry element, RgR_{g} is its matrix, and 𝐒=(Sx,Sy,Sz)T\mathbf{S}=(S_{x},S_{y},S_{z})^{T}. We define the corresponding action on the Hamiltonian term by

[gH](𝐒i,𝐒j)=H(g1𝐒i,g1𝐒j).[g\cdot H](\mathbf{S}_{i},\mathbf{S}_{j})=H(g^{-1}\mathbf{S}_{i},g^{-1}\mathbf{S}_{j}). (5)

An exchange term in the Hamiltonian can be written as

HJ(𝐒i,𝐒j)=𝐒iTJ𝐒j,H_{J}(\mathbf{S}_{i},\mathbf{S}_{j})=\mathbf{S}_{i}^{T}J\mathbf{S}_{j}, (6)

where JJ is the exchange matrix. In particular, the DMI matrix has the form

D=(0DzDyDz0DxDyDx0),D=\begin{pmatrix}0&&D_{z}&&-D_{y}\\ -D_{z}&&0&&D_{x}\\ D_{y}&&-D_{x}&&0\\ \end{pmatrix}, (7)

where DαD_{\alpha} are the components of the vector 𝐃\mathbf{D}. Since the matrix DD is antisymmetric, we have

𝐒iTD𝐒j=𝐒jTD𝐒i,\mathbf{S}_{i}^{T}D\mathbf{S}_{j}=-\mathbf{S}_{j}^{T}D\mathbf{S}_{i}, (8)

which one can interpret as

HD(𝐒i,𝐒j)=HD(𝐒j,𝐒i).H_{D}(\mathbf{S}_{i},\mathbf{S}_{j})=H_{-D}(\mathbf{S}_{j},\mathbf{S}_{i}). (9)

In other words, the vector 𝐃\mathbf{D} must change sign upon the permutation of the spin labels to compensate the sign change of the cross product and leave the energy contribution invariant.

Suppose that the group element gg maps each atom of the bond to itself. Then it follows from Eqs. (4), (5) and (6) that the matrix JJ transforms as

gJ=RgJRgT,g\cdot J=R_{g}JR_{g}^{T}, (10)

where we used that RgR_{g} is orthogonal, so Rg1=Rg1=RgTR_{g^{-1}}=R_{g}^{-1}=R_{g}^{T}. In the case when gg interchanges two atoms, the DMI matrix also changes its sign, according to Eq. (9). We conclude that the symmetry element that maps the bond to itself acts on the exchange matrices as follows:

gΓ=RgΓRgT,gD=±RgDRgT,g\cdot\Gamma=R_{g}\Gamma R_{g}^{T},\qquad g\cdot D=\pm R_{g}DR_{g}^{T}, (11)

where the minus sign corresponds to the symmetries that flip the bond.

One can also derive the transformation rule for the vector 𝐃\mathbf{D}. Since the cross product transforms as an axial vector,

[gH𝐃](𝐒i,𝐒j)=𝐃[RgT𝐒i×RgT𝐒j]=𝐃(det(RgT)RgT[𝐒i×𝐒j])=(det(Rg)Rg𝐃)[𝐒i×𝐒j].[g\cdot H_{\mathbf{D}}](\mathbf{S}_{i},\mathbf{S}_{j})=\mathbf{D}\cdot[R_{g}^{T}\mathbf{S}_{i}\times R_{g}^{T}\mathbf{S}_{j}]=\\ \mathbf{D}\cdot\bigl(\det(R_{g}^{T})R_{g}^{T}[\mathbf{S}_{i}\times\mathbf{S}_{j}]\bigr)=\bigl(\det(R_{g})R_{g}\mathbf{D}\bigr)\cdot[\mathbf{S}_{i}\times\mathbf{S}_{j}]. (12)

Thus, 𝐃\mathbf{D} also transforms as an axial vector, which additionally changes its sign when gg flips the bond.

2.2 Stabilizer and orbit of the bond

Our next step is to determine which symmetry elements contribute to the constraints of the first kind introduced above and which bonds are affected by the constraints of the second kind. To this end, we define the notions of a stabilizer subgroup and an orbit of a bond, taking into account the lattice periodicity.

Recall that the point group GG of a crystal is defined as a quotient G=S/TG=S/T of the space group SS by the subgroup TT of lattice translations. The point group consists of cosets

[g]={R|𝐭}T,[g]=\{R|\mathbf{t}\}T, (13)

where RR is the reflection or rotation matrix and 𝐭\mathbf{t} is the translation vector. For each coset [g][g], we choose a representative element g={R|𝐭}g=\{R|\mathbf{t}\}, where 𝐭\mathbf{t} has non-negative fractional components.

Our goal is to define the action of the point group GG on the bonds formed by pairs of atoms. As an intermediate step, consider the action of the representative gg on an atom aa with the position vector 𝐫\mathbf{r}:

ga={atom at position g𝐫=R𝐫+𝐭}.g\cdot a=\{\text{atom at position }g\cdot\mathbf{r}=R\mathbf{r}+\mathbf{t}\}. (14)

We define a bond as an ordered pair of atoms and denote it

𝐛=(a1,a2).\mathbf{b}=(a_{1},a_{2}). (15)

There is no need to distinguish bonds that are related by a uniform lattice translation of both atoms. Formally, one can describe this by an equivalence relation \sim on the set of all bonds:

(a1+𝐓,a2+𝐓)(a1,a2),(a_{1}+\mathbf{T},a_{2}+\mathbf{T})\sim(a_{1},a_{2}), (16)

where 𝐓\mathbf{T} is a translation by a lattice vector. Now we can consider the equivalence classes of bonds [𝐛][\mathbf{b}] associated with \sim. One can think of the class [𝐛][\mathbf{b}] as an infinite lattice of all bonds related to 𝐛\mathbf{b} by a lattice translation.

We define the action of the point group on the class [𝐛]=[(a1,a2)][\mathbf{b}]=[(a_{1},a_{2})] as

[g][𝐛]=[(ga1,ga2)].[g]\cdot[\mathbf{b}]=[(g\cdot a_{1},g\cdot a_{2})]. (17)

One checks that the action is well-defined in both arguments: the result does not depend neither on the choice of the representative gg of the coset, nor on the choice of the bond 𝐛\mathbf{b} in the equivalence class. This happens because the lattice translations in [g]=gT[g]=gT are absorbed by the equivalence of bonds. Note, however, that it is crucial to “mod out” the lattice translations only as a last step, not for the symmetry action on individual atoms. Keeping this in mind, from now on we will not distinguish between the coset [g][g] and its representative gg, to simplify the notation.

The action (17) allows us to introduce the standard notions of a stabilizer and an orbit. Note that the equivalence (16) distinguishes the bonds that have the opposite orientation: 𝐛=(a1,a2)\mathbf{b}=(a_{1},a_{2}) and 𝐛=(a2,a1)-\mathbf{b}=(a_{2},a_{1}) belong to different classes. However, an important constraint on the exchange tensors of the bond comes from the symmetries that flip the bond. Taking this into account, we define the stabilizer of the bond [𝐛][\mathbf{b}] as

St={gGg[𝐛]=[±𝐛]}.\operatorname{St}=\{g\in G\mid g\cdot[\mathbf{b}]=[\pm\mathbf{b}]\}. (18)

In words, the stabilizer subgroup consists of the symmetry elements that, up to a lattice translation, either leave the bond fixed or interchange its atoms. This set of symmetry operations determines constraints on the form of exchange tensors for a given bond class. The orbit

Orb={g[𝐛]gG}.\operatorname{Orb}=\{g\cdot[\mathbf{b}]\mid g\in G\}. (19)

contains all the bonds whose exchange tensors are symmetry-related to those of the starting bond. Note that, for the orbit-stabilizer theorem to hold, the elements of the orbit should also be considered “modulo orientation” to avoid double-counting.

2.3 Symmetry-compatible exchange matrices

To find the most general form of the exchange matrices for the bonds in the class [𝐛][\mathbf{b}] and its orbit, we use basic tools from the representation theory of finite groups. Since the DMI matrix DD, Eq. (7), has three independent matrix elements, one can consider it as an element of a three-dimensional vector space VDV_{D}:

D=α=x,y,zDαeα.D=\sum_{\alpha=x,y,z}D_{\alpha}e_{\alpha}. (20)

Here, eαe_{\alpha} are the basis elements in the space of antisymmetric rank 3 matrices. For example,

ex=(000001010).e_{x}=\begin{pmatrix}0&&0&&0\\ 0&&0&&1\\ 0&&-1&&0\\ \end{pmatrix}. (21)

In a similar way, the anisotropic symmetric matrix Γ\Gamma belongs to the six-dimensional vector space VΓV_{\Gamma} of rank 3 symmetric matrices. Since the action (11) preserves (anti)symmetry of the exchange matrix JJ, it can be interpreted as a linear transformation of the corresponding vector space VJV_{J}:

(gJ)i=jρij(g)Jj,(g\cdot J)_{i}=\sum_{j}\rho_{ij}(g)J_{j}, (22)

where JjJ_{j} is a component of a dd-dimensional vector of matrix elements (d=3d=3 for J=DJ=D and d=6d=6 for J=ΓJ=\Gamma). The set of such linear transformations

ρ={ρ(g)gSt}\rho=\{\rho(g)\mid g\in\operatorname{St}\} (23)

forms a representation of the stabilizer St\operatorname{St} of the bond class [𝐛][\mathbf{b}], which is a subgroup of the point group GG.

An exchange matrix JJ for the bond in the class [𝐛][\mathbf{b}] is symmetry-compatible if for all elements in the stabilizer we have

gJ=J,gSt.g\cdot J=J,\qquad g\in\operatorname{St}. (24)

This means that JJ belongs to the invariant subspace of the trivial representation W1VJW_{1}\subset V_{J}. Thus, our task of finding all symmetry-compatible matrices JJ amounts to specifying the subspace W1W_{1}. First, we determine its dimension:

dimW1=1|St|gSttrρ(g).\dim W_{1}=\frac{1}{|\operatorname{St}|}\sum_{g\in\operatorname{St}}\operatorname{tr}\rho(g). (25)

If dimW1=0\dim W_{1}=0, the anisotropic exchange interaction JJ is not allowed by symmetry. If dimW1=d\dim W_{1}=d, that is, the whole space transforms according to the trivial representation, then the stabilizer of the bond does not put any symmetry constraints on the matrix JJ (but there may be symmetry relations between the matrices for different bonds in the orbit).

In the intermediate case 0<dimW1<d0<\dim W_{1}<d we need to find n=dimW1n=\dim W_{1} linearly independent vectors in the subspace W1W_{1}. This is done by the projection operator

Proj1=1|St|gStρ(g),\operatorname{Proj}_{1}=\frac{1}{|\operatorname{St}|}\sum_{g\in\operatorname{St}}\rho(g), (26)

which projects any vector onto the invariant subspace W1W_{1} of the trivial representation. Applying Proj1\operatorname{Proj}_{1} to the basis elements {ei}\{e_{i}\}, one can find the desired basis for the space W1W_{1}.

Once the subspace W1W_{1} is found for the bond class [𝐛][\mathbf{b}], one can compute symmetry-compatible exchange matrices for all bonds in the orbit of [𝐛][\mathbf{b}] using the requirement that HH be equal to gHg\cdot H for all pairs of sites. Note that the bond [𝐛][\mathbf{b}] may be mapped to g[𝐛]g\cdot[\mathbf{b}] by more than one group element. One checks that the resulting Hamiltonian gHg\cdot H does not depend on the choice of this element, by virtue of using g1g^{-1} in Eq. (5).

For a specific example, let gg map the bond (a1,a2)(a_{1},a_{2}) to the bond (a3,a4)(a_{3},a_{4}). Then the invariance gH=Hg\cdot H=H implies that

J34=RgJ12RgTJ_{34}=R_{g}J_{12}R_{g}^{T} (27)

for each exchange matrix.

3 Implementation details

Below we discuss general features of data structures and algorithms, which we use to implement the mathematical procedures described in the previous section.

3.1 Crystal data

Information on chemical composition, cell vectors, and coordinates of atoms is obtained from a cif file, which is processed using the ase library [17]. We also check that the site occupancy is an integer for all atoms with the parsnip-cif package [18].

Then the list of atomic coordinates is processed with the spglib library [19], which finds the space group of the crystal and provides the list of all symmetry elements. Each symmetry element consists of the matrix part and the translation part, both expressed in the basis of the cell vectors. The only control parameter for the symmetry analysis is the numerical precision sym_tolerance, which is used to determine whether coordinates of atoms coincide after applying symmetry operations. Its default value is 10510^{-5} Å. Note that this parameter might influence the resulting symmetry group in some cases.

For each symmetry element, we compute the Cartesian version of the matrix part. To this end, we construct the basis transformation matrix from the cell vectors. After the transformation, we convert the resulting matrix to a SymPy matrix object, whose elements are exact expressions, such as 32\tfrac{\sqrt{3}}{2}. The list of possible exact values is determined by the fact that a crystal can only have rotation axes of orders 1,2,3,41,2,3,4 and 66. We assume that the crystal structure is defined using a conventional unit cell in the standard crystallographic setting. Then the matrix elements can only take values 0, ±1\pm 1, ±12\pm\tfrac{1}{2} and ±32\pm\tfrac{\sqrt{3}}{2}.

All geometric data, including coordinates of atoms and symmetry elements, is stored in an instance of class Compound.

3.2 Representation of atoms and bonds

Atoms are represented by instances of AtomicSite class. An atom is specified by an index nn, which enumerates atoms in the unit cell, and by the integer cell coordinates (mx,my,mz)(m_{x},m_{y},m_{z}). The value of nn encodes both the fractional part of atom’s scaled coordinates 𝐫f\mathbf{r}_{f}, which take value in the interval [0,1)[0,1), and its chemical element. We will refer to the cell with coordinates (0,0,0)(0,0,0) as the home unit cell.

We define the Bond object as an ordered pair of AtomicSite objects. Since we are interested in bonds only up to a lattice translation, we define the standard set as a subset of the set of all possible bonds. The bond belongs to the standard set if the following condition is satisfied: in each pair of cell coordinates, (mx1,mx2),(my1,my2),(mz1,mz2)(m_{x}^{1},m_{x}^{2}),(m_{y}^{1},m_{y}^{2}),(m_{z}^{1},m_{z}^{2}), the smallest coordinate is 0. In other words, the bonds in the standard set belong to the sector with non-negative cell coordinates and lie as close to the origin as possible. In the language of Sec. 2.2, the standard set is a set of representatives for equivalence classes that correspond to the equivalence relation (16). Moving the bond to the standard set after any transformation allows us to work with the equivalence classes [𝐛][\mathbf{b}].

3.3 Action of symmetry elements

Symmetry elements are represented by instances of SymElement class, which contain rotation/reflection matrices RR and translation vectors 𝐭\mathbf{t} in scaled and Cartesian coordinates.

3.3.1 Action on atoms

Schematically, the action (14) of a symmetry element g={R|𝐭}g=\{R|\mathbf{t}\} on an atom is implemented as follows:

𝐫f+𝐦=𝐫𝑔R𝐫+𝐭=𝐫dec.𝐫f+𝐦.\mathbf{r}_{f}+\mathbf{m}\quad=\quad\mathbf{r}\quad\xrightarrow{g}\quad R\mathbf{r}+\mathbf{t}\quad=\quad\mathbf{r}^{\prime}\quad\xrightarrow{\text{dec.}}\quad\mathbf{r}^{\prime}_{f}+\mathbf{m}^{\prime}. (28)

Here, all vectors and symmetry transformations are expressed in the scaled coordinates. First, we add fractional and integer coordinates of an atom, then act on the resulting vector with the symmetry transformation, and then decompose the result into fractional and integer parts. In the last step, one must carefully handle the cases when atom is close to the cell boundary, which is done as follows for each coordinate:

  1. 1.

    If a coordinate lies within sym_tolerance of an integer mm, round it to mm.

  2. 2.

    Use Python floor function to extract the integer part, to be interpreted as a cell coordinate (recall that floor(x) returns the largest integer not greater than x).

  3. 3.

    Interpret the remaining fractional part as the coordinate inside the home unit cell.

Finally, we determine the atomic index by comparing the fractional coordinates with those of the atoms in the home unit cell.

3.3.2 Action on bonds

The action of a symmetry element on a bond consists of two steps, which implement Eq. (17):

  1. 1.

    Act on each atom individually.

  2. 2.

    If necessary, move the resulting bond to the standard set by parallel translation.

In the context of orbits, each Bond object can play one of two roles: it can be a starting bond of the orbit, or an element of an orbit of another bond. Consider a starting bond 𝐛\mathbf{b}, which is represented by an object b. The orbit property of b is a list of bonds of the form g𝐛g\cdot\mathbf{b}, each containing the link to the starting bond b and the index of the symmetry element i_g. The orbit is constructed in such a way that all its elements are distinct, so there is some arbitrariness in choosing the symmetry element gg. The full information about group action is stored in the full_orbit property, which contains all bonds of the form g𝐛g\cdot\mathbf{b} with their respective group elements.

3.4 Finding symmetry constraints on exchange tensors

An exchange tensor is represented by an instance of ExchangeTensor class. Its properties include 3×33\times 3 SymPy matrix and a list of symbols used in the matrix. There are two types of exchange tensors, Symm and DMI, whose matrices are symmetric and antisymmetric, respectively. Each tensor can be represented as a “vector” of independent matrix elements. For DMI tensor, this vector is (Dx,Dy,Dz)(D_{x},D_{y},D_{z}), while for the symmetric exchange it reads (Γxx,Γyy,Γzz,Γxy,Γxz,Γyz)(\Gamma_{xx},\Gamma_{yy},\Gamma_{zz},\Gamma_{xy},\Gamma_{xz},\Gamma_{yz}).

3.4.1 Constraints for individual bond

The method compute_exchange() of a Bond object finds the most general form of exchange tensors allowed by symmetry for the given bond.

First, we find the matrices of representation ρ(g)\rho(g), as defined by Eq. (22). To this end, we compute the action defined by Eq.(11) using Cartesian rotation matrices for RgR_{g}. Then, according to Eq. (22), we consider the ii-th component of the transformed vector as a linear combination of initial vector components. To find the coefficients, we employ SymPy methods for polynomials:

ρijsp.Poly(g_J_v[i], J.symb).eval(vals) \rho_{ij}\leftrightarrow\verb|sp.Poly(g_J_v[i], J.symb).eval(vals) | (29)

For example, for the DMI exchange tensor we treat (gD)ig_J_v[i](g\cdot D)_{i}\leftrightarrow\verb|g_J_v[i]| as a polynomial in variables (Dx,Dy,Dz)J.symb(D_{x},D_{y},D_{z})\leftrightarrow\verb|J.symb|, and evaluate it for

{Dj=1, other components are zero}𝚟𝚊𝚕𝚜,\{D_{j}=1,\text{ other components are zero}\}\leftrightarrow\verb|vals|, (30)

which gives the desired coefficients ρij(g)\rho_{ij}(g).

Then, proceeding with the steps described in Sec. 2.3, we find the dimension of the invariant subspace of the trivial representation (25). If needed, we construct the projection operator (26) and act with it on basis vectors of the form 𝐞i=(0,,0,1,0,,0)T\mathbf{e}_{i}=(0,\ldots,0,1,0,\ldots,0)^{T} with non-zero ii-th component. We check that the result is non-zero, normalize it, and check that it is linearly-independent with the previously found vectors by using the nullspace()\verb|nullspace()| method of SymPy Matrix\verb|SymPy Matrix|. The process continues until we find n=dimW1n=\dim W_{1} vectors, which span the invariant subspace. Finally, we multiply each Proj1𝐞i\operatorname{Proj}_{1}\mathbf{e}_{i} by the ii-th symbol (e.g. DiD_{i}) and convert the resulting vector of components into matrix form, which gives the symmetry-adapted exchange tensor matrix.

3.4.2 Symmetry relations between bonds in the orbit

Suppose that we have computed exchange tensors for a bond 𝐛\mathbf{b}. Then we can find the exchange tensors for the bond g𝐛g\cdot\mathbf{b} in the orbit according to Eq. (27). This is implemented in the pull_exchange() method of the class Bond. One should not use compute_exchange() for this purpose, since this method treats the bond individually, and its symmetry relations with other bonds in the orbit are lost.

A typical algorithm for finding the symmetry-compatible exchange tensors for all bonds in an orbit consists of two steps:

  1. 1.

    Choose a starting bond 𝐛\mathbf{b} and compute its exchange tensors by
    compute_exchange().

  2. 2.

    Iterate over the bonds in the orbit of 𝐛\mathbf{b} and call pull_exchange() for each bond.

This will produce a set of exchange tensors that is invariant under the action of the symmetry group.

3.5 Building list of bonds

Our code provides functionality for a common task: for a given crystal, find all symmetry constraints on the exchange tensors for bonds between magnetic elements AA and BB, whose length does not exceed a given value ll.

We start by listing all atoms and their positions for a 3×3×33\times 3\times 3 cluster of cells centered at the home unit cell. Then we use the cKDTree method of the SciPy spatial module to build a list of pairs of atoms aA,aBa_{A},a_{B} such that

distance(aA,aB)<l.\text{distance}(a_{A},a_{B})<l. (31)

The first atom always lies in the home unit cell, while the second atom can be anywhere in the cluster. Next, we create Bond objects from all pairs, forming a pool of bonds. Our goal is to organize these bonds by their symmetry and length. The result will be the list of starting bonds, each being the first in its orbit. The orbit of each starting bond will be stored as an attribute of the Bond object. This is done as follows:

  1. 1.

    Pick any bond 𝐛\mathbf{b} from the pool and compute its symmetry orbit. Compute the exchange tensors for all bonds in the orbit. Add 𝐛\mathbf{b} to the list of bonds.

  2. 2.

    Exclude the orbit elements from the pool of bonds.

  3. 3.

    Repeat until the pool is empty.

Finally, we sort the bonds in the list by their length.

4 Running package

In this section, we briefly demonstrate how one can use the package in various modes. We start with an interactive text mode, then consider the graphical web interface, and finally discuss using the package as a code library. For more usage examples and a detailed description of the package API, we refer the interested reader to the documentation [20].

Note that the code’s output has a dual nature: on the one hand, it is strictly determined by symmetry, but on the other hand, it can assume seemingly different forms. When analyzing the results, one should keep in mind that the essential part of the output is the relations between the matrix elements of the exchange tensors for bonds in one orbit. In particular, each independent variable has the same value in all these matrices (of course, there is no such relationship between the matrix elements for bonds in different orbits).

Two possible sources of variation in the form of the exchange matrices are:

  • 1.

    Arbitrary choice of orientation of bonds that enter the orbit, which influence the sign of the DMI tensor.

  • 2.

    Degree of alignment between the starting bond of an orbit and the coordinate axes of the Cartesian coordinate system. Better alignment leads to simpler form of the matrix elements.

4.1 Interactive text mode

Given a cif file of a crystal, one can quickly analyze the exchange tensors using the package in a Python console. Below we show a typical workflow, using hematite α\alpha-Fe2O3 as an example.

We start by initializing the Compound object from a cif file.

$ python -m jsymm
=== Welcome to jsymm interactive session ===
Available classes: Compound, Bond, BondList
>>>Fe2O3 = Compound("Fe2O3.cif")
>>>Fe2O3.show()
Symmetry group: R-3c (167), |G| = 36
Number of atoms: 30
[Fe: 12, O: 18]

The output indicates that the Compound was initialized successfully.

Now one can find all bonds between Fe atoms, whose length does not exceed 5Å:

>>>BL = BondList(Fe2O3, "Fe", "Fe", 5)
>>>BL.show()
List of starting bonds:
ind Bond L, A |Orb| DMI Symm
0. (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) 2.8873 6 1 2
6. (Fe_7, [0 0 0])--(Fe_12,[0 0 0]) 2.9671 18 0 6
24. (Fe_10,[0 0 0])--(Fe_8, [0 0 0]) 3.3651 18 2 4
42. (Fe_7, [0 1 0])--(Fe_10,[0 0 0]) 3.7013 36 3 6
78. (Fe_7, [0 0 0])--(Fe_8, [0 0 0]) 3.9872 6 0 2

Here, an atom is represented by a label, which indicates the atom’s position in the unit cell, and a triple of integer unit cell coordinates. The list contains starting bonds of the orbits. Also shown are the length of each bond and the number of bonds in its orbit. The columns DMI and Symm show the numbers of independent matrix elements in the exchange matrices DD and Γ\Gamma. One can readily conclude that the DMI exchange in the second and in the last orbit is prohibited by symmetry.

Exchange tensors for the bonds from the first orbit are

>>>BL.show_ex_orbit(0)
Orbit of the bond 0. (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) and DMI exchange tensor components:
ind g * b [x, y, z]
0. (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) [0, 0, Dz]
1. (Fe_11,[0 0 0])--(Fe_9, [0 0 1]) [0, 0, Dz]
2. (Fe_10,[0 0 0])--(Fe_12,[0 0 0]) [0, 0, -Dz]
3. (Fe_5, [0 0 0])--(Fe_7, [0 0 0]) [0, 0, -Dz]
4. (Fe_3, [0 0 0])--(Fe_1, [0 0 0]) [0, 0, Dz]
5. (Fe_2, [0 0 0])--(Fe_4, [0 0 0]) [0, 0, -Dz]
Orbit of the bond 0. (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) and Symm exchange tensor components:
ind g * b [xx, yy, zz, xy, xz, yz]
0. (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) [Gxx, Gxx, Gzz, 0, 0, 0]
1. (Fe_11,[0 0 0])--(Fe_9, [0 0 1]) [Gxx, Gxx, Gzz, 0, 0, 0]
2. (Fe_10,[0 0 0])--(Fe_12,[0 0 0]) [Gxx, Gxx, Gzz, 0, 0, 0]
3. (Fe_5, [0 0 0])--(Fe_7, [0 0 0]) [Gxx, Gxx, Gzz, 0, 0, 0]
4. (Fe_3, [0 0 0])--(Fe_1, [0 0 0]) [Gxx, Gxx, Gzz, 0, 0, 0]
5. (Fe_2, [0 0 0])--(Fe_4, [0 0 0]) [Gxx, Gxx, Gzz, 0, 0, 0]

The first table indicates that the DMI vector of the bonds belongs to the vertical axis. To interpret the signs correctly, one should take into account the orientation of the bonds:

>>>BL.show_orbit(0)
Orbit of the bond b = (Fe_8, [0 0 1])--(Fe_6, [0 0 0]):
|St| = 6, |Orb| = 6, L = 2.8873 A
dim DMI = 1 dim Symm = 2
ind g g * b Bond vector, A
0. g_0 (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) [0.0000, 0.0000, -2.8873]
1. g_1 (Fe_11,[0 0 0])--(Fe_9, [0 0 1]) [0.0000, 0.0000, 2.8873]
2. g_6 (Fe_10,[0 0 0])--(Fe_12,[0 0 0]) [0.0000, 0.0000, 2.8873]
3. g_7 (Fe_5, [0 0 0])--(Fe_7, [0 0 0]) [0.0000, 0.0000, -2.8873]
4. g_13 (Fe_3, [0 0 0])--(Fe_1, [0 0 0]) [0.0000, 0.0000, 2.8873]
5. g_18 (Fe_2, [0 0 0])--(Fe_4, [0 0 0]) [0.0000, 0.0000, 2.8873]

To orient the bonds uniformly, we need to flip the first and fourth bonds, which will change the signs of 𝐃\mathbf{D}.

Now consider the fourth orbit. It contains 36 bonds, which equals the order of the group. This means that each of these bonds is stabilized only by the identity transformation. Still, symmetry puts constraints on the exchange matrices:

>>>BL.show_ex_orbit(42, ’DMI’)
Orbit of the bond 42. (Fe_7, [0 1 0])--(Fe_10,[0 0 0]) and DMI exchange tensor components:
ind g * b [x, y, z]
42. (Fe_7, [0 1 0])--(Fe_10,[0 0 0]) [Dx, Dy, Dz]
43. (Fe_12,[0 0 0])--(Fe_5, [0 1 0]) [Dx, Dy, Dz]
44. (Fe_7, [0 0 0])--(Fe_10,[1 0 0]) [-Dx/2 - sqrt(3)*Dy/2, sqrt(3)*Dx/2 - Dy/2, Dz]
45. (Fe_12,[1 0 0])--(Fe_5, [0 0 0]) [-Dx/2 - sqrt(3)*Dy/2, sqrt(3)*Dx/2 - Dy/2, Dz]
46. (Fe_7, [0 0 0])--(Fe_10,[0 0 0]) [-Dx/2 + sqrt(3)*Dy/2, -sqrt(3)*Dx/2 - Dy/2, Dz]
47. (Fe_12,[0 0 0])--(Fe_5, [0 0 0]) [-Dx/2 + sqrt(3)*Dy/2, -sqrt(3)*Dx/2 - Dy/2, Dz]
48. (Fe_9, [1 0 0])--(Fe_8, [0 0 0]) [-Dx/2 + sqrt(3)*Dy/2, sqrt(3)*Dx/2 + Dy/2, -Dz]
49. (Fe_6, [0 0 0])--(Fe_11,[1 0 0]) [-Dx/2 + sqrt(3)*Dy/2, sqrt(3)*Dx/2 + Dy/2, -Dz]
50. (Fe_9, [0 0 0])--(Fe_8, [0 1 0]) [Dx, -Dy, -Dz]
<...>

Thus, while each DMI vector is described by three independent variables, the vectors are not at all arbitrary, since they are related by the symmetries that interchange the bonds in the orbit.

4.2 Web interface

The package provides a web interface that can be run locally [20] or accessed on the web [21]. The user can upload a cif file and analyze it with a chosen numerical precision. Alternatively, one can load an example file from the Help page. Once the file is loaded, the interface shows crystal geometric data, such as position of atoms and representation of symmetry elements. The user can then choose a pair of chemical elements and a maximal bond length LL, and obtain a list of all bonds shorter than LL classified into symmetry orbits.

For a chosen orbit, the interface shows a table of symmetry-compatible exchange tensors. For any bond, the user can further address its geometric details (coordinates of atoms), its stabilizer subgroup, and interact with a 3D model showing the placement of the bond inside the unit cell.

4.3 Usage as a library

4.3.1 Orbit of a bond

Consider a bond 𝐛\mathbf{b} in La2CuO4 compound. The orbit of the bond is simply a list of distinct bonds obtained from the starting bond by the group action. Each of these bonds, g𝐛g\cdot\mathbf{b}, stores the starting bond 𝐛\mathbf{b} (as a property starting_bond) and the index of the group element gg (as a property i_g):

from jsymm import *
LCO = Compound("La2CuO4-Sol.cif")
b = Bond(LCO).from_labels("Cu_4", [0,0,0], "Cu_1", [0,0,0])
for gb in b.orbit:
print(f"g_{gb.i_g} * b = ", gb)
g_0 * b = (Cu_4, [0 0 0])--(Cu_1, [0 0 0])
g_1 * b = (Cu_4, [0 1 0])--(Cu_1, [1 0 0])
g_2 * b = (Cu_1, [0 0 0])--(Cu_4, [0 1 0])
g_3 * b = (Cu_1, [1 0 0])--(Cu_4, [0 0 0])
g_8 * b = (Cu_2, [1 0 0])--(Cu_3, [0 0 0])
g_9 * b = (Cu_2, [0 1 0])--(Cu_3, [0 0 0])
g_10 * b = (Cu_3, [0 0 0])--(Cu_2, [1 1 0])
g_11 * b = (Cu_3, [0 0 0])--(Cu_2, [0 0 0])

The stabilizer of the bond is a dictionary in which the keys are the indices of the symmetry elements that map the bond to itself, and each value is of Boolean type. It equals True if the symmetry element flips the bond and False otherwise:

print(b.stabilizer)
{0: False, 6: True}

4.3.2 Computing exchange

The exchange matrices for an individual bond can be found by the method compute_exchange(). The results of the computation are stored as a dictionary with keys "DMI" and "Symm", and the values are instances of the class ExchangeTensor. Each tensor can be represented as a column vector or as a 3×33\times 3 matrix, and also contains the list of all symbols that can enter its matrix. Using these symbols, one can evaluate the exchange tensor for specific numerical values of the variables:

b.compute_exchange()
print(b.exchange[’DMI’], "\n")
Dx, Dy, Dz = b.exchange[’DMI’].symb
print(b.exchange[’DMI’].evaluate({Dy: 3, Dx: 1}))
[Dx, Dy, 0]
[[ 0 0 -3]
[ 0 0 1]
[ 3 -1 0]]

The numbers of independent matrix elements are stored in the attribute dimV:

for ex_type, dim in b.dimV.items():
print(f"dim {ex_type} = {dim}")
dim DMI = 2
dim Symm = 4

If the tensors are not yet computed, both values are set to -1.

Once the exchange tensors are computed for the bond b, they can be determined for all bonds in the orbit of b. This should be done by calling the pull_exchange() method for each bond in turn:

b.compute_exchange()
for gb in b.orbit:
gb.pull_exchange()
print(f"g_{gb.i_g} * {gb.starting_bond.exchange[’DMI’]} = {gb.exchange[’DMI’]}")
g_0 * [Dx, Dy, 0] = [Dx, Dy, 0]
g_1 * [Dx, Dy, 0] = [Dx, Dy, 0]
g_2 * [Dx, Dy, 0] = [-Dx, Dy, 0]
g_3 * [Dx, Dy, 0] = [-Dx, Dy, 0]
g_8 * [Dx, Dy, 0] = [Dx, Dy, 0]
g_9 * [Dx, Dy, 0] = [Dx, Dy, 0]
g_10 * [Dx, Dy, 0] = [-Dx, Dy, 0]
g_11 * [Dx, Dy, 0] = [-Dx, Dy, 0]

If we use compute_exchange() for the bonds in the orbit, the symmetry relations between different bonds will be lost.

4.3.3 Full data of group action

The orbit attribute of a bond 𝐛\mathbf{b} contains distinct bonds in the form g𝐛g\cdot\mathbf{b}. If the stabilizer is non-trivial, there are several elements gg that map 𝐛\mathbf{b} to g𝐛g\cdot\mathbf{b}, but the orbit includes only one of them. Complete information on the group action is contained in the full_orbit attribute of a Bond object.

b1 = Bond(Fe2O3).from_labels("Fe_2", [0, 0, 0], "Fe_4", [0, 0, 0])
b1.compute_exchange()
b2 = b1.orbit[2]
keys = b2.key, b2.flip().key
print(f"Symmetry elements that send b1 = {b1} \nto b2 = {b2}, up to a flip:\n")
for k in keys:
for gb1 in b1.full_orbit[k]:
gb1.pull_exchange()
print(f"g_{gb1.i_g} * b1 = {gb1} \t {gb1.exchange[’DMI’]}")
print()
Symmetry elements that send b1 = (Fe_2, [0 0 0])--(Fe_4, [0 0 0])
to b2 = (Fe_6, [0 0 0])--(Fe_8, [0 0 1]), up to a flip:
g_12 * b1 = (Fe_6, [0 0 0])--(Fe_8, [0 0 1]) [0, 0, Dz]
g_14 * b1 = (Fe_6, [0 0 0])--(Fe_8, [0 0 1]) [0, 0, Dz]
g_16 * b1 = (Fe_6, [0 0 0])--(Fe_8, [0 0 1]) [0, 0, Dz]
g_18 * b1 = (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) [0, 0, -Dz]
g_20 * b1 = (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) [0, 0, -Dz]
g_22 * b1 = (Fe_8, [0 0 1])--(Fe_6, [0 0 0]) [0, 0, -Dz]

Here, the key property of the bond b2 represents the bond as a tuple. In this form, it is used as a key in the dictionary full_orbit. The corresponding value is the list of all bonds identical to b2 but obtained from b1 by the action of different group elements. The output indicates that the exchange tensors do not depend on the choice of the group element sending b1 to b2. We also check that the DMI vector changes its sign upon flipping the bond, as expected.

4.3.4 Transformation of DM vector

The method compute_exchange() implements the procedure described in Sec. 2.3 both for the symmetric exchange and for DMI. The representation matrices are constructed directly from the action (11) and are stored in the attribute rho of the Bond object. However, in the case of DMI we know that the vector 𝐃\mathbf{D} must transform as an axial vector, which changes sign if the bond is flipped (see Eq. (12)). Let us compare the two representations:

b = Bond(Fe2O3).from_labels("Fe_1", [0,0,0], "Fe_11", [0,0,0])
b.compute_exchange()
rep = dict()
for i_g, flip in b.stabilizer.items():
F = 1
if flip:
F = -1
R = Fe2O3.group[i_g].R_Cart
rep[i_g] = F * sp.det(R) * R
b.rho[’DMI’] == rep
True

This illustrates that the procedure of finding representation matrices works correctly for the DMI exchange tensor.

4.3.5 Generating equations

As a final example, let us generate the code for Eq. (33), which shows the full exchange matrices for a set of representative bonds in α\alpha-Fe2O3:

import sympy as sp
BL = BondList(Fe2O3, "Fe", "Fe", 5, prefer_aligned= True)
equation = r"\begin{align}" + "\n"
for i_sb in range(len(BL.start_bonds)):
sb = BL.start_bonds[i_sb]
L = sb.length
ex = sb.exchange
J = ex["DMI"].matrix + ex["Symm"].matrix
equation += fr"L_{{{i_sb+1}}} = {L:.2f}\text{{\AA}} \qquad "
equation += fr"J_{{{i_sb+1}}} &= "
equation += sp.latex(J)
if i_sb != len(BL.start_bonds) -1:
equation += r"\\" + "\n"
equation += "\n" + r"\end{align}"

Here, the prefer_aligned parameter ensures that, whenever possible, the starting bond of an orbit will be chosen to belong to the coordinate planes of the Cartesian system, which can simplify the expressions of the exchange matrices.

5 Test cases

5.1 La2CuO4

We start with the famous La2CuO4, which is the parent compound for cuprate high-temperature superconductors. In the overdoped regime, it exhibits magnetic order with spins directed along orthorhombic aa axis, but canted out of the CuO2 plane (see Fig. 1 in  [22]). A detailed structural study has shown that the crystal is orthorhombic in this phase, with CmcmCmcm space group [23]. Experimentally spins are mostly lying in the abab plane and point nearly two the second nearest neighbor Cu ions, but have a small canting out of the plane.

Analysis of the exchange tensor using Jsymm immediately reveals a non-zero Dzyaloshinskii–Moriya interaction (DMI), with the 𝐃\mathbf{D} vector having two independent components for the nearest-neighbor Cu–Cu bonds lying in the abab plane (distance is 3.8Å), as shown in Table 1. This result is in agreement with microscopic calculations of the DMI, such as those presented in [24, 25].

The presence of a C2C_{2} rotational axis directed along the cc axis (i.e. perpendicular to each of these bonds) and passing through their centers forces the zz component of the DM vectors to vanish. Consequently, the DM vectors for nearest-neighbor Cu ions possess only xx and yy components, which naturally explains the canting of spins out of the abab plane observed experimentally [22].

ii Cu Bond vector 𝐃i\mathbf{D}^{i} Γi\Gamma^{i}
1 3-212_{1} (2.67, -2.71, 0.0) (DxD_{x}, DyD_{y}, 0 ) (Γxx\Gamma_{xx}, Γyy\Gamma_{yy}, Γzz\Gamma_{zz}, Γxy\Gamma_{xy}, 0, 0)
2 3-222_{2} (-2.67, 2.71, 0.0) (DxD_{x}, DyD_{y}, 0 ) (Γxx\Gamma_{xx}, Γyy\Gamma_{yy}, Γzz\Gamma_{zz}, Γxy\Gamma_{xy}, 0, 0)
3 232_{3}-3 (-2.67, -2.71, 0.0) (Dx-D_{x}, DyD_{y}, 0 ) (Γxx\Gamma_{xx}, Γyy\Gamma_{yy}, Γzz\Gamma_{zz}, Γxy-\Gamma_{xy}, 0, 0)
4 242_{4}-3 (2.67, 2.71, 0.0) (Dx-D_{x}, DyD_{y}, 0 ) (Γxx\Gamma_{xx}, Γyy\Gamma_{yy}, Γzz\Gamma_{zz}, Γxy-\Gamma_{xy}, 0, 0)
Table 1: Symmetry analysis of the orthorhombic structure [23] of La2CuO4. Bonding vectors for four nearest Cu neighbors in the abab plane are given in Å. The labels such as 33 and 212_{1} refer to the Cu ions, as shown in Fig. 1. Dzyaloshinskii–Moriya vector 𝐃\mathbf{D} for each bond and components of anisotropic symmetric exchange Γ\Gamma are given in the last two columns.

Jsymm also demonstrates relations between exchange tensors corresponding to different bonds that belong to the same orbit. For example, consider the DM vectors 𝐃1\mathbf{D}^{1} and 𝐃3\mathbf{D}^{3} of the bonds 3-212_{1} and 232_{3}-3 formed by Cu ions, as shown in Fig. 1. Their components are related as

Dx1=Dx3,Dy1=Dy3.D^{1}_{x}=-D^{3}_{x},\qquad D^{1}_{y}=D^{3}_{y}. (32)

This agrees with the results of Ref. [25] (if one flips the bond 232_{3}-3, so that 𝐃3\mathbf{D}^{3} changes its sign) and Ref. [24] (coordinate system must be rotated by π4\tfrac{\pi}{4} about the zz axis for comparison).

Refer to caption
Figure 1: Crystal structure of La2CuO4 (abab plane). Cu ions are shown by blue, and O ions by red spheres. Structures were generated using VESTA [26].

5.2 Fe2O3

Another classical example of a material with anisotropic exchange coupling is the mineral hematite, α\alpha-Fe2O3, which has a corundum structure described by the R3¯cR\bar{3}c space group [27]. Below TN950T_{N}\sim 950K, but above the so-called Morin temperature TM250T_{M}\sim 250K — the temperature of the spin reorientation transition — it orders antiferromagnetically with moments perpendicular to the [111] direction, but with a small canting angle of 103\sim 10^{-3} within the basal plane [28, 29]. Using phenomenological theory and symmetry arguments, Dzyaloshinskii was the first to explain this canting [30]. This theory was later elaborated by Moriya using microscopic considerations [16]. In this work, he also introduced the symmetry principles known as the “Moriya rules”, which correspond in our terms to the constraints put on an individual bond by its stabilizer subgroup.

Our analysis of the crystal structure taken from [31] demonstrates that for nearest-neighbor Fe ions forming a short Fe–Fe bond (distance is 2.89Å), the DM vector is (0,0,Dz)(0,0,D_{z}), while Γ\Gamma is allowed to have only two terms: Γxx=Γyy\Gamma_{xx}=\Gamma_{yy} and Γzz\Gamma_{zz}. DMI with a nonzero zz component of the DM vector causes spins lying perpendicular to the cc axis to cant within the (111) plane in rhombohedral notation. Exchange matrices for the next neighbors are given in Eq. (33), which was generated by the code listed in Sec. 4.3.5:

L1=2.89ÅJ1\displaystyle L_{1}=2.89\text{\AA }\qquad J_{1} =[ΓxxDz0DzΓxx000Γzz]\displaystyle=\left[\begin{matrix}\Gamma_{xx}&D_{z}&0\\ -D_{z}&\Gamma_{xx}&0\\ 0&0&\Gamma_{zz}\end{matrix}\right] (33a)
L2=2.97ÅJ2\displaystyle L_{2}=2.97\text{\AA }\qquad J_{2} =[ΓxxΓxyΓxzΓxyΓyyΓyzΓxzΓyzΓzz]\displaystyle=\left[\begin{matrix}\Gamma_{xx}&\Gamma_{xy}&\Gamma_{xz}\\ \Gamma_{xy}&\Gamma_{yy}&\Gamma_{yz}\\ \Gamma_{xz}&\Gamma_{yz}&\Gamma_{zz}\end{matrix}\right] (33b)
L3=3.37ÅJ3\displaystyle L_{3}=3.37\text{\AA }\qquad J_{3} =[ΓxxDzDyDzΓyyΓyzDyΓyzΓzz]\displaystyle=\left[\begin{matrix}\Gamma_{xx}&D_{z}&-D_{y}\\ -D_{z}&\Gamma_{yy}&\Gamma_{yz}\\ D_{y}&\Gamma_{yz}&\Gamma_{zz}\end{matrix}\right] (33c)
L4=3.70ÅJ4\displaystyle L_{4}=3.70\text{\AA }\qquad J_{4} =[ΓxxDz+ΓxyDy+ΓxzDz+ΓxyΓyyDx+ΓyzDy+ΓxzDx+ΓyzΓzz]\displaystyle=\left[\begin{matrix}\Gamma_{xx}&D_{z}+\Gamma_{xy}&-D_{y}+\Gamma_{xz}\\ -D_{z}+\Gamma_{xy}&\Gamma_{yy}&D_{x}+\Gamma_{yz}\\ D_{y}+\Gamma_{xz}&-D_{x}+\Gamma_{yz}&\Gamma_{zz}\end{matrix}\right] (33d)
L5=3.99ÅJ5\displaystyle L_{5}=3.99\text{\AA }\qquad J_{5} =[Γxx000Γxx000Γzz]\displaystyle=\left[\begin{matrix}\Gamma_{xx}&0&0\\ 0&\Gamma_{xx}&0\\ 0&0&\Gamma_{zz}\end{matrix}\right] (33e)

The degree and character of the symmetry constraints vary among the bonds. While the anisotropic symmetric exchange Γ\Gamma can be present to certain extent in all bonds, only the first, third, and fourth bonds are allowed to have DM exchange interaction. The fourth bond has the lowest possible symmetry, so its matrix has a generic form. Still, there are the symmetry restrictions for the exchange tensors of the bonds in its orbit, as we saw in Sec. 4.1.

These matrices are in complete agreement with the recent results presented in Ref. [32] (see Eq. (25) there). The apparent discrepancy for the exchange matrices of the third bond can be removed by the rotation UαU_{\alpha} of the Cartesian coordinate system by α=π12\alpha=\tfrac{\pi}{12} about the zz axis and by selecting an appropriate bond. In our coordinates, its bond vector in Angstroms reads [2.5173,1.4533,1.6957][2.5173,1.4533,1.6957]. Conjugation of its exchange matrix by UαU_{\alpha} produces a matrix whose elements are related to each other precisely as in Ref. [32]. This illustrates that the form of the symmetry-adapted exchange tensors may vary depending on the relative orientation of the bond vector and the axes of the Cartesian coordinate system.

6 Summary

Jsymm performs symmetry analysis of exchange tensors in magnetic Hamiltonians using crystallographic information from a cif file. For any interatomic bond of interest, it computes its stabilizer subgroup and its orbit under the action of the point group of the crystal, taking into account equivalence of bonds related by lattice translations. Based on these data, Jsymm finds the most general form of the tensors of the Dzyaloshinskii–Moriya antisymmetric exchange and anisotropic symmetric Heisenberg exchange for the selected bond, as well as the symmetry-compatible exchange tensors for all bonds in its orbit. The method uses the representation theory of finite groups: for each bond, the representation of the stabilizer on the space of exchange tensors is computed, and the invariant subspace of the trivial representation is found by projection operators. All calculations are exact, use rational and algebraic numbers via SymPy, and produce symbolic matrices, which are ready for numerical evaluations or mathematical typesetting.

The code is particularly valuable for density functional theory (DFT) calculations of magnetic materials. By determining which components of the exchange tensor are allowed by crystal symmetry, Jsymm eliminates the need to compute all nine matrix elements of the exchange tensor for each bond. Instead, only the independent symmetry-allowed components must be evaluated, which can reduce computational time by orders of magnitude, especially when spin-orbit coupling is included. This is crucial because DFT calculations of anisotropic exchange are computationally demanding, often suffering from slow convergence and local minima. Jsymm thus serves as an essential preprocessing tool that guides DFT calculations, ensures consistency with symmetry, and helps avoid unphysical results. The package provides both an interactive text interface and a graphical web interface, and can be used as a standalone tool or integrated into larger computational workflows.

7 Acknowledgments

S.V.S. thanks the Russian Science Foundation for support via RSF 23-12-00159-P. Analisys of exchange tensors for La2CuO4 and Fe2O3 were supported by Ministry of Science and Education of Russia (via IMP).

References

  • [1] W. Heisenberg, Zur Theorie des Ferromagnetismus, Zeitschrift für Physik 49 (1928) 619. doi:10.1007/BF01328601.
  • [2] P. A. M. Dirac, Quantum mechanics of many-electron systems, Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character 123 (792) (1929) 714–733. doi:10.1098/rspa.1929.0094.
  • [3] J. H. Van Vleck, On the anisotropy of cubic ferromagnetic crystals, Physical Review 52 (11) (1937) 1178–1198. doi:10.1103/PhysRev.52.1178.
  • [4] S.-W. Cheong, M. Mostovoy, Multiferroics: A magnetic twist for ferroelectricity, Nature materials 6 (1) (2007) 13–20. doi:10.1038/nmat1804.
  • [5] A. Kitaev, Anyons in an exactly solved model and beyond, Annals of Physics 321 (1) (2006) 2–111. doi:10.1016/j.aop.2005.10.005.
  • [6] G. Jackeli, G. Khaliullin, Mott insulators in the strong spin-orbit coupling limit: From Heisenberg to a quantum compass and Kitaev models, Phys. Rev. Lett. 102 (1) (2009) 017205. doi:10.1103/PhysRevLett.102.017205.
  • [7] A. Liechtenstein, V. Gubanov, M. Katsnelson, V. Anisimov, Magnetic transition state approach to ferromagnetism of metals: Ni, Journal of Magnetism and Magnetic Materials 36 (1983) 125.
  • [8] D. Korotin, V. Mazurenko, V. Anisimov, S. Streltsov, Calculation of exchange constants of the Heisenberg model in plane-wave-based methods using the Green’s function approach, Physical Review B 91 (22) (2015) 224405. doi:10.1103/PhysRevB.91.224405.
  • [9] H. Xiang, E. Kan, S.-H. Wei, M.-H. Whangbo, X. Gong, Predicting the spin-lattice order of frustrated systems from first principles, Physical Review B 84 (22) (2011) 224429. doi:10.1103/PhysRevB.84.224429.
  • [10] L. Noodleman, Valence bond description of antiferromagnetic coupling in transition metal dimers, The Journal of Chemical Physics 74 (10) (1981) 5737. doi:10.1063/1.440939.
  • [11] K. Riedl, Y. Li, R. Valent, S. M. Winter, Ab-initio approaches for low-energy spin Hamiltonians, Phys. Status Solidi B 256 (2019) 1800684. arXiv:1811.06553v1.
  • [12] X. Li, H. Yu, F. Lou, J. Feng, M. H. Whangbo, H. Xiang, Spin Hamiltonians in magnets: Theories and computations, Molecules 26 (4) (2021) 803. doi:10.3390/molecules26040803.
  • [13] A. Szilva, Y. Kvashnin, E. A. Stepanov, L. Nordström, O. Eriksson, A. I. Lichtenstein, M. I. Katsnelson, Quantitative theory of magnetic interactions in solids, Review of Modern Physics 95 (2022) 035004. arXiv:2206.02415.
  • [14] Yu. A. Izyumov, V. E. Naish, R. P. Ozerov, Neutron Diffraction of Magnetic Materials, Springer US, Boston, MA, 1991. doi:10.1007/978-1-4615-3658-1.
  • [15] B. Tsukerblat, M. Belinskii, Magnetochemistry and Radiospectroscopy of Exchange Clusters, Kishinev, 1983.
  • [16] T. Moriya, Anisotropic superexchange interaction and weak ferromagnetism, Physical Review 120 (1960) 97.
  • [17] A. Hjorth Larsen, J. Jørgen Mortensen, J. Blomqvist, I. E. Castelli, R. Christensen, M. Dułak, J. Friis, M. N. Groves, B. Hammer, C. Hargus, E. D. Hermes, P. C. Jennings, P. Bjerre Jensen, J. Kermode, J. R. Kitchin, E. Leonhard Kolsbjerg, J. Kubal, K. Kaasbjerg, S. Lysgaard, J. Bergmann Maronsson, T. Maxson, T. Olsen, L. Pastewka, A. Peterson, C. Rostgaard, J. Schiøtz, O. Schütt, M. Strange, K. S. Thygesen, T. Vegge, L. Vilhelmsen, M. Walter, Z. Zeng, K. W. Jacobsen, The atomic simulation environment — a Python library for working with atoms, Journal of Physics: Condensed Matter 29 (27) (2017) 273002. doi:10.1088/1361-648X/aa680e.
    URL https://doi.org/10.1088/1361-648X/aa680e
  • [18] J. Bradley, D. Behar, Parsnip documentation, https://parsnip-cif.readthedocs.io (2026).
  • [19] A. Togo, K. Shinohara, I. Tanaka, Spglib: a software library for crystal symmetry search, Science and Technology of Advanced Materials: Methods 4 (1) (2024) 2384822. doi:10.1080/27660400.2024.2384822.
  • [20] A. Sergeev, S. Streltsov, Jsymm documentation, https://jsymm.readthedocs.io (2026).
  • [21] Jsymm web interface, http://jsymm.ru (2026).
  • [22] M. A. Kastner, R. J. Birgeneau, T. R. Thurston, P. J. Picone, H. P. Jenssen, D. R. Gabbe, M. Sato, K. Fukuda, S. Shamoto, Y. Endoh, K. Yamada, G. Shirane, Neutron-scattering study of the transition from antiferromagnetic to weak ferromagnetic order in La2CuO4, Physical Review B 38 (10) (1988) 6636–6640. doi:10.1103/PhysRevB.38.6636.
  • [23] P. G. Radaelli, D. G. Hinks, A. W. Mitchell, B. A. Hunter, J. L. Wagner, B. Dabrowski, K. G. Vandervoort, H. K. Viswanathan, J. D. Jorgensen, Structural and superconducting properties of La2-x Srx CuO4 as a Function of Sr Content, Physical Review B 49 (6) (1994) 4163–4175. doi:10.1103/PhysRevB.49.4163.
  • [24] L. Shekhtman, A. Aharony, O. Entin-Wohlman, Bond-dependent symmetric and antisymmetric superexchange interactions in La2CuO4, Physical Review B 47 (1) (1993) 174–182. doi:10.1103/PhysRevB.47.174.
  • [25] V. Mazurenko, V. Anisimov, Weak ferromagnetism in antiferromagnets: α\alpha-Fe2O3 and La2CuO4, Physical Review B 71 (18) (2005) 184434. arXiv:cond-mat/0410767v1.
  • [26] K. Momma, F. Izumi, VESTA 3 for three-dimensional visualization of crystal, volumetric and morphology data, J. Appl. Crystallogr. 44 (2011) 1272.
  • [27] L. Pauling, S. B. Hendricks, The crystal structures of hematite and corundum, Journal of the American Chemical Society 47 (3) (1925) 781–790. doi:10.1021/ja01680a027.
  • [28] P. J. Flanders, J. P. Remeika, Magnetic properties of hematite single crystals, The Philosophical Magazine: A Journal of Theoretical Experimental and Applied Physics 11 (114) (1965) 1271–1288. doi:10.1080/14786436508224935.
  • [29] A. H. Hill, F. Jiao, P. G. Bruce, A. Harrison, W. Kockelmann, C. Ritter, Neutron diffraction study of mesoporous and bulk hematite, α\alpha-Fe2O3, Chemistry of Materials 20 (15) (2008) 4891–4899. doi:10.1021/cm800009s.
  • [30] I. Dzyaloshinskii, A thermodynamic theory of “weak” ferromagnetism of antiferromagnetics, J. Phys. Chem. Solids 4 (2) (1958) 241. doi:10.1002/pssb.2220460236.
  • [31] E. E. Newnham, Y. M. de Haan, Refinement of the a Al2O3, Ti2O3, V2O3 and Cr2O3 structures, Zeitschrift für Kristallographie - Crystalline Materials 117 (1-6) (Jan. 1962). doi:10.1524/zkri.1962.117.16.235.
  • [32] R. Hoyer, P. P. Stavropoulos, A. Razpopov, R. Valentí, L. Šmejkal, A. Mook, Altermagnetic splitting of magnons in hematite α\alpha-Fe2O3, Physical Review B 112 (6) (2025) 064425. doi:10.1103/fgc1-5blp.