gpe.soc#
Experimental setup for Peter Engels’ 2-component Rb 87 counterflow experiments with spin-orbit coupling. The results are summarized in the SOC Soliton.ipynb notebook.
The design of this module is as follows:
- State1, State2: These are two state objects for single component and two
component SOC states respectively. The single component state uses the Dispersion class to provide a modified dispersion. These maintain a reference to the relevant Experiment object (see below) and overload the get_Vext() function of the base class to use the appropriate experimental protocol.
- Experiment*: Each experimental setup is characterized by a subclass of
Experiment which specifies the experimental parameters and protocol in terms of physical dimensions. These experimental objects are responsible for returning an appropriate State* object to implement the dynamics.
Experiment objects can define a set of time-dependent parameters by defining methods with the name *_t_() that take an argument t_ and returns the value at a specified time. To facilitate plotting, another method *_info() can be defined which returns (unit, label) with the associated numerical unit, and a text label. These are used for plotting. For example, for a varying Omega, one might define:
def Omega_t_(self, t_): return np.sin(t_) @property def Omega_info(self): return (self.E_R, r'$\Omega/E_R$')
The underlying Experiment class designed here allows for the following manipulations.
Time dependent parameters: * Omega: SOC coupling strength * detuning: Detuning * B_gradient: counterflow * xyz0: Location of trap center * ws: Trap frequencies
Functions (which may contain time dependence):
get_Vext(state, fiducial, expt, single_band): External trapping potential. The default version of this combines the following pieces:
Vtrap: (Always)
Vt: (If not fiducial)
Magnetic field gradient: (If not single band)
SOC: (If not single band)
get_Vtrap_expt(state, xyz): Trapping potential used in the experiment. This is used to compute the fiducial_V_TF.
Unless you need to modify this structure you should customize the following pieces instead.
get_Vtrap(state, xyz): Trapping potential for your simulation.
get_Vt(state): Time dependent trap. This is only used for initial state preparation but not computing the fiducial_V_TF. The need for this is the case where the initial state is specified with an x_TF without this potential, but then the system is prepared by cooling with this potential. Unless you are matching an experiment where they report x_TF this way, you probably don’t need to modify this.
barrier_xyz0: Position of a barrier potential
barrier_depth: Depth of a barrier potential
Initial States#
The initial state is defined in terms of the chemical potentials which define the initial wavefunction through the Thomas Fermi approximation. From the experimental standpoint, the initial state is typically expressed in terms of the Thomas Fermi “radius” x_TF at which point in space the “chemical potential” should match the external potential V_TF = V_ext(x_TF). In the presence of axial degrees of freedom and the various tube approximations, the chemical potential required to reproduce this extent of the cloud can differ from V_TF (for example, due to a shift \(\hbar\omega_\perp\)) so we provide the following functions to convert between the two:
mu = State.get_mu_from_V_TF(V_TF)
V_TF = State.get_V_TF_from_mu(mu)
To specify the initial state then one should define V_TF. This is the fundamental quantity determining the initial state.
The alternative - used by default for the experiments - is to specify x_TF and then to compute V_TF from the potential. This is typically determined as the extent of a cloud without any spin-orbit coupling, barrier potential, etc. The actual initial state is usually obtained by then evolving this state adiabatically into the ground state with SOC, possibly including the barrier potential. This adiabatic preparation should be thought of as roughly performed at constant total particle number (though there may be some particle losses).
Thus, the external chemical potential that should be used to compute V_TF from x_TF may differ from the potentials defined for evolution. Finally, the state may actually be too small to represent the entire and may not even include x_TF in the range of abscissa. This leads us to define a fiducial_V_TF which is the value of V_TF that should be used to initialize the state. This may differ from the V_TF = V_ext(x_TF) because of these factors. The function get_fiducial_V_TF() is responsible for computing the appropriate V_TF to match the experiment and may need to construct another larger state in order to solve for the value of V_TF that will appropriately match the experiment.
For these reasons, Experiment.get_Vext(state, fiducial, expt) and State.set_initial_state(V_TF, fiducial, expt) take two flags fiducial and expt in order to accommodate this functionality (see their docstrings for details).
Attributes#
Classes#
Tools for computing properties of the lower band dispersion. |
|
Tools for computing properties of the lower band dispersion for |
|
State for spin-orbit coupled experiments with a counterflow induced by a |
|
State for spin-orbit coupled experiments with a counterflow induced by a |
|
State for spin-orbit coupled experiments with a counterflow induced by a |
|
State for spin-orbit coupled experiments with a counterflow induced by a |
|
Mixin for single-band states. |
|
Mixin for single-band states. |
|
Tube state for single band model. |
|
Axial state for single_band models. |
|
Represents a set of experimental parameters. |
|
Adds to the basic Experiment class a moving barrier potential (along the |
|
Classes and Glasses |
Module Contents#
- class Dispersion[source]#
Tools for computing properties of the lower band dispersion.
Everything is expressed in dimensionless units with \(k/k_r\), \(d=\delta/4E_R\), \(w=\Omega/4E_R\), and \(E_\pm/2E_R\).
Examples
>>> E = Dispersion(w=1.5/4, d=0.543/4) >>> ks = np.linspace(-3, 3, 500) >>> ks_ = (ks[1:] + ks[:-1])/2.0 >>> ks__ = ks[1:-1] >>> Es = E(ks).T >>> dEs = E(ks, d=1).T >>> ddEs = E(ks, d=2).T >>> d3Es = E(ks, d=3).T >>> d4Es = E(ks, d=4).T >>> dEs_ = np.diff(Es, axis=0)/np.diff(ks)[:, None] >>> ddEs_ = np.diff(dEs, axis=0)/np.diff(ks)[:, None] >>> d3Es_ = np.diff(ddEs, axis=0)/np.diff(ks)[:, None] >>> d4Es_ = np.diff(d3Es, axis=0)/np.diff(ks)[:, None] >>> np.allclose((dEs[1:] + dEs[:-1])/2, dEs_, rtol=0.01) True >>> np.allclose((ddEs[1:] + ddEs[:-1])/2, ddEs_, rtol=0.02) True >>> np.allclose((d3Es[1:] + d3Es[:-1])/2, d3Es_, rtol=0.01) True >>> np.allclose((d4Es[1:] + d4Es[:-1])/2, d4Es_, rtol=0.1) True
Here are some regression tests >>> E = Dispersion(w=1.0, d=0) >>> float(E.get_k0()) 0.0
- class Dispersion3[source]#
Tools for computing properties of the lower band dispersion for a three-component system.
Everything is expressed in dimensionless units with \(k/k_r\), \(d=\delta/4E_R\), \(w=\Omega/4E_R\), \(e=\epsilon/2E_R\) and \(E_\pm/2E_R\).
- class SOCMixin[source]#
Bases:
gpe.utils.GPUHelperState for spin-orbit coupled experiments with a counterflow induced by a magnetic field gradient.
This class depends on an Experiment() instance to define the time-dependent properties such as ramping on of the magnetic field gradient, Raman lasers, and ramping off everything for expansion imaging.
To do this, the experiment can define the following methods, which will be used if they exist. Note: for performance reasons, these should return NotImplemented if they are not used.
experiment.delta_t_(t_): experiment.delta experiment.Omega_t_(t_): experiment.Omega experiment.B_gradient_t_(t_): experiment.B_gradient
In addition, the following attributes are expected in experiments:
- experiment.t_unit:
All experiment times are specified in this unit t_ = t/t_unit.
- experiment.t__final:
For t_ > self.experiment.t__final, all the potentials are set to zero.
- experiment.t__image:
If imaging is performed (see image_ts_ in the Simulation class), then expansion occurs for this length of time (previously this was t__expand).
- get_mu_from_V_TF(V_TF)[source]#
Return the corrected chemical potential from V_TF.
- Parameters:
V_TF (float) – External potential at the Thomas Fermi “radius”. (The external potential is evaluated at this position and this is used to get mu.)
- get_V_TF_from_mu(mu)[source]#
Return V_TF from the chemical potential mu.
- Parameters:
mu (float) – Physical chemical potential (i.e. what you would pass to the minimizer).
- get_Vext_GPU(mu=None, fiducial=False, expt=False, single_band=None)[source]#
Return the external potentials (V_a, V_b, V_ab) (or V_ext in the single-band case).
This method just delegates to the experiment, and provides some simple memoization for performance.
- Parameters:
mu (float, None) – If None, then subtract self.mu. This will minimize the phase rotations during time evolution, but is undesirable when computing initial states. In the latter case, set mu=0.
- get_ns_TF(Vs_TF, fiducial=False, expt=False)[source]#
Return the TF densities. Assumes gaa = gbb = gab and populates only the lower band.
- set_initial_state(V_TF=None, fiducial=False, expt=False)[source]#
Set the state using the Thomas Fermi (TF) approximation.
This will overload the base class versions to pass the fiducial and expt arguments to the experiments. See get_fiducial_V_TF() for details about the meaning of these parameters. This also sets more appropriate phases for the state.
- Parameters:
V_TF (float) – Value of the external potential at the Thomas-Fermi “radius”. Note: this is the chemical potential without any corrections from the tube or SOC and is applied directly to the external potential to get the densities. These are then transformed into components using the spin-quasimomentum map.
fiducial (bool) – If True, then use the fiducial initial state - i.e. do not include the barrier potential.
expt (bool) – If True, then initialize the state using experimental parameters. This is needed, for example, if the desired state is homogeneous (wx=0) but we want to initialize the state with the experimental x_TF parameter. the expt=True flag should be used when initializing a (typically) larger state with Lx=Lx_expt and frequencies wx=wx_expt to compute the fiducial_V_TF in the presence of a barrier potential.
- get_k0(t_=0, branch=-1)[source]#
Return the momentum on the lattice that has minimum dispersion.
- Parameters:
branch (-1 or 1) – 1 for upper branch, -1 for lower branch (default).
- get(name, t_=None)[source]#
Return the value of the parameter name at time self.t.
This just delegates to self.experiment.get().
- get_density_x()[source]#
Return the density along x.
For periodic boxes, this is the average density in the transverse plane (which is the central density if the transverse plane is translationally invariant) and the integrated 1D line density for tube and axial codes.
- get_branch_mixture()[source]#
Return the population [n_+, n_-] of the two energy branches assuming the TF approximation is valid.
- get_branch_psi_ab(n0, k=None, branch=-1, tol=10 * _EPS)[source]#
Return the wavefunction factors (psi_a, psi_b) for the specified band. In some sense, this is the inverse of get_branch_mixture() but for purely homogeneous states. These include the appropriate phase factors of exp(1j*(k+k_r)*x) and exp(1j*(k-k_r)*x).
- Parameters:
k (float) – Momentum of homogeneous state (in the single band model) If None, then get the minimium of the dispersion.
n0 (float) – Background density (3D)
experiment (Experiment) – Defines Omega, detuning, gs, E_R and k_r.
branch (-1 or 1) – 1 for upper branch, -1 for lower branch (default).
- plot(plot_elements=None, fig=None, data=None, grid=None, show_n=True, show_na=True, show_nb=True, show_log_n=True, show_momenta=False, show_mixtures=False, show_V=False, show_history_ab=True, show_history_a=False, show_history_b=False, show_log_history=False, combine_momenta_and_history=False, dynamic_range=100, log_dynamic_range=5, parity=False, clip_momenta_modes=1, k_range_k_r=(-2.5, 2.5), nk_amplitude_factor=0.5, mu_background=None, symmetric=True, fig_width=15, pane_height=2, space=0.1, history=None, split=False, rescale=False, plot_dim=None, subplot_spec=None)[source]#
Plot the state.
- Parameters:
data (PlotData) – Instance returned by self.get_plot_data() of the data to be plotted.
plot_elements (PlotElements) – If defined, then update the plot here (faster, but will not rescale).
history ([State]) – List of states defining the frames.
parity (bool) – If True, then plot abs(x) on the abscissa of the density plots to show parity violations.
clip_momenta_modes (int) – Clip this many momenta modes (peaks). If most of the cloud occupies a single background momentum state, then there will be a large peak that obscures features. This many peaks will be clipped.
plot_dim (None, int) – If provided, then try to reduce plots to this dimension. If None, then use self.dim. This is particularly useful for plot_dim = 1 which will plot the line density along the x axis, averaging or integrating over the other dimensions.
combine_momenta_and_history (bool) – If True, then combine the momenta and history plots in a single pane.
will (The following "boolean" flags can actually be numbers which)
plot (specify the relative height of the corresponding pane in the)
show_n
show_mixtures
show_momenta
show_history_ab
show_history_a
:param : :param show_history_b:
- plot_densities(data, plot_elements, grid=None, split=False, show_n=True, show_na=True, show_nb=True, show_mixtures=False, show_log_n=False, show_V=False, parity=False, symmetric=False, dynamic_range=100, log_alpha=0.3, log_dynamic_range=5)[source]#
- plot_time_dependent_parameters(fig=None, subplot_spec=None, share=False)[source]#
Plot all the time-dependent parameters stacked on top of each other. Used as part of other plotting routines.
- plot_mixtures(data, plot_elements, grid=None, dynamic_range=100, show_V=False)[source]#
Plot the occupation of the two bands.
- plot_history(data, plot_elements, grid=None, rescale=False, show_history_ab=True, show_history_a=False, show_history_b=False, show_log_history=False, dynamic_range=100, log_dynamic_range=5, **kw)[source]#
Show an imcountorf plot of of the states.
- get_momenta_data(clip_momenta_modes=1, log_dynamic_range=5, mu_background=None, k_range_k_r=(-2.5, 2.5))[source]#
Return (ks, Em, Ep, E_ph, nk, log_nk).
- Parameters:
clip_momenta_modes (int) – Clip this many momenta modes (peaks). If most of the cloud occupies a single background momentum state, then there will be a large peak that obscures features. This many peaks will be clipped.
log_dynamic_range (int) – Return the log of the density scaled so that 0 corresponds to a 10**log_dynamic_range suppression.
k_range_k_r ((float, float)) – Range of momenta (in units of k_r).
mu_background (float, None) – Background chemical potential used for computing the phonon dispersion. If this is None, the the maximum density will be used.
- Returns:
ks (array) – Momenta abscissa.
Em, Ep (array) – Dispersion bands.
Ph_m, Ph_p (array) – Phonon dispersions
nk (array) – Momentum distribution ranging from 0 to the Em.max()-Em.min(). This is intended to be added to Em for plotting.
log_nk (array) – Log of the momentum distribution ranging from 0 to the Em.max()-Em.min(). This is intended to be added to Em for plotting.
- get_plot_data(states=None, frame=None, t_unit=u.ms, x_unit=u.micron, n_unit=1.0 / u.micron**3, dynamic_range=100, log_dynamic_range=5, get_momenta_data=False, **get_momenta_kw)[source]#
Return a PlotData namedtuple with the data needed for plotting.
- plot_momenta(data, plot_elements, grid=None, amplitude_factor=0.5, ax=None)[source]#
Plot the dispersion and momentum distribution. Return plot_elements.
- Parameters:
amplitude_factor (float) – The occupation is shown added on top of the dispersion such that the maximum occupation is this fraction of the dispersion range. I.e. If amplitude_factor=0.5, then the maximum momentum occupation will be half of the dispersion range.
- make_movie(filename, states, skip=1, fps=20, skip_frames=10, show_frames=2, dpi=None, display=True, extra_args=('-vcodec', 'libx264', '-pix_fmt', 'yuv420p'), **kw)[source]#
Make a movie of the states.
- Parameters:
filename (str) – Name of movie file such as “movie.mp4”.
states ([State]) – List of states defining the frames.
skip (int) – If this is >1, then skip this many states when making the movie. This allows one to have more states for smooth history plots, but speeds making the movie.
fps (int) – Frames-per-second for output movie
show_frames (int) – Display this many initial frames to aid debugging. Does not affect the generated movie.
skip_frames (int) – After the initial frames, draw only these frames. (Drawing frames greatly slows down the making of the movie so we limit the display). Does not affect the generated movie.
display (bool) – If False, then do not display anything. (Use for offline generation of movies for example.)
- class State2(experiment, **kw)[source]#
Bases:
SOCMixin,gpe.bec2.StateState for spin-orbit coupled experiments with a counterflow induced by a magnetic field gradient.
This class depends on an Experiment() instance to define the time-dependent properties such as ramping on of the magnetic field gradient, Raman lasers, and ramping off everything for expansion imaging.
To do this, the experiment can define the following methods, which will be used if they exist. Note: for performance reasons, these should return NotImplemented if they are not used.
experiment.delta_t_(t_): experiment.delta experiment.Omega_t_(t_): experiment.Omega experiment.B_gradient_t_(t_): experiment.B_gradient
In addition, the following attributes are expected in experiments:
- experiment.t_unit:
All experiment times are specified in this unit t_ = t/t_unit.
- experiment.t__final:
For t_ > self.experiment.t__final, all the potentials are set to zero.
- experiment.t__image:
If imaging is performed (see image_ts_ in the Simulation class), then expansion occurs for this length of time (previously this was t__expand).
- class State2Tube(experiment, **kw)[source]#
Bases:
SOCMixin,gpe.tube2.StateGPEdrZState for spin-orbit coupled experiments with a counterflow induced by a magnetic field gradient.
This class depends on an Experiment() instance to define the time-dependent properties such as ramping on of the magnetic field gradient, Raman lasers, and ramping off everything for expansion imaging.
To do this, the experiment can define the following methods, which will be used if they exist. Note: for performance reasons, these should return NotImplemented if they are not used.
experiment.delta_t_(t_): experiment.delta experiment.Omega_t_(t_): experiment.Omega experiment.B_gradient_t_(t_): experiment.B_gradient
In addition, the following attributes are expected in experiments:
- experiment.t_unit:
All experiment times are specified in this unit t_ = t/t_unit.
- experiment.t__final:
For t_ > self.experiment.t__final, all the potentials are set to zero.
- experiment.t__image:
If imaging is performed (see image_ts_ in the Simulation class), then expansion occurs for this length of time (previously this was t__expand).
- class State2Axial(experiment, **kw)[source]#
Bases:
SOCMixin,gpe.axial.State2AxialState for spin-orbit coupled experiments with a counterflow induced by a magnetic field gradient.
This class depends on an Experiment() instance to define the time-dependent properties such as ramping on of the magnetic field gradient, Raman lasers, and ramping off everything for expansion imaging.
To do this, the experiment can define the following methods, which will be used if they exist. Note: for performance reasons, these should return NotImplemented if they are not used.
experiment.delta_t_(t_): experiment.delta experiment.Omega_t_(t_): experiment.Omega experiment.B_gradient_t_(t_): experiment.B_gradient
In addition, the following attributes are expected in experiments:
- experiment.t_unit:
All experiment times are specified in this unit t_ = t/t_unit.
- experiment.t__final:
For t_ > self.experiment.t__final, all the potentials are set to zero.
- experiment.t__image:
If imaging is performed (see image_ts_ in the Simulation class), then expansion occurs for this length of time (previously this was t__expand).
- class State1Mixin[source]#
Mixin for single-band states.
- class State1(experiment, **kw)[source]#
Bases:
State1Mixin,SOCMixin,gpe.bec.StateTwist_xMixin for single-band states.
- class State1Tube(experiment, **kw)[source]#
Bases:
State1Mixin,SOCMixin,gpe.tube.StateGPEdrZTube state for single band model.
- class State1Axial(experiment, **kw)[source]#
Bases:
State1Mixin,SOCMixin,gpe.axial.StateAxialAxial state for single_band models.
- class Experiment(_local_dict=None, **kw)[source]#
Bases:
gpe.utils.ExperimentBaseRepresents a set of experimental parameters.
Responsible for translating these into a proper State object. This generally amounts to converting experimental parameters into values useful to the state class. These are stored in self.state_args for use in self.get_state and self.get_initial_state.
Provides get_Vext(state) with a (possibly time dependent) external potential.
Implements an experimental protocol. To do this, subclass and define the run_experiment method. This can be used to get the initial state, then to manipulate it. (Not implemented yet.)
Note: these experiments are designed for SOC along the x-axis only. The following basis options are supported:
‘1D’ : Periodic basis along the x-axis.
- tube==FalseAssume a constant density along y and z. This
should be thought of as modeling a 3D gas with translation symmetry along the transverse directions. (The coupling constants are not modified for modeling 1D systems.) The density here will be the central density.
- tube==TrueUse the the tube code to model the transverse trap. The
density here will be the line density obtained by integrating over the transverse directions. This will effectively modify the coupling constants.
- ‘axial’Periodic basis along the x-axis with radial excitations assuming
axial symmetry. The transverse trapping frequency will be the average of the y and z frequencies. The radial extent and lattice spacing will be inferred from Nx, dx and Lx using the ratio of the trapping frequencies at time t_=0.
- ‘2D’, ‘3D’Full 2D or 3D simulation assuming no symmetry. The transverse
extents and lattice spacing should be provided in Nxyz and Lxyz, otherwise it will be inferred from Nx, dx and Lx using the ratio of the trapping frequencies at time t_=0.
Note: All times in the Experiment classes are specified in units of t_unit. In arguments this is t_ = t/t_unit and we use t_ as a kwarg to ensure that this is properly used.
- Parameters:
cells_x (None, int) – If specified (not None), then the length of the box in the x direction Lxyz[0] will be computed to be an integral number of cells to hold cells_x periods of a wave with frequency k_r. In addition, the trap will be reset to ‘cos’ which will replace the HO potential with a compatible, but periodic cosine. This allows one to simulate the center of the trapped system with matching gradients and densities. If this is defined, then the original Lx will be stored as Lx_expt which is used to obtain initial states.
dx (None, (float,)) – If specified (not None), then Nx will be computed such that his minimum lattice spacing is realized, guaranteeing a certain UV cutoff.
initial_imbalance (float) – Initial state is prepared in (1,-1) then this fraction is transfered to the (1, 0) state.
Omega (float) – This is the strength of the spin-orbit coupling.
delta (float) – This is the value of detuning in energy units.
B_gradient (float) – This is the strength of the magnetic field gradient which induces a counterflow.
x0 (float) – Location of the center of the trapping potential.
State (The following attributes are guaranteed to exist for use by the)
class.
- get_Vext(state, fiducial=False, expt=False)[source]#
Return (V_a, V_b, V_ab), the external potentials.
For t_ > self.t__final, all the potentials are set to zero.
- Parameters:
state (IState) – Current state. Use this to get the time state.t and abscissa state.basis.xyz.
fiducial (bool) – If True, then return the potential that should be used to define the initial state in terms of the Thomas Fermi radius of the cloud x_TF.
expt (bool) – If True, then return the proper experimental potential rather than the potential used in the simulation.
See also
interface.IExperiment.get_Vext
- get_initial_state(perturb=0.0, E_tol=1e-12, psi_tol=1e-12, disp=1, tries=20, cool_steps=100, cool_dt_t_scale=0.1, minimize=True, **kw)[source]#
Return an initial state with the specified population fractions.
This initial state is prepared in state[0] with the potentials as they are at time t=0, then the initial_imbalance is transferred as specified simulating an RF pulse by simply the appropriate fraction in each state. Phases are kept the same as in the state[0].
- get_Vtrap_expt(state, xyz, ws=None)[source]#
Return the external trapping potential used in the experiment.
This is used to determine the chemical potential and fidcucial_V_TF from a value of x_TF. It uses the experimental trapping frequencies stored in ws_expt.
- Parameters:
state (State) – Current state.
xyz ([array]) – Use these abscissa (not state.xyz) to compute the potential. This is likely being applied to a much larger state in order to compute the fiducial_V_TF.
ws ([float]) – These are the trapping frequencies. This is just a convenience if your get_Vtrap needs to compute a harmonic potential.
- get_Vtrap(state, xyz)[source]#
Return the external trapping potential used in the simulation.
This should return the trapping potential that is used in cases, both when determining x_TF, and when cooling into the initial state. It should not include time-dependent potential like the bucket that are used for preparing the initial state but NOT used when determining x_TF.
- Parameters:
state (State) – Current state.
xyz ([array]) – Use these abscissa (not state.xyz) to compute the potential. This is likely being applied to a much larger state in order to compute the fiducial_V_TF.
- get_Vt(state)[source]#
Optional time-dependent trapping potentials.
These potentials are not included in the fiducial state used to determine the initial conditions, however, if Vt is non-zero at time t=0, then this will be included in the initial state preparation.
See also
interface.IExperiment.get_Vext
- _xyz_trap(state, x_periodic=False)[source]#
Return the abscissa for use in the trapping potentials.
This has the abscissa shifted by x0 so that this value is zero, with periodic wrapping. I.e. it assumes that the trapping potentials are periodic with center at zero.
- Parameters:
x_periodic (bool) – If True, then transform the abscissa so that any potential applied is smooth and periodic as discussed in the Utils.ipynb notebook. This assumes additionally that the potentials are even functions about zero.
- _get_Lx(state)[source]#
Return the actual length of the box represented by the state.
This is needed because self.Lx might not be the same as self.Lx_expt and the latter is sometimes needed for fiducial states.
- property fiducial_V_TF[source]#
This may be slow to calculate, so we defer calculation until we really need it.
- get_fiducial_V_TF(t_=0.0, Nx=2**12, Lx_factor=1.1)[source]#
Return the V_TF required to initialize the state.
If V_TF is None or not defined, then compute the V_TF that defines the state in terms of the Thomas-Fermi radius x_TF along the x axis using a Harmonic trapping potential with frequencies ws_expt as follows:
Construct an axially symmetric state using a CylindricalBasis with enough points to model the harmonically trapped cloud in the TF approximation. The assumption is made here that the extremities of the cloud are harmonic. Inside, the potential need not be harmonic. This construction uses self.ws_expt.
Compute V_TF from self.x_TF and self.ws_expt assuming harmonic extremities.
Get the external potential using this state by calling get_Vext(expt_state, fiducial=True, expt=True). This allows the function get_Vext() to customize what is meant by the fiducial state (i.e. including or excluding parts of the time-varying potential.)
Set the initial state and compute the total particle number in the TF approximation using:
expt_state.set_initial_state(V_TF=V_TF, fiducial=True, expt=True)
Adjust V_TF to reproduce the total particle number in the TF approximation using:
expt_state.set_initial_state(V_TF=V_TF, fiducial=False, expt=True)
This allows one to simulate a long time cooling into the ground with a different potential, while fixing x_TF without that potential.
- get_dispersion(t_=0.0, active_components=None)[source]#
Return Dispersion instance.
- Parameters:
t (float) – Time at which to get parameters.
active_components (2, 3) – Specify which dispersion to use - Dispersion or Dispersion3
- class ExperimentBarrier(_local_dict=None, **kw)[source]#
Bases:
ExperimentAdds to the basic Experiment class a moving barrier potential (along the x axis only) with the following parameters:
- barrier_type[source]#
Type of barrier potential. The ‘constant’ barrier will just provide the cosine modulation.
- Type:
‘gaussian’, ‘harmonic’, ‘constant’
- barrier_k[source]#
If this is non-zero, then the barrier has an underlying cosine modulation with this wavelength.
- Type:
- These use the function get_barrier_potential(state).
- _barrier_potential(x_barrier_width)[source]#
Return the barrier potential without the power factor.
x_barrier_width : x/barrier_width
- get_Vt(state)[source]#
Optional time-dependent trapping potentials.
These potentials are not included in the fiducial state used to determine the initial conditions, however, if Vt is non-zero at time t=0, then this will be included in the initial state preparation.
See also
interface.IExperiment.get_Vext
- class Bloch(experiment=ExperimentStub())[source]#
Classes and Glasses
- get_initial_state(theta=np.pi, phi=np.pi / 2.0)[source]#
returns an initial state packed for odeint. theta is the azimuthal angle, phi is in the xy-plane in the bloch sphere