def discriminant(self): """ Return the discriminant of this ring, which is the discriminant of the trace pairing. .. note:: One knows that for modular abelian varieties, the endomorphism ring should be isomorphic to an order in a number field. However, the discriminant returned by this function will be `2^n` ( `n =` self.dimension()) times the discriminant of that order, since the elements are represented as 2d x 2d matrices. Notice, for example, that the case of a one dimensional abelian variety, whose endomorphism ring must be ZZ, has discriminant 2, as in the example below. EXAMPLES:: sage: J0(33).endomorphism_ring().discriminant() -64800 sage: J0(46).endomorphism_ring().discriminant() # long time (6s on sage.math, 2011) 24200000000 sage: J0(11).endomorphism_ring().discriminant() 2 """ g = self.gens() M = Matrix(ZZ,len(g), [ (g[i]*g[j]).trace() for i in range(len(g)) for j in range(len(g)) ]) return M.determinant()
def taut_polynomial_via_smith(tri, angle, cycles = [], alpha = True, mode = "taut"): # set up assert tri.homology().rank() == 1 # need the polynomial ring to be a PID ZH = group_ring(tri, angle, cycles, alpha = alpha, ring = QQ) # ditto P = ZH.polynomial_ring() ET = edges_to_triangles_matrix(tri, angle, cycles, ZH, P, mode = mode) # compute via smith normal form ETs = ET.smith_form()[0] a = tri.countEdges() ETs_reduced = Matrix([row[:a] for row in ETs]) return normalise_poly(ETs_reduced.determinant(), ZH, P)
def c3_func(SUK, prec=106): r""" Return the constant `c_3` from Smart's 1995 TCDF paper, [Sma1995]_ INPUT: - ``SUK`` -- a group of `S`-units - ``prec`` -- (default: 106) the precision of the real field OUTPUT: The constant ``c3``, as a real number EXAMPLES:: sage: from sage.rings.number_field.S_unit_solver import c3_func sage: K.<xi> = NumberField(x^3-3) sage: SUK = UnitGroup(K, S=tuple(K.primes_above(3))) sage: c3_func(SUK) # abs tol 1e-29 0.4257859134798034746197327286726 .. NOTE:: The numerator should be as close to 1 as possible, especially as the rank of the `S`-units grows large REFERENCES: - [Sma1995]_ p. 823 """ R = RealField(prec) all_places = list(SUK.primes()) + SUK.number_field().places(prec) Possible_U = Combinations(all_places, SUK.rank()) c1 = R(0) for U in Possible_U: # first, build the matrix C_{i,U} columns_of_C = [] for unit in SUK.fundamental_units(): columns_of_C.append(column_Log(SUK, unit, U, prec)) C = Matrix(SUK.rank(), SUK.rank(), columns_of_C) # Is it invertible? if abs(C.determinant()) > 10**(-10): poss_c1 = C.inverse().apply_map(abs).norm(Infinity) c1 = R(max(poss_c1, c1)) return R(0.9999999) / (c1*SUK.rank())
def taut_polynomial_via_tree_and_smith(tri, angle, cycles = [], alpha = True, mode = "taut"): # set up assert tri.homology().rank() == 1 # need the polynomial ring to be a PID ZH = group_ring(tri, angle, cycles, alpha = alpha, ring = QQ) # ditto P = ZH.polynomial_ring() ET = edges_to_triangles_matrix(tri, angle, cycles, ZH, P, mode = mode) _, non_tree_faces, _ = spanning_dual_tree(tri) ET = ET.transpose() ET = Matrix([row for i, row in enumerate(ET) if i in non_tree_faces]).transpose() # compute via smith normal form ETs = ET.smith_form()[0] a = tri.countEdges() ETs_reduced = Matrix([row[:a] for row in ETs]) return normalise_poly(ETs_reduced.determinant(), ZH, P)