0% found this document useful (0 votes)
37 views53 pages

Supersolids Python

Uploaded by

Vernon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views53 pages

Supersolids Python

Uploaded by

Vernon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

supersolids

Release 0.1.26

Daniel Scheiermann

Sep 12, 2021


CONTENTS

1 Supersolids 1
1.1 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 pip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.4 Archlinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.5 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.6 Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.7 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.8 Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.9 Contributing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Contributing 5

3 License 7

4 API Reference 9
4.1 supersolids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Indices and tables 41

Python Module Index 43

Index 45

i
ii
CHAPTER

ONE

SUPERSOLIDS

Package to simulate and animate supersolids. This is done by solving the dimensionless time-dependent non-linear
Schrodinger equation for an arbitrary potential. The split operator method with the Trotter-Suzuki approximation is
used.

1.1 Documentation

[Link]

1.2 Installing

For the animation to work, ffmpeg needs to be installed on your system.

1.3 pip

• pip install supersolids

1.4 Archlinux

It is provided in the AUR


• git clone [Link]
• Run “makepkg -sic”, where the PKGBUILD lies

1.5 Windows

You need to add python to your path (if you didn’t do it, when installing python/anaconda).
• Then continue with pip installation

1
supersolids, Release 0.1.26

1.6 Source

Go to the directory, where the “[Link]” lies.


• For Linux use “python [Link] install –user” from console to build and install the package

1.7 Usage

The package uses __main__.py, so it can be run as module. To get help for the flags, run:
• python -m supersolids -h
• python -m [Link].load_npz -h
• python -m [Link].simulate_npz -h
To actually run (example):
• python -m supersolids -Res=’{“x”: 16, “y”: 32, “z”: 62}’ -Box=’{“x0”: -10, “x1”: 10, “y0”: -6, “y1”: 5,
“z0”: -8, “z1”: 8}’
• python -m [Link].load_npz -frame_start=79000
• python -m [Link].simulate_npz -dir_name=movie004 -filename_npz=step_079000.npz
If you use an IDE and your script parameter includes double quotes, escape the double quotes with backslashes, for example:

• “-Res={\”x\”: 256}” “-Box={\”x0\”: -10, \”x1\”: 10}” “-a={\”a_x\”: 2.0}” -max_timesteps=51 “-


V=lambda x, y, z: 100.0 * [Link](-(x ** 2 + y ** 2)/ 1.0 ** 2)”
The default path for the results is ~/supersolids/results

1.8 Issues

1. Please read the [Link] closely.


2. If the issue persist please open an “Issue” in git:
• Click on “New Issue” on [Link]
• Assign a suitable label.
• Follow the steps on git the to create the issue. Please describe your issue closely (what are your
configurations, did it work before, what have you changed, what is the result, what have you expected
as a result?).
• Try to include screenshots.
• Describe what you think causes the issue and if you have suggestions how to solve it, mention it!
• Close the issue, if you accidentally did something wrong (but mention that before closing).

2 Chapter 1. Supersolids
supersolids, Release 0.1.26

1.9 Contributing

Please read the [Link].

1.9. Contributing 3
supersolids, Release 0.1.26

4 Chapter 1. Supersolids
CHAPTER

TWO

CONTRIBUTING

1. Fork the repository. Here is a guide how to do this:


[Link]
2. Before you make changes, make sure you synchronized with the repository.
Here is a guide: [Link]
4. Edit the python scripts (implement your improvements).
5. Edit the version number in [Link].
Therefore, somebody could identify, that he is using a package with your changes later on,
this will allow rechecking the results from the past, as every version is saved in git and can be restored.
6. Install the package (as in the section “How to install” described).
7. Restart your integrated development environment (IDE)
eg. Spyder, VSCode, . . . , so the IDE reloads all packages, and the changes are applied
(depends on the IDE, whether this is required).
8. Test your code.
9. Git add filenames, git commit -m “comment”, git push to your fork.
10. If you successfully pushed to your repository, there should be a notification, when you log into
the web-version of github, to pull a request (this is the inquiry to make your changes applied
to the main repository, so all could profit from your changes). Describe the issue you where solving
and how and why it is solving the problem.
11. Hope that the maintainer approves your work and merges it.

5
supersolids, Release 0.1.26

6 Chapter 2. Contributing
CHAPTER

THREE

LICENSE

MIT License
Copyright (c) 2021 Scheiermann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documen-
tation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PAR-
TICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT-
WARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

7
supersolids, Release 0.1.26

8 Chapter 3. License
CHAPTER

FOUR

API REFERENCE

This page contains auto-generated API reference documentation1 .

4.1 supersolids

4.1.1 Subpackages

[Link]

Submodules

[Link]

Base class for Animations

Module Contents

Classes

Animation

class [Link](Res=Resolution(x=2 ** 8, y=2 ** 7, z=2 ** 5),


plot_psi_sol=True, plot_V=False, alpha_psi=0.8,
alpha_psi_sol=0.53, alpha_V=0.3,
camera_r_func=None, camera_phi_func=None,
camera_z_func=None, filename='split.mp4')

Parameters
• Res ([Link]) –
• plot_psi_sol (bool) –
• plot_V (bool) –
• alpha_psi (float) –
1 Created with sphinx-autoapi

9
supersolids, Release 0.1.26

• alpha_psi_sol (float) –
• alpha_V (float) –
• camera_r_func (Optional[Callable]) –
• camera_phi_func (Optional[Callable]) –
• camera_z_func (Optional[Callable]) –
• filename (str) –

[Link]

Implements an Animation with matplotlib (for Systems in 1D or 2D).

Module Contents

Classes

MatplotlibAnimation

Functions

plot_2d(resolution=32, x_lim = (-1, 1), y_lim = (-1, 1),


z_lim = (0, 1), alpha = [0.6], **kwargs) param resolution number of grid points
in one direction

round_z_to_0(pos, func, tol = 1e-05)

crop_pos_to_limits(ax, pos, func, func_val=None)

get_V_plot_values(ax, pos, V, resolution, reserve =


1.0)

class [Link](Anim)
Bases: [Link]
Parameters Anim ([Link]) –
set_limits(self, row, col, x_min, x_max, y_min, y_max)
Sets the plot limits appropriate, even if the initial wave function 𝜓0 is not normalized.
Parameters
• row (int) – row of the subplot for the animation
• col (int) – column of the subplot for the animation
• x_min (float) – minimum x value of subplot
• x_max (float) – maximum x value of subplot
• y_min (float) – minimum y value of subplot

10 Chapter 4. API Reference


supersolids, Release 0.1.26

• y_max (float) – maximum y value of subplot


set_limits_smart(self, row, col, System)
Sets the plot limits appropriate, even if the initial wave function 𝜓0 is not normalized.
Parameters
• row (int) – row of the subplot for the animation
• col (int) – column of the subplot for the animation
• System ([Link]) – Defines the Schroedinger
equation for a given problem
get_V_plot_values(self, i, j, System, reserve=1.0)

Parameters
• i (int) –
• j (int) –
• System ([Link]) –
• reserve (float) –
animate(self, frame_index, System, accuracy=10 ** - 6)
Sets the plot limits appropriate, even if the initial wave function 𝜓0 is not normalized.
Parameters
• frame_index (int) – Current index of frame
• System ([Link]) – Defines the Schroedinger
equation for a given problem
• accuracy (float) – Convergence is reached when relative error of mu is smaller than
accuracy, where 𝜇 = − log(𝜓𝑛𝑜𝑟𝑚𝑒𝑑 )/(2𝑑𝑡)
start(self, System, accuracy=10 ** - 6)
Sets the plot limits appropriate, even if the initial wave function 𝜓0 is not normalized
Parameters
• accuracy (float) – Convergence is reached when relative error of mu is smaller than
accuracy, where 𝜇 = − log(𝜓𝑛𝑜𝑟𝑚𝑒𝑑 )/(2𝑑𝑡)
• System ([Link]) – Defines the Schroedinger
equation for a given problem
[Link].plot_2d(resolution=32, x_lim=(- 1, 1), y_lim=(- 1, 1),
z_lim=(0, 1), alpha=[0.6], **kwargs)

