Implemented wedderburn malcev complement

This commit is contained in:
Montessinos Mickael Gerard Bernard 2024-03-08 18:10:41 +02:00
parent 8cfe612220
commit 9c6e8270e4
4 changed files with 114 additions and 28 deletions

View File

@ -120,22 +120,27 @@ def atiyah_bundle(field, rank, degree, base=None):
if degree < 0:
return atiyah_bundle(field, rank, -degree, base).dual()
divisor = field.places_infinite()[0].divisor()
gcd = _euclid(rank, degree)
plan = [(i % 2,q) for i,(_, _, q, _) in enumerate(gcd)]
a, b = plan[-1]
plan[-1] = (a, b - 1)
starting_rank = gcd[-1][1]
if degree == 0:
plan = []
starting_rank = rank
else:
gcd = _euclid(rank, degree)
plan = [(i % 2,q) for i,(_, _, q, _) in enumerate(gcd)]
a, b = plan[-1]
plan[-1] = (a, b - 1)
starting_rank = gcd[-1][1]
result = trivial_bundle(field)
line_bundle = VectorBundle(field, divisor)
for _ in range(starting_rank - 1):
result = result.extension_by_global_sections()
result = result.tensor_product(line_bundle)
for move, reps in reversed(plan):
if degree > 0:
result = result.tensor_product(line_bundle)
for op, reps in reversed(plan):
for _ in range(reps):
if move == 0:
result = result.extension_by_global_sections()
else:
if op:
result = result.tensor_product(line_bundle)
else:
result = result.extension_by_global_sections()
return result

View File

