\documentclass[notitlepage]{article}
\usepackage{titling}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{fullpage}
\usepackage{mathtools}
\usepackage{etoolbox}
\cslet{lrbox*}\lrbox
\expandafter\patchcmd\csname lrbox*\endcsname{\setbox}{\global\setbox}{}{}
\cslet{endlrbox*}\endlrbox
\usepackage{sagetex}
\usepackage{url}
\usepackage{cite}
\usepackage{xcolor}
\usepackage{breqn}
\usepackage{collect}
\setlength{\parskip}{1ex}
\usepackage[titletoc,title]{appendix}
\usepackage{float}
\usepackage{hyperref}
\hypersetup{
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
\title{Discretization of the Quantum Dynamical Equations of Motion - One Dimension}
\author{Bill Page \small{(\href{mailto:bill.page@newsynthesis.org}{bill.page@newsynthesis.org})}}
\date{Draft \today}
\begin{document}
\maketitle
\thispagestyle{empty}
\begin{abstract}
\textbf{From Poirier’s Bohmian Mechanics without Wavefunctions, to Hall’s Many Interacting Worlds
in One Dimension}
In this note we show that Hall's ``toy'' model of quantum mechanics as many interacting interacting classical worlds in one dimension follows directly from the approximation of Poirier's quantum mechanical equations of motion as difference equations with a judicious choice of difference operators. These calculations are a preliminary exercise for the case of more than one dimension. The main emphasis is methodological with the main applications to follow in later articles.
We provide a numerical simulation that reproduces the results given previously by Poirier\cite{poirier2008}.
\end{abstract}
\section{Introduction}
In a general sense the quantum mechanical equations of motion originates with the work of Erwin Madelung\cite{madelung1927} on quantum hydrodynamics. David Bohm\cite{bohm1993} rediscovered and extended an interpretation of quantum mechanics originating with Louis de Broglie\cite{debroglie1960}, aka. Bohmian mechanics, which the notion of particles ``guided'' by the wavefunction. Peter Holland\cite{holland1995} and co-workers have continued to extend the de Broglie-Bohm theory in this direction, ultimately showing that it is possible to dispense with the wavefunction all together in favor of a continuous ensemble of quantum trajectories. Besides the conceptual metaphysical issues, this has lead to some new more powerful calculation methods that have become important for practical application of quantum mechanics to physical chemistry (e.g. Wyatt \cite{wyatt2005}). Poirier continues in this tradition while Hall, Deckert, and Wiseman\cite{hall2014quantum} emphasize the interpretation of the quantum trajectories as interaction between parallel worlds reminiscent but differing from Hugh Everett's many-worlds interpretation of quantum mechanics.
In this article the Hamiltonian formulaion of these equations of motion is important. Conservation of energy is an important indicator of the quality of the numerical integration. The Störmer–Verlet method implemented in this article is well known and preserves the symplectic structure on the system phase space.
From the point of view of Poirier\cite{schiff2012communication} this simulation is viewed as an approximation to the quantum dynamical field equations. One should think of this in hydrodynamic terms. But from the point of view of Hall, et al. these are discrete trajectories of the \textbf{same} particle in many different ``parallel'' worlds - but just one particle!
In the expressions which follow $\mathbf{C}$ is the co-ordinate which indexes these worlds. One should think of this as the same particle in many different worlds interacting with the copy of itself in other worlds. It is a an important aspect of the equations of motion that trajectories of these particles never cross. The co-ordinate function $\mathbf{C}$ is assumed to be ``uniformized''\footnote{ Schiff and Poirier\cite{schiff2012communication}} so that discretization of $\mathbf{C}$ assigns an equal ``density'' to the particle in each world.
In the example simulation included in this article the starting distribution of the particle in these different worlds is a Gaussian distribution. But the distribution evolves as it interacts with the classical potential. Some trajectories are scattered from the potential while other tunnel through. From the point of view of Poirier, an important goal of this simulation is to provide an efficient calculation of the scattering and tunneling amplitudes. But from the point of view of Hall this is a just purely "classical" mechanical problem with a rather unusual form of interaction. It is the form of this interaction between worlds that leads to statistics that approximate quantum mechanics in the limit of a very large number of interacting worlds.
\newcommand{\J}{\begin{vmatrix}\scriptstyle{J}\end{vmatrix}}
\definecollection{prelim}
\begin{sagesilent}[prelim]
import numpy
from numpy import array,concatenate,vectorize,isnan
rdf=numpy.array([RDF.pi()]).dtype
import mpmath
from mpmath import erfinv
def fun(*y):
cache={}
def upd(f,x,y):
try: return cache[x]
except KeyError:
try: cache[x] = f.subs(dict([[y[i],x[i]]
for i in range(len(y))]))
except AttributeError:
def sub(f): return f.subs(dict([[y[i],x[i]]
for i in range(len(y))]))
cache[x] = map(sub,f)
return cache[x]
return lambda f: lambda *x: upd(f,x,y)
def argscript(self, *args):
return "%s_{%s}"%(self.name(),','.join(map(repr, args)))
def functions(*names):
return map(lambda nam:function(nam, print_latex_func=argscript),names)
def detJscript(self, *args):
return '\J_{%s}'% (','.join(map(repr, args)))
J__= function('J_')
J_ = function('J_', print_latex_func=detJscript)
def squared(x):
try: return x.dot(x)
except: return power(x,2)
\end{sagesilent}
\definecollection{shift}
\begin{sagesilent}[shift]
def shift(x,n):
try:
start = (x.__array_interface__['data'][0] -
x.base.__array_interface__['data'][0])/x.itemsize
stop = start + x.shape[0]
if start+n<0 or stop+n>x.base.shape[0]:
raise RuntimeError('bounds')
return x.base[start+n:stop+n]
except AttributeError:
raise RuntimeError('expecting view')
\end{sagesilent}
In this document we have used the computer algebra system
Sage\footnote{\sagestr{version()}\cite{SageMath2016} on SageMathCloud\cite{SageMathCloud2016}} with components of
SciPy\footnote{numpy Version \sagestr{numpy.version.version} \cite{SciPy2016}}
and
mpmath\footnote{mpmath Version \sagestr{mpmath.__version__} \cite{mpmath2016}}
for both symbolic and numeric calculations. This document and the source code for this work can be found
online\footnote{\LaTeX\ \href{https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/miw/\jobname.tex}{source} \href{https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/miw/\jobname.pdf}{pdf} \href{https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/miw/\jobname.sagews}{SageWorksheet}. The online versions may be more up to date.}. The inset bold text below and many of the formulas in this paper are input and output produced directly by the Sage system. For more details please refer to Appendix \ref{SageAppendix}.
For example we define some special symbols for Planck's constant and mass:
\begin{sageblock}
hbar = var('hbar',latex_name=r'\hbar')
m = var('m')
\end{sageblock}
\definecollection{fancy}
\definecollection{prelim1}
\begin{collect}{prelim1}{\noindent}{\par}
The following is a work-round for a bug\footnote{Some commands for manipulating and simplifying expressions do not respect the \textbf{\rm print\_latex\_func} option. \url{https://trac.sagemath.org/ticket/19151}} in Sage.
\end{collect}
\definecollection{prelim2}
\begin{sagecollect}{prelim2}
def fix(it):
ret = it.subs(dict([[function('x')(n+i), X[0](n+i)] for i in range(-2,3)] +
[[J__(n+i), J_(n+i)] for i in range(-2,3)]))
return ret
def factor(x):
try: return fix(x.factor())
except: return vector(map(lambda y:fix(y.factor()),x))
\end{sagecollect}
\section{One Dimensional System}
We show below that in one dimension Schiff and Poirier's quantum dynamical equation of motion, \cite{schiff2012communication} eqs. (18-20),
\begin{equation} \label{eq18}
m \ddot{x^i}+\frac{\partial V(x)}{\partial x^i}- \frac{\hbar^2}{4 m}\frac{\partial}{\partial C^m}\left(K^k_i K^m_j \frac{\partial^2 K^l_j}{\partial C^k \partial C^l}\right)=0
\end{equation}
that follows from a quantum potential of the form
\begin{equation} \label{eq20}
Q = -\frac{\hbar^2}{4 m} \left(K^k_j \frac{\partial^2 K^l_j}{\partial C^l \partial C^k} + \frac{1}{2}\frac{\partial K^l_j}{\partial C^l}\frac{\partial K^k_j}{\partial C^k} \right)
\end{equation}
when discretized by replacing derivatives with difference operators, is equivalent to Hall’s \cite{hall2014quantum} ``toy'' expression eq. (24) for a finite number of classically interacting ``parallel'' worlds.
\begin{align}
r_N(x_n;X) &= \frac{\hbar^2}{4 m}[\sigma_{n+1}(X)-\sigma_n(X)] \label{eq24} \\
\sigma_n(X) &= \frac{1}{(x_n-x_{n-1})^2} \left[ \frac{1}{x_{n+1}-x_n} - \frac{2}{x_n-x_{n-1}} + \frac{1}{x_{n-1}-x_{n-2}}\right] \nonumber
\end{align}
By discretized we mean that the ``uniformizing co-ordinate'' $\mathbf{C}$ will be replaced with discrete values representing a finite number of ``worlds''. Derivatives with respect to $\mathbf{C}$ will be replaced with difference operators in the expressions for the quantum potential and quantum force. $\mathbf{C}$ becomes a discrete index $n$.
In the following we write most expressions in their general vector form even though in one dimension considerable simplification is possible to connect with related articles where we use these expressions in more than one dimension.
Let $E =[x_{n}]$ represent the configuration space of one particle in 1-D space with world co-ordinate $n$. In Sage this can be represented as:
\begin{sageblock}
X = functions('x')
d = len(X)
C = (var('n'),)
E = tuple([x(*C) for x in X])
\end{sageblock}
\begin{equation} \sage{E} \end{equation}
\section{Forward/Backward Difference Approximation}
In this approximation to the derivative each world interacts only locally but with the
\emph{two} nearest neighbors to the left and right.
The forward and backward difference operators
\begin{sageblock}
def DM(x,n):return x-x.subs(n==n-1)
def DP(x,n):return x.subs(n==n+1)-x
\end{sageblock}
approximate derivatives.
To derive Hall's equations for a finite number of interacting worlds we replace derivatives with difference operators so the Jacobian becomes a $1x1$ matrix
\begin{sageblock}
J = fun(n) (matrix([[DM(E[j],C[i]) for i in range(d)] for j in range(d)]))
\end{sageblock}
\begin{equation} \sage{J(n)} \end{equation}
It will be convenient for our calculations to represent the inverse of the Jacobian in terms of its adjugate and delay evaluation of the determinant until needed. The adjugate ``matrix'' is just
\begin{sageblock}
A = fun(n) (J(n).adjoint())
\end{sageblock}
\begin{equation} \sage{A(n)} \end{equation}
so the inverse ``matrix'' is
\begin{sageblock}
K = fun(n) (A(n)/J_(n))
\end{sageblock}
\begin{equation} \sage{K(n)} \end{equation}
where the symbol $\J_n$ represents the determinant. We will eventually need to replace the symbolic determinants with then explicit expressions
\begin{sageblock}
_J = fun(n) (factor(J(n).determinant()))
dets = {J_(n+i):_J(n+i) for i in range(-2,3)}
\end{sageblock}
\begin{equation} \sage{_J(n)} \end{equation}
It is $\sage{factor(J(n)^(-1))==K(n).subs(J_(n)==_J(n))}$ that $J(n)^{-1}=K(n) \text{ where }{\sage{J_(n)}=\operatorname{_J}(n)}$.
\subsection{Quantum Potential}
The Schiff and Poirier expression for the quantum potential \eqref{eq20} can be approximated in terms of difference operations. Let $Q(n)=Q_2(n)+Q_3(n)$ be the 2nd and 3rd order terms, respectively.
\begin{sageblock}
Q = fun(n) ( -(hbar^2/4/m) * sum( sum( sum(
(K(n)[k,j] * DM( DP( K(n)[l,j],C[l] ),C[k] ) +
1/2 * DP(K(n)[l,j],C[l]) * DP(K(n)[k,j],C[k]))
for k in range(d)) for j in range(d)) for l in range(d)) )
\end{sageblock}
\begin{dmath}
\sage{ expand(factor(Q(n))) }
\end{dmath}
\begin{sageblock}
Q2 = fun(n) ( -(hbar^2/4/m) * sum( sum( sum(
(1/2 * DP(K(n)[l,j],C[l]) * DP(K(n)[k,j],C[k]) )
for k in range(d)) for j in range(d)) for l in range(d)) )
\end{sageblock}
\begin{dmath}
\sage{ expand(factor(Q2(n))) }
\end{dmath}
\begin{sageblock}
Q3 = fun(n) ( -(hbar^2/4/m) * sum( sum( sum(
(K(n)[k,j] * DM( DP( K(n)[l,j],C[l] ),C[k]) )
for k in range(d)) for j in range(d)) for l in range(d)) )
\end{sageblock}
\begin{dmath}
\sage{ expand(factor(Q3(n))) }
\end{dmath}
In the discretized expressions it will be convenient to replace the $X$ co-ordinates with scalar quantities. The forward and backward difference approximations will then require $2x5x5 = 50$ scalar quantities.
\begin{sageblock}
xyk = [X[i](n+j)
for j in range(-2,3) for i in range(d)]
xyv = [var(X[i].name()+str(2+j))
for j in range(-2,3) for i in range(d)]
xykv = dict(zip(xyk,xyv))
xyvk = dict(zip(xyv,xyk))
xn = X[0](n).subs(xykv)
\end{sageblock}
\begin{dmath}
\sage{(n==xn,)}
\end{dmath}
\subsection{Quantum Force}
The Schiff and Poirier expression for the quantum force is the last term on the left of \eqref{eq18}. It can be rewritten as terms of difference operations as follows
\begin{sageblock}
R = fun(n) (vector([ (hbar^2/4/m) * sum( sum( sum( sum(
DP( K(n)[k,i] * K(n)[p,j] * DP( DM( K(n)[l,j],C[l] ),C[k] ),C[p] )
for p in range(d)) for k in range(d)) for j in range(d)) for l in range(d))
for i in range(d)]) )
\end{sageblock}
\begin{dmath}
\sage{ expand(R(n)[0]).subs(dets) }
\end{dmath}
We can compute the discretized quantum force as the negative gradient of the discretized quantum potential symbolically. We would like to compare this with the discretization of Poirier's expression for the force.
To get the corresponding expression for the force we sum the potential symbolically over a sufficiently large area and then differentiate by $x(n)$. Since the potential is local, involving only nearby worlds, the result is independent of the size of the area so long as the area is large enough to include all the neighbors of a given world at $n$.
\noindent
Gradients:
\begin{sageblock}
r = fun(n) (vector([ -sum(Q(n+i) for i in range(-2,3)
).subs(dets).subs(xykv).diff(xn).expand()
for k in range(d)]))
\end{sageblock}
\begin{dmath}
\sage{ expand(r(n).subs(xyvk)) }
\end{dmath}
with $r_2$ and $r_3$ the gradients of the 2nd and 3rd order terms of the potential, separately.
\begin{sageblock}
r2 = fun(n) (vector([ -sum(Q2(n+i) for i in range(-2,3)
).subs(dets).subs(xykv).diff(xn).expand()
for k in range(d)]))
\end{sageblock}
\begin{dmath}
\sage{ expand(r2(n).subs(xyvk)) }
\end{dmath}
\begin{sageblock}
r3 = fun(n) (vector([ -sum([Q3(n+i) for i in range(-2,3)]
).subs(dets).subs(xykv).diff(xn).expand()
for k in range(d)]))
\end{sageblock}
\begin{dmath}
\sage{ expand(r3(n).subs(xyvk)) }
\end{dmath}
Of course $r2(n)+r3(n)=r(n)$ is $\sage{r2(n)+r3(n)==r(n)}$.
Surprisingly, the force term from the 3rd order term is exactly -2 times the force term obtained from the 2nd order term so the difference between the force from just the 2nd order term so the force from the full expression for the quantum potential differs from the 2nd term by only a sign.
It is $\sage{r3(n)==-2*r2(n)}$ that $r3(n)= -2\ r2(n)$.
This result is the same as the expression we obtained directly by substituting difference operators for derivatives in Poirier's expression eq. (18) for the quantum force. We will see later that this is not the case in more than one dimension.
It is $ \sage{bool(factor(r(n))==factor(R(n).subs(dets).subs(xykv)))} $ that $r(n)==R(n)$
Hall's equation \eqref{eq24} can be written
\begin{sageblock}
sigma = fun(n) ( (1/(X[0](n)-X[0](n-1))^2) *
(1/(X[0](n+1)-X[0](n)) - 2/(X[0](n)-X[0](n-1)) + 1/(X[0](n-1)-X[0](n-2))) )
r_hall = fun(n) (hbar^2/4/m * (sigma(n+1) - sigma(n)))
\end{sageblock}
\begin{dmath}
\sage{ expand(r_hall(n)) }
\end{dmath}
It is $ \sage{bool(r(n)[0]==r_hall(n).subs(xykv))} $ that $rr=r_{hall}$.
Thus Hall's model of quantum mechanics as many interacting interacting classical worlds in one dimension follows directly from the approximation of Poirier's quantum mechanical equations of motion as difference equations with a certain choice of operators. Obviously this is not the only way to approximate Poirier's equations as difference equations.
Save these calculations for later.
\begin{sageblock}
Q_hall = Q(n).subs(dets)
R_hall = R(n).subs(dets)
xyv_hall = xyv
xykv_hall = xykv
\end{sageblock}
\section{Symmetric Difference Approximation}
The central difference approximation to this derivative is
\begin{sageblock}
def D(x,n):return x.subs(n==n+1)/2-x.subs(n==n-1)/2
\end{sageblock}
In this approximation we will see that each world interacts with its four neighbors to the left and right. In fact we may continue this process of approximation to higher orders with more neighbors but in all these Hall-like models this non-locality in phase space is always bounded. Perhaps most interesting form the point of view of efficient computation is the lowest order approximation given previously. But the surprise is that all of these approximations gives quantum mechanics in the limit of a very large number of worlds (i.e. a continuum) and are good approximations even for a very small number of worlds.
Repeating the computations above using a symmetric difference approximation to the derivatives we again find that the quantum force computed as the gradient of the discretized quantum potential is identical to the discretization of Poirier's expression for the force.
\begin{sageblock}
J = fun(n) (matrix([[D(E[j],C[i]) for i in range(d)] for j in range(d)]))
\end{sageblock}
\begin{equation} \sage{J(n)} \end{equation}
\begin{sageblock}
A = fun(n) (fix(J(n).adjoint()))
K = fun(n) (A(n)/J_(n))
\end{sageblock}
\begin{equation} \sage{K(n)} \end{equation}
\begin{sageblock}
_J = fun(n) (fix(J(n).determinant().expand()))
dets = {J_(n+i):_J(n+i) for i in range(-6,7)}
\end{sageblock}
\begin{equation} \sage{_J(n)} \end{equation}
\begin{sageblock}
Q = fun(n) ( -(hbar^2/4/m) *
sum( sum( sum(
(K(n)[k,j] * D( D( K(n)[l,j],C[l] ),C[k] ) +
1/2 * D(K(n)[l,j],C[l]) * D(K(n)[k,j],C[k]))
for k in range(d)) for j in range(d)) for l in range(d)) )
Q2 = fun(n) ( -(hbar^2/4/m) *
sum( sum( sum( (1/2 * D(K(n)[l,j],C[l]) * D(K(n)[k,j],C[k]))
for k in range(d)) for j in range(d)) for l in range(d)) )
Q3 = fun(n) ( -(hbar^2/4/m) *
sum( sum( sum( (K(n)[k,j] * D( D( K(n)[l,j],C[l] ),C[k] ))
for k in range(d)) for j in range(d)) for l in range(d)) )
\end{sageblock}
\begin{dmath}
\sage{ expand(factor(Q(n))) }
\end{dmath}
\begin{sageblock}
R = fun(n) (vector([ (hbar^2/4/m)*sum( sum( sum( sum(
D( K(n)[k,i] * K(n)[p,j] * D( D( K(n)[l,j],C[l] ),C[k] ),C[p] )
for p in range(d)) for k in range(d)) for j in range(d)) for l in range(d))
for i in range(d)]) )
\end{sageblock}
\begin{dmath}
\sage{ expand(R(n)[0].subs(dets)) }
\end{dmath}
\begin{sageblock}
xyk = [X[i](n+j) for j in range(-4,5) for i in range(d)]
xyv = [var(X[i].name()+str(5+j)) for j in range(-4,5) for i in range(d)]
xykv = dict(zip(xyk,xyv))
xn = X[0](n).subs(xykv)
\end{sageblock}
\begin{dmath}
\sage{(n==xn)}
\end{dmath}
The neighborhood for the symmetric difference operators is larger than previous case.
\begin{sageblock}
r = fun(n) (vector([-sum(Q(n+i) for i in range(-3,4)
).subs(dets).subs(xykv).diff(xn).expand()
for k in range(d)]))
r2 = fun(n) (vector([-sum(Q2(n+i) for i in range(-3,4)
).subs(dets).subs(xykv).diff(xn).expand()
for k in range(d)]))
r3 = fun(n) (vector([-sum([Q3(n+i) for i in range(-3,4)]
).subs(dets).subs(xykv).diff(xn).expand()
for k in range(d)]))
\end{sageblock}
It is $\sage{r3(n)==-2*r2(n)}$ that $r3(n)= -2\ r2(n)$.
It is $ \sage{bool(factor(r(n))==factor(R(n).subs(dets).subs(xykv)))} $ that $r(n)=R(n)$
This expression is the same as the expression we obtained directly by substituting difference operators for derivatives in Poirier's expression \eqref{eq18} for the quantum force.
Save these calculations for later.
\begin{sageblock}
Q_poirier = Q(n).subs(dets)
R_poirier = R(n).subs(dets)
xyv_poirer = xyv
xykv_poirier = xykv
\end{sageblock}
\section{Simulation}
Using the expressions derived above we can generate efficient numerical functions which we use later in determining the motion of a particle in many worlds simultaneously.
We will use Hall's difference approximation to Poirier's equations above for a numerical simulation of quantum motion in a small number of ``parallel'' worlds.
For efficiency we expression the following operations in ``vectorized'' form. First we need the difference operator
\begin{sageblock}
def dM(x,n):return shift(x,n) - shift(x,n-1)
\end{sageblock}
\subsection{Classical Potential}
Poirier's problem involves scattering a proton-mass particle from an Eckart potential slightly less than the particles incident energy.
\begin{sageblock}
alf = 2.5 ; x0=0 ; B = 0.0024
V_(x) = B /cosh(alf *(x-x0))^2
V = vectorize(fast_callable( V_(x), vars=[x], domain=RDF))
_ = plot(V,(-3,3),axes_labels=['distance','energy'],axes_labels_size=1,
legend_label='potential')
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Classical Potential}
\end{figure}
\subsection{Classical Force}
\begin{sageblock}
F = vectorize(fast_callable( -diff(V_(x),x), vars=[x], domain=RDF))
_ =plot(F,(-3,3),axes_labels=['distance','force'],axes_labels_size=1,
legend_label='force')
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Classical Force}
\end{figure}
\subsection{Quantum Potential}
\begin{sagesilent}[fancy]
def qq(hbar,m,x):
dx0 = dM(x,0)
dxp1 = dM(x,+1)
dxm1 = dM(x,-1)
return hbar^2/4/m*(-1/2/dxp1^2 + 3/2/dx0^2 - 1/dxm1/dx0)
\end{sagesilent}
\includesagecollection{fancy}
\subsection{Quantum Force}
In general the force is a vector but in the following we treat it as a single scalar quantity.
Vectorized Quantum Force
\begin{sagesilent}[fancy]
def ff(hbar,m,x):
dx0 = dM(x,0)
dxp1 = dM(x,+1)
dxp2 = dM(x,+2)
dxm1 = dM(x,-1)
return hbar^2/2/m*(-1/dxp1^3 + 1/2/dxp2/dxp1^2 + 1/dx0^3 - 1/2/dxp1/dx0^2 - 1/2/dxm1/dx0^2 + 1/2/dxp1^2/dx0)
\end{sagesilent}]
\includesagecollection{fancy}
\subsection{Initial Data}
\subsubsection{Spatial Distribution}
In order to compute the quantum force on the particles in world $n$ we introduce four widely separated fictitious particles in worlds to the left and right to represent open boundary conditions.
\begin{sagesilent}[fancy]
def boundary(x):
return concatenate((
array([-1e18,-1e14,-1e10,-1e6]),
x,
array([1e6,1e10,1e14,1e18])))[4:-4]
\end{sagesilent}
\includesagecollection{fancy}
For example consider the spatial distribution of a Gaussian ensemble of one particle in $N$ ``parallel'' worlds. Everything is in atomic units below, so $\hbar=1$.
\begin{sagesilent}[fancy]
N = 2000
var('alf,x0,m,v,x1')
model1={m:RDF(2000),alf:RDF(0.70),v:RDF(0.00164317),x0:RDF(-7.0)}
W(x)=abs((alf/pi)^(1/4)*exp(-(alf/2)*(x-x0)^2)*exp(I*m*v*x))^2
\end{sagesilent}
\includesagecollection{fancy}
\begin{equation}
\sage{W(x)}
\end{equation}
We may compute a uniform mapping into this distribution by inverting the cummulative distribution.
\begin{sagesilent}[fancy]
assume(alf>0)
erf0=integrate(W(x),x,-oo,x1).subs(model1)
y1=var('y1');inverse_erf=function('inverse_erf')
erfinv0=solve(
integrate(W(x),x,-oo,x1).subs(model1)==y1,x1)[0].rhs()
def erfinv1(x): return erfinv0.subs(y1==x).substitute_function(inverse_erf,erfinv)
\end{sagesilent}
\includesagecollection{fancy}
After adding the open boundary conditions, we can check the accuracy by comparing the discrete representation to the original distribution.
\begin{sageblock}
p0 = array([erfinv1((i+0.001)/(N-1+0.002)) for i in range(N)], dtype=rdf)
b0 = boundary(p0)
_ = (list_plot([[b0[i],2/N/(b0[i+1]-b0[i-1])] for i in range(4,len(b0)-4) ],
axes_labels=['location','density'], color='red',
legend_label='discrete')+
plot(W(x).subs(model1),(x,-15,5),
legend_label='continuous'))
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Initial Spatial Density}
\end{figure}
\subsubsection{Distribution of Velocity}
The particles have an identical initial velocity in each world of $\sage{v.subs(model1)}$.
\begin{sageblock}
v0=array([v.subs(model1) for i in range(N)],dtype=rdf)
\end{sageblock}
\subsection{Energy of the Ensemble}
\noindent
Total classical potential
\begin{sageblock}
def PU(m,x): return sum(V(i) for i in x)
\end{sageblock}
\noindent
Total kinetic energy
\begin{sageblock}
def KU(m,v): return RDF(0.5)*m*(v.dot(v))
\end{sageblock}
\noindent
Total quantum potential
\begin{sageblock}
def QU(m,hbar,x): return qq(m,hbar,x).sum()
\end{sageblock}
\subsection{Acceleration}
Acceleration is the combined effect of both classical and quantum forces.
\begin{sageblock}
def A(hbar,m,x): return (F(x) + ff(hbar,m,x))/m
\end{sageblock}
\subsection{Step Size Controller}
Continuous integrating step size controller \cite{hairer2005}
\begin{sagesilent}[fancy]
def G(a,v):
alpha = RDF(-100.0)
eps = RDF(10.0^-10)
return -alpha*(a.dot(v))/max(v.dot(v),eps)
\end{sagesilent}
\includesagecollection{fancy}
\subsection{Integration}
Integrate using the Störmer–Verlet algorithm with adaptive step size.
\begin{sagesilent}[fancy]
t_end = 11600; t_samples = 100; x_samples = 100
t_sample = t_end/t_samples
x_sample = max(1,int(N)/int(x_samples))
x_start = max(0,int(N-x_samples*x_sample)/int(2))
XS = range(x_start,N-x_start-1,x_sample)
ds0 = RDF(0.007)
dsn = 1
xb = boundary(p0)
while True:
try:
ds = ds0/dsn
rho = RDF(1.0)
dt = ds/rho
m0 = RDF(2000.0)
hbar0 = RDF(1.0)
x = boundary(p0); v = v0.copy(); a = A(hbar0,m0,x)
rho = rho - RDF(0.5)*G(a,v)*dt
t = 0; T = [t]
XX = {t:x[XS].copy()}; XV = {t:v[XS].copy()}
KK = KU(m0,v); PP = PU(m0,x); QQ = QU(hbar0,m0,x)
E1 = KK+PP+QQ
Rho = {t:rho}; TK = {t:KK}; TP = {t:PP}; TQ = {t:QQ}; E = {t:E1}
try:
while t<t_end:
print "t =", t, "rho =", rho
t1 = t + t_sample
while t<t1:
rho = rho + G(a,v)*dt
dt = ds/rho; t += dt
x += v*dt + 0.5*a*dt^2
v += 0.5*a*dt; a = A(hbar0,m0,x); v += 0.5*a*dt
if isnan(rho) or rho>100 or rho<0.01:
raise ValueError(
"Step control failed at %s. rho=%s"%(t,rho))
if (x[1:]-x[:N-1]).min()<0:
raise ValueError("crossing")
KK = KU(m0,v); PP = PU(m0,x); QQ = QU(hbar0,m0,x)
E2 = KK+PP+QQ
if abs(E1-E2)>0.01:
raise ValueError(
"Energy conservation bound failed at %s. Delta E:"\
"|%s| > 0.01."%(t,E1-E2))
E1 = E2
T += [t]; XX[t] = x[XS].copy(); XV[t] = v[XS].copy()
Rho[t] = rho; TK[t] = KK; TP[t] = PP; TQ[t] = QQ; E[t] = E1
except KeyboardInterrupt:
print "Interrupted at %s ..."%(t)
T += [t]; XX[t] = x[XS].copy(); XV[t] = v[XS].copy()
Rho[t] = rho; TK[t] = KK; TP[t] = PP; TQ[t] = QQ; E[t] = E1
tmax = t
break
except ValueError as msg:
print msg
dsn = dsn + 1
print "Trying a shorter initial step size: %s."%(ds0/dsn)
continue
print "t =", tmax, "rho =",rho
\end{sagesilent}
\includesagecollection{fancy}
The adaptation of the integration stepsize during the simulation is given by \textbf{\rm rho}. A value greater than 1 indicates a smaller stepsize.
\begin{sageblock}
_ = line2d([[t,Rho[t]] for t in T],axes_labels=['time','rho'])
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Step Density}
\end{figure}
Energy is exchanged between classical, quantum mechanical and kinetic forms due to the interaction of the particle with the potential barrier (in each world) as well as the interaction between worlds.
\begin{sageblock}
_ = (line2d([[t,TK[t]] for t in T], axes_labels=['time','energy'],
legend_label='kinetic', color='green') +
line2d([[t,TQ[t]] for t in T], axes_labels=['time','energy'],
legend_label='quantum potential',color='red') +
line2d([[t,TP[t]] for t in T], axes_labels=['time','energy'],
legend_label='classical potential',color='blue'))
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Quantum Potential, Classical Potential and Kinetic Energy}
\end{figure}
Conservation of energy is an important indicator of the quality of the numerical integration.
Note in particular how the changes in total energy over time remain well-bounded.
\begin{sageblock}
_ = line2d([[t,E[t]] for t in T],axes_labels=['time','energy'],
legend_label='total energy',color='black')
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Energy Conservation}
\end{figure}
The trajectory of the particle in each world is shown below. Notice how the trajectories do not cross, yet in some worlds the particle is scattered from the barrier while in others the particle tunnels across the barrier ``pushed'' by its counterpart in other worlds.
\begin{sageblock}
_ = (line([[t,XX[t].mean()] for t in T], color='black',
thickness=2, legend_label="average",
axes_labels=['time','location'], axes_labels_size=1)+
sum(line([[t,XX[t][i]] for t in T], color=hue((0.5*i)/len(XS)), alpha=0.5,
axes_labels=['time','location'], axes_labels_size=1)
for i in range(len(XS))))
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Trajectories}
\end{figure}
The distribution at the end of the simulation shows the reflected and transmitted "wave packets" separating from each other.
\begin{sageblock}
_ = list_plot([[x[i-1],2/N/(x[i+1]-x[i-1])] for i in range(1,N-1) ],
axes_labels=['location','density'])
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Final Spatial Density}
\end{figure}
Transmission probability
\begin{sageblock}
_ = line([[t,(XV[t]>0).mean()] for t in T ],
axes_labels=['time','transmission'])
\end{sageblock}
\begin{figure}[H] \centering
\sageplot[width=.9\textwidth]{_}
\caption{Evolution of Spatial Density}
\end{figure}
Final $\sage{(v>0).mean()}$.
\newpage
\begin{appendices}
\section{Sage Preliminaries}\label{SageAppendix}
It is convenient to define a compact notation for functions:
\includesagecollection{prelim}
\includecollection{prelim1}
\includesagecollection{prelim2}
This routine shifts a numpy array view left or right by $n$ cells.
\includesagecollection{shift}
\end{appendices}
\newpage
\listoffigures
\bibliographystyle{../bibstyles/utphys}
\noindent
\bibliography{../bibliography}
\end{document}