本文整理匯總了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]
#.........這裏部分代碼省略.........