Note
Go to the end to download the full example code.
Convention of spin Hamiltonian¶
Tutorial tasks
Create an instance of
magnopy.Conventionfor every mathematical formula on this page.(extra) Write down the spin Hamiltonian in the convention that you usually use or seen recently. Create an instance of the
magnopy.Conventionthat describes it.
Before we move on to the Hamiltonian itself it is very important to understand that there is a dozen of different conventions present in the literature of essentially the same type of Hamiltonian. Here are a few examples of different conventions for the isotropic exchange term
Please read Convention problem with the illustration of challenges that this problem introduces.
We did not want to introduce a new convention in magnopy neither to use a single convention in particular. As a solution we decided to support any convention that user wants to use. Naturally, that implied a responsibility on the user: to provide one! If spin Hamiltonian is loaded from the known source (i. e. TB2J or GROGU), then magnopy knows the convention and user can just read the Hamiltonian from the file like so
# Reading from TB2J
spinham = magnopy.io.load_tb2j("exchange.out")
# Reading from GROGU
spinham = magnopy.io.load_grogu("spinham-from-GROGU.txt")
However, when the spin Hamiltonian is created by user, the magnopy.Convention
object has to be created. For example, to introduce the convention for the Hamiltonian
one shall create the convention object as
import magnopy
convention = magnopy.Convention(
c21=1, c22=0.5, multiple_counting=False, spin_normalized=False
)
To consult the convention properties you can either access individual options or print a summary
print(convention.multiple_counting)
convention.summary()
False
custom convention where
* Bonds are counted once in the sum;
* Spin vectors are not normalized;
* Undefined c1 factor;
* c21 = 1.0;
* c22 = 0.5;
* Undefined c31 factor;
* Undefined c32 factor;
* Undefined c33 factor;
* Undefined c41 factor;
* Undefined c421 factor;
* Undefined c422 factor;
* Undefined c43 factor;
* Undefined c44 factor.
Pre-defined conventions¶
Magnopy offers some pre-defined named conventions. Use
convention = magnopy.Convention.get_predefined("GROGU")
convention.summary()
convention = magnopy.Convention.get_predefined("Vampire")
convention.summary()
convention = magnopy.Convention.get_predefined("TB2J")
convention.summary()
grogu convention where
* Bonds are counted multiple times in the sum;
* Spin vectors are normalized to 1;
* Undefined c1 factor;
* c21 = 1.0;
* c22 = 0.5;
* Undefined c31 factor;
* Undefined c32 factor;
* Undefined c33 factor;
* Undefined c41 factor;
* Undefined c421 factor;
* Undefined c422 factor;
* Undefined c43 factor;
* Undefined c44 factor.
vampire convention where
* Bonds are counted multiple times in the sum;
* Spin vectors are normalized to 1;
* Undefined c1 factor;
* c21 = -1.0;
* c22 = -0.5;
* Undefined c31 factor;
* Undefined c32 factor;
* Undefined c33 factor;
* Undefined c41 factor;
* Undefined c421 factor;
* Undefined c422 factor;
* Undefined c43 factor;
* Undefined c44 factor.
tb2j convention where
* Bonds are counted multiple times in the sum;
* Spin vectors are normalized to 1;
* Undefined c1 factor;
* c21 = -1.0;
* c22 = -1.0;
* Undefined c31 factor;
* Undefined c32 factor;
* Undefined c33 factor;
* Undefined c41 factor;
* Undefined c421 factor;
* Undefined c422 factor;
* Undefined c43 factor;
* Undefined c44 factor.
to get one.
Modifying convention¶
To get the convention where just a few of the properties are changed one can create a new convention and populate all of its properties again. Or use a shortcut
modified = convention.get_modified(c31=1)
modified.summary()
tb2j convention where
* Bonds are counted multiple times in the sum;
* Spin vectors are normalized to 1;
* Undefined c1 factor;
* c21 = -1.0;
* c22 = -1.0;
* c31 = 1.0;
* Undefined c32 factor;
* Undefined c33 factor;
* Undefined c41 factor;
* Undefined c421 factor;
* Undefined c422 factor;
* Undefined c43 factor;
* Undefined c44 factor.
Total running time of the script: (0 minutes 0.014 seconds)