I have some concerns about certain results I saw in my initial tests of the Gaigen code (via python). Any problems should be simple enough to diagnose.
In [2]:
import spacetime
First, construct the usual basis vectors
In [3]:
t = spacetime.mv(); x = spacetime.mv(); y=spacetime.mv(); z=spacetime.mv();
t.set_gamma_0(1); x.set_gamma_1(1); y.set_gamma_2(1); z.set_gamma_3(1);
Next, look at the various products between them
In [4]:
names = ['t','x','y','z']
for i,v in enumerate([t,x,y,z]):
for j,w in enumerate([t,x,y,z]):
print("{0}%{1}={2}, {0}^{1}={3}, {0}*{1}={4}".format(names[i], names[j], v%w, v^w, v*w))
That all looks good. But the problems I noticed seemed to have to do with exp. So let's try out some important operations.
In [5]:
B = spacetime.mv();
B.set_gamma_1_gamma_2(pi/4.)
R = spacetime.exp(-B)
print(R)
In [6]:
for v in [t,x,y,z]:
print(R*v*spacetime.reverse(R))
Here, $R$ represents a rotation by $\pi/2$ about the $z$ axis. And we set that it behaves appropriately when rotating any of the basis vectors. Let's see if we just combine any two of the basis vectors.
In [7]:
for i,v in enumerate([t,x,y,z]):
for j,w in enumerate([t,x,y,z]):
u = (v+w)/sqrt(2)
print("v=({0}+{1})/sqrt(2)={2}\tR*u*Rbar={3}".format(names[i], names[j], u, R*u*spacetime.reverse(R)))
These all look fine to me.
In [8]:
for v in [t,x,y,z]:
print(spacetime.norm(v))
print(spacetime.norm2(v))
In [9]:
beta = 0.5
alpha = arctanh(beta)
gamma = 1./sqrt(1-beta**2)
B = spacetime.mv();
B.set_gamma_0_gamma_3(alpha/2.)
R = spacetime.exp(-B)
print(B)
print(R)
In [10]:
alpha
Out[10]:
In [11]:
cosh(-alpha/2.),sinh(-alpha/2.)
Out[11]:
In [12]:
I = spacetime.mv()
I.set_gamma_0_gamma_1_gamma_2_gamma_3(1.0)
print(exp(1.j))
print(spacetime.exp(I))
print(exp(1.j*pi/4.))
print(spacetime.exp(I*pi/4.))
In [13]:
tmp = spacetime.mv()
tmp.set_scalar(1.0/sqrt(2)).set_gamma_0_gamma_1_gamma_2_gamma_3(1.0/sqrt(2))
print(tmp)
print(exp(1./sqrt(2)+1.j/sqrt(2)))
print(spacetime.exp(tmp))
That's way wrong... I don't know what to make of that. I even tried the "Euclidean-metric" version of the exponential.
In [15]:
I*I*I
Out[15]:
In [16]:
tmp*tmp
Out[16]:
In [17]:
tmp2= 1./sqrt(2)+1.j/sqrt(2)
In [18]:
tmp2*tmp2
Out[18]:
In [19]:
from math import factorial
def powtmp(tmp,i):
c=spacetime.mv()
c.set_scalar(1.0)
for i in range(i):
c = c*tmp
return c
In [20]:
[powtmp(tmp,i)/factorial(i) for i in range(12)]
exptmp = spacetime.mv()
for i in range(18):
exptmp = exptmp + powtmp(tmp,i)/factorial(i)
exptmp
Out[20]:
In [21]:
exp(1./sqrt(2)+1.j/sqrt(2))
Out[21]:
In [22]:
tmp*spacetime.reverse(tmp)
Out[22]:
In [23]:
I*spacetime.reverse(I)
Out[23]:
In [24]:
spacetime.norm2(x^y)
Out[24]:
In [27]:
spacetime.gradeInvolution(I)
Out[27]:
Okay, so exponentials involving the pseudoscalar aren't going to work. The reason is that the logic Gaigen uses depends on the norm and/or norm2. Now, norm2 is defined as $\left\langle X\, \tilde{X} \right\rangle_0$. But $I$ is invariant under reversal, whereas any given bivector, for example, is not. So we can expect different results from the logic. Of course, the exponential is defined without reference to a reverse, so the results for $I$ and a spatial bivector should actually be identical, except that the bivector should be replaced by the $I$. But this will not be the case with the code produced by Gaigen.