Added coordinates computation in h0

This commit is contained in:
Montessinos Mickael Gerard Bernard 2024-03-07 13:51:27 +02:00
parent 9a51dfff7c
commit b58d7ab874
2 changed files with 36 additions and 2 deletions

View File

@ -1013,4 +1013,4 @@ def full_rank_matrix_in_completion(mat, place=None, pi=None):
row = [exps[i][j].coefficient(vals[i] + ell) for j in range(s)]
N = insert_row(N, (i+1)*(ell+1) - 1, row)
ell += 1
return N
return N, Kp, vals

View File

@ -144,6 +144,9 @@ class VectorBundle(SageObject):
else:
self._vector_bundle_from_data(function_field, ideals,
g_finite,g_infinite)
self._h0_matrix = None
self._h0_Kp = None
self._h0_vs = None
def __hash__(self):
return hash((tuple(self._ideals),
@ -949,7 +952,7 @@ class VectorBundle(SageObject):
dual_matrix = matrix([h1_dual_bundle._matrix_to_vector(mat)
for mat in h1_dual]).transpose()
zero_rows = [i for i, row in enumerate(dual_matrix) if row == 0]
n_matrix = function_field_utility.full_rank_matrix_in_completion(
n_matrix, _, _ = function_field_utility.full_rank_matrix_in_completion(
dual_matrix,
place_0,
pi_0)
@ -1043,6 +1046,36 @@ class VectorBundle(SageObject):
for mat in ext_dual]
return ext_group.extension(form)
def coordinates_in_h0(self, f):
r"""
Return a vector of coordinates of ``f`` in the basis returned
by ``self.h0()``
EXAMPLES ::
sage: from vector_bundle import VectorBundle
sage: F.<x> = FunctionField(GF(7))
sage: R.<y> = F[]
sage: K.<y> = F.extension(y^2 - x^3 - x)
sage: ideals = [P.prime_ideal() for P in K.places_finite()[:2]]
sage: g_finite = matrix([[1,1 / (x**5 + y)],[2, y]])
sage: g_infinite = matrix([[x, 1], [2, y**3]])
sage: V = VectorBundle(K, ideals, g_finite, g_infinite)
sage: h0 = V.h0()
sage: v = sum([i*e for i, e in enumerate(h0)])
sage: V.coordinates_in_h0(v)
(0, 1, 2, 3, 4, 5)
"""
if self._h0_matrix is None:
mat = matrix(self._function_field, self.h0()).transpose()
self._h0_matrix, self._h0_Kp, self._h0_vs =\
function_field_utility.full_rank_matrix_in_completion(mat)
ell = self._h0_matrix.nrows() // self.rank()
series = [self._h0_Kp(c) for c in f]
v = vector(sum([[s.coefficient(val + j) for j in range(ell)]
for s, val in zip(series, self._h0_vs)],[]))
return self._h0_matrix.solve_right(v)
def _isomorphism_to_large_field(self, other, proba=10^-20):
r"""
Return an isomorphism from self to other if it exists and None otherwise.
@ -1052,6 +1085,7 @@ class VectorBundle(SageObject):
``len(self.end().h0())``.
"""
def isomorphism_to(self, other):
r"""
Return an isomorphism from self to other if it exists and None otherwise