Skip to content

btquotient ValueError: negative valuation #40209

@Eloitor

Description

@Eloitor

Steps To Reproduce

sage: X = BruhatTitsQuotient(7, 5*17*13)
sage: X
Quotient of the Bruhat Tits tree of GL_2(QQ_7) with discriminant 5 * 13 * 17 and level 1
sage: X.get_maximal_order()
Order of Quaternion Algebra (-7, -1105) with base ring Rational Field with basis (1, 1/2 + 1/2*i, j, 1/2 + 1/14*i + 1/2*j + 1/14*k)
sage: X.plot()

Expected Behavior

A plot of the graph of the btquotient is shown.

Actual Behavior

I get the following ValueError:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/modular/btquotients/btquotient.py:2040, in BruhatTitsQuotient.get_graph(self)
   2039 try:
-> 2040     return self._S
   2041 except AttributeError:

AttributeError: 'BruhatTitsQuotient' object has no attribute '_S'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In[3], line 1
----> 1 X.plot()

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/modular/btquotients/btquotient.py:2075, in BruhatTitsQuotient.plot(self, *args, **kwargs)
   2063 def plot(self, *args, **kwargs):
   2064     r"""
   2065     Plot the quotient graph.
   2066
   (...)   2073         Graphics object consisting of 17 graphics primitives
   2074     """
-> 2075     S = self.get_graph()
   2076     vertex_colors = {}
   2077     v0 = Matrix(ZZ, 2, 2, [1, 0, 0, 1])

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/modular/btquotients/btquotient.py:2042, in BruhatTitsQuotient.get_graph(self)
   2040     return self._S
   2041 except AttributeError:
-> 2042     self._compute_quotient()
   2043     return self._S

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/modular/btquotients/btquotient.py:3533, in BruhatTitsQuotient._compute_quotient(self, check)
   3531 num_verts = 0
   3532 num_edges = 0
-> 3533 self.get_embedding_matrix(prec=3)
   3534 p = self._p
   3535 v0 = Vertex(p, num_verts, self._Mat_22([1, 0, 0, 1]),
   3536             determinant=1, valuation=0)

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/modular/btquotients/btquotient.py:2442, in BruhatTitsQuotient.get_embedding_matrix(self, prec, exact)
   2440 if prec > self._prec:
   2441     verbose('self._prec = %s, prec = %s' % (self._prec, prec))
-> 2442     Iotamod = self._compute_embedding_matrix(prec)
   2443     self._Iotainv_lift = Iotamod.inverse().lift()
   2444     self._Iota = Matrix(self._R, 4, 4, [Iotamod[ii, jj]
   2445                                         for ii in range(4)
   2446                                         for jj in range(4)])

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/modular/btquotients/btquotient.py:2277, in BruhatTitsQuotient._compute_embedding_matrix(self, prec, force_computation)
   2274 phi = self._local_splitting_map(prec)
   2275 B = self.get_eichler_order_basis()
   2276 return Matrix(Zmod(self._p ** prec), 4, 4,
-> 2277               [phi(B[kk])[ii, jj] for ii in range(2)
   2278                for jj in range(2) for kk in range(4)])

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/modular/btquotients/btquotient.py:2176, in BruhatTitsQuotient._local_splitting_map.<locals>.phi(q)
   2174 R = I.parent()
   2175 v = q.coefficient_tuple()
-> 2176 return R(v[0] + I * v[1] + J * v[2] + K * v[3])

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/structure/parent.pyx:900, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:12762)()
    898 if mor is not None:
    899     if no_extra_args:
--> 900         return mor._call_(x)
    901     else:
    902         return mor._call_with_args(x, args, kwds)

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/structure/coerce_maps.pyx:164, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:6979)()
    162             print(type(C), C)
    163             print(type(C._element_constructor), C._element_constructor)
--> 164         raise
    165
    166 cpdef Element _call_with_args(self, x, args=(), kwds={}):

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/structure/coerce_maps.pyx:159, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:6871)()
    157 cdef Parent C = self._codomain
    158 try:
--> 159     return C._element_constructor(x)
    160 except Exception:
    161     if print_warnings:

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/matrix/matrix_space.py:1172, in MatrixSpace._element_constructor_(self, entries, **kwds)
   1054 def _element_constructor_(self, entries, **kwds):
   1055     """
   1056     Construct an element of ``self`` from ``entries``.
   1057
   (...)   1170         False
   1171     """
-> 1172     return self.element_class(self, entries, **kwds)

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/matrix/matrix_generic_dense.pyx:82, in sage.matrix.matrix_generic_dense.Matrix_generic_dense.__init__ (build/cythonized/sage/matrix/matrix_generic_dense.c:5911)()
     80     """
     81     ma = MatrixArgs_init(parent, entries)
---> 82     self._entries = ma.list(coerce)
     83
     84 cdef Matrix_generic_dense _new(self, Py_ssize_t nrows, Py_ssize_t ncols):

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/matrix/args.pyx:872, in sage.matrix.args.MatrixArgs.list (build/cythonized/sage/matrix/args.c:15065)()
    870             L = L[:]
    871 else:
--> 872     L = list(self.iter(convert))
    873
    874 cdef long N = self.nrows * self.ncols

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/matrix/args.pyx:651, in iter (build/cythonized/sage/matrix/args.c:13569)()
    649 x = m[i, j]
    650 if convert and self.need_to_convert(x):
--> 651     x = self.base(x)
    652 if sparse:
    653     yield make_SparseEntry(i, j, x)

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/structure/parent.pyx:900, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:12762)()
    898 if mor is not None:
    899     if no_extra_args:
--> 900         return mor._call_(x)
    901     else:
    902         return mor._call_with_args(x, args, kwds)

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/structure/coerce_maps.pyx:164, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:6979)()
    162             print(type(C), C)
    163             print(type(C._element_constructor), C._element_constructor)
--> 164         raise
    165
    166 cpdef Element _call_with_args(self, x, args=(), kwds={}):

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/structure/coerce_maps.pyx:159, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:6871)()
    157 cdef Parent C = self._codomain
    158 try:
--> 159     return C._element_constructor(x)
    160 except Exception:
    161     if print_warnings:

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/categories/sets_cat.py:1011, in Sets.ParentMethods._element_constructor_from_element_class(self, *args, **keywords)
    991 def _element_constructor_from_element_class(self, *args, **keywords):
    992     """
    993     The default constructor for elements of this parent ``self``.
    994
   (...)   1009         <class 'sage.categories.examples.sets_cat.PrimeNumbers_Inherits_with_category.element_class'>
   1010     """
-> 1011     return self.element_class(self, *args, **keywords)

File /private/var/tmp/sage-10.6-current/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/sage/rings/padics/padic_template_element.pxi:166, in sage.rings.padics.padic_capped_relative_element.pAdicTemplateElement.__init__ (build/cythonized/sage/rings/padics/padic_capped_relative_element.c:14337)()
    164 val = get_ordp(x, self.prime_pow)
    165 if val < 0 and self.prime_pow.in_field == 0:
--> 166     raise ValueError("negative valuation")
    167 xprec = get_preccap(x, self.prime_pow)
    168 self._set(x, val, xprec, absprec, relprec)

ValueError: negative valuation

Additional Information

The issue is caused because 7 is in the denominator of the basis of the maximal order.

Environment

  • OS: MacOS 15.5
  • Sage Version: 10.6

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions