gpe.exact_solutions#

This file contains a set of exact solutions useful for testing.

Classes#

HarmonicOscillator

Modified 1D harmonic oscillator potential with analytic solution.

HarmonicOscillators

Modified 2D harmonic oscillator potential with analytic solution.

BrightSoliton

Analytic moving bright soliton (for attractive interactions).

TravellingWaves

Analytic traveling wave solutions for the GPE without a

DarkBrightSolitons

State with HO potential for backward compatibility.

Functions#

sn(u, m)

Jacobi elliptic function sn.

K(m)

Jacobi elliptic integral

Module Contents#

class HarmonicOscillator(Nx=46, Lx=17.0, sigma=1.0, g=1.0, n0=1.0, **kw)[source]#

Bases: gpe.bec.StateBase

Modified 1D harmonic oscillator potential with analytic solution.

Here we add a piece to the harmonic oscillator potential to ensure that a Gaussian is an eigenstate, even in the presence of interactions.

w = 1.0[source]#
n0 = 1.0[source]#
sigma = 1.0[source]#
get_psi_exact(r)[source]#
get_Vext_r(r)[source]#
property psi_exact[source]#
get_Vext_GPU()[source]#

Return the external potential. This default version is zero.

class HarmonicOscillators(Nxyz=(46, 46), Lxyz=(17.0, 17.0), sigmas=(1.0, 1.0), g=1.0, n0=1.0, **kw)[source]#

Bases: gpe.bec.StateBase

Modified 2D harmonic oscillator potential with analytic solution.

Here we add a piece to the harmonic oscillator potential to ensure that a Gaussian is an eigenstate, even in the presence of interactions.

ws[source]#
n0 = 1.0[source]#
sigmas = (1.0, 1.0)[source]#
get_psi_exact(xyz=None)[source]#
get_Vext_GPU()[source]#

Return the external potential. This default version is zero.

property psi_exact[source]#
class BrightSoliton(Nx=2**4 * 3**3, Lx=58.0, sigma=1.0, g=None, n0=1.0, v=0.0, **kw)[source]#

Bases: gpe.bec.StateTwist_x

Analytic moving bright soliton (for attractive interactions).

sigma = 1.0[source]#
n0 = 1.0[source]#
v = 0.0[source]#
property x[source]#

Flat x abscissa as a numpy array.

property psi0[source]#
sn(u, m)[source]#

Jacobi elliptic function sn.

K(m)[source]#

Jacobi elliptic integral

class TravellingWaves(Nx=64, Lx=10.0, n0=0.1, n1=1.0, m=1.0, g=1.0, hbar=1.0, v_p=0.0, v_x=None, twist=None, **kw)[source]#

Bases: gpe.bec.StateTwist_x

Analytic traveling wave solutions for the GPE without a potential.

The solutions are characterized by the following parameters:

n0, n1float

Minimum and maximum density of the soliton. The amplitude is a=n1-n0.

Lxfloat

The period of the wave, and the length of our box. This is specified in terms of Lx = 2lK(m_), where m_=al^2.

v_pfloat

Phase velocity.

v_xfloat

Velocity of the frame. If None, this is set to be the phase velocity so that the solution should be stationary.

twistfloat

Twisted boundary condition. If None, this is computed by integrating the continuity equation.

v_unit = 1.0[source]#
v_p = 0.0[source]#
_n0 = 0.1[source]#
_m[source]#
_C[source]#
mu = 1.05[source]#
_twist = None[source]#
n_exact(x=None)[source]#
psi_exact(x=None, Lx=None)[source]#

Return the exact solution.

Parameters:
  • x (array, float) – Abscissa and box size - used by the constructor for getting the exact solution before the state has been properly initialized.

  • Lx (array, float) – Abscissa and box size - used by the constructor for getting the exact solution before the state has been properly initialized.

static get_m(_a, _L)[source]#

Return the solution to _L = 2*sqrt(m/_a)*K(m).

class DarkBrightSolitons(kappa=1.0, bs=[-1.0, -2.0, -3.0], lambdas=(0.0, 0.0), **kw)[source]#

Bases: gpe.bec2.State

State with HO potential for backward compatibility.

kappa = 1.0[source]#
bs[source]#
lambdas = (0.0, 0.0)[source]#
Cs[source]#
get_initial_state(x0=0.0, eta=1.0, v=1.0, t=0.0, mu=1.0)[source]#