Vector Calculations in Python
I think your scalar product calculation is wrong…scalar product should yield a real number, not a vector. Other calculations use this, so those are also broken.
If you are looking for a simple script to do vector calculations in python, you can use this one. Enjoy ;) I didn't find some other easy to use scripts, so created my own. You can do these basic calculations with the vector class

sum 
norm
scalar product
cross product
etc