gpe.Examples.tutorial#
Example code from the tutorial.
Classes#
State with tools to check convergence for a 1D HO GPE. |
|
State with tools to check convergence for a 2D HO GPE. |
Module Contents#
- class StateHOConvergence1(**kw)[source]#
Bases:
gpe.bec.HOMixin,gpe.bec.StateGPEBaseState with tools to check convergence for a 1D HO GPE.
This is a simple state with default parameters forming a trapped gas in a 1D harmonic oscillator. It has some functions for checking and plotting convergence.
The state is specified by the parameter dmu = mu / (hbar*w/2) - 1. If dmu = 0, we will have no interactions (but don’t do this: use a small, non-zero value), while larger values will approach the TF limit.
- init()[source]#
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.
- get_convergence(full_output=False)[source]#
Return (ir, uv) convergence factors.
These are the ratios of the density at the edge vs maximum density in position (IR) and momentum (UV) space.
- Parameters:
full_output (bool) – If True, return (ir, uv, x, nx, k, nk).
- class StateHOConvergence2(**kw)[source]#
Bases:
StateHOConvergence1State with tools to check convergence for a 2D HO GPE.
This is a simple state with default parameters forming a trapped gas in a 2D harmonic oscillator. It has some functions for checking and plotting convergence.
The state is specified by the parameter dmu = mu / (hbar*w/2) - 1. If dmu = 0, we will have no interactions (but don’t do this: use a small, non-zero value), while larger values will approach the TF limit.
- get_convergence(full_output=False)[source]#
Return (ir, uv) convergence factors.
These are the ratios of the density at the edge vs maximum density in position (IR) and momentum (UV) space.
- Parameters:
full_output (bool) – If True, return (ir, uv, r, nr, k, nk).