Parameters
• resolution – number of grid points in one direction
• x_lim (Tuple[float, float]) – Limits of plot in x direction
• y_lim (Tuple[float, float]) – Limits of plot in y direction
• z_lim (Tuple[float, float]) – Limits of plot in z direction
• alpha (List[float]) – alpha value for plot transparency

4.1. supersolids 11
supersolids, Release 0.1.26

[Link].round_z_to_0(pos, func, tol=1e-05)

Parameters tol (float) –


[Link].crop_pos_to_limits(ax, pos, func, func_val=None)
[Link].get_V_plot_values(ax, pos, V, resolution, reserve=1.0)

Parameters
• resolution (int) –
• reserve (float) –

[Link]

Functions for Potential and initial wave function 𝜓0

Module Contents

Classes

MayaviAnimation

Functions

get_supersolids_version()

get_legend(System, frame, supersolids_version,


mu_rel=None)
axes_style()

[Link].get_supersolids_version()
[Link].get_legend(System, frame, supersolids_version, mu_rel=None)
[Link].axes_style()
class [Link](Anim, slice_indices=[0, 0, 0],
dir_path=[Link]().joinpath('supersolids',
'results'), offscreen=False)
Bases: [Link]
Parameters
• Anim ([Link]) –
• slice_indices ([Link]) –
• dir_path ([Link] ) –

12 Chapter 4. API Reference


supersolids, Release 0.1.26

• offscreen (bool) –
mayavi_counter :int = 0
create_movie(self, dir_path=None, input_data_file_pattern='*.png', delete_input=True)
Creates movie filename with all matching pictures from input_data_file_pattern. By default deletes all input
pictures after creation of movie to save disk space.
Parameters
• dir_path ([Link] ) – Path where to look for old directories (movie data)
• input_data_file_pattern (str) – Regex pattern to find all input data
• delete_input (bool) – Condition if the input pictures should be deleted, after creation
the creation of the animation as e.g. mp4
Return type [Link]
prepare(self, System)

Parameters System ([Link]) –


animate_npz(self, dir_path = None, dir_name = None, filename_schroedinger = f'[Link]',
filename_steps = f'step_', steps_format = '%06d', steps_per_npz = 10, frame_start = 0,
arg_slices = False, azimuth = 0.0, elevation = 0.0)

Parameters
• dir_path ([Link] ) –
• dir_name (str) –
• filename_schroedinger (str) –
• filename_steps (str) –
• steps_format (str) –
• steps_per_npz (int) –
• frame_start (int) –
• arg_slices (bool) –
• azimuth (float) –
• elevation (float) –
animate(self, System, accuracy=10 ** - 6, interactive=True)
Animates solving of the Schroedinger equations of System with mayavi in 3D. Animation is limited to
System.max_timesteps or the convergence according to accuracy.
Parameters
• System ([Link]) – Schrödinger equations for the
specified system
• accuracy (float) – Convergence is reached when relative error of mu is smaller than
accuracy, where 𝜇 = − log(𝜓𝑛𝑜𝑟𝑚𝑒𝑑 )/(2𝑑𝑡)
• slice_indices – Numpy array with indices of grid points in the directions x, y, z (in
terms of System.x, System.y, System.z) to produce a slice/plane in mayavi, where 𝜓𝑝𝑟𝑜𝑏 =
|𝜓|2 is used for the slice Max values is for e.g. [Link].x - 1.

4.1. supersolids 13
supersolids, Release 0.1.26

• interactive (bool) – Condition for interactive mode. When camera functions are used,
then interaction is not possible. So interactive=True turn the usage of camera functions off.

[Link]

Submodules

[Link]

Functions for Potential and initial wave function 𝜓0

Module Contents

Classes

Box Specifies the ranges in which the simulation is calculated


(1D, 2D or 3D).

Functions

BoxResAssert(Res, Box)

class [Link](x0, x1, y0=None, y1=None, z0=None, z1=None)


Specifies the ranges in which the simulation is calculated (1D, 2D or 3D). Needs to be given in pairs (x0, x1),
(y0, y1), (z0, z1).
Parameters
• x0 (float) –
• x1 (float) –
• y0 (Optional[float]) –
• y1 (Optional[float]) –
• z0 (Optional[float]) –
• z1 (Optional[float]) –
__str__(self )
Return str(self).
Return type List[Optional[float]]
lengths(self )
Calculates the box lengths in the directions available in order [x, y, z]
Returns List of the box length in the directions available in order [x, y, z]
Return type List[float]
min_length(self )

14 Chapter 4. API Reference


supersolids, Release 0.1.26

[Link](Res, Box)

[Link]

Module Contents

Classes

Resolution Specifies the resolution of the simulation in x, y, z direc-


tions (1D, 2D, 3D).

Functions

ResAssert(Res, a)

class [Link](x, y=None, z=None)


Specifies the resolution of the simulation in x, y, z directions (1D, 2D, 3D).
Parameters
• x (float) –
• y (Optional[float]) –
• z (Optional[float]) –
__str__(self )
Return str(self).
Return type List[Optional[float]]
to_array(self )
[Link](Res, a)

[Link]

Script to check a calculation in a paper and import 𝑎0 and 𝑢 in kg

Module Contents

[Link].a_0 :float
[Link].u_in_kg :float
[Link].a_0

4.1. supersolids 15
supersolids, Release 0.1.26

[Link].cut_1d

Animation for the numerical solver for the non-linear time-dependent Schrodinger equation.

Module Contents

Functions

cut_1d(System, slice_indices = [0, 0, 0], Creates 1D plots of the probability function of the Sys-
psi_sol_3d_cut_x = None, psi_sol_3d_cut_y = tem |𝜓|2
None, psi_sol_3d_cut_z = None, dir_path =
Path(__file__).[Link]('results'), y_lim =
(0.0, 1.0))
prepare_cuts(func, N, alpha_z, e_dd, a_s_l_ho_ratio) Helper function to get 𝑅𝑟 and 𝑅𝑧 and set it for the given
func.

[Link].cut_1d.cut_1d(System, slice_indices=[0, 0, 0], psi_sol_3d_cut_x=None,


psi_sol_3d_cut_y=None, psi_sol_3d_cut_z=None,
dir_path=Path(__file__).[Link]('results'), y_lim=(0.0,
1.0))
Creates 1D plots of the probability function of the System |𝜓|2 and if given of the solution.
Parameters
• System ([Link]) – Schrödinger equations for the
specified system
• slice_indices ([Link]) – Numpy array with indices of grid points in the direc-
tions x, y, z (in terms of System.x, System.y, System.z) to produce a slice/plane in mayavi,
where 𝜓𝑝𝑟𝑜𝑏 = |𝜓|2 is used for the slice Max values is for e.g. [Link].x - 1.
• psi_sol_3d_cut_x (Optional[Callable]) – 1D function after cut in x direction.
• psi_sol_3d_cut_y (Optional[Callable]) – 1D function after cut in y direction.
• psi_sol_3d_cut_z (Optional[Callable]) – 1D function after cut in z direction.
• dir_path ([Link] ) – Path where to save 1d cut plots
• y_lim (Tuple[float, float]) – Limit of y for plotting the 1D cut
Return type None
[Link].cut_1d.prepare_cuts(func, N, alpha_z, e_dd, a_s_l_ho_ratio)
Helper function to get 𝑅𝑟 and 𝑅𝑧 and set it for the given func.
Parameters
• func (Callable) – Function to take cuts from
• N (int) – Number of particles
• alpha_z (float) – Ratio between z and x frequencies of the trap 𝑤𝑧 /𝑤𝑥
• e_dd (float) – Factor 𝜖𝑑𝑑 = 𝑎𝑑𝑑 /𝑎𝑠
• a_s_l_ho_ratio (float) – 𝑎𝑠 in units of 𝑙𝐻𝑂
Returns func with fixed 𝑅𝑟 and 𝑅𝑧 (zeros of 𝑓 𝑢𝑛𝑐125 ), if no singularity occurs, else None.