@ -878,8 +878,7 @@ def pseudo_hermite_form(ideals, mat, include_zero_cols=True, transformation=Fals
j = k-1
for i in range(n-1, -1, -1):
#Check zero
if not h[i,:]:
j -= 1
if all([h[i,m] == 0 for m in range(j)]):
continue
m = [h[i,m] == 0 for m in range(j, -1, -1)].index(False)
h[:,m], h[:,j] = h[:,j], h[:,m]
@ -908,9 +907,10 @@ def pseudo_hermite_form(ideals, mat, include_zero_cols=True, transformation=Fals
h[:, m] -= q*h[:, j]
j -=1
if not include_zero_cols:
h = h[:,k-n:]
h_ideals = h_ideals[k-n:]
U = U[:,k-n:]
first_nonzero = [h[:,j].is_zero() for j in range(k)].index(False)
h = h[:,first_nonzero:]
h_ideals = h_ideals[first_nonzero:]
U = U[:,first_nonzero:]
if transformation:
return h_ideals, h, U
return h_ideals, h
@ -950,7 +950,7 @@ def hermite_form_infinite_polymod(mat, include_zero_cols=True, transformation=Fa
U = identity_matrix(K,k)
j = k-1
for i in range(n-1, -1, -1):
if not h[i,:]:
if all([h[i,m] == 0 for m in range(j)]):
continue
min_vals = [min([h[i,m].valuation(place) for m in range(j+1)])
for place in places]
@ -979,8 +979,9 @@ def hermite_form_infinite_polymod(mat, include_zero_cols=True, transformation=Fa
j-=1
h /= den
if not include_zero_cols:
h = h[:,k-n:]
U = U[:,k-n:]
first_nonzero = [h[:,j].is_zero() for j in range(k)].index(False)
h = h[:,first_nonzero:]
U = U[:,first_nonzero:]
if transformation:
return h, U
return h

View File

@ -42,8 +42,9 @@ is the constant field of `K`::
from sage.misc.cachefunc import cached_method
from sage.matrix.constructor import matrix
from sage.matrix.special import identity_matrix
from sage.modules.free_module_element import vector
from sage.categories.all import FiniteDimensionalAlgebrasWithBasis
from sage.categories.all import Algebras
from sage.algebras.all import FiniteDimensionalAlgebra
from vector_bundle import VectorBundle
from vector_bundle import function_field_utility
@ -332,7 +333,46 @@ class HomBundle(VectorBundle):
vec_f = self._matrix_to_vector(mat)
return VectorBundle.coordinates_in_h0(self, vec_f)
def image(self, f):
r"""
Return an image of global homomorphism ``f`` which is an element of
`H^0(\mathrm{self})`.
That is, a vector bundle `V` together with an injective morphism of `V`
into ``self.codomain``
EXAMPLES ::
sage: from vector_bundle import trivial_bundle, canonical_bundle
sage: F.<x> = FunctionField(GF(7))
sage: R.<y> = F[]
sage: K.<y> = F.extension(y^2 - x^3 - x)
sage: triv = trivial_bundle(K)
sage: can = canonical_bundle(K)
sage: V1 = triv.direct_sum(can)
sage: V2 = can.direct_sum(triv)
sage: hom = V1.hom(V2)
sage: image, map = hom.image(matrix(K, [[0, 1], [0, 0]]))
sage: image.isomorphism_to(can) is not None
True
sage: image.hom(V2).coordinates_in_h0(map)
(1, 0)
"""
dom = self._domain
cod = self._codomain
ideals, C_fi = function_field_utility.pseudo_hermite_form(
dom._ideals,
f*dom._g_finite,
False)
C_inf = function_field_utility.hermite_form_infinite_polymod(
f*dom._g_infinite,
False)
g_fi = C_inf.solve_right(C_fi)
K = self._function_field
image = VectorBundle(K, ideals, g_fi, identity_matrix(K, g_fi.ncols()))
return image, C_inf
class EndBundle(HomBundle):
r"""
Vector bundles representing endomorphism sheaves of vector bundles.
@ -374,6 +414,7 @@ class EndBundle(HomBundle):
sage: h0 = end.h0()
"""
k = self._function_field.constant_base_field()
category = Algebras(k).FiniteDimensional().WithBasis().Associative()
basis = self.h0()
tables = [matrix(k,[self.coordinates_in_h0(b*a) for b in basis])
for a in basis]
@ -381,7 +422,7 @@ class EndBundle(HomBundle):
k,
tables,
assume_associative=True,
category = FiniteDimensionalAlgebrasWithBasis(k))
category = category)
to_a = lambda mat : algebra(self.coordinates_in_h0(mat))
from_a = lambda a : self.h0_from_vector(a.vector())
return algebra, to_a, from_a

View File

@ -76,7 +76,7 @@ from sage.structure.sage_object import SageObject
from sage.misc.misc_c import prod
from sage.arith.functions import lcm
from sage.arith.misc import integer_ceil
from sage.functions.log import logb
from sage.functions.log import logb, log
from sage.matrix.constructor import matrix
from sage.matrix.special import block_matrix, elementary_matrix\
, identity_matrix
@ -1084,7 +1084,7 @@ class VectorBundle(SageObject):
"""
return sum([a*e for a, e in zip(v, self.h0())])
def _isomorphism_to_large_field(self, other, proba=10^-20):
def _isomorphism_to_large_field(self, other, tries=1):
r"""
Return an isomorphism from self to other if it exists and None otherwise.
@ -1092,7 +1092,21 @@ class VectorBundle(SageObject):
only works if the constant base field is larger than
``len(self.end().h0())``.
"""
Hom1 = self.hom(other)
hom1 = Hom1.h0()
hom2 = Hom1.dual().h0()
End = self.end()
end = End.h0()
s = len(hom1)
if s != len(hom2) or s != len(end):
return None
k = self.function_field().constant_base_field()
for _ in range(tries):
v = vector([k.random_element() for _ in range(s)])
P = Hom1.h0_from_vector(v)
mat = matrix([End.coordinates_in_h0(P*Q) for Q in hom2])
if mat.is_unit():
return P
def isomorphism_to(self, other):
r"""
@ -1101,12 +1115,37 @@ class VectorBundle(SageObject):
EXAMPLES ::
sage: from vector_bundle import trivial_bundle, canonical_bundle
sage: F.<x> = FunctionField(GF(3))
sage: F.<x> = FunctionField(GF(101))
sage: R.<y> = F[]
sage: K.<y> = F.extension(y^4 - x^-2 - 1)
sage: K.<y> = F.extension(y^2 - x^3 - x)
sage: triv = trivial_bundle(K)
sage: can = canonical_bundle(K)
sage: triv.isomorphism_to(can)
sage: iso = triv.isomorphism_to(can)
sage: iso.ncols()
1
sage: iso.nrows()
1
sage: iso.is_zero()
False
WARNING:
Not well implemented for infinite fields: need to specify how to chose
random elements and adequatly alter the number for tries.
"""
hom = self.hom(other)
#return hom.global_isomorphism()
s = len(self.end().h0())
k = self._function_field.constant_base_field()
if k.cardinality() > s:
return self._isomorphism_to_large_field(
other,
integer_ceil(60/log(k.cardinality()/s)))
def apply_isomorphism(self, isom):
r"""
Isom is an invertible square matrix of order ``self.rank()``.
Return the image of ``self`` by ``isom``.
"""
return VectorBundle(self._function_field,
self._ideals,
isom * self._g_finite,
isom * self._g_infinite)