gpe.slda
========

.. py:module:: gpe.slda


Classes
-------

.. autoapisummary::

   gpe.slda.HomogeneousSLDA


Functions
---------

.. autoapisummary::

   gpe.slda.cubic_degeneracy
   gpe.slda.get_n2s


Module Contents
---------------

.. py:function:: cubic_degeneracy(N, ny, nz)

   Return the degeneracy of the point (N, ny, nz) on the cube.

   Assumes N >= ny >= nz.


.. py:function:: get_n2s(N)

   Return dictionary of `sum(n**2)` keys with degeneracies.


.. py:class:: HomogeneousSLDA(**kw)

   Class for computing parameters for the Homogeneous SLDA.

   .. attribute:: hbar2_2m

      `hbar**2 / 2 / m`.

      :type: float

   .. attribute:: xi

      Bertsch parameter.

      :type: float

   .. attribute:: alpha

      Inverse effective mass.

      :type: float

   .. attribute:: eta

      Gap in units of the Fermi energy: `eta = Delta / E_F`

      :type: float

   .. attribute:: aurel

      If `True`, then use Aurel's regularization scheme which converges faster.

      :type: bool


   .. py:attribute:: hbar2_2m
      :value: 0.5



   .. py:attribute:: xi
      :value: 0.372



   .. py:attribute:: alpha
      :value: 1.09



   .. py:attribute:: eta
      :value: 0.45



   .. py:attribute:: aurel
      :value: False



   .. py:method:: _quad(f, mu_alpha, delta_alpha, kc_k0)

      Return the integral of `f(k)` over a sphere in momentum up to `kc`.



   .. py:method:: _get_nk(k, mu_alpha, delta_alpha)

      Carefully compute the density integrand to avoid round-off errors.

      Uses a series expansion for large k.



   .. py:method:: _get_kF_EF_EFG(n)

      Return `(k_F, E_F, E_FG)`. (DRY)

      :param n: Total density n = n_a + n_b.
      :type n: float or array-like



   .. py:method:: n_integrand(k, **kw)


   .. py:method:: tau_integrand(k, **kw)


   .. py:method:: nu_integrand(k, mu_alpha, delta_alpha)


   .. py:method:: gap_eq(delta_alpha, **kw)

      Return the gap equation objective (should be zero).



   .. py:method:: compute(kc_k0=50, mu_alpha=1.0, delta_alpha=1)

      Solve the gap equation, then compute the parameters.

      :param kc_k0: Momentum cutoff in units of k0.
      :type kc_k0: float
      :param mu_alpha: mu / alpha.  Sets the scale for densities and k0.
      :type mu_alpha: float
      :param delta_alpha: Initial guess for `delta / alpha`.  If this is zero, then properties of the
                          normal state are computed.
      :type delta_alpha: float

      :returns: * **Res** (*tuple*) -- Object with `alpha`, `beta` and `gamma` parameters.
                * Note, for debugging purposes, all variables are stored in `self._locals` which can be
                * used with e.g. `locals().update(s._locals)`.



   .. py:method:: f(y0, l)

      Return the `-pi P_l(-y_0)/sin(pi*l)`.



   .. py:method:: compute_lattice(y0, L)


   .. py:method:: _quad_box(f, mu_alpha, delta_alpha)

      Return the integral of `f(k)` over a box.