16 Chapter 4. API Reference


supersolids, Release 0.1.26

Return type Optional[Callable]

[Link]

Functions for Potential and initial wave function 𝜓0

Module Contents

Classes

Resolution Specifies the resolution of the simulation in x, y, z direc-


tions (1D, 2D, 3D).
Box Specifies the ranges in which the simulation is calculated
(1D, 2D or 3D).

Functions

BoxResAssert(Res, Box)

aResAssert(Res, a)

lambda_parsed(s)

identity(*args)

fft_plot(t, property_all)

get_meshgrid(x, y)

get_meshgrid_3d(x, y, z)

get_parameters(N = 10**4, m = 164 * con-


stants.u_in_kg, a_s = 90.0 * constants.a_0, a_dd = 130.0
* constants.a_0, w_x = 2.0 * [Link] * 30.0)
get_g(N, a_s_l_ho_ratio)

g_qf_helper(m = 164 * constants.u_in_kg, a_s = 90.0


* constants.a_0, a_dd = 130.0 * constants.a_0, w_x =
2.0 * [Link] * 30.0)
get_g_qf (N, a_s_l_ho_ratio, epsilon_dd)

get_l_ho(m = 164.0 * constants.u_in_kg, w_x = 2.0 *


[Link] * 30.0)
get_alphas(w_x = 2.0 * [Link] * 30.0, w_y = 2.0 * [Link]
* 30.0, w_z = 2.0 * [Link] * 30.0)
psi_gauss_2d_pdf (pos, mu=[Link]([0.0, 0.0]), Gives values according to gaus dirstribution (2D)
var=[Link]([[1.0, 0.0], [0.0, 1.0]]))
continues on next page

4.1. supersolids 17
supersolids, Release 0.1.26

Table 12 – continued from previous page


psi_gauss_2d(x, y, a = 1.0, x_0 = 0.0, y_0 = 0.0, k_0 Gaussian wave packet of width a and momentum k_0,
= 0.0) centered at x_0
psi_gauss_3d(x, y, z, a_x = 1.0, a_y = 1.0, a_z = 1.0, Gaussian wave packet of width a and momentum k_0,
x_0 = 0.0, y_0 = 0.0, z_0 = 0.0, k_0 = 0.0) centered at x_0
psi_gauss_1d(x, a = 1.0, x_0 = 0.0, k_0 = 0.0) Gaussian wave packet of width a and momentum k_0,
centered at x_0
psi_pdf (x, loc = 0.0, scale = 1.0) Mathematical function of gauss pulse
psi_rect(x, x_min = -0.5, x_max = 0.5, a = 1.0) Mathematical function of rectangular pulse
psi_gauss_solution(x) Mathematical function of solution of non-linear
Schroedinger for g=0
thomas_fermi_1d(x, g = 0.0) Mathematical function of Thomas-Fermi distribution
with coupling constant g
thomas_fermi_2d(x, y, g = 0.0) Mathematical function of Thomas-Fermi distribution
with coupling constant g
thomas_fermi_2d_pos(pos, g = 0.0)

thomas_fermi_3d(x, y, z, g = 0.0) Mathematical function of Thomas-Fermi distribution


with coupling constant g
mu_1d(g = 0.0)

mu_2d(g = 0.0)

mu_3d(g = 0.0)

v_harmonic_1d(x)

v_harmonic_2d(pos, alpha_y = 1.0)

v_2d(x, y, alpha_y=1.0)

v_harmonic_3d(x, y, z, alpha_y = 1.0, alpha_z = 1.0)

get_r_cut(k_mesh, r_cut = 1.0)

dipol_dipol_interaction(kx_mesh, ky_mesh,
kz_mesh, r_cut = 1.0)
f_kappa(kappa, epsilon = 10**(-10))

atan_special(x)

func_125(kappa, alpha_z, e_dd, epsilon = 10**(-10))

func_124(kappa, e_dd, N, a_s_l_ho_ratio)

get_R_rz(kappa, e_dd, N, a_s_l_ho_ratio)

get_kappa(alpha_z, e_dd, x_min = 3.0, x_max = 5.0,


res = 1000)
density_in_trap(x, y, z, R_r, R_z, g = 0.0)

continues on next page

18 Chapter 4. API Reference


supersolids, Release 0.1.26

Table 12 – continued from previous page


density_in_trap_r(r, z, R_r, R_z, g = 0.0)

camera_func_r(frame, r_0 = 10.0, phi_0 = 45.0, z_0 =


20.0, r_per_frame = 10.0)
camera_func_phi(frame, r_0 = 10.0, phi_0 = 45.0, z_0
= 20.0, phi_per_frame = 10.0)
camera_func_z(frame, r_0 = 10.0, phi_0 = 45.0, z_0 =
20.0, z_per_frame = 10.0)
camera_3d_trajectory(frame, r_func = None, Computes r, phi, z as the components of the camera po-
phi_func = None, z_func = None, r_0 = 10.0, phi_0 = sition
45.0, z_0 = 20.0)
noise_mesh (min = 0.8, max = 1.2, shape = (64, 64, 64))

dt_adaptive(t, dt)

Attributes

datapoints_exponent

class [Link](x, y=None, z=None)


Specifies the resolution of the simulation in x, y, z directions (1D, 2D, 3D).
Parameters
• x (float) –
• y (Optional[float]) –
• z (Optional[float]) –
__str__(self )
Return str(self).
Return type List[Optional[float]]
class [Link](x0, x1, y0=None, y1=None, z0=None, z1=None)
Specifies the ranges in which the simulation is calculated (1D, 2D or 3D). Needs to be given in pairs (x0, x1),
(y0, y1), (z0, z1).
Parameters
• x0 (float) –
• x1 (float) –
• y0 (Optional[float]) –
• y1 (Optional[float]) –
• z0 (Optional[float]) –
• z1 (Optional[float]) –
__str__(self )
Return str(self).

4.1. supersolids 19
supersolids, Release 0.1.26

Return type List[Optional[float]]


lengths(self )
Calculates the box lengths in the directions available in order [x, y, z]
Returns List of the box length in the directions available in order [x, y, z]
Return type List[float]
min_length(self )
[Link](Res, Box)
[Link](Res, a)
[Link].lambda_parsed(s)
[Link](*args)
[Link].fft_plot(t, property_all)
[Link].get_meshgrid(x, y)
[Link].get_meshgrid_3d(x, y, z)
[Link].get_parameters(N=10 ** 4, m=164 * constants.u_in_kg, a_s=90.0 *
constants.a_0, a_dd=130.0 * constants.a_0, w_x=2.0 *
[Link] * 30.0)

Parameters
• N (int) –
• m (float) –
• a_s (float) –
• a_dd (float) –
• w_x (float) –
[Link].get_g(N, a_s_l_ho_ratio)

Parameters
• N (int) –
• a_s_l_ho_ratio (float) –
[Link].g_qf_helper(m=164 * constants.u_in_kg, a_s=90.0 * constants.a_0,
a_dd=130.0 * constants.a_0, w_x=2.0 * [Link] * 30.0)

Parameters
• m (float) –
• a_s (float) –
• a_dd (float) –
• w_x (float) –
[Link].get_g_qf(N, a_s_l_ho_ratio, epsilon_dd)

Parameters

20 Chapter 4. API Reference


supersolids, Release 0.1.26

