.. _release-notes_0.5: *********** 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 :py:func:`.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 :py:meth:`.SpinHamiltonian._get_missing_parameters`, that prevented the method from working, when there are indeed missing parameters. * Fix a bug in :py:meth:`.SpinHamiltonian.purge`. The bug prevented modification of the Hamiltonian parameters if this method was used. 0.5.2 ===== **Date**: 14 April 2026 New features ------------ * :py:attr:`.SpinHamiltonian.M_prime`. * :py:meth:`.SpinHamiltonian.set_magnetic_field`. * :py:attr:`.SpinHamiltonian.magnetic_field`. * :py:attr:`.SpinHamiltonian.zeeman_parameters`. * ``when_present`` argument in :py:func:`.io.load_tb2j` and :py:func:`.io.load_tb2j`. * ``missing_bonds`` argument in :py:func:`.io.load_tb2j` and :py:func:`.io.load_tb2j`. * ``g_factors`` argument in :py:func:`.io.load_grogu`. * :py:meth:`.SpinHamiltonian.restore_missing_parameters`. * :py:meth:`.SpinHamiltonian.set_distribution`. * :py:meth:`.SpinHamiltonian.purge`. * :py:func:`.get_equivalent_parameters`. Bugfix ------ * Bug in :py:meth:`.SpinHamiltonian.symmetrize` - new parameters were not saved, meaning that symmetrization was not performed correctly. It is now. * Bug in a :ref:`user-guide_cli_magnopy` CLI, that prevented correct error message for unsupported commands. 0.5.1 ===== **Date**: 2 April 2026 Bugfix ------ * Fix a bug in :py:func:`.experimental.plot_spinham`, that was introduced in 0.5.0 and prevented the function from working. 0.5.0 ===== .. warning:: We recommend to update to 0.5.1 if you need to use :py:func:`.experimental.plot_spinham`. This function was broken in 0.5.0 and fixed in 0.5.1. **Date**: 31 March 2026 New features ------------ * :py:func:`.is_eigenstate` * :py:meth:`.Energy.E_corr` * :py:meth:`.SpinHamiltonian.add` * :py:meth:`.SpinHamiltonian.remove` * :py:meth:`.SpinHamiltonian.symmetrize` * Optimization of classical energy with quantum correction. Breaking changes wrt 0.4 ======================== Deprecated features ------------------- * :py:meth:`.SpinHamiltonian.add_1`, :py:meth:`.SpinHamiltonian.remove_1`, :py:meth:`.SpinHamiltonian.add_21`, :py:meth:`.SpinHamiltonian.remove_21`, :py:meth:`.SpinHamiltonian.add_22`, :py:meth:`.SpinHamiltonian.remove_22`, :py:meth:`.SpinHamiltonian.add_31`, :py:meth:`.SpinHamiltonian.remove_31`, :py:meth:`.SpinHamiltonian.add_41`, :py:meth:`.SpinHamiltonian.remove_41`. Use :py:meth:`.SpinHamiltonian.add` and :py:meth:`.SpinHamiltonian.remove` instead. Removed features ---------------- * :py:meth:`.LSWT.G_inv`. * :py:func:`.experimental.plot_dispersion` (made permanent part of Magnopy: :py:func:`.io.plot_dispersion`). * :py:func:`.io.plot_k_resolved`. * :py:func:`.io.output_k_resolved`. * ``make_sd_image`` argument in CLI scripts. * ``replace`` argument in the :py:meth:`.SpinHamiltonian.add_*` methods. * :py:meth:`.SpinHamiltonian.add_32`, :py:meth:`.SpinHamiltonian.remove_32`, :py:meth:`.SpinHamiltonian.add_421`, :py:meth:`.SpinHamiltonian.remove_421`, :py:meth:`.SpinHamiltonian.add_422`, :py:meth:`.SpinHamiltonian.remove_422`, :py:meth:`.SpinHamiltonian.add_43`, :py:meth:`.SpinHamiltonian.remove_43` are removed as being incorrect. Use :py:meth:`.SpinHamiltonian.add` and :py:meth:`.SpinHamiltonian.remove` instead. * :py:meth:`.SpinHamiltonian.add_33`, :py:meth:`.SpinHamiltonian.remove_33`. * :py:meth:`.SpinHamiltonian.add_44`, :py:meth:`.SpinHamiltonian.remove_44` are renamed to :py:meth:`.SpinHamiltonian.add_45`, :py:meth:`.SpinHamiltonian.remove_45` to be consistent with the new labeling rules described :ref:`here `. * :py:meth:`.SpinHamiltonian.p421`, :py:meth:`.SpinHamiltonian.p422`, :py:meth:`.SpinHamiltonian.p43`, :py:meth:`.SpinHamiltonian.p44` are renamed to be consistent with the new labeling rules described :ref:`here `. The new properties are :py:meth:`.SpinHamiltonian.p42`, :py:meth:`.SpinHamiltonian.p43`, :py:meth:`.SpinHamiltonian.p44`, :py:meth:`.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 :ref:`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 :ref:`support`. Adding parameters to the Hamiltonian ------------------------------------ Compare line to line. .. code-block:: python # 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)) .. code-block:: python # 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. .. code-block:: python # 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)) .. code-block:: python # 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. .. code-block:: python # 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) .. code-block:: python # 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)