Transition

class mrsimulator.transition.Transition(*, name: str = None, description: str = None, label: str = None, property_units: Dict = {}, initial: List[float] = [], final: List[float] = [])

Bases: Parseable

Base Transition class describes a spin transition between two energy states, where the energy states are described using the weakly coupled basis.

(50)\[|m_{i,0}, m_{i,1}, ... m_{i,N} \rangle \rightarrow |m_{f,0}, m_{f,1}, ... m_{f,N} \rangle\]
Parameters
  • initial (list) – The initial Zeeman energy state represented as a list of quantum numbers \(m_{i,n}\).

  • final (list) – The final Zeeman energy state represented as a list of quantum numbers \(m_{f,n}\).

Example

>>> from mrsimulator.transition import Transition
>>> t1 = Transition(initial = [0.5, 0.5], final = [0.5, -0.5])
>>> t1
|0.5, -0.5⟩⟨0.5, 0.5|
property D

Return a list of Δm**2 values of the spin transition for each site in a weakly coupled basis.

Example

>>> t1.D
array([0., 0.])
property P

Return a list of Δm values of the spin transition for each site in a weakly coupled basis.

Example

>>> t1.P
array([ 0., -1.])
property delta_m

An alias for p

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

property p

Return the total Δm (m_final-m_initial) value of the spin transition.

Example

>>> t1.p
-1.0
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.

tolist() list

Convert the transition to a list of quantum numbers where the first N quantum numbers corresponds to the initial energy state, while the last N corresponds to the final energy state, where N is the number of sites.

Example

>>> t1.tolist()
[0.5, 0.5, 0.5, -0.5]