• N (int) –
• a_s_l_ho_ratio (float) –
• epsilon_dd (float) –
[Link].get_l_ho(m=164.0 * constants.u_in_kg, w_x=2.0 * [Link] * 30.0)

Parameters
• m (float) –
• w_x (float) –
[Link].get_alphas(w_x=2.0 * [Link] * 30.0, w_y=2.0 * [Link] * 30.0, w_z=2.0 * [Link]
* 30.0)

Parameters
• w_x (float) –
• w_y (float) –
• w_z (float) –
[Link].psi_gauss_2d_pdf(pos, mu=[Link]([0.0, 0.0]), var=[Link]([[1.0, 0.0],
[0.0, 1.0]]))
Gives values according to gaus dirstribution (2D) with meshgrid of x,y as input
Parameters
• pos – stacked meshgrid of an x (1D) and y (1D)
• mu – Mean of gauss
• var – Variance of gauss
• z_mesh – values according to gaus dirstribution (2D) with meshgrid of x,y as input
[Link].psi_gauss_2d(x, y, a=1.0, x_0=0.0, y_0=0.0, k_0=0.0)
Gaussian wave packet of width a and momentum k_0, centered at x_0
Parameters
• x – mathematical variable
• y – mathematical variable
• a (float) – Amplitude of pulse
• x_0 (float) – Mean spatial x of pulse
• y_0 (float) – Mean spatial y of pulse
• k_0 (float) – Group velocity of pulse
[Link].psi_gauss_3d(x, y, z, a_x=1.0, a_y=1.0, a_z=1.0, x_0=0.0, y_0=0.0,
z_0=0.0, k_0=0.0)
Gaussian wave packet of width a and momentum k_0, centered at x_0
Parameters
• x – mathematical variable
• y – mathematical variable
• z – mathematical variable

4.1. supersolids 21
supersolids, Release 0.1.26

• a_x (float) – Stretching factor in x direction


• a_y (float) – Stretching factor in y direction
• a_z (float) – Stretching factor in z direction
• x_0 (float) – Mean spatial x of pulse
• y_0 (float) – Mean spatial y of pulse
• z_0 (float) – Mean spatial z of pulse
• k_0 (float) – Group velocity of pulse
[Link].psi_gauss_1d(x, a=1.0, x_0=0.0, k_0=0.0)
Gaussian wave packet of width a and momentum k_0, centered at x_0
Parameters
• x – mathematical variable
• a (float) – Amplitude of pulse
• x_0 (float) – Mean spatial x of pulse
• k_0 (float) – Group velocity of pulse
[Link].psi_pdf(x, loc=0.0, scale=1.0)
Mathematical function of gauss pulse
Parameters
• x – mathematical variable
• loc (float) – Localization of pulse centre
• scale (float) – Scale of pulse
[Link].psi_rect(x, x_min=- 0.5, x_max=0.5, a=1.0)
Mathematical function of rectangular pulse between x_min and x_max with amplitude a
Parameters
• x – mathematical variable
• x_min (float) – Minimum x value of pulse (spatial)
• x_max (float) – Maximum x value of pulse (spatial)
• a (float) – Amplitude of pulse
[Link].psi_gauss_solution(x)
Mathematical function of solution of non-linear Schroedinger for g=0
Parameters x – mathematical variable
[Link].thomas_fermi_1d(x, g=0.0)
Mathematical function of Thomas-Fermi distribution with coupling constant g
Parameters
• x – mathematical variable
• g (float) – coupling constant
[Link].thomas_fermi_2d(x, y, g=0.0)
Mathematical function of Thomas-Fermi distribution with coupling constant g
Parameters

22 Chapter 4. API Reference


supersolids, Release 0.1.26

• x – mathematical variable
• y – mathematical variable
• g (float) – coupling constant
[Link].thomas_fermi_2d_pos(pos, g=0.0)

Parameters g (float) –
[Link].thomas_fermi_3d(x, y, z, g=0.0)
Mathematical function of Thomas-Fermi distribution with coupling constant g
Parameters
• x – mathematical variable
• y – mathematical variable
• z – mathematical variable
• g (float) – coupling constant
[Link].mu_1d(g=0.0)

Parameters g (float) –
[Link].mu_2d(g=0.0)

Parameters g (float) –
[Link].mu_3d(g=0.0)

Parameters g (float) –
[Link].v_harmonic_1d(x)
[Link].v_harmonic_2d(pos, alpha_y=1.0)

Parameters alpha_y (float) –


[Link].v_2d(x, y, alpha_y=1.0)
[Link].v_harmonic_3d(x, y, z, alpha_y=1.0, alpha_z=1.0)

Parameters
• alpha_y (float) –
• alpha_z (float) –
[Link].get_r_cut(k_mesh, r_cut=1.0)

Parameters
• k_mesh ([Link]) –
• r_cut (float) –
[Link].dipol_dipol_interaction(kx_mesh, ky_mesh, kz_mesh, r_cut=1.0)

4.1. supersolids 23
supersolids, Release 0.1.26

Parameters
• kx_mesh (float) –
• ky_mesh (float) –
• kz_mesh (float) –
• r_cut (float) –
[Link].f_kappa(kappa, epsilon=10 ** - 10)

Parameters
• kappa ([Link]) –
• epsilon (float) –
Return type float
[Link].atan_special(x)
[Link].func_125(kappa, alpha_z, e_dd, epsilon=10 ** - 10)

Parameters
• kappa (float) –
• alpha_z (float) –
• e_dd (float) –
• epsilon (float) –
[Link].func_124(kappa, e_dd, N, a_s_l_ho_ratio)

Parameters
• kappa (float) –
• e_dd (float) –
• N (float) –
• a_s_l_ho_ratio (float) –
[Link].get_R_rz(kappa, e_dd, N, a_s_l_ho_ratio)

Parameters
• kappa (float) –
• e_dd (float) –
• N (int) –
• a_s_l_ho_ratio (float) –
[Link].get_kappa(alpha_z, e_dd, x_min=3.0, x_max=5.0, res=1000)

Parameters
• alpha_z (float) –
• e_dd (float) –

24 Chapter 4. API Reference


supersolids, Release 0.1.26

• x_min (float) –
• x_max (float) –
• res (int) –
[Link].density_in_trap(x, y, z, R_r, R_z, g=0.0)

Parameters
• x (float) –
• y (float) –
• z (float) –
• R_r (float) –
• R_z (float) –
• g (float) –
[Link].density_in_trap_r(r, z, R_r, R_z, g=0.0)

Parameters
• r (float) –
• z (float) –
• R_r (float) –
• R_z (float) –
• g (float) –
[Link].camera_func_r(frame, r_0=10.0, phi_0=45.0, z_0=20.0,
r_per_frame=10.0)

Parameters
• frame (int) –
• r_0 (float) –
• phi_0 (float) –
• z_0 (float) –
• r_per_frame (float) –
Return type float
[Link].camera_func_phi(frame, r_0=10.0, phi_0=45.0, z_0=20.0,
phi_per_frame=10.0)

Parameters
• frame (int) –
• r_0 (float) –
• phi_0 (float) –
• z_0 (float) –

4.1. supersolids 25
supersolids, Release 0.1.26

• phi_per_frame (float) –
Return type float
[Link].camera_func_z(frame, r_0=10.0, phi_0=45.0, z_0=20.0,
z_per_frame=10.0)

