symmetr.mham module

Module for finding a symmetrical form of classical magnetic Hamiltonians.

symmetr.mham.convert_mag_ham(H, T)[source]

Converts the tensor representing the magnetic Hamiltonian to a different basis.

Note: This is just a tensor transformation, there are several other functions very similar to this. The only difference is which indeces transform by T and which by T^-1. This just corresponds to covariant and contravariant indeces and this would be nice to eventually implement in the code.

Parameters:
  • H (Tensor) – the magnetic Hamiltonian in basis A

  • T (matrix) – . If it is set, the symmetry operations will be transformed by this matrix. T transforms from A to B, ie Tx_A = x_B.

Returns:

the magnetic Hamiltonian in basis B

Return type:

H_T

symmetr.mham.equiv(H, sites, syms, T=None, debug=False)[source]

Transform H for one set of sites to all sites that are related by symmetry operation

Parameters:
  • H (class tensor) – the magnetic Hamiltonian.

  • sites (list) – list of atomic sites

  • () (syms) – symmetry operations in the findsym format

  • T (sympy matrix) – Coordinate transformation matrix used to transform the symmetry operations. Must transform syms to the coordinate system in which H is given.

Returns:

the keys are all the equivalent sets of sites. Asites[sites] is the

transformed Hamiltonian for the sites.

Return type:

Asites (dictionary)

symmetr.mham.find_perms(sites)[source]

Find permutations of identical atomic sites.

The Hamiltonian must be invariant under interchanging atomic sites if they are the same. This function takes the list of sites and returns such permutations. :param sites: list of atomic sites :type sites: list

Returns:

list of permutations

Return type:

perms

class symmetr.mham.params_trans_ham(sites, debug=None, T=None, check_sym=False)[source]

Bases: object

Class for storing parameters of the transformation function.

__dict__ = mappingproxy({'__module__': 'symmetr.mham', '__firstlineno__': 52, '__doc__': 'Class for storing parameters of the transformation function.', '__init__': <function params_trans_ham.__init__>, '__static_attributes__': ('T', 'check_sym', 'debug', 'sites'), '__dict__': <attribute '__dict__' of 'params_trans_ham' objects>, '__weakref__': <attribute '__weakref__' of 'params_trans_ham' objects>, '__annotations__': {}})
__firstlineno__ = 52
__init__(sites, debug=None, T=None, check_sym=False)[source]
__module__ = 'symmetr.mham'
__static_attributes__ = ('T', 'check_sym', 'debug', 'sites')
symmetr.mham.print_Ham(H, sites, latex=False, ret=False)[source]

Prints the magnetic Hamiltonian in a nice format.

symmetr.mham.sym_mag_ham(sites, syms, T=None, s_opt=None)[source]

Returns the symmetrized magnetic Hamiltonian

Parameters:
  • sites (list) – The atomic sites for which the Hamiltonian is considered

  • syms – the symmetry operations.

  • T (optinal[matrix]) – Transformation matrix to a different basis. If set, it is used to transform the symmetry operations.

Returns:

The symmetrized form of the Hamiltonian

symmetr.mham.trans_mag_Ham_perms(H, perm, params)[source]

Transforms the Hamiltonian by a permutation of atomic sites.

Parameters:
  • H (class tensor) – the magnetic Hamiltonian.

  • perm (tuple) – the permutation

  • params – not used right now

Returns:

the transformed Hamiltonian

Return type:

H_T

symmetr.mham.trans_mag_ham(H, sym, params)[source]

Transforms the magnetic Hamiltonian by a symmetry operation.

There are two different modes depending on params.check_sym If params.chech_sym == True:

Returns None for any symmetry operation, which transforms sites into a differet set of sites. If sym transform sites into the same set of sites then it returns transformed H for the original sites. That is: if sites = 1,2 and sym(sites) = 2,1 then sym is used and returned H is for sites = 1,2.

If params.check_sym == False:

Returns transformed H for the transformed sites. That is if sites = 1,2 and sym(sites) = 2,1 the H is returned for 2,1 sites. If sym(sites) = 2,3 then H is returned for 2,3 sites.

Parameters:
  • H (class tensor) – the magnetic Hamiltonian.

  • () (sym) – symmetry operation in the findsym format

  • params (class params_trans_ham) – contains parameters for the transformation

Returns:

transformed Hamiltonian

Return type:

H_T (class tensor)