gpe.axial
=========

.. py:module:: gpe.axial

.. autoapi-nested-parse::

   Dynamics in elongated harmonic traps.

   See Expansion.ipynb for details.



Attributes
----------

.. autoapisummary::

   gpe.axial.u


Classes
-------

.. autoapisummary::

   gpe.axial.StateAxialBase
   gpe.axial.State2AxialBase


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

.. py:data:: u

.. py:class:: StateAxialBase(basis, **kw)

   Bases: :py:obj:`gpe.bec.StateTwist_x`


   3D model for an elongated cloud with axial symmetry.

   For compatibility with the tube code, the user should still provide the
   function `get_ws()`, but the assumption here is that the frequencies
   are the same.

   Expansion is implemented in the axial direction through a rescaling of the
   coordinates according to the procedure described in Docs/Expansion.ipynb
   developed by Y. Castin and R. Dum.

   https://doi.org/10.1103/PhysRevLett.77.5315


   .. py:attribute:: basis_type
      :value: 'axial'



   .. py:method:: init()

      Initialize the state.

      This method defines the basis positions, momenta, etc. for use later
      on.  We define these here rather than in the constructor `__init__()`
      so that the user can change them later and the reinitialize the state.
      We also call this function from the `pre_evolve_hook()` so that it is
      called before any evolution takes place.  For this reason, we should
      not modify the state here.



   .. py:property:: K_factor


   .. py:property:: E_max

      Return the maximum kinetic energy in the basis.

      This is useful when using evolvers as convergence should be obtained
      when the time-step is roughly::

          dt = 0.1 * state.hbar / state.E_max

      See `t_scale`.


   .. py:property:: kx2

      Overload the bec.StateTwist_x.kx2 variable to include the factor of
      lam_perp**2 to compensate for K_factor.


   .. py:method:: get_xyz_GPU()


   .. py:property:: metric


   .. py:method:: get_ws(t=None)

      Return the perpendicular frequency at time t.



   .. py:method:: get_psi_GPU()

      Return the physical wavefunction (applying any twist).



   .. py:method:: set_psi(psi)

      Set the state from a physical wavefunction (removing any twist).



   .. py:method:: get_density_x(n=None)

      Return integrated density along x axis.



   .. py:property:: w0_perp

      Average perpendicular frequency at time t=0.


   .. py:method:: _get_Vext()

      Correct the external potentials.



   .. py:method:: _rhs(q, t)

      RHS for lambda(t) ODE.



   .. py:method:: get_lambda()


   .. py:method:: _plot(ratios=(1, 2), colorbar_fraction=0.05, grid=None)


   .. py:method:: plot(grid=None, axs=None)

      Plot 1D, 2D, or 3D data and return axs.

      :param log: If `True`, plot the log of the densities.
      :type log: bool
      :param label: For 1D data, use this label.
      :type label: str
      :param phase: If `True`, draw the phase plot in 2D.
      :type phase: bool
      :param fig: Figure in which to draw plots.  Only used if `ax` or `axs` are `None`.
      :type fig: Figure
      :param axs: List of axes used in plot.  This is what is returned and should be passed in
                  during an animation loop
      :type axs: [Axes]
      :param convergence: If `True`, display UV and IR convergence factors.
      :type convergence: bool
      :param plot_convergence: If `True`, plot converge in inset.
      :type plot_convergence: bool



.. py:class:: State2AxialBase(basis, **kw)

   Bases: :py:obj:`gpe.bec2.StateBase`


   3D model for an elongated cloud with axial symmetry.

   For compatibility with the tube code, the user should still provide the
   function `get_ws()`, but the assumption here is that the frequencies
   are the same.

   Expansion is implemented in the axial direction through a rescaling of the
   coordinates according to the procedure described in Docs/Expansion.ipynb
   developed by Y. Castin and R. Dum.

   https://doi.org/10.1103/PhysRevLett.77.5315


   .. py:attribute:: basis_type
      :value: 'axial'



   .. py:method:: init()

      Initialize the state.

      This method defines the basis positions, momenta, etc. for use later
      on.  We define these here rather than in the constructor `__init__()`
      so that the user can change them later and the reinitialize the state.
      We also call this function from the `pre_evolve_hook()` so that it is
      called before any evolution takes place.  For this reason, we should
      not modify the state here.



   .. py:property:: K_factor


   .. py:property:: E_max

      Return the maximum kinetic energy in the basis.

      This is useful when using evolvers as convergence should be obtained
      when the time-step is roughly::

          dt = 0.1 * state.hbar / state.E_max

      See `t_scale`.


   .. py:property:: kx2

      Overload the bec2.State.kx2 variable to include the factor of
      lam_perp**2 to compensate for K_factor.


   .. py:method:: get_xyz_GPU()


   .. py:property:: metric


   .. py:method:: get_ws(t=None)

      Return the perpendicular frequency at time t.



   .. py:method:: get_psi_GPU()

      Return the physical wavefunction (applying any twist).



   .. py:method:: set_psi(psi)

      Set the state from a physical wavefunction (removing any twist).



   .. py:method:: get_density_x(ns=None)


   .. py:method:: _get_energy_density()


   .. py:property:: w0_perp

      Average perpendicular frequency at time t=0.


   .. py:method:: _get_Vext()

      Correct the external potentials.



   .. py:method:: _rhs(q, t)

      RHS for lambda(t) ODE.



   .. py:method:: get_lambda()


   .. py:method:: _plot(ratios=(1, 2), colorbar_fraction=0.05, grid=None)


   .. py:method:: plot(grid=None)


