I wonder, how is the spatial dependence of the dipolar interaction implemented in Easyspin? Usually, the dipolar energy between two magnetic moments is defined by their dot product as well as their projections along the vector that separates them.
For example, consider four spins located at the corners of a square. For two spins located at one edge of the square, the dipolar interaction will favour ferromagnetic alignment along the edge. For two spins on opposing corners of the square, ferromagnetic alignment along the diagonal of the square is favoured.
How to implement this in Easyspin syntax? The case I am looking to implement is actually slightly more complicated: The dipolar couplings among 6 spins situated at the faces of a cube.
Overall, pairwise dipolar couplings can be calculated explicitly. This must be done for all spin pairs, just like exchange interactions.
In the case of the dipolar couplings between anisotropic spins, each spin's gFrame, along with each interspin vector needs to be explicitly provided. Then each 3x3 interaction matrix is simply added to Sys.ee. It can be a tedious process, but doable.
clear, clc
Sys.S = [1/2 1/2 1/2 1/2];
a = 0.8; % edge length of square, in nm
r = a*[1 0 0; 0 1 0; -1 0 0; 0 -1 0].'/2; % vertices of square in xy plane
% Calculate all dipolar coupling tensors and add to spin system
Sys.ee = [];
g = 2.0023;
for i = 1:3
for j = i+1:4
d = diptensor(g,g,r(:,i)-r(:,j));
Sys.ee = [Sys.ee; d];
end
end
Sys.lw = 1;
Exp.Field = 350;
Exp.mwRange = [8 11];
pepper(Sys,Exp)