CoCalc Shared FilesUse_Sage_in_Jupyter_notebook_on_SageMathCloud.ipynb
Authors: David Cyganski, Bill Page
Views : 8
Description: Jupyter notebook Use_Sage_in_Jupyter_notebook_on_SageMathCloud.ipynb

### 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 [1]:
%display latex

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

$\left({\hbar}, {\mu}\right)$
In [3]:
sin(x)

$\sin\left(x\right)$
In [4]:
1+1

$2$
In [5]:
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)

$\left[x_{n,m}, y_{n,m}\right]$
In [6]:
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 [7]:
Jnm = matrix(map(lambda e:[Dminus(e,i) for i in range(d)],Enm));show(Jnm)

$\left(\begin{array}{rr} -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} \end{array}\right)$
In [9]:
# inverse Jacobian
Knm = matrix(map(lambda x: map(lambda y:y.normalize(),x),Jnm^(-1)))
show(Knm)

$\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)$

# Heading - double click to edit.

In [ ]: