I am pretty new to Python and am trying to use some code I found online for an undergrad physics project. This code includes the clifford library, which is causing my problems. Given the syntax of the code and the fact that I installed it using pip3, it should be Python 3.
After running this code:
from __future__ import division
import numpy
from clifford import *
layout, blades = Cl(3,0)
e0, e1, e2 = [blades['e%i'%k] for k in range(3)]
I = (e0^e1^e2)
I get the following traceback:
Traceback (most recent call last):
File "/Users/melissa/Documents/Fodje.py", line 5, in <module>
e0, e1, e2 = [blades['e%i'%k] for k in range(3)]
File "/Users/melissa/Documents/Fodje.py", line 5, in <listcomp>
e0, e1, e2 = [blades['e%i'%k] for k in range(3)]
KeyError: 'e0'
I asked my CS professor and he said there is likely a problem with the indexing in blades
.
Can anyone help me in trying to troubleshoot this issue? Thanks!