AntisymmetricTensor

class mrsimulator.spin_system.tensors.AntisymmetricTensor(*, name: str = None, description: str = None, label: str = None, property_units: Dict = {'alpha': 'rad', 'beta': 'rad', 'zeta': 'ppm'}, zeta: float = None, alpha: float = None, beta: float = None)

Bases: Parseable

Base AntiSymmetricTensor class representing the traceless symmetric part of an irreducible second-rank tensor.

zeta

The anisotropy parameter of the AntiSymmetricTensor expressed using the Haeberlen convention. The default value is None.

Type

Optional[float]

alpha

Euler angle, alpha, given in radian. The default value is None.

Type

Optional[float]

beta

Euler angle, beta, given in radian. The default value is None.

Type

Optional[float]

json(exclude={}, units=True) dict

Parse the class object to a JSON compliant python dictionary object.

Parameters
  • exclude – Set of keys that will be excluded from the result.

  • units – If true, the attribute value is a physical quantity expressed as a string with a number and a unit, else a float.

Returns: dict

classmethod parse_dict_with_units(json_dict: dict)

Parse the physical quantity from a dictionary representation of the class object, where the physical quantity is expressed as a string with a number and a unit.

Parameters

json_dict (dict) – A required python dict object.

reduced_dict(exclude={}) dict

Returns a reduced dictionary representation of the class object by removing all key-value pair corresponding to keys listed in the exclude argument, and keys with value as None.

Parameters

exclude – A list of keys to exclude from the dictionary.

Return: A dict.