Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sage/rings/number_field/number_field_element_quadratic.pyx:7: DeprecationWarning: invalid escape sequence '\Q'
- """
- sage/rings/number_field/number_field_element_quadratic.pyx:7: DeprecationWarning: invalid escape sequence '\Q'
- """
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- Cell In [5], line 1
- ----> 1 QuaternionOrder(A, [Integer(1), Integer(3)*i, Integer(1)/Integer(2)*w + Integer(1)/Integer(2) + (Integer(3)/Integer(2)*w + Integer(1))*i + Integer(1)/Integer(2)*j, Integer(1)/Integer(2)*w + (Integer(3)/Integer(2)*w - Integer(1)/Integer(2))*i + Integer(1)/Integer(2)*k])
- File /usr/lib/python3.10/site-packages/sage/algebras/quatalg/quaternion_algebra.py:1417, in QuaternionOrder.__init__(self, A, basis, check)
- 1414 raise ValueError("lattice must contain 1")
- 1416 # check if multiplicatively closed
- -> 1417 Y = matrix(QQ, 16, 4, [(x*y).coefficient_tuple()
- 1418 for x in basis for y in basis])
- 1419 X = M.solve_left(Y)
- 1420 if any(a not in O for x in X for a in x):
- File /usr/lib/python3.10/site-packages/sage/matrix/constructor.pyx:643, in sage.matrix.constructor.matrix (build/cythonized/sage/matrix/constructor.c:2731)()
- 641 """
- 642 immutable = kwds.pop('immutable', False)
- --> 643 M = MatrixArgs(*args, **kwds).matrix()
- 644 if immutable:
- 645 M.set_immutable()
- File /usr/lib/python3.10/site-packages/sage/matrix/args.pyx:667, in sage.matrix.args.MatrixArgs.matrix (build/cythonized/sage/matrix/args.c:8012)()
- 665 break
- 666 else:
- --> 667 M = self.space(self, coerce=convert)
- 668
- 669 # Also store the matrix to support multiple calls of matrix()
- File /usr/lib/python3.10/site-packages/sage/structure/parent.pyx:900, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9485)()
- 898 return mor._call_(x)
- 899 else:
- --> 900 return mor._call_with_args(x, args, kwds)
- 901
- 902 raise TypeError(_LazyString(_lazy_format, ("No conversion defined from %s to %s", R, self), {}))
- File /usr/lib/python3.10/site-packages/sage/structure/coerce_maps.pyx:180, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args (build/cythonized/sage/structure/coerce_maps.c:5265)()
- 178 print(type(C), C)
- 179 print(type(C._element_constructor), C._element_constructor)
- --> 180 raise
- 181
- 182
- File /usr/lib/python3.10/site-packages/sage/structure/coerce_maps.pyx:170, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args (build/cythonized/sage/structure/coerce_maps.c:5055)()
- 168 return C._element_constructor(x)
- 169 else:
- --> 170 return C._element_constructor(x, **kwds)
- 171 else:
- 172 if len(kwds) == 0:
- File /usr/lib/python3.10/site-packages/sage/matrix/matrix_space.py:925, in MatrixSpace._element_constructor_(self, entries, **kwds)
- 815 def _element_constructor_(self, entries, **kwds):
- 816 """
- 817 Construct an element of ``self`` from ``entries``.
- 818
- (...)
- 923 False
- 924 """
- --> 925 return self.element_class(self, entries, **kwds)
- File /usr/lib/python3.10/site-packages/sage/matrix/matrix_rational_dense.pyx:192, in sage.matrix.matrix_rational_dense.Matrix_rational_dense.__init__ (build/cythonized/sage/matrix/matrix_rational_dense.cpp:4962)()
- 190 ma = MatrixArgs_init(parent, entries)
- 191 cdef Rational z
- --> 192 for t in ma.iter(coerce, True):
- 193 se = <SparseEntry>t
- 194 z = <Rational>se.entry
- File /usr/lib/python3.10/site-packages/sage/matrix/args.pyx:521, in iter (build/cythonized/sage/matrix/args.c:6532)()
- 519 x = next(row)
- 520 if convert and self.need_to_convert(x):
- --> 521 x = self.base(x)
- 522 if sparse:
- 523 yield make_SparseEntry(i, j, x)
- File /usr/lib/python3.10/site-packages/sage/structure/parent.pyx:898, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9458)()
- 896 if mor is not None:
- 897 if no_extra_args:
- --> 898 return mor._call_(x)
- 899 else:
- 900 return mor._call_with_args(x, args, kwds)
- File /usr/lib/python3.10/site-packages/sage/structure/coerce_maps.pyx:161, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4734)()
- 159 print(type(C), C)
- 160 print(type(C._element_constructor), C._element_constructor)
- --> 161 raise
- 162
- 163 cpdef Element _call_with_args(self, x, args=(), kwds={}):
- File /usr/lib/python3.10/site-packages/sage/structure/coerce_maps.pyx:156, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4626)()
- 154 cdef Parent C = self._codomain
- 155 try:
- --> 156 return C._element_constructor(x)
- 157 except Exception:
- 158 if print_warnings:
- File /usr/lib/python3.10/site-packages/sage/rings/rational.pyx:538, in sage.rings.rational.Rational.__init__ (build/cythonized/sage/rings/rational.cpp:6529)()
- 536 """
- 537 if x is not None:
- --> 538 self.__set_value(x, base)
- 539
- 540 def __reduce__(self):
- File /usr/lib/python3.10/site-packages/sage/rings/rational.pyx:626, in sage.rings.rational.Rational.__set_value (build/cythonized/sage/rings/rational.cpp:7657)()
- 624
- 625 elif hasattr(x, "_rational_"):
- --> 626 set_from_Rational(self, x._rational_())
- 627
- 628 elif isinstance(x, tuple) and len(x) == 2:
- File /usr/lib/python3.10/site-packages/sage/rings/number_field/number_field_element_quadratic.pyx:1713, in sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic._rational_ (build/cythonized/sage/rings/number_field/number_field_element_quadratic.cpp:15940)()
- 1711 cdef Rational res
- 1712 if mpz_cmp_ui(self.b, 0)!=0:
- -> 1713 raise TypeError("Unable to coerce %s to a rational" % self)
- 1714 else:
- 1715 res = <Rational>Rational.__new__(Rational)
- TypeError: Unable to coerce 1/2*w + 1/2 to a rational
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement