# Extended Czjzek distribution Model¶

class mrsimulator.models.ExtCzjzekDistribution(symmetric_tensor: SymmetricTensor, eps: float, polar=False)

Bases: AbstractDistribution

An extended Czjzek distribution distribution model.

The extended Czjzek random distribution [1] model is an extension of the Czjzek model, given as

(80)$S_T = S(0) + \rho S_C(\sigma=1),$

where $$S_T$$ is the total tensor, $$S(0)$$ is the dominant tensor, $$S_C(\sigma=1)$$ is the Czjzek random model attributing to the random perturbation of the tensor about the dominant tensor, $$S(0)$$, and $$\rho$$ is the size of the perturbation. Note, in the above equation, the $$\sigma$$ parameter from the Czjzek random model, $$S_C$$, has no meaning and is set to one. The factor, $$\rho$$, is defined as

(81)$\rho = \frac{||S(0)|| \epsilon}{\sqrt{30}},$

where $$\|S(0)\|$$ is the 2-norm of the dominant tensor, and $$\epsilon$$ is a fraction.

Parameters:
• symmetric_tensor (SymmetricTensor) – A shielding or quadrupolar symmetric tensor or equivalent dict object.

• eps (float) – A fraction determining the extent of perturbation.

Example

>>> from mrsimulator.models import ExtCzjzekDistribution
>>> S0 = {"Cq": 1e6, "eta": 0.3}
>>> ext_cz_model = ExtCzjzekDistribution(S0, eps=0.35)

pdf(pos, size: int = 400000)

Generates a probability distribution function by binning the random variates of length size onto the given grid system.

Parameters:
• pos – A list of coordinates along the two dimensions given as NumPy arrays.

• size – The number of random variates drawn in generating the pdf. The default is 400000.

Returns:

A list of x and y coordinates and the corresponding amplitudes.

Example

>>> import numpy as np
>>> cq = np.arange(50) - 25
>>> eta = np.arange(21)/20
>>> Cq_dist, eta_dist, amp = cz_model.pdf(pos=[cq, eta])

rvs(size: int)

Draw random variates of length size from the distribution.

Parameters:

size – The number of random points to draw.

Returns:

A list of two NumPy array, where the first and the second array are the anisotropic/quadrupolar coupling constant and asymmetry parameter, respectively.

Example

>>> Cq_dist, eta_dist = ext_cz_model.rvs(size=1000000)