From: Michael Orlitzky Date: Wed, 2 Dec 2020 14:07:08 +0000 (-0500) Subject: eja: check that the basis is rational when it's supposed to be. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=5afa0afc19e6a4695687ea9f0c26fc531e18e5b8;p=sage.d.git eja: check that the basis is rational when it's supposed to be. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index ec3dd11..70be6ed 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1165,6 +1165,12 @@ class RationalBasisEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebr check_field=True, check_axioms=True): + if check_field: + # Abuse the check_field parameter to check that the entries of + # out basis (in ambient coordinates) are in the field QQ. + if not all( all(b_i in QQ for b_i in b.list()) for b in basis ): + raise TypeError("basis not rational") + n = len(basis) vector_basis = basis