supersolids.Schroedinger¶
Numerical solver for non-linear time-dependent Schrodinger equation.
Module Contents¶
Classes¶
Implements a numerical solution of the dimensionless time-dependent |
- 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.
- 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, 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.
- 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_r_vector(self)¶
- get_peaks_along(self, axis=0, height=0.05, amount=4)¶
- get_peak_positions(self, axis=0, height=0.05, amount=4)¶
- get_peak_distances(self, axis=0, height=0.05, amount=3)¶
Calculates the distances between the peaks in terms of box units.
- get_peak_neighborhood(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_center_of_mass(self)¶
Calculates the center of mass of the System.
- get_parity(self, axis=2)¶
- get_phase_var_neighborhood(self, axis=0, height=0.05, amount=4, fraction=0.1, peak_distances_cutoff=0.5)¶
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.
- 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=f'schroedinger.pkl', filename_steps=f'step_', steps_format = '%06d', steps_per_npz = 10, frame_start = 0)¶
- Parameters
accuracy (float) –
dir_path (pathlib.Path) –
dir_name_result (str) –
steps_format (str) –
steps_per_npz (int) –
frame_start (int) –