Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
r""" Weierstrass for Elliptic Curves in Higher Codimension
The :mod:`~sage.schemes.toric.weierstrass` module lets you transform a genus-one curve, given as a hypersurface in a toric surface, into Weierstrass form. The purpose of this module is to extend this to higher codimension subschemes of toric varieties. In general, this is an unsolved problem. However, for certain special cases this is known.
The simplest codimension-two case is the complete intersection of two quadratic equations in `\mathbb{P}^3` ::
sage: R.<w,x,y,z> = QQ[] sage: quadratic1 = w^2+x^2+y^2 sage: quadratic2 = z^2 + w*x sage: WeierstrassForm([quadratic1, quadratic2]) (-1/4, 0)
Hence, the Weierstrass form of this complete intersection is $Y^2 = X^3 - \frac{1}{4} X Z^4$. """
#***************************************************************************** # Copyright (C) 2012 Volker Braun <vbraun.name@gmail.com> # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #*****************************************************************************
_check_homogeneity, _extract_coefficients )
###################################################################### r""" Helper function for :func:`~sage.schemes.toric.weierstrass.WeierstrassForm`
Currently, only the case of the complete intersection of two quadratic equations in `\mathbb{P}^3` is supported.
INPUT / OUTPUT:
See :func:`~sage.schemes.toric.weierstrass.WeierstrassForm`
TESTS::
sage: from sage.schemes.toric.weierstrass_higher import WeierstrassForm2 sage: R.<w,x,y,z> = QQ[] sage: quadratic1 = w^2+x^2+y^2 sage: quadratic2 = z^2 + w*x sage: WeierstrassForm2([quadratic1, quadratic2]) (-1/4, 0) """ return WeierstrassMap_P3(*polynomial, variables=variables) else:
###################################################################### # # Weierstrass form of complete intersection of two quadratics in P^3 # ###################################################################### """ Check that the polynomial is weighted homogeneous in standard variables.
INPUT:
- ``quadratic1``, ``quadratic2`` -- two quadratic polynomials in 4 homogeneous or 3 inhomogeneous variables.
- ``variables`` -- the variables or ``None`` (default).
OUTPUT:
This function returns ``variables``, potentially guessed from the polynomial ring. A ``ValueError`` is raised if the polynomial is not homogeneous.
EXAMPLES:
sage: from sage.schemes.toric.weierstrass_higher import _check_polynomials_P3 sage: R.<w,x,y,z> = QQ[] sage: quadratic = w^2+x^2+y^2+z^2 sage: _check_polynomials_P3(w^2, quadratic, [w,x,y,z]) (w, x, y, z) sage: _check_polynomials_P3(w^2, quadratic, None) (w, x, y, z) sage: _check_polynomials_P3(z^2, quadratic.subs(w=0), None) (x, y, z, None) sage: R.<w,x,y,z,t> = QQ[] sage: quadratic = w^2+x^2+y^2+z^2 + t*(x*y+y*z+z*w+w*x) sage: _check_polynomials_P3(w^2, quadratic, [w,x,y,z]) (w, x, y, z) sage: _check_polynomials_P3(w^2, quadratic, [w,x,y,t]) Traceback (most recent call last): ... ValueError: The polynomial is not homogeneous with weights (1, 1, 1, 1) """ raise ValueError('The two quadratics must be in the same polynomial ring.') else: raise ValueError('Need three or four variables, got '+str(variables))
###################################################################### r""" Helper function for the Weierstrass form of a biquadratic in $`\mathbb{P}^3$
The invariants and covariants of a quaternary biquadratic satisfy the relation :meth:`sage.rings.invariant_theory.TwoQuaternaryQuadratics.syzygy`, which is (modulo the two quadratic equations) of the form $J^2 = p_4(T, T')$ where
* $J$, $T$, $T'$ are the covariants of the biquadratic.
* $p_4$ is some quartic polynomial whose coefficients are invariants of the biquadratic.
INPUT:
See :func:`WeierstrassForm_P3`
OUTPUT:
A triple consisting of
- The quaternary biquadratic as an algebraic form :class:`~sage.rings.invariant_theory.TwoQuaternaryQuadratics`
- The binary quartic $p_4$ as a :class:`~sage.rings.invariant_theory.BinaryQuartic`
- The dictionary of variable substitutions from the variables of the quartic to the variables of the biquadratic.
EXAMPLES::
sage: from sage.schemes.toric.weierstrass_higher import _biquadratic_syzygy_quartic sage: R.<w,x,y,z> = QQ[] sage: _biquadratic_syzygy_quartic(w^2+x^2+y^2, z^2) (Joint quaternary quadratic with coefficients (1, 1, 1, 0, 0, 0, 0, 0, 0, 0) and quaternary quadratic with coefficients (0, 0, 0, 1, 0, 0, 0, 0, 0, 0), Binary quartic with coefficients (0, 0, 0, -1, 0), {aux...}) """
# construct auxiliary polynomial ring to work with the rhs of the syzygy
# Syzygy is J^2 = syz_rhs + (terms that vanish on the biquadratic) with # J = biquadratic.J_covariant() - T**3*T_prime * biquadratic.Theta_invariant().subs(to_aux) \ + T**2*T_prime**2 * biquadratic.Phi_invariant().subs(to_aux) \ - T*T_prime**3 * biquadratic.Theta_prime_invariant().subs(to_aux) \ + T_prime**4 * biquadratic.Delta_prime_invariant().subs(to_aux)
###################################################################### r""" Bring a complete intersection of two quadratics into Weierstrass form.
Input/output is the same as :func:`sage.schemes.toric.weierstrass.WeierstrassForm`, except that the two input polynomials must be quadratic polynomials in `\mathbb{P}^3`.
EXAMPLES::
sage: from sage.schemes.toric.weierstrass_higher import WeierstrassForm_P3 sage: R.<w,x,y,z> = QQ[] sage: quadratic1 = w^2+x^2+y^2 sage: quadratic2 = z^2 + w*x sage: WeierstrassForm_P3(quadratic1, quadratic2) (-1/4, 0)
TESTS::
sage: R.<w,x,y,z,a0,a1,a2,a3,b0,b1,b2,b3,b4,b5> = QQ[] sage: p1 = w^2 + x^2 + y^2 + z^2 sage: p2 = a0*w^2 + a1*x^2 + a2*y^2 + a3*z^2 sage: p2 += b0*x*y + b1*x*z + b2*x*w + b3*y*z + b4*y*w + b5*z*w sage: a, b = WeierstrassForm_P3(p1, p2, [w,x,y,z]) sage: a.total_degree(), len(a.coefficients()) (4, 107) sage: b.total_degree(), len(b.coefficients()) (6, 648) """ _biquadratic_syzygy_quartic(quadratic1, quadratic2, variables=variables)
###################################################################### r""" Bring a complete intersection of two quadratics into Weierstrass form.
Input/output is the same as :func:`sage.schemes.toric.weierstrass.WeierstrassForm`, except that the two input polynomials must be quadratic polynomials in `\mathbb{P}^3`.
EXAMPLES::
sage: from sage.schemes.toric.weierstrass_higher import \ ....: WeierstrassMap_P3, WeierstrassForm_P3 sage: R.<w,x,y,z> = QQ[] sage: quadratic1 = w^2+x^2+y^2 sage: quadratic2 = z^2 + w*x sage: X, Y, Z = WeierstrassMap_P3(quadratic1, quadratic2) sage: X 1/1024*w^8 + 3/256*w^6*x^2 + 19/512*w^4*x^4 + 3/256*w^2*x^6 + 1/1024*x^8 sage: Y 1/32768*w^12 - 7/16384*w^10*x^2 - 145/32768*w^8*x^4 - 49/8192*w^6*x^6 - 145/32768*w^4*x^8 - 7/16384*w^2*x^10 + 1/32768*x^12 sage: Z -1/8*w^2*y*z + 1/8*x^2*y*z
sage: a, b = WeierstrassForm_P3(quadratic1, quadratic2); a, b (-1/4, 0)
sage: ideal = R.ideal(quadratic1, quadratic2) sage: (-Y^2 + X^3 + a*X*Z^4 + b*Z^6).reduce(ideal) 0
TESTS::
sage: R.<w,x,y,z,a0,a1,a2,a3> = GF(101)[] sage: p1 = w^2 + x^2 + y^2 + z^2 sage: p2 = a0*w^2 + a1*x^2 + a2*y^2 + a3*z^2 sage: X, Y, Z = WeierstrassMap_P3(p1, p2, [w,x,y,z]) sage: X.total_degree(), len(X.coefficients()) (22, 4164) sage: Y.total_degree(), len(Y.coefficients()) (33, 26912) sage: Z.total_degree(), len(Z.coefficients()) (10, 24) sage: Z w*x*y*z*a0^3*a1^2*a2 - w*x*y*z*a0^2*a1^3*a2 - w*x*y*z*a0^3*a1*a2^2 + w*x*y*z*a0*a1^3*a2^2 + w*x*y*z*a0^2*a1*a2^3 - w*x*y*z*a0*a1^2*a2^3 - w*x*y*z*a0^3*a1^2*a3 + w*x*y*z*a0^2*a1^3*a3 + w*x*y*z*a0^3*a2^2*a3 - w*x*y*z*a1^3*a2^2*a3 - w*x*y*z*a0^2*a2^3*a3 + w*x*y*z*a1^2*a2^3*a3 + w*x*y*z*a0^3*a1*a3^2 - w*x*y*z*a0*a1^3*a3^2 - w*x*y*z*a0^3*a2*a3^2 + w*x*y*z*a1^3*a2*a3^2 + w*x*y*z*a0*a2^3*a3^2 - w*x*y*z*a1*a2^3*a3^2 - w*x*y*z*a0^2*a1*a3^3 + w*x*y*z*a0*a1^2*a3^3 + w*x*y*z*a0^2*a2*a3^3 - w*x*y*z*a1^2*a2*a3^3 - w*x*y*z*a0*a2^2*a3^3 + w*x*y*z*a1*a2^2*a3^3 """ _biquadratic_syzygy_quartic(quadratic1, quadratic2, variables=variables)
|