def WeierstrassMap_P2_112(polynomial, variables=None): r""" Map an anticanonical hypersurface in `\mathbb{P}^2[1,1,2]` into Weierstrass form. Input/output is the same as :func:`WeierstrassMap`, except that the input polynomial must be a standard anticanonical hypersurface in weighted projective space `\mathbb{P}^2[1,1,2]`: .. MATH:: \begin{split} p(x,y) =&\; a_{40} x^4 + a_{30} x^3 + a_{21} x^2 y + a_{20} x^2 + \\ &\; a_{11} x y + a_{02} y^2 + a_{10} x + a_{01} y + a_{00} \end{split} EXAMPLES:: sage: from sage.schemes.toric.weierstrass_covering import WeierstrassMap_P2_112 sage: from sage.schemes.toric.weierstrass import WeierstrassForm_P2_112 sage: R = PolynomialRing(QQ, 'x,y,a0,a1,a2,a3,a4', order='lex') sage: R.inject_variables() Defining x, y, a0, a1, a2, a3, a4 sage: equation = y^2 + a0*x^4 + 4*a1*x^3 + 6*a2*x^2 + 4*a3*x + a4 sage: X, Y, Z = WeierstrassMap_P2_112(equation, [x,y]) sage: f, g = WeierstrassForm_P2_112(equation, variables=[x,y]) sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) 0 Another example, this time in homogeneous coordinates:: sage: fan = Fan(rays=[(1,0),(0,1),(-1,-2),(0,-1)],cones=[[0,1],[1,2],[2,3],[3,0]]) sage: P112.<x,y,z,t> = ToricVariety(fan) sage: (-P112.K()).sections_monomials() (z^4*t^2, x*z^3*t^2, x^2*z^2*t^2, x^3*z*t^2, x^4*t^2, y*z^2*t, x*y*z*t, x^2*y*t, y^2) sage: C_eqn = sum(_) sage: C = P112.subscheme(C_eqn) sage: WeierstrassForm_P2_112(C_eqn, [x,y,z,t]) (-97/48, 17/864) sage: X, Y, Z = WeierstrassMap_P2_112(C_eqn, [x,y,z,t]) sage: (-Y^2 + X^3 - 97/48*X*Z^4 + 17/864*Z^6).reduce(C.defining_ideal()) 0 """ x,y,z,t = _check_polynomial_P2_112(polynomial, variables) a00 = polynomial.coefficient({y:2}) V = polynomial.coefficient({y:1}) U = - _partial_discriminant(polynomial, y, t) / 4 Q = invariant_theory.binary_quartic(U, x, z) g = Q.g_covariant() h = Q.h_covariant() if t is None: t = 1 return ( 4*g*t**2, 4*h*t**3, (a00*y+V/2) )
def WeierstrassMap_P2_112(polynomial, variables=None): r""" Map an anticanonical hypersurface in `\mathbb{P}^2[1,1,2]` into Weierstrass form. Input/output is the same as :func:`WeierstrassMap`, except that the input polynomial must be a standard anticanonical hypersurface in weighted projective space `\mathbb{P}^2[1,1,2]`: .. MATH:: \begin{split} p(x,y) =&\; a_{40} x^4 + a_{30} x^3 + a_{21} x^2 y + a_{20} x^2 + \\ &\; a_{11} x y + a_{02} y^2 + a_{10} x + a_{01} y + a_{00} \end{split} EXAMPLES:: sage: from sage.schemes.toric.weierstrass_covering import WeierstrassMap_P2_112 sage: from sage.schemes.toric.weierstrass import WeierstrassForm_P2_112 sage: R = PolynomialRing(QQ, 'x,y,a0,a1,a2,a3,a4', order='lex') sage: R.inject_variables() Defining x, y, a0, a1, a2, a3, a4 sage: equation = y^2 + a0*x^4 + 4*a1*x^3 + 6*a2*x^2 + 4*a3*x + a4 sage: X, Y, Z = WeierstrassMap_P2_112(equation, [x,y]) sage: f, g = WeierstrassForm_P2_112(equation, variables=[x,y]) sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) 0 Another example, this time in homogeneous coordinates:: sage: fan = Fan(rays=[(1,0),(0,1),(-1,-2),(0,-1)],cones=[[0,1],[1,2],[2,3],[3,0]]) sage: P112.<x,y,z,t> = ToricVariety(fan) sage: (-P112.K()).sections_monomials() (z^4*t^2, x*z^3*t^2, x^2*z^2*t^2, x^3*z*t^2, x^4*t^2, y*z^2*t, x*y*z*t, x^2*y*t, y^2) sage: C_eqn = sum(_) sage: C = P112.subscheme(C_eqn) sage: WeierstrassForm_P2_112(C_eqn, [x,y,z,t]) (-97/48, 17/864) sage: X, Y, Z = WeierstrassMap_P2_112(C_eqn, [x,y,z,t]) sage: (-Y^2 + X^3 - 97/48*X*Z^4 + 17/864*Z^6).reduce(C.defining_ideal()) 0 """ x, y, z, t = _check_polynomial_P2_112(polynomial, variables) a00 = polynomial.coefficient({y: 2}) V = polynomial.coefficient({y: 1}) U = -_partial_discriminant(polynomial, y, t) / 4 Q = invariant_theory.binary_quartic(U, x, z) g = Q.g_covariant() h = Q.h_covariant() if t is None: t = 1 return (4 * g * t**2, 4 * h * t**3, (a00 * y + V / 2))