magnopy.Convention#
- class magnopy.Convention(multiple_counting: bool = None, spin_normalized: bool = None, c1: float = None, c21: float = None, c22: float = None, c31: float = None, c32: float = None, c33: float = None, c41: float = None, c421: float = None, c422: float = None, c43: float = None, c44: float = None, name: str = 'custom')[source]#
Convention of the spin Hamiltonian.
For the detailed description of the convention problem see Convention problem.
- Parameters:
- multiple_countingbool, optional
Whether the pairs of spins are counted multiple times in the Hamiltonian's sums.
- spin_normalizedbool, optional
Whether spin vectors/operators are normalized to 1. If
True, then spin vectors/operators are normalized.- c1float, optional
Numerical factor before the (one spin & one site) term of the Hamiltonian.
- c21float, optional
Numerical factor before the (two spins & one site) term of the Hamiltonian.
- c22float, optional
Numerical factor before the (two spins & two sites) term of the Hamiltonian.
- c31float, optional
Numerical factor before the (three spins & one site) term of the Hamiltonian.
- c32float, optional
Numerical factor before the (three spins & two sites) term of the Hamiltonian.
- c33float, optional
Numerical factor before the (three spins & three sites) term of the Hamiltonian.
- c41float, optional
Numerical factor before the (four spins & one site) term of the Hamiltonian.
- c421float, optional
Numerical factor before the (four spins & two sites & 1+3) term of the Hamiltonian.
- c422float, optional
Numerical factor before the (four spins & two sites & 2+2) term of the Hamiltonian.
- c43float, optional
Numerical factor before the (four spins & three sites) term of the Hamiltonian.
- c44float, optional
Numerical factor before the (four spins & four sites) term of the Hamiltonian.
- namestr, default "custom"
A label for the convention. Any string, case-insensitive.
Examples
>>> from magnopy import Convention >>> n1 = Convention(True, True, c21=1, c22=-0.5) >>> n2 = Convention(False, True, c21=1, c22=-0.5) >>> n3 = Convention(False, True, c22=-0.5) >>> n1.multiple_counting True >>> n1 == n2 False >>> n3.c21 Traceback (most recent call last): ... magnopy._exceptions.ConventionError: Convention of spin Hamiltonian has an undefined property 'c21': custom convention where * Bonds are counted once in the sum; * Spin vectors are normalized to 1; * Undefined c1 factor; * Undefined c21 factor; * c22 = -0.5; * Undefined c31 factor; * Undefined c32 factor; * Undefined c33 factor; * Undefined c41 factor; * Undefined c421 factor; * Undefined c422 factor; * Undefined c43 factor; * Undefined c44 factor. >>> n3.name 'custom'
Methods:
get_modified([multiple_counting, ...])Returns the new instance of the
Conventionclass based on the called one with changed given properties.get_predefined(name)Returns one of the pre-defined conventions.
summary([return_as_string])Gives human-readable summary of the convention.
Properties:
Numerical factor before the (one spin & one site) sum of the Hamiltonian.
Numerical factor before the (two spins & one site) sum of the Hamiltonian.
Numerical factor before the (two spins & two sites) sum of the Hamiltonian.
Numerical factor before the (three spins & one site) sum of the Hamiltonian.
Numerical factor before the (three spins & two sites) sum of the Hamiltonian.
Numerical factor before the (three spins & three sites) sum of the Hamiltonian.
Numerical factor before the (four spins & one site) sum of the Hamiltonian.
Numerical factor before the (four spins & two sites (1+3)) sum of the Hamiltonian.
Numerical factor before the (four spins & two sites (2+2)) sum of the Hamiltonian.
Numerical factor before the (four spins & three sites) sum of the Hamiltonian.
Numerical factor before the (four spins & four sites) sum of the Hamiltonian.
Whether the pairs of spins are counted multiple times in the Hamiltonian's sums.
A label for the convention.
Whether spin vectors/operators are normalized to 1.