X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feuclidean_jordan_algebra.py;h=ca344edc709352dea2d1940a7646e058066d4b8d;hb=388d1430380c72c14da47bfab73f7365fa0977f7;hp=7c1f249b4632766e4b1808acc0275b2e55b8b506;hpb=7668f7ca04051e748cc072e6cf3e637e0b4c8861;p=sage.d.git diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 7c1f249..ca344ed 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -96,7 +96,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): 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: @@ -259,7 +259,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): """ 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) @@ -294,7 +294,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): """ 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() @@ -384,7 +384,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): # 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 @@ -740,7 +740,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): 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() @@ -903,7 +903,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): 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() @@ -1119,7 +1119,7 @@ def _embed_complex_matrix(M): """ 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(): @@ -1147,9 +1147,9 @@ def _unembed_complex_matrix(M): """ 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()