def __init__(self, domain, distribution, terms):
        r"""A class describing an ensemble of atoms driven different dynamics.

        To describe Doppler broadening from a Maxwell-Boltzmann velocity
        distribution.

        >>> from fast.atomic_structure import speed_average
        >>> from fast import PlaneWave, Atom
        >>> from fast.bloch import phase_transformation
        >>> import numpy as np
        >>> from sympy import Matrix

        >>> element = "Rb"
        >>> isotope = 85
        >>> T = 273.15+20
        >>> v_av = speed_average(T, element, isotope)
        >>> v = np.linspace(-4*v_av, 4*v_av, 11)
        >>> mass = Atom(element, isotope).mass
        >>> f = fast_maxwell_boltzmann(mass)
        >>> distribution = f([v], T)
        >>> print distribution
        [  3.34624364e-12   5.12403858e-09   1.53771999e-06   9.04382537e-05
           1.04240650e-03   2.35468108e-03   1.04240650e-03   9.04382537e-05
           1.53771999e-06   5.12403858e-09   3.34624364e-12]

        We obtain a fast function for the Doppler terms.

        >>> Ne = 2
        >>> Nl = 1
        >>> unfolding = Unfolding(Ne, True, True, True)

        >>> a0 = physical_constants["Bohr radius"][0]
        >>> rm = [Matrix([[0, 0], [a0, 0]]),
        ...       Matrix([[0, 0], [0, 0]]),
        ...       Matrix([[0, 0], [0, 0]])]
        >>> xi = np.array([[[0, 1], [1, 0]]])
        >>> theta = phase_transformation(Ne, Nl, rm, xi)

        >>> omega_level = [1, 2.4e15]

        >>> v_sym = symbols("vx vy vz")
        >>> detuning_knob = [symbols("delta1")]
        >>> laser = PlaneWave(0, 0, 0, 0, 1)
        >>> k = [laser.k]

        >>> doppler_terms = fast_doppler_terms(v_sym, detuning_knob, k,
        ...                                    omega_level,
        ...                                    xi, theta, unfolding,
        ...                                    matrix_form=True)

        >>> doppler_effect = Inhomogeneity([v], distribution, doppler_terms)

        """
        self.domain = domain
        self.distribution = distribution
        self.terms = terms
        self.shape = distribution.shape
def __init__ ( self , domain , distribution , terms ) : self . domain = domain self . distribution = distribution self . terms = terms self . shape = distribution . shape
r"""A class describing an ensemble of atoms driven different dynamics.

        To describe Doppler broadening from a Maxwell-Boltzmann velocity
        distribution.

        >>> from fast.atomic_structure import speed_average
        >>> from fast import PlaneWave, Atom
        >>> from fast.bloch import phase_transformation
        >>> import numpy as np
        >>> from sympy import Matrix

        >>> element = "Rb"
        >>> isotope = 85
        >>> T = 273.15+20
        >>> v_av = speed_average(T, element, isotope)
        >>> v = np.linspace(-4*v_av, 4*v_av, 11)
        >>> mass = Atom(element, isotope).mass
        >>> f = fast_maxwell_boltzmann(mass)
        >>> distribution = f([v], T)
        >>> print distribution
        [  3.34624364e-12   5.12403858e-09   1.53771999e-06   9.04382537e-05
           1.04240650e-03   2.35468108e-03   1.04240650e-03   9.04382537e-05
           1.53771999e-06   5.12403858e-09   3.34624364e-12]

        We obtain a fast function for the Doppler terms.

        >>> Ne = 2
        >>> Nl = 1
        >>> unfolding = Unfolding(Ne, True, True, True)

        >>> a0 = physical_constants["Bohr radius"][0]
        >>> rm = [Matrix([[0, 0], [a0, 0]]),
        ...       Matrix([[0, 0], [0, 0]]),
        ...       Matrix([[0, 0], [0, 0]])]
        >>> xi = np.array([[[0, 1], [1, 0]]])
        >>> theta = phase_transformation(Ne, Nl, rm, xi)

        >>> omega_level = [1, 2.4e15]

        >>> v_sym = symbols("vx vy vz")
        >>> detuning_knob = [symbols("delta1")]
        >>> laser = PlaneWave(0, 0, 0, 0, 1)
        >>> k = [laser.k]

        >>> doppler_terms = fast_doppler_terms(v_sym, detuning_knob, k,
        ...                                    omega_level,
        ...                                    xi, theta, unfolding,
        ...                                    matrix_form=True)

        >>> doppler_effect = Inhomogeneity([v], distribution, doppler_terms)