Parameters
• frame (int) –
• r_0 (float) –
• phi_0 (float) –
• z_0 (float) –
• z_per_frame (float) –
Return type float
[Link].camera_3d_trajectory(frame, r_func=None, phi_func=None,
z_func=None, r_0=10.0, phi_0=45.0, z_0=20.0)
Computes r, phi, z as the components of the camera position in the animation for the given frame. Depending
on, if a callable function is given for the components, it is applied to the parameters or the start values are used.
Parameters
• frame (int) – Index of the frame in the animation
• r_func (Callable) – r component of the movement of the camera.
• phi_func (Callable) – phi component of the movement of the camera.
• z_func (Callable) – z component of the movement of the camera.
• r_0 (float) – r component of the starting point of the camera movement.
• phi_0 (float) – phi component of the starting point of the camera movement.
• z_0 (float) – z component of the starting point of the camera movement.
Returns r, phi, z as the components of the camera position in the animation for the given frame.
Return type Tuple[float, float, float]
[Link].noise_mesh(min=0.8, max=1.2, shape=(64, 64, 64))

Parameters
• min (float) –
• max (float) –
• shape (Tuple[int, int, int]) –
Return type [Link]
[Link].dt_adaptive(t, dt)

Return type float


[Link].datapoints_exponent :int = 6

26 Chapter 4. API Reference


supersolids, Release 0.1.26

[Link].get_path

Module Contents

Functions

get_path (dir_path, dir_name = 'movie', count- Looks up all directories with matching dir_name
ing_format = '%03d', file_pattern = '')

[Link].get_path.get_path(dir_path, dir_name='movie', counting_format='%03d',


file_pattern='')
Looks up all directories with matching dir_name and counting format in dir_path. Gets the highest number and
returns a path with dir_name counted one up (prevents colliding with old data).
Parameters
• dir_path ([Link] ) – Path where to look for old directories (movie data)
• dir_name (str) – General name of the directories without the counter
• counting_format (str) – Format of counter of the directories
• file_pattern (str) –
Returns Path for the new directory (not colliding with old data)
Return type Tuple[[Link], int, str, str]

[Link].run_time

Helper-Functions/decorators to compute parallel and profile functions

Module Contents

Functions

run_time(name = 'method')

[Link].run_time.run_time(name='method')

Parameters name (str) –


Return type Iterator

4.1. supersolids 27
supersolids, Release 0.1.26

[Link].simulate_case

Animation for the numerical solver for the non-linear time-dependent Schrodinger equation for 1D, 2D and 3D in
single-core.

Module Contents

Functions

simulate_case(System, Anim, accuracy = Wrapper for Animation and Schroedinger to get a work-
10**(-6), delete_input = True, dir_path = ing Animation
[Link]().joinpath('supersolids', 'results'),
dir_name_result = '', slice_indices = [0, 0, 0], offscreen
= False, x_lim = (-1.0, 1.0), y_lim = (-1.0, 1.0), z_lim =
(-1.0, 1.0), filename_schroedinger = '[Link]',
filename_steps = 'step_', steps_format = '%07d',
steps_per_npz = 10, frame_start = 0)

[Link].simulate_case.simulate_case(System, Anim, accuracy=10 ** - 6, delete_input=True,


dir_path=[Link]().joinpath('supersolids', 'results'),
dir_name_result='', slice_indices=[0, 0, 0],
offscreen=False, x_lim=(- 1.0, 1.0), y_lim=(- 1.0, 1.0),
z_lim=(- 1.0, 1.0),
filename_schroedinger='[Link]',
filename_steps='step_', steps_format='%07d',
steps_per_npz=10, frame_start=0)
Wrapper for Animation and Schroedinger to get a working Animation of a System through the equations given
by Schroedinger.
Parameters
• System ([Link]) – Schrödinger equations for the
specified system
• Anim ([Link]) –
class Animation with configured properties
• accuracy (float) – Convergence is reached when relative error of mu is smaller than ac-
curacy, where 𝜇 = − log(𝜓𝑛𝑜𝑟𝑚𝑒𝑑 )/(2𝑑𝑡)
• offscreen (bool) – Condition for interactive mode. When camera functions are used, then
interaction is not possible. So interactive=True turn the usage of camera functions off.
• delete_input (bool) – Condition if the input pictures should be deleted, after creation the
creation of the animation as e.g. mp4
• dir_path ([Link] ) – Path where to look for old directories (movie data)
• dir_name_result (str) – Name of directory where to save the results at. For example the
standard naming convention is movie002”)
• slice_indices ([Link]) – Numpy array with indices of grid points in the direc-
tions x, y, z (in terms of System.x, System.y, System.z) to produce a slice/plane in mayavi,
where 𝜓𝑝𝑟𝑜𝑏 = |𝜓|2 is used for the slice Max values is for e.g. [Link].x - 1.
• x_lim (Tuple[float, float]) – Limits of plot in x direction

28 Chapter 4. API Reference


supersolids, Release 0.1.26

• y_lim (Tuple[float, float]) – Limits of plot in y direction


• z_lim (Tuple[float, float]) – Limits of plot in z direction
• filename_schroedinger (str) – Name of file, where the Schroedinger object is saved
• filename_steps (str) – Name of file, without enumerator for the files. For example the
standard naming convention is step_000001.npz, the string needed is step_
• steps_format (str) – Formatting string for the enumeration of steps.
• steps_per_npz (int) – Number of dt steps skipped between saved npz.
• frame_start (int) – Number of named file, where psi_val is loaded from. For example
the standard naming convention is step_000001.npz
Returns Reference to Schroedinger System
Return type [Link]

[Link]

Subpackages

[Link]

Submodules

[Link].multi_core

DEPRECATED
Animation for the numerical solver for the non-linear time-dependent Schrodinger equation for 1D and 2D in multi-core.

Module Contents

[Link].multi_core.max_workers

[Link].single_core

Animation for the numerical solver for the non-linear time-dependent Schrodinger equation for 1D, 2D and 3D.

Module Contents

[Link].single_core.Res :[Link]

4.1. supersolids 29
supersolids, Release 0.1.26

Submodules

[Link].cp_plots

Module Contents

Functions

cp_plots(start, number, path_anchor_input, dir_name,


filename_in, path_anchor_output, filename_out, count-
ing_format='%03d', filename_extension='.png')

Attributes

path_anchor_input

[Link].cp_plots.cp_plots(start, number, path_anchor_input, dir_name, filename_in,


path_anchor_output, filename_out, counting_format='%03d',
filename_extension='.png')
[Link].cp_plots.path_anchor_input

[Link].density_in_trap

Calculates the density functions for a quantum droplet in a trap.

Module Contents

[Link].density_in_trap.N :int

[Link].multi_load

Module Contents

Functions

string_float(s)

30 Chapter 4. API Reference


supersolids, Release 0.1.26

Attributes

path_anchor_input

[Link].multi_load.string_float(s)
[Link].multi_load.path_anchor_input

[Link].multi_property

Module Contents

Functions

string_float(s)

Attributes

path_anchor_input

[Link].multi_property.string_float(s)
[Link].multi_property.path_anchor_input

[Link].multi_simulate

Module Contents

[Link].multi_simulate.supersolids_version = 0.1.32rc12
[Link].multi_simulate.dir_path
[Link].multi_simulate.xvfb_display = 98
[Link].multi_simulate.max_timesteps = 700001
[Link].multi_simulate.dt = 0.0002
[Link].multi_simulate.steps_per_npz = 1000
[Link].multi_simulate.accuracy = 0.0
[Link].multi_simulate.v_start = 2.0
[Link].multi_simulate.v_end = 33.0
[Link].multi_simulate.v_step = 10.0
[Link].multi_simulate.d_start = 0.2

4.1. supersolids 31
supersolids, Release 0.1.26

[Link].multi_simulate.d_end = 1.1
[Link].multi_simulate.d_step = 0.2
[Link].multi_simulate.file_start = step_
[Link].multi_simulate.file_number = 1150000
[Link].multi_simulate.file_pattern = .npz
[Link].multi_simulate.file_name
[Link].multi_simulate.movie_string = movie
[Link].multi_simulate.counting_format = %03d
[Link].multi_simulate.movie_number = 151
[Link].multi_simulate.files2last = 324
[Link].multi_simulate.movie_now
[Link].multi_simulate.func_filename = [Link]
[Link].multi_simulate.j_counter = 0
[Link].multi_simulate.func_list = []
[Link].multi_simulate.func_path_list = []
[Link].multi_simulate.dir_path_func_list = []
[Link].multi_simulate.v_string
[Link].multi_simulate.j_counter = 0
[Link].multi_simulate.func

