diff --git a/src/sage/algebras/clifford_algebra.py b/src/sage/algebras/clifford_algebra.py index 8943f248b71..3ad111cc36a 100644 --- a/src/sage/algebras/clifford_algebra.py +++ b/src/sage/algebras/clifford_algebra.py @@ -180,7 +180,7 @@ def list(self): sage: elt.list() [(1, 5), (01, 1)] """ - return sorted(self._monomial_coefficients.items(), key=lambda m_c : (-len(m_c[0]), m_c)) + return sorted(self._monomial_coefficients.items(), key=lambda m : (-len(m[0]), list(m[0]))) def support(self): """ @@ -197,7 +197,7 @@ def support(self): sage: elt.support() [1, 01] """ - return sorted(self._monomial_coefficients.keys(), key=lambda x: (-len(x), x)) + return sorted(self._monomial_coefficients.keys(), key=lambda x: (-len(x), list(x))) def reflection(self): r""" @@ -545,8 +545,7 @@ def __init__(self, Q, names, category=None): sage: Q = QuadraticForm(ZZ, 9) sage: Cl = CliffordAlgebra(Q) sage: ba = Cl.basis().keys() - sage: all( tuple(sorted(S)) in ba - ....: for S in Subsets(range(9)) ) + sage: all(FrozenBitset(format(i,'b')[::-1]) in ba for i in range(2**9)) True """ self._quadratic_form = Q @@ -583,6 +582,8 @@ def _repr_term(self, m): sage: Cl. = CliffordAlgebra(Q) sage: Cl._repr_term((0,2)) 'x*z' + sage: Cl._repr_term(FrozenBitset('101')) + 'x*z' sage: Cl._repr_term(()) '1' sage: Cl._repr_term((1,))