本文整理汇总了Python中sage.modules.free_module.VectorSpace.dimension方法的典型用法代码示例。如果您正苦于以下问题:Python VectorSpace.dimension方法的具体用法?Python VectorSpace.dimension怎么用?Python VectorSpace.dimension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.modules.free_module.VectorSpace
的用法示例。
在下文中一共展示了VectorSpace.dimension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _possible_normalizers
# 需要导入模块: from sage.modules.free_module import VectorSpace [as 别名]
# 或者: from sage.modules.free_module.VectorSpace import dimension [as 别名]
def _possible_normalizers(E, SA):
r"""Find a list containing all primes `l` such that the Galois image at `l`
is contained in the normalizer of a Cartan subgroup, such that the
corresponding quadratic character is ramified only at the given primes.
INPUT:
- ``E`` - EllipticCurve - over a number field K.
- ``SA`` - list - a list of primes of K.
OUTPUT:
- list - A list of primes, which contains all primes `l` such that the
Galois image at `l` is contained in the normalizer of a Cartan
subgroup, such that the corresponding quadratic character is
ramified only at primes in SA.
- If `E` has geometric CM that is not defined over its ground field, a
ValueError is raised.
EXAMPLES::
sage: E = EllipticCurve([0,0,0,-56,4848])
sage: 5 in sage.schemes.elliptic_curves.gal_reps_number_field._possible_normalizers(E, [ZZ.ideal(2)])
True
"""
E = _over_numberfield(E)
K = E.base_field()
SA = [K.ideal(I.gens()) for I in SA]
x = K['x'].gen()
selmer_group = K.selmer_group(SA, 2) # Generators of the selmer group.
if selmer_group == []:
return []
V = VectorSpace(GF(2), len(selmer_group))
# We think of this as the character group of the selmer group.
traces_list = []
W = V.zero_subspace()
deg_one_primes = K.primes_of_degree_one_iter()
while W.dimension() < V.dimension() - 1:
P = deg_one_primes.next()
k = P.residue_field()
defines_valid_character = True
# A prime P defines a quadratic residue character
# on the Selmer group. This variable will be set
# to zero if any elements of the selmer group are
# zero mod P (i.e. the character is ramified).
splitting_vector = [] # This will be the values of this
# character on the generators of the Selmer group.
for a in selmer_group:
abar = k(a)
if abar == 0:
# Ramification.
defines_valid_character = False
break
if abar.is_square():
splitting_vector.append(GF(2)(0))
else:
splitting_vector.append(GF(2)(1))
if not defines_valid_character:
continue
if splitting_vector in W:
continue
try:
Etilde = E.change_ring(k)
except ArithmeticError: # Bad reduction.
continue
tr = Etilde.trace_of_frobenius()
if tr == 0:
continue
traces_list.append(tr)
W = W + V.span([splitting_vector])
bad_primes = set([])
for i in traces_list:
for p in i.prime_factors():
bad_primes.add(p)
# We find the unique vector v in V orthogonal to W:
v = W.matrix().transpose().kernel().basis()[0]
#.........这里部分代码省略.........