CoCalc Public FilesUse_Sage_in_Jupyter_notebook_on_SageMathCloud.html
Authors: David Cyganski, Bill Page
Views : 50
Description: Jupyter html version of Use_Sage_in_Jupyter_notebook_on_SageMathCloud.ipynb
Compute Environment: Ubuntu 18.04 (Deprecated)
Use_Sage_in_Jupyter_notebook_on_SageMathCloud

### From Poirier's Bohmian Mechanics without Wavefunctions to Hall's Many Interacting Worlds in More Than One Dimension¶

Ref:

1. Quantum Mechanics Without Wavefunctions
 Jeremy Schiff and Bill Poirier
J. Chem. Phys. 136, 031102 (2012)


2. Quantum Phenomena Modeled by Interactions between Many Classical Worlds
 Michael J. W. Hall Dirk-André Deckert and Howard M. Wiseman,
PHYSICAL REVIEW X 4, 041013 (23 October 2014)


3. Verlet integration (Wikipedia)

4. Explicit, Time Reversible, Adaptive Step Size Control
 Ernst Hairer and Gustaf Söderlind
SIAM Journal on Scientific Computing. 2005, vol. 26, no. 6, p. 1838-1851
In [2]:
%load_ext sage

In [3]:
from numpy import array,concatenate,isnan
from mpmath import erfinv
hbar=var('hbar',latex_name='\\hbar')
mu=var('mu',latex_name='\mu')

In [4]:
vars = ['x','y']; d = len(vars)
def argscript(self, *args): return "%s_{%s}"%(self.name(),','.join(map(repr, args)))
X = map(lambda nam:function(nam, print_latex_func=argscript),vars); x,y = X
n,m = var('n,m'); ind=[n,m]
# position of particle in world (n,m)
Enm=map(lambda x:x(*ind),X);show(Enm)

[x(n, m), y(n, m)]

In [5]:
def Dminus(x,i):return(x-x.subs(ind[i]==ind[i]-1))
def Dplus(x,i):return(x.subs(ind[i]==ind[i]+1)-x)

In [6]:
Jnm = matrix(map(lambda e:[Dminus(e,i) for i in range(d)],Enm));show(Jnm)

[-x(n - 1, m) + x(n, m) -x(n, m - 1) + x(n, m)]
[-y(n - 1, m) + y(n, m) -y(n, m - 1) + y(n, m)]

In [8]:
# inverse Jacobian
Knm = matrix(map(lambda x: map(lambda y:y.normalize(),x),Jnm^(-1)))
show(Knm)

Out[8]:
\left(\begin{array}{rr}
\frac{y_{n,m - 1} - y_{n,m}}{x_{n,m - 1} y_{n - 1,m} - x_{n,m} y_{n - 1,m} - x_{n - 1,m} y_{n,m - 1} + x_{n,m} y_{n,m - 1} + x_{n - 1,m} y_{n,m} - x_{n,m - 1} y_{n,m}} & -\frac{x_{n,m - 1} - x_{n,m}}{x_{n,m - 1} y_{n - 1,m} - x_{n,m} y_{n - 1,m} - x_{n - 1,m} y_{n,m - 1} + x_{n,m} y_{n,m - 1} + x_{n - 1,m} y_{n,m} - x_{n,m - 1} y_{n,m}} \\
-\frac{y_{n - 1,m} - y_{n,m}}{x_{n,m - 1} y_{n - 1,m} - x_{n,m} y_{n - 1,m} - x_{n - 1,m} y_{n,m - 1} + x_{n,m} y_{n,m - 1} + x_{n - 1,m} y_{n,m} - x_{n,m - 1} y_{n,m}} & \frac{x_{n - 1,m} - x_{n,m}}{x_{n,m - 1} y_{n - 1,m} - x_{n,m} y_{n - 1,m} - x_{n - 1,m} y_{n,m - 1} + x_{n,m} y_{n,m - 1} + x_{n - 1,m} y_{n,m} - x_{n,m - 1} y_{n,m}}
\end{array}\right)
In [ ]: