magnopy.Convention.get_predefined#

method

static Convention.get_predefined(name: str)[source]#

Returns one of the predefined conventions.

Parameters:
namestr

Name of the desired predefined convention. Supported are

  • "tb2j"

  • "grogu"

  • "vampire"

  • "spinw"

Case-insensitive.

Returns:
conventionConvention

Notes

To check which conventions are hard-coded in Magnopy one can do

>>> from magnopy._constants._conventions import _SPINHAM_CONVENTIONS
>>> print(list(_SPINHAM_CONVENTIONS.keys()))
['tb2j', 'grogu', 'vampire', 'spinw']

Examples

>>> import magnopy
>>> tb2j = magnopy.Convention.get_predefined("TB2J")
>>> print(tb2j)
"tb2j" convention where
  * Bonds are counted multiple times in the sum;
  * Spin vectors are normalized to 1;
  * Undefined c1 factor;
  * c21 = -1.0;
  * c22 = -1.0;
  * Undefined c31 factor;
  * Undefined c32 factor;
  * Undefined c33 factor;
  * Undefined c41 factor;
  * Undefined c42 factor;
  * Undefined c43 factor;
  * Undefined c44 factor;
  * Undefined c45 factor.
>>> grogu = magnopy.Convention.get_predefined("GROGU")
>>> print(grogu)
"grogu" convention where
  * Bonds are counted multiple times in the sum;
  * Spin vectors are normalized to 1;
  * Undefined c1 factor;
  * c21 = 1.0;
  * c22 = 0.5;
  * Undefined c31 factor;
  * Undefined c32 factor;
  * Undefined c33 factor;
  * Undefined c41 factor;
  * Undefined c42 factor;
  * Undefined c43 factor;
  * Undefined c44 factor;
  * Undefined c45 factor.
>>> vampire = magnopy.Convention.get_predefined("Vampire")
>>> print(vampire)
"vampire" convention where
  * Bonds are counted multiple times in the sum;
  * Spin vectors are normalized to 1;
  * Undefined c1 factor;
  * c21 = -1.0;
  * c22 = -0.5;
  * Undefined c31 factor;
  * Undefined c32 factor;
  * Undefined c33 factor;
  * Undefined c41 factor;
  * Undefined c42 factor;
  * Undefined c43 factor;
  * Undefined c44 factor;
  * Undefined c45 factor.
>>> spinW = magnopy.Convention.get_predefined("spinW")
>>> print(spinW)
"spinw" convention where
  * Bonds are counted multiple times in the sum;
  * Spin vectors are not normalized;
  * Undefined c1 factor;
  * c21 = 1.0;
  * c22 = 1.0;
  * Undefined c31 factor;
  * Undefined c32 factor;
  * Undefined c33 factor;
  * Undefined c41 factor;
  * Undefined c42 factor;
  * Undefined c43 factor;
  * Undefined c44 factor;
  * Undefined c45 factor.