supersolids.Schroedinger

Numerical solver for non-linear time-dependent Schrodinger equation.

Module Contents

Classes

Schroedinger

Implements a numerical solution of the dimensionless time-dependent

Functions

peaks_sort(peaks_indices, peaks_height, amount)

peaks_sort_along(peaks_indices, peaks_height, amount, axis)

get_peaks(prob)

Takes an image and detect the peaks using the local maximum filter.

supersolids.Schroedinger.peaks_sort(peaks_indices, peaks_height, amount)
supersolids.Schroedinger.peaks_sort_along(peaks_indices, peaks_height, amount, axis)
supersolids.Schroedinger.get_peaks(prob)

Takes an image and detect the peaks using the local maximum filter. Returns a boolean mask of the peaks (i.e. 1 when the pixel’s value is the neighborhood maximum, 0 otherwise)

class supersolids.Schroedinger.Schroedinger(N, MyBox, Res, max_timesteps, dt, dt_func=None, g=0.0, g_qf=0.0, w_x=2.0 * np.pi * 33.0, w_y=2.0 * np.pi * 80.0, w_z=2.0 * np.pi * 167.0, a_s=85.0 * constants.a_0, e_dd=1.0, imag_time=True, mu=1.1, E=1.0, psi_0=functions.psi_gauss_3d, V=functions.v_harmonic_3d, V_interaction=None, psi_sol=functions.thomas_fermi_3d, mu_sol=functions.mu_3d, psi_0_noise=functions.noise_mesh)

Implements a numerical solution of the dimensionless time-dependent non-linear Schrodinger equation for an arbitrary potential:

\[\begin{split}i \partial_t \psi = [&-\frac{1}{2} \nabla ^2 + \frac{1}{2} (x^2 + (y \alpha_y)^2 + (z \alpha_z)^2) \\ &+ g |\psi|^2 + g_{qf} |\psi|^3 + U_{dd}] \psi \\\end{split}\]

With \(U_{dd} = \mathcal{F}^{-1}(\mathcal{F}(H_{pot} \psi) \epsilon_{dd} g ((3 k_z / k^2) - 1))\)

The split operator method with the Trotter-Suzuki approximation for the commutator relation (\(H = H_{pot} + H_{kin}\)) is used. Hence the accuracy is proportional to \(dt^4\) The approximation is needed because of the Baker-Campell-Hausdorff formula.

Parameters
  • N (int) –

  • MyBox (supersolids.helper.Box.Box) –

  • Res (supersolids.helper.Resolution.Resolution) –

  • max_timesteps (int) –

  • dt (float) –

  • dt_func (Optional[Callable]) –

  • g (float) –

  • g_qf (float) –

  • w_x (float) –

  • w_y (float) –

  • w_z (float) –

  • a_s (float) –

  • e_dd (float) –

  • imag_time (bool) –

  • mu (float) –

  • E (float) –

  • psi_0 (Callable) –

  • V (Optional[Callable]) –

  • V_interaction (Optional[Callable]) –

  • psi_sol (Optional[Callable]) –

  • mu_sol (Optional[Callable]) –

  • psi_0_noise (numpy.ndarray) –

get_density(self, p=2.0)

Calculates \(|\psi|^p\) for 1D, 2D or 3D (depending on self.dim).

Parameters

p (float) – Exponent of \(|\psi|\). Use p=2.0 for density.

Returns

\(|\psi|^p\)

Return type

numpy.ndarray

get_norm(self, func=None, p=2.0)

Calculates \(\int |\psi|^p \mathrm{dV}\) for 1D, 2D or 3D (depending on self.dim). For p=2 it is the 2-norm.

Parameters
  • p (float) – Exponent of \(|\psi|\). Use p=2.0 for density.

  • func – If func is not provided self.get_density(p=p) is used.

Returns

\(\int |\psi|^p \mathrm{dV}\)

Return type

float

trapez_integral(self, func_val)

Calculates \(\int |\psi|^p \mathrm{dV}\) for 1D, 2D or 3D (depending on self.dim) by using the trapez rule.

For 1D: \(h (f(a) + f(a+h)) / 2\)

For 2D: \(h (f(a, b) + f(a+h, b) + f(a, b+h) + f(a+h, b+h)) / 2\)

For 3D there are 8 entries in the same manner \((a, b, c) ... (a+h, b+h, c+h)\)

Parameters

func_val (Callable) – Grid sampled values of the function to integrate.

Returns

\(\int |\psi|^p \mathrm{dV}\) according to trapez rule

Return type

float

get_r2(self)
get_mesh_list(self, x0=None, x1=None, y0=None, y1=None, z0=None, z1=None)
get_peaks_along(self, axis=0, height=0.05)
get_peak_positions_along(self, axis=0, height=0.05, amount=4)
get_peak_distances_along(self, axis=0, height=0.05)

Calculates the distances between the peaks in terms of box units.

get_peak_neighborhood_along(self, axis=0, height=0.05, amount=4, fraction=0.1, peak_distances_cutoff=0.5)

Calculates the neighborhood of the peaks, which has at least the given fraction of the maximum probability \(|\psi|^2\).

get_peak_neighborhood(self, prob_min, amount)

Calculates the neighborhood of the peaks, which has at least the given fraction of the maximum probability \(|\psi|^2\).

get_droplet_edges(self, prob_droplets, peaks_index_3d, cut_axis)
extract_droplet(self, prob_droplets, peaks_index_3d)
slice_default(self, x0=None, x1=None, y0=None, y1=None, z0=None, z1=None)
get_center_of_mass(self, x0=None, x1=None, y0=None, y1=None, z0=None, z1=None)

Calculates the center of mass of the System.

get_parity(self, axis=2, x0=None, x1=None, y0=None, y1=None, z0=None, z1=None)
get_phase_var_neighborhood(self, prob_min, amount)

Calculates the variance of the phase of the System.

get_phase_var(self, x0, x1, y0, y1, z0, z1)

Calculates the variance of the phase of the System by cos(phi).

time_step(self)

Evolves System according Schrödinger Equations by using the split operator method with the Trotter-Suzuki approximation.

Return type

None

simulate_raw(self, accuracy=10 ** - 6, dir_path=Path.home().joinpath('supersolids', 'results'), dir_name_result='', filename_schroedinger='schroedinger.pkl', filename_steps='step_', steps_format='%07d', steps_per_npz=10, frame_start=0)
Parameters
  • accuracy (float) –

  • dir_path (pathlib.Path) –

  • dir_name_result (str) –

  • filename_schroedinger (str) –

  • filename_steps (str) –

  • steps_format (str) –

  • steps_per_npz (int) –

  • frame_start (int) –