magnopy.examples.full_ham#

magnopy.examples.full_ham(M=4)[source]#

Prepares a Hamiltonian with M atoms on a cubic lattice and all possible types of interaction parameters populated.

Parameters:
Mint, default 4

Number of magnetic atoms in the unit cell. Must be greater than or equal to 4.

Returns:
spinhamSpinHamiltonian

Spin Hamiltonian with M atoms and all possible types of interaction parameters populated.

Notes

This Hamiltonian is not meant to represent any physical system. Its purpose is to be used in the examples of the code, when the creation of the Hamiltonian is not the main point of the example.

Examples

To get an instance of the Hamiltonian use

>>> import magnopy
>>> spinham = magnopy.examples.full_ham()
>>> spinham.cell
array([[1., 0., 0.],
       [0., 1., 0.],
       [0., 0., 1.]])
>>> spinham.atoms.names
['Fe1', 'Fe2', 'Fe3', 'Fe4']
>>> spinham.convention
magnopy.Convention(
    multiple_counting = True,
    spin_normalized = False,
    c1 = 1.0,
    c21 = 1.0,
    c22 = 1.0,
    c31 = 1.0,
    c32 = 1.0,
    c33 = 1.0,
    c41 = 1.0,
    c42 = 1.0,
    c43 = 1.0,
    c44 = 1.0,
    c45 = 1.0,
    name = "full_ham(m=4)"
)
>>> len(spinham.parameters())
1660
>>> len(spinham.p1)
4
>>> len(spinham.p21)
4
>>> len(spinham.p22)
20
>>> len(spinham.p31)
4
>>> len(spinham.p32)
84
>>> len(spinham.p33)
24
>>> len(spinham.p41)
4
>>> len(spinham.p42)
64
>>> len(spinham.p43)
60
>>> len(spinham.p44)
624
>>> len(spinham.p45)
768

Note how the amount of parameters changes when we change convention to non-multiple counting:

>>> spinham.convention = spinham.convention.get_modified(
...     multiple_counting=False
... )

>>> len(spinham.parameters())
168
>>> len(spinham.p1)
4
>>> len(spinham.p21)
4
>>> len(spinham.p22)
10
>>> len(spinham.p31)
4
>>> len(spinham.p32)
28
>>> len(spinham.p33)
4
>>> len(spinham.p41)
4
>>> len(spinham.p42)
16
>>> len(spinham.p43)
10
>>> len(spinham.p44)
52
>>> len(spinham.p45)
32