Classical Energy

Exercises

  1. Compute classical energy of one of the Hamiltonians from the previous tasks.

  2. Change the convention of the spin Hamiltonian and compute the energy again. Does it change?

  3. Create a Hamiltonian with the isotropic exchange, triaxial anisotropy and DM interaction. Optimize the spin direction for the full Hamiltonian. Use them to compute energy contributions of every term.

  4. (extra) Create a Hamiltonian of the ferromagnet with an easy magnetic axis. Find out numerically the value of the magnetic field that shall be applied perpendicular to the easy axis, which fully orients the spins along the magnetic field.

Classical energy of the spin Hamiltonian is implemented in a separate class.

import magnopy

# Get an example of the ferromagnet on a cubic lattice, with an easy axis
spinham = magnopy.examples.cubic_ferro_nn(S=1, J_iso=1, J_21=[0, 0, -0.1])

# Create an instance of the energy class
energy = magnopy.Energy(spinham=spinham)

Now this object can be used to compute the energy for some set of spin directions

Note

By default energy is returned in meV.

print(f" Energy with spin along x axis: {energy(spin_directions=[[1, 0, 0]]):.4f} meV")
print(f" Energy with spin along y axis: {energy(spin_directions=[[0, 1, 0]]):.4f} meV")
print(f" Energy with spin along z axis: {energy(spin_directions=[[0, 0, 1]]):.4f} meV")
Energy with spin along x axis: -3.0000 meV
Energy with spin along y axis: -3.0000 meV
Energy with spin along z axis: -3.1000 meV

Energy optimization

Magnopy implements numerical minimization of classical energy, by varying spin directions of all magnetic centers in the unit cell on a sphere [1]. A local minima can be found in that way.

optimized_sd = energy.optimize()
print(
    f"Optimized spin directions are\n{optimized_sd}\nwith the energy of {energy(optimized_sd)} meV"
)
─────┬─────────────┬─────────────┬─────────────
step │     E_0     │  delta E_0  │ max torque
─────┴─────────────┴─────────────┴─────────────
1       -3.0996947     0.0384084     0.0110339
2       -3.0999451     0.0002504     0.0046850
3       -3.1000000     0.0000549     0.0000055
4       -3.1000000     0.0000000     0.0000000
───────────────────────────────────────────────
Optimized spin directions are
[[-7.45469565e-09  6.76789369e-09 -1.00000000e+00]]
with the energy of -3.1000000000000005 meV

see magnopy.Energy for more details.

References

Total running time of the script: (0 minutes 0.004 seconds)

Gallery generated by Sphinx-Gallery