This repository is for showcasing only. You are free to use any of its contents, but it is currently not maintained and not open for contributions. This code was originally not intended for publication, is poorly documented, and may not run out of the box on your device (my apologies).
Simulation of the dynamics of the spherically symmetric single particle Schrödinger-Newton equation. The code uses a Crank-Nicolson scheme for the evolution of the time dependent nonlinear Schrödinger-Newton equation and is inspired by the PhD thesis by Salzman1. It has been used to retrieve the results published as part of my PhD research2.
Requirements:
- GNU C compiler installed and gcc executable in PATH
Before running:
- Edit the path in line 22 of
run.sh
to reflect your preferred output directory
The simulation is run using the run.sh
script. The parameters for the
simulation are set in the param.h
header file. Options for running using the
run.sh
script provided are:
./run.sh s
starts a new calculation./run.sh c path time
continues from given path and timestep./run.sh safe s
compile in safe mode with fewer optimization./run.sh safe c path time
same but continues calculation
For the evaluation of the results, the following scripts are provided
in the python_scripts
directory:
movie.py path n max_t save_every [plot_title w m dr dt]
creates a movie of the probability densityphase.py path n max_t save_every [plot_title w m dr dt]
creates a movie of the wave function phaseplot.py path n save_every times
creates a plot of the probability density for given time stepsplotfile.py path outfile-prefix n save_every dr times
writes the probability density to a file for a given time steps for further processingplotphasefile.py path outfile-prefix n save_every dr times
writes the phase to a filermax.py path n max_t save_every w m dr dt outfile
writes a file containing the maximum radius of the wave function for each time stepr90.py path n max_t save_every w m dr dt outfile
writes a file containing the radius at which 90% of the probability density is containedmasstime.py path n max_t save_every w m dr dt deviation
prints the time at which a certain relative deviation in width of the probability distribution from the free evolution is reached
The parameters for these Python scripts are:
path
: path to the directory containing the simulation resultsn
: number of grid pointsmax_t
: maximum time stepsave_every
: save every nth time step (parameter from simulation run)plot_title
: title of the plotw
: width of the initial Gaussian wave packetm
: mass of particledr
: spatial grid sizedt
: temporal step sizetimes
: time steps for which to plot, separated by spacesoutfile
: file to write tooutfile-prefix
: prefix for output file name (time step is appended)deviation
: relative deviation in width of probability distribution from free evolution
We solve the the time dependent Schrödinger-Newton equation
Due to the nonlinearity of the equation, the Hamilton operator
where
We consider the spherically symmetric case, i.e.
We define a spatial and temporal grid size
Linearizing this equation we can write it as
with the matrix
where
in order to obtain the wave function at the next time step:
The radial component of the Laplacian in spherical coordinates is
It takes the discretized form
while the discretized form of the potential
Using the shorthand notations
the diagonal elements are given by
and the off-diagonal elements by
and
We use the tridiagonal matrix algorithm to solve the linear system.
Routines for the simulation, written in C, and bash scripts for compiling
and running the simulation are located in the code
directory:
run.sh
: Bash script to compile and run the simulationcompile.sh
: Bash script to only compile without runningparam.h
: Header file containing all parameters to be setsne.c
: Main program running Crank-Nicolson algorithmwf.c
: Definition of different wave function shapeshelpers.c
: Various helper functions for handling of files and output
Python scripts for evaluation of the results are located in the
python_scripts
directory, with descriptions given above in the section
"Usage". The file helpers.py
contains helper functions for the Python
scripts.
Footnotes
-
Salzman, Peter Jay. 2005. Investigation of the Time Dependent Schrödinger-Newton Equation. PhD Thesis, Davis: University of California. ↩
-
Giulini, Domenico, and André Großardt. 2011. Gravitationally Induced Inhibitions of Dispersion According to the Schrödinger-Newton Equation. Classical and Quantum Gravity 28 (19): 195026. Preprint at arXiv:1105.1921. ↩