-
-
Notifications
You must be signed in to change notification settings - Fork 642
Closed
Labels
Description
Docstring:
diagonal matrix with diagonal entries
2
,2a
,2b
,2ab
Implementation: diagonal_matrix(self.base_ring(), [2, -2 * a, -2 * b, 2 * a * b])
sage/src/sage/algebras/quatalg/quaternion_algebra.py
Lines 539 to 561 in d617df4
def inner_product_matrix(self): | |
""" | |
Return the inner product matrix associated to ``self``. | |
This is the | |
Gram matrix of the reduced norm as a quadratic form on ``self``. | |
The standard basis `1`, `i`, `j`, `k` is orthogonal, so this matrix | |
is just the diagonal matrix with diagonal entries `2`, `2a`, `2b`, | |
`2ab`. | |
EXAMPLES:: | |
sage: Q.<i,j,k> = QuaternionAlgebra(-5,-19) | |
sage: Q.inner_product_matrix() | |
[ 2 0 0 0] | |
[ 0 10 0 0] | |
[ 0 0 38 0] | |
[ 0 0 0 190] | |
""" | |
a, b = self._a, self._b | |
M = diagonal_matrix(self.base_ring(), [2, -2 * a, -2 * b, 2 * a * b]) | |
M.set_immutable() | |
return M |
Checklist
- I have searched the existing issues for a bug report that matches the one I want to file, without success.
- I have read the documentation and troubleshoot guide