[Link].multi_simulate_real

Module Contents

[Link].multi_simulate_real.supersolids_version
[Link].multi_simulate_real.dir_path
[Link].multi_simulate_real.xvfb_display = 70
[Link].multi_simulate_real.max_timesteps = 100001
[Link].multi_simulate_real.dt = 0.0002
[Link].multi_simulate_real.steps_per_npz = 1000
[Link].multi_simulate_real.accuracy = 0.0
[Link].multi_simulate_real.v_start = 2.0
[Link].multi_simulate_real.v_end = 13.0
[Link].multi_simulate_real.v_step = 2.0
[Link].multi_simulate_real.d_start = 0.2
[Link].multi_simulate_real.d_end = 1.1
[Link].multi_simulate_real.d_step = 0.2

32 Chapter 4. API Reference


supersolids, Release 0.1.26

[Link].multi_simulate_real.file_start = step_
[Link].multi_simulate_real.file_number = 1210000
[Link].multi_simulate_real.file_pattern = .npz
[Link].multi_simulate_real.file_name
[Link].multi_simulate_real.movie_string = movie
[Link].multi_simulate_real.counting_format = %03d
[Link].multi_simulate_real.movie_number = 475
[Link].multi_simulate_real.files2last = 41
[Link].multi_simulate_real.movie_now
[Link].multi_simulate_real.func_filename = [Link]
[Link].multi_simulate_real.j_counter = 0
[Link].multi_simulate_real.func_list = []
[Link].multi_simulate_real.func_path_list = []
[Link].multi_simulate_real.dir_path_func_list = []
[Link].multi_simulate_real.v_string
[Link].multi_simulate_real.j_counter = 0
[Link].multi_simulate_real.func

[Link]

Submodules

[Link].get_System_at_npz

Module Contents

Functions

get_System_at_npz(dir_path = Gets Schroedinger at given npz


Path('~/supersolids/results').expanduser(),
dir_name = 'movie001', filename_schroedinger
= f'[Link]', filename_steps = f'step_',
steps_format = '%06d', frame = 0)
plot_System_at_npz(args)

flags(args_array)

4.1. supersolids 33
supersolids, Release 0.1.26

Attributes

args

[Link].get_System_at_npz.get_System_at_npz(dir_path =
Path('~/supersolids/results').expanduser(),
dir_name = 'movie001',
filename_schroedinger = f'[Link]',
filename_steps = f'step_', steps_format =
'%06d', frame = 0)
Gets Schroedinger at given npz
Returns Schroedinger System
Parameters
• dir_path ([Link] ) –
• dir_name (str) –
• filename_schroedinger (str) –
• filename_steps (str) –
• steps_format (str) –
• frame (int) –
Return type [Link]
[Link].get_System_at_npz.plot_System_at_npz(args)
[Link].get_System_at_npz.flags(args_array)
[Link].get_System_at_npz.args

[Link].load_npz

Animation for the numerical solver for the non-linear time-dependent Schrodinger equation for 1D, 2D and 3D in
single-core.

Module Contents

Functions

load_npz(args)

flags(args_array)

34 Chapter 4. API Reference


supersolids, Release 0.1.26

Attributes

args

[Link].load_npz.load_npz(args)
[Link].load_npz.flags(args_array)
[Link].load_npz.args

[Link].simulate_npz

Animation for the numerical solver for the non-linear time-dependent Schrodinger equation for 1D, 2D and 3D in
single-core.

Module Contents

Functions

simulate_npz(args)

flags(args_array)

Attributes

args

[Link].simulate_npz.simulate_npz(args)
[Link].simulate_npz.flags(args_array)
[Link].simulate_npz.args

4.1. supersolids 35
supersolids, Release 0.1.26

[Link].track_property

Track a property of an Schrodinger object. For example the center of mass.

Module Contents

Functions

get_input_path (dir_path, dir_name)

get_last_index(input_path, filename_steps)

get_property(System, property_name =
'get_center_of_mass')
property_check(property, property_name =
'get_center_of_mass', property_func = False, prop-
erty_args=[])
track_property(input_path, file-
name_schroedinger=f'[Link]', file-
name_steps=f'step_', steps_format = '%06d',
steps_per_npz = 10, frame_start = 0, property_name
= 'get_center_of_mass', property_func = False, prop-
erty_args=[])
property_to_array(property_tuple)

plot_property(args, func=[Link])

flags(args_array)

Attributes

args

[Link].track_property.get_input_path(dir_path, dir_name)
[Link].track_property.get_last_index(input_path, filename_steps)
[Link].track_property.get_property(System, property_name='get_center_of_mass')

Parameters
• System ([Link]) –
• property_name (str) –
[Link].track_property.property_check(property, property_name='get_center_of_mass',
property_func=False, property_args=[])

Parameters

36 Chapter 4. API Reference


supersolids, Release 0.1.26

• property_name (str) –
• property_func (bool) –
[Link].track_property.track_property(input_path,
filename_schroedinger=f'[Link]',
filename_steps=f'step_', steps_format = '%06d',
steps_per_npz = 10, frame_start = 0, property_name
= 'get_center_of_mass', property_func = False,
property_args=[])

Parameters
• steps_format (str) –
• steps_per_npz (int) –
• frame_start (int) –
• property_name (str) –
• property_func (bool) –
[Link].track_property.property_to_array(property_tuple)
[Link].track_property.plot_property(args, func=[Link])
[Link].track_property.flags(args_array)
[Link].track_property.args

4.1.2 Submodules

[Link]

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 max-
imum filter.

4.1. supersolids 37
supersolids, Release 0.1.26

[Link].peaks_sort(peaks_indices, peaks_height, amount)


[Link].peaks_sort_along(peaks_indices, peaks_height, amount, axis)
[Link].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 [Link](N, MyBox, Res, max_timesteps, dt, dt_func=None, g=0.0,
g_qf=0.0, w_x=2.0 * [Link] * 33.0, w_y=2.0 * [Link] * 80.0,
w_z=2.0 * [Link] * 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:
1 1
𝑖𝜕𝑡 𝜓 = [ − ∇2 + (𝑥2 + (𝑦𝛼𝑦 )2 + (𝑧𝛼𝑧 )2 )
2 2
+ 𝑔|𝜓|2 + 𝑔𝑞𝑓 |𝜓|3 + 𝑈𝑑𝑑 ]𝜓

With 𝑈𝑑𝑑 = ℱ −1 (ℱ(𝐻𝑝𝑜𝑡 𝜓)𝜖𝑑𝑑 𝑔((3𝑘𝑧 /𝑘 2 ) − 1))


The split operator method with the Trotter-Suzuki approximation for the commutator relation (𝐻 = 𝐻𝑝𝑜𝑡 +𝐻𝑘𝑖𝑛 )
is used. Hence the accuracy is proportional to 𝑑𝑡4 The approximation is needed because of the Baker-Campell-
Hausdorff formula.
Parameters
• N (int) –
• MyBox ([Link]) –
• Res ([Link]) –
• 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) –

38 Chapter 4. API Reference


supersolids, Release 0.1.26

