Version 0.5#

0.5.4#

Date: 9 June 2026

Bugfix#

  • Fix issue #114. Bug that affected calculations of magnon dispersion with non-collinear ground states or with anisotropic exchange interactions.

0.5.3#

Date: 25 May 2026

New features#

  • Update io.load_grogu() can read the Hamiltonian's convention from the file instead of assuming the default GROGU's one.

Bugfix#

  • Fix a bug in SpinHamiltonian._get_missing_parameters(), that prevented the method from working, when there are indeed missing parameters.

  • Fix a bug in SpinHamiltonian.purge(). The bug prevented modification of the Hamiltonian parameters if this method was used.

0.5.2#

Date: 14 April 2026

New features#

Bugfix#

  • Bug in SpinHamiltonian.symmetrize() - new parameters were not saved, meaning that symmetrization was not performed correctly. It is now.

  • Bug in a magnopy CLI, that prevented correct error message for unsupported commands.

0.5.1#

Date: 2 April 2026

Bugfix#

0.5.0#

Warning

We recommend to update to 0.5.1 if you need to use experimental.plot_spinham(). This function was broken in 0.5.0 and fixed in 0.5.1.

Date: 31 March 2026

New features#

Breaking changes wrt 0.4#

Deprecated features#

Removed features#

  • LSWT.G_inv().

  • experimental.plot_dispersion() (made permanent part of Magnopy: io.plot_dispersion()).

  • io.plot_k_resolved().

  • io.output_k_resolved().

  • make_sd_image argument in CLI scripts.

  • replace argument in the SpinHamiltonian.add_*() methods.

  • SpinHamiltonian.add_32(), SpinHamiltonian.remove_32(), SpinHamiltonian.add_421(), SpinHamiltonian.remove_421(), SpinHamiltonian.add_422(), SpinHamiltonian.remove_422(), SpinHamiltonian.add_43(), SpinHamiltonian.remove_43() are removed as being incorrect. Use SpinHamiltonian.add() and SpinHamiltonian.remove() instead.

  • SpinHamiltonian.add_33(), SpinHamiltonian.remove_33().

  • SpinHamiltonian.add_44(), SpinHamiltonian.remove_44() are renamed to SpinHamiltonian.add_45(), SpinHamiltonian.remove_45() to be consistent with the new labeling rules described here.

  • SpinHamiltonian.p421(), SpinHamiltonian.p422(), SpinHamiltonian.p43(), SpinHamiltonian.p44() are renamed to be consistent with the new labeling rules described here. The new properties are SpinHamiltonian.p42(), SpinHamiltonian.p43(), SpinHamiltonian.p44(), SpinHamiltonian.p45() respectively.

Transition guide#

Version 0.5.0 introduces breaking changes in the magnopy's API. Those changes were unavoidable, as we needed to fix more-than-three-spins terms of the Hamiltonian and introduce full and correct form of the spin Hamiltonian.

This page is aimed to ease the transition to the 0.5.0 for the users of the previous versions. As always, if you have questions of how to modify your existing scripts, please contact us via User support.

Adding parameters to the Hamiltonian#

Compare line to line.

# Prior to 0.5.0
spinham.add_1(alpha=0, parameter = [0,0,1])
spinham.add_21(alpha=0, parameter = np.eye(3))
spinham.add_22(alpha=0, beta=1, nu=(1, 0, 0), parameter = np.eye(3))
# 0.5.0 and later
spinham.add(nus=(), alphas=(0,), parameter=[0,0,1])
spinham.add(nus=((0, 0, 0),), alphas=(0, 0), parameter=np.eye(3))
spinham.add(nus=((1, 0, 0),), alphas=(0, 1), parameter=np.eye(3))

Removing parameters from the Hamiltonian#

Compare line to line.

# Prior to 0.5.0
spinham.remove_1(alpha=0)
spinham.remove_21(alpha=0)
spinham.remove_22(alpha=0, beta=1, nu=(1, 0, 0))
# 0.5.0 and later
spinham.remove(nus=(), alphas=(0,))
spinham.remove(nus=((0, 0, 0),), alphas=(0, 0))
spinham.remove(nus=((1, 0, 0),), alphas=(0, 1))

Iterating over parameters of the Hamiltonian#

Compare cycle to cycle.

# Prior to 0.5.0
for alpha, parameter in spinham.p1:
    print(spinham.atoms.names[alpha], parameter)

for alpha, parameter in spinham.p21:
    print(spinham.atoms.names[alpha], parameter)

for alpha, beta, nu, parameter in spinham.p22:
    print(spinham.atoms.names[alpha], spinham.atoms.names[beta], nu)
    print(parameter)
# 0.5.0 and later
for nus, alphas, parameters in spinham.p1:
    alpha = alphas[0]
    print(spinham.atoms.names[alpha], parameter)

for nus, alphas, parameters in spinham.p21:
    alpha = alphas[0]
    print(spinham.atoms.names[alpha], parameter)

for nus, alphas, parameters in spinham.p22:
    alpha_1 = alphas[0]
    alpha_2 = alphas[1]
    nu = nus[0]
    print(spinham.atoms.names[alpha_1], spinham.atoms.names[alpha_2], nu)
    print(parameter)