From 5afa0afc19e6a4695687ea9f0c26fc531e18e5b8 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 2 Dec 2020 09:07:08 -0500 Subject: [PATCH] eja: check that the basis is rational when it's supposed to be. --- mjo/eja/eja_algebra.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.43.2