• V (Optional[Callable]) –
• V_interaction (Optional[Callable]) –
• psi_sol (Optional[Callable]) –
• mu_sol (Optional[Callable]) –
• psi_0_noise ([Link]) –
get_density(self, p=2.0)
Calculates |𝜓|𝑝 for 1D, 2D or 3D (depending on [Link]).
Parameters p (float) – Exponent of |𝜓|. Use p=2.0 for density.
Returns |𝜓|𝑝
Return type [Link]
get_norm(self, ∫︀func=None, p=2.0)
Calculates |𝜓|𝑝 dV for 1D, 2D or 3D (depending on [Link]). For p=2 it is the 2-norm.
Parameters
• p (float) – Exponent of |𝜓|. Use p=2.0 for density.
• func – If func is not provided self.get_density(p=p) is used.
Returns |𝜓|𝑝 dV
∫︀

Return type float


trapez_integral(self, func_val)
Calculates |𝜓|𝑝 dV for 1D, 2D or 3D (depending on [Link]) by using the trapez rule.
∫︀

For 1D: ℎ(𝑓 (𝑎) + 𝑓 (𝑎 + ℎ))/2


For 2D: ℎ(𝑓 (𝑎, 𝑏) + 𝑓 (𝑎 + ℎ, 𝑏) + 𝑓 (𝑎, 𝑏 + ℎ) + 𝑓 (𝑎 + ℎ, 𝑏 + ℎ))/2
For 3D there are 8 entries in the same manner (𝑎, 𝑏, 𝑐)...(𝑎 + ℎ, 𝑏 + ℎ, 𝑐 + ℎ)
Parameters func_val (Callable) – Grid sampled values of the function to integrate.
Returns |𝜓|𝑝 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
|𝜓|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
|𝜓|2 .
get_droplet_edges(self, prob_droplets, peaks_index_3d, cut_axis)

4.1. supersolids 39
supersolids, Release 0.1.26

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=[Link]().joinpath('supersolids', 'results'),
dir_name_result='', filename_schroedinger='[Link]', filename_steps='step_',
steps_format='%07d', steps_per_npz=10, frame_start=0)

Parameters
• accuracy (float) –
• dir_path ([Link] ) –
• dir_name_result (str) –
• filename_schroedinger (str) –
• filename_steps (str) –
• steps_format (str) –
• steps_per_npz (int) –
• frame_start (int) –

supersolids.__main__

Animation for the numerical solver for the non-linear time-dependent Schrodinger equation for 1D, 2D and 3D.

Module Contents

supersolids.__main__.parser

40 Chapter 4. API Reference


CHAPTER

FIVE

INDICES AND TABLES

• genindex
• modindex
• search

41
supersolids, Release 0.1.26

42 Chapter 5. Indices and tables


PYTHON MODULE INDEX

s
supersolids, 9
supersolids.__main__, 40
[Link], 9
[Link], 9
[Link], 10
[Link], 12
[Link], 14
[Link], 14
[Link], 15
[Link].cut_1d, 16
[Link], 17
[Link].get_path, 27
[Link], 15
[Link].run_time, 27
[Link].simulate_case, 28
[Link], 37
[Link], 29
[Link].cp_plots, 30
[Link].density_in_trap, 30
[Link], 29
[Link].multi_core, 29
[Link].single_core,
29
[Link].multi_load, 30
[Link].multi_property, 31
[Link].multi_simulate, 31
[Link].multi_simulate_real, 32
[Link], 33
[Link].get_System_at_npz, 33
[Link].load_npz, 34
[Link].simulate_npz, 35
[Link].track_property, 36

43
supersolids, Release 0.1.26

44 Python Module Index


INDEX

Symbols C
__str__() ([Link] method), 14 camera_3d_trajectory() (in module super-
__str__() ([Link] [Link]), 26
method), 15 camera_func_phi() (in module super-
__str__() ([Link] method), [Link]), 25
19 camera_func_r() (in module super-
__str__() ([Link] [Link]), 25
method), 19 camera_func_z() (in module super-
[Link]), 26
A counting_format (in module super-
a_0 (in module [Link]), 15 [Link].multi_simulate), 32
accuracy (in module [Link].multi_simulate), counting_format (in module super-
31 [Link].multi_simulate_real), 33
accuracy (in module super- cp_plots() (in module [Link].cp_plots), 30
[Link].multi_simulate_real), 32 create_movie() (super-
[Link]
animate() ([Link]
method), 11 method), 13
animate() ([Link]
crop_pos_to_limits() (in module super-
method), 13 [Link]), 12
animate_npz() (super- cut_1d() (in module [Link].cut_1d), 16
[Link]
method), 13 D
Animation (class in [Link]), 9 d_end (in module [Link].multi_simulate), 31
aResAssert() (in module [Link]), d_end (in module super-
20 [Link].multi_simulate_real), 32
args (in module [Link].get_System_at_npz), 34 d_start (in module [Link].multi_simulate),
args (in module [Link].load_npz), 35 31
args (in module [Link].simulate_npz), 35 d_start (in module super-
args (in module [Link].track_property), 37 [Link].multi_simulate_real), 32
atan_special() (in module super- d_step (in module [Link].multi_simulate),
[Link]), 24 32
axes_style() (in module super- d_step (in module super-
[Link]), 12 [Link].multi_simulate_real), 32
datapoints_exponent (in module super-
B [Link]), 26
Box (class in [Link]), 14 density_in_trap() (in module super-
Box (class in [Link]), 19 [Link]), 25
BoxResAssert() (in module [Link]), 14 density_in_trap_r() (in module super-
BoxResAssert() (in module super- [Link]), 25
[Link]), 20 dipol_dipol_interaction() (in module super-
[Link]), 23

45
supersolids, Release 0.1.26

dir_path (in module [Link].multi_simulate), func_filename (in module super-


31 [Link].multi_simulate_real), 33
dir_path (in module super- func_list (in module super-
[Link].multi_simulate_real), 32 [Link].multi_simulate), 32
dir_path_func_list (in module super- func_list (in module super-
[Link].multi_simulate), 32 [Link].multi_simulate_real), 33
dir_path_func_list (in module super- func_path_list (in module super-
[Link].multi_simulate_real), 33 [Link].multi_simulate), 32
dt (in module [Link].multi_simulate), 31 func_path_list (in module super-
dt (in module [Link].multi_simulate_real), [Link].multi_simulate_real), 33
32
dt_adaptive() (in module super- G
[Link]), 26 g_qf_helper() (in module super-
[Link]), 20
E get_alphas() (in module [Link]),
extract_droplet() (super- 21
[Link] method), get_center_of_mass() (super-
39 [Link] method),
40
F get_density() ([Link]
f_kappa() (in module [Link]), 24 method), 39
fft_plot() (in module [Link]), 20 get_droplet_edges() (super-
file_name (in module super- [Link] method),
[Link].multi_simulate), 32 39
file_name (in module super- get_g() (in module [Link]), 20
[Link].multi_simulate_real), 33 get_g_qf() (in module [Link]), 20
file_number (in module super- get_input_path() (in module super-
[Link].multi_simulate), 32 [Link].track_property), 36
file_number (in module super- get_kappa() (in module [Link]),
[Link].multi_simulate_real), 33 24
file_pattern (in module super- get_l_ho() (in module [Link]), 21
[Link].multi_simulate), 32 get_last_index() (in module super-
file_pattern (in module super- [Link].track_property), 36
[Link].multi_simulate_real), 33 get_legend() (in module super-
file_start (in module super- [Link]), 12
[Link].multi_simulate), 32 get_mesh_list() (super-
file_start (in module super- [Link] method),
[Link].multi_simulate_real), 32 39
files2last (in module super- get_meshgrid() (in module super-
[Link].multi_simulate), 32 [Link]), 20
files2last (in module super- get_meshgrid_3d() (in module super-
[Link].multi_simulate_real), 33 [Link]), 20
flags() (in module super- get_norm() ([Link]
[Link].get_System_at_npz), 34 method), 39
flags() (in module [Link].load_npz), 35 get_parameters() (in module super-
flags() (in module [Link].simulate_npz), 35 [Link]), 20
flags() (in module [Link].track_property), 37 get_parity() ([Link]
func (in module [Link].multi_simulate), 32 method), 40
func (in module [Link].multi_simulate_real), get_path() (in module [Link].get_path), 27
33 get_peak_distances_along() (super-
func_124() (in module [Link]), 24 [Link] method),
func_125() (in module [Link]), 24 39
func_filename (in module super- get_peak_neighborhood() (super-
[Link].multi_simulate), 32 [Link] method),

46 Index
supersolids, Release 0.1.26

39 max_timesteps (in module super-


get_peak_neighborhood_along() (super- [Link].multi_simulate), 31
[Link] method), max_timesteps (in module super-
39 [Link].multi_simulate_real), 32
get_peak_positions_along() (super- max_workers (in module super-
[Link] method), [Link].multi_core), 29
39 mayavi_counter (super-
get_peaks() (in module [Link]), 38 [Link]
get_peaks_along() (super- attribute), 13
[Link] method), MayaviAnimation (class in super-
39 [Link]), 12
get_phase_var() (super- min_length() ([Link] method), 14
[Link] method), min_length() ([Link]
40 method), 20
get_phase_var_neighborhood() (super- module
[Link] method), supersolids, 9
40 supersolids.__main__, 40
get_property() (in module super- [Link], 9
[Link].track_property), 36 [Link], 9
get_r2() ([Link] [Link],
method), 39 10
get_r_cut() (in module [Link]), [Link], 12
23 [Link], 14
get_R_rz() (in module [Link]), 24 [Link], 14
get_supersolids_version() (in module super- [Link], 15
[Link]), 12 [Link].cut_1d, 16
get_System_at_npz() (in module super- [Link], 17
[Link].get_System_at_npz), 34 [Link].get_path, 27
get_V_plot_values() (in module super- [Link], 15
[Link]), 12 [Link].run_time, 27
get_V_plot_values() (super- [Link].simulate_case, 28
[Link]
[Link], 37
method), 11 [Link], 29
[Link].cp_plots, 30
I [Link].density_in_trap, 30
identity() (in module [Link]), 20 [Link], 29
[Link].multi_core,
J 29
j_counter (in module super- [Link].single_core,
[Link].multi_simulate), 32 29
j_counter (in module super- [Link].multi_load, 30
[Link].multi_simulate_real), 33 [Link].multi_property, 31
[Link].multi_simulate, 31
L [Link].multi_simulate_real,
lambda_parsed() (in module super- 32
[Link]), 20 [Link], 33
lengths() ([Link] method), 14 [Link].get_System_at_npz, 33
lengths() ([Link] method), [Link].load_npz, 34
20 [Link].simulate_npz, 35
load_npz() (in module [Link].load_npz), 35 [Link].track_property, 36
movie_now (in module super-
M [Link].multi_simulate), 32
MatplotlibAnimation (class in super- movie_now (in module super-
[Link]), 10 [Link].multi_simulate_real), 33

Index 47
supersolids, Release 0.1.26

movie_number (in module super- R


[Link].multi_simulate), 32 Res (in module super-
movie_number (in module super- [Link].single_core), 29
[Link].multi_simulate_real), 33 ResAssert() (in module [Link]),
movie_string (in module super- 15
[Link].multi_simulate), 32 Resolution (class in [Link]), 19
movie_string (in module super- Resolution (class in [Link]), 15
[Link].multi_simulate_real), 33 round_z_to_0() (in module super-
mu_1d() (in module [Link]), 23 [Link]), 11
mu_2d() (in module [Link]), 23 run_time() (in module [Link].run_time), 27
mu_3d() (in module [Link]), 23
S
N Schroedinger (class in [Link]), 38
N (in module [Link].density_in_trap), 30 set_limits() ([Link]
noise_mesh() (in module [Link]), method), 10
26 set_limits_smart() (super-
[Link]
P method), 11
parser (in module supersolids.__main__), 40 simulate_case() (in module super-
path_anchor_input (in module super- [Link].simulate_case), 28
[Link].cp_plots), 30 simulate_npz() (in module super-
path_anchor_input (in module super- [Link].simulate_npz), 35
[Link].multi_load), 31 simulate_raw() (super-
path_anchor_input (in module super- [Link] method),
[Link].multi_property), 31 40
peaks_sort() (in module [Link]), 37 slice_default() (super-
peaks_sort_along() (in module super- [Link] method),
[Link]), 38 40
plot_2d() (in module super- start() ([Link]
[Link]), 11 method), 11
plot_property() (in module super- steps_per_npz (in module super-
[Link].track_property), 37 [Link].multi_simulate), 31
plot_System_at_npz() (in module super- steps_per_npz (in module super-
[Link].get_System_at_npz), 34 [Link].multi_simulate_real), 32
prepare() ([Link]
string_float() (in module super-
method), 13 [Link].multi_load), 31
prepare_cuts() (in module [Link].cut_1d), string_float() (in module super-
16 [Link].multi_property), 31
property_check() (in module super- supersolids
[Link].track_property), 36 module, 9
property_to_array() (in module super- supersolids.__main__
[Link].track_property), 37 module, 40
psi_gauss_1d() (in module super- [Link]
[Link]), 22 module, 9
psi_gauss_2d() (in module super- [Link]
[Link]), 21 module, 9
psi_gauss_2d_pdf() (in module super- [Link]
[Link]), 21 module, 10
psi_gauss_3d() (in module super- [Link]
[Link]), 21 module, 12
psi_gauss_solution() (in module super- [Link]
[Link]), 22 module, 14
psi_pdf() (in module [Link]), 22 [Link]
psi_rect() (in module [Link]), 22 module, 14

48 Index
supersolids, Release 0.1.26

[Link] thomas_fermi_2d() (in module super-


module, 15 [Link]), 22
[Link].cut_1d thomas_fermi_2d_pos() (in module super-
module, 16 [Link]), 23
[Link] thomas_fermi_3d() (in module super-
module, 17 [Link]), 23
[Link].get_path time_step() ([Link]
module, 27 method), 40
[Link] to_array() ([Link]
module, 15 method), 15
[Link].run_time track_property() (in module super-
module, 27 [Link].track_property), 37
[Link].simulate_case trapez_integral() (super-
module, 28 [Link] method),
[Link] 39
module, 37
[Link] U
module, 29 u_in_kg (in module [Link]), 15
[Link].cp_plots
module, 30 V
[Link].density_in_trap v_2d() (in module [Link]), 23
module, 30 v_end (in module [Link].multi_simulate), 31
[Link] v_end (in module super-
module, 29 [Link].multi_simulate_real), 32
[Link].multi_core v_harmonic_1d() (in module super-
module, 29 [Link]), 23
[Link].single_core v_harmonic_2d() (in module super-
module, 29 [Link]), 23
[Link].multi_load v_harmonic_3d() (in module super-
module, 30 [Link]), 23
[Link].multi_property v_start (in module [Link].multi_simulate),
module, 31 31
[Link].multi_simulate v_start (in module super-
module, 31 [Link].multi_simulate_real), 32
[Link].multi_simulate_real v_step (in module [Link].multi_simulate),
module, 32 31
[Link] v_step (in module super-
module, 33 [Link].multi_simulate_real), 32
[Link].get_System_at_npz v_string (in module [Link].multi_simulate),
module, 33 32
[Link].load_npz v_string (in module super-
module, 34 [Link].multi_simulate_real), 33
[Link].simulate_npz
module, 35 X
[Link].track_property
xvfb_display (in module super-
module, 36
[Link].multi_simulate), 31
supersolids_version (in module super-
xvfb_display (in module super-
[Link].multi_simulate), 31
[Link].multi_simulate_real), 32
supersolids_version (in module super-
[Link].multi_simulate_real), 32

T
thomas_fermi_1d() (in module super-
[Link]), 22

Index 49

You might also like