1 | initial version |
Not sure but maybe you need to convert to matrix beforehand? If I append zero to the gravity vector I get
sage: gravity = vector([0, 0, 1, 0])
sage: a.matrix() * gravity * a.conjugate().matrix()
(-c^2*d*a2*a4 - c^2*a2*a4 - d*a1*a3 + a1*a3, c*d*a2*a3 + c*a1*a4 + d*a1*a4 - a2*a3, -c^2*a2^2 - c^2*a4^2 + a1^2 - a3^2, -c*a1*a2 - c*a3*a4 + a1*a2 - a3*a4)