Will default to the trace inner product if nothing else.
"""
if (not x in self) or (not y in self):
- raise ArgumentError("arguments must live in this algebra")
+ raise TypeError("arguments must live in this algebra")
if self._inner_product is None:
return x.trace_inner_product(y)
else:
"""
P = self.parent()
if not other in P:
- raise ArgumentError("'other' must live in the same algebra")
+ raise TypeError("'other' must live in the same algebra")
return P.inner_product(self, other)
"""
if not other in self.parent():
- raise ArgumentError("'other' must live in the same algebra")
+ raise TypeError("'other' must live in the same algebra")
A = self.operator_matrix()
B = other.operator_matrix()
# TODO: we can do better once the call to is_invertible()
# doesn't crash on irregular elements.
#if not self.is_invertible():
- # raise ArgumentError('element is not invertible')
+ # raise ValueError('element is not invertible')
# We do this a little different than the usual recursive
# call to a finite-dimensional algebra element, because we
if other is None:
other=self
elif not other in self.parent():
- raise ArgumentError("'other' must live in the same algebra")
+ raise TypeError("'other' must live in the same algebra")
L = self.operator_matrix()
M = other.operator_matrix()
Return the trace inner product of myself and ``other``.
"""
if not other in self.parent():
- raise ArgumentError("'other' must live in the same algebra")
+ raise TypeError("'other' must live in the same algebra")
return (self*other).trace()
"""
n = M.nrows()
if M.ncols() != n:
- raise ArgumentError("the matrix 'M' must be square")
+ raise ValueError("the matrix 'M' must be square")
field = M.base_ring()
blocks = []
for z in M.list():
"""
n = ZZ(M.nrows())
if M.ncols() != n:
- raise ArgumentError("the matrix 'M' must be square")
+ raise ValueError("the matrix 'M' must be square")
if not n.mod(2).is_zero():
- raise ArgumentError("the matrix 'M' must be a complex embedding")
+ raise ValueError("the matrix 'M' must be a complex embedding")
F = QuadraticField(-1, 'i')
i = F.gen()