Difference between revisions of "Package sagbi/SB.TruncSAGBI"
Andraschko (talk | contribs) (examples and see) |
Andraschko (talk | contribs) (added Hilbert driven info and example) |
||
Line 7: | Line 7: | ||
<short_description>Computes a truncated SAGBI-basis of a standard-graded subalgebra.</short_description> | <short_description>Computes a truncated SAGBI-basis of a standard-graded subalgebra.</short_description> | ||
− | <syntax> | + | <syntax>SB.SAGBI(G: LIST of POLY,d: RAT): LIST of POLY</syntax> |
− | SB.SAGBI(G:LIST of POLY,d:RAT):LIST of POLY | + | <syntax>SB.SAGBI(G: LIST of POLY,d: RAT, HS: PSERIES): LIST of POLY</syntax> |
− | </syntax> | ||
<description> | <description> | ||
− | This function computes a <tt>d</tt>-truncated SAGBI-basis of the subalgebra <tt>S</tt> generated by the polynomials in the list <tt>G</tt>, i.e. a set of polynomials <tt>F</tt> such that any term appearing as the leading term of a polynomial in <tt>S</tt> of degree smaller than or equal to <tt>d</tt> is a product of terms appearing as leading term of a polynomial in <tt>F</tt>. | + | This function computes a <tt>d</tt>-truncated SAGBI-basis of the subalgebra <tt>S</tt> generated by the polynomials in the list <tt>G</tt>, i.e. a set of polynomials <tt>F</tt> such that any term appearing as the leading term of a polynomial in <tt>S</tt> of degree smaller than or equal to <tt>d</tt> is a product of terms appearing as leading term of a polynomial in <tt>F</tt>. <par/> |
+ | If additionally, the Hilbert series of <tt>K[G]</tt> is given, then the SAGBI basis is computed Hilbert-driven. | ||
<itemize> | <itemize> | ||
<item>@param <em>G</em> A list of homogeneous polynomials which generates a subalgebra.</item> | <item>@param <em>G</em> A list of homogeneous polynomials which generates a subalgebra.</item> | ||
<item>@param <em>d</em> An integer specifying the truncation degree.</item> | <item>@param <em>d</em> An integer specifying the truncation degree.</item> | ||
+ | <item>@param <em>HS</em> (optional) The Hilbert Series of <tt>K[G]</tt>.</item> | ||
<item>@return A tuple <tt>[L,b]</tt> where <tt>L</tt> is a list of polynomials which form a <tt>d</tt>-truncated finite SAGBI-basis of the subalgebra generated by <tt>G</tt>. <tt>b</tt> is a boolean value which is <tt>true</tt> if <tt>L</tt> is already a complete SAGBI basis.</item> | <item>@return A tuple <tt>[L,b]</tt> where <tt>L</tt> is a list of polynomials which form a <tt>d</tt>-truncated finite SAGBI-basis of the subalgebra generated by <tt>G</tt>. <tt>b</tt> is a boolean value which is <tt>true</tt> if <tt>L</tt> is already a complete SAGBI basis.</item> | ||
</itemize> | </itemize> | ||
<example> | <example> | ||
− | Use QQ[x,y,z]; | + | Use QQ[x,y,z], DegRevLex; |
S := SB.TruncSAGBI([x^2 -z^2, x*y +z^2, y^2 -2*z^2],3); | S := SB.TruncSAGBI([x^2 -z^2, x*y +z^2, y^2 -2*z^2],3); | ||
indent(S); | indent(S); | ||
Line 29: | Line 30: | ||
<example> | <example> | ||
− | Use QQ[x,y]; | + | Use QQ[x,y], Lex; |
S := SB.TruncSAGBI([x +y, x*y, x*y^2],7); -- K[x+y,xy,xy^2] does not have a finite SAGBI basis | S := SB.TruncSAGBI([x +y, x*y, x*y^2],7); -- K[x+y,xy,xy^2] does not have a finite SAGBI basis | ||
indent(S); | indent(S); | ||
Line 36: | Line 37: | ||
-- false | -- false | ||
-- ] | -- ] | ||
+ | </example> | ||
+ | |||
+ | <example> | ||
+ | Use QQ[x,y], DegLex; | ||
+ | L := [x, x*y -y^2, x*y^2]; | ||
+ | t0 := CpuTime(); | ||
+ | s1 := SB.TruncSAGBI(L,30); | ||
+ | t1 := CpuTime(); | ||
+ | HS := SB.SubalgebraHS(L); | ||
+ | s2 := SB.TruncSAGBI(L,30,HS); | ||
+ | t2 := CpuTime(); | ||
+ | PrintLn "Normal: ", FloatStr(t1-t0); | ||
+ | PrintLn "Hilbert-driven: ", FloatStr(t2-t1); -- should be faster | ||
</example> | </example> | ||
</description> | </description> | ||
+ | |||
<seealso> | <seealso> | ||
<see>Package sagbi/SB.SAGBI</see> | <see>Package sagbi/SB.SAGBI</see> | ||
Line 44: | Line 59: | ||
<see>Package sagbi/SB.GetSAGBI</see> | <see>Package sagbi/SB.GetSAGBI</see> | ||
<see>Package sagbi/SB.GetTruncSAGBI</see> | <see>Package sagbi/SB.GetTruncSAGBI</see> | ||
+ | <see>Package sagbi/SB.SubalgebraHS</see> | ||
</seealso> | </seealso> | ||
<types> | <types> |
Latest revision as of 15:15, 5 November 2020
This article is about a function in ApCoCoA-2.0. |
SB.TruncSAGBI
Computes a truncated SAGBI-basis of a standard-graded subalgebra.
Syntax
SB.SAGBI(G: LIST of POLY,d: RAT): LIST of POLY
Syntax
SB.SAGBI(G: LIST of POLY,d: RAT, HS: PSERIES): LIST of POLY
Description
This function computes a d-truncated SAGBI-basis of the subalgebra S generated by the polynomials in the list G, i.e. a set of polynomials F such that any term appearing as the leading term of a polynomial in S of degree smaller than or equal to d is a product of terms appearing as leading term of a polynomial in F.
If additionally, the Hilbert series of K[G] is given, then the SAGBI basis is computed Hilbert-driven.
@param G A list of homogeneous polynomials which generates a subalgebra.
@param d An integer specifying the truncation degree.
@param HS (optional) The Hilbert Series of K[G].
@return A tuple [L,b] where L is a list of polynomials which form a d-truncated finite SAGBI-basis of the subalgebra generated by G. b is a boolean value which is true if L is already a complete SAGBI basis.
Example
Use QQ[x,y,z], DegRevLex; S := SB.TruncSAGBI([x^2 -z^2, x*y +z^2, y^2 -2*z^2],3); indent(S); -- [ -- [y^2 -2*z^2, x*y +z^2, x^2 -z^2], -- false -- ]
Example
Use QQ[x,y], Lex; S := SB.TruncSAGBI([x +y, x*y, x*y^2],7); -- K[x+y,xy,xy^2] does not have a finite SAGBI basis indent(S); -- [ -- [x +y, x*y, x*y^2, x*y^3, x*y^4, x*y^5, x*y^6], -- false -- ]
Example
Use QQ[x,y], DegLex; L := [x, x*y -y^2, x*y^2]; t0 := CpuTime(); s1 := SB.TruncSAGBI(L,30); t1 := CpuTime(); HS := SB.SubalgebraHS(L); s2 := SB.TruncSAGBI(L,30,HS); t2 := CpuTime(); PrintLn "Normal: ", FloatStr(t1-t0); PrintLn "Hilbert-driven: ", FloatStr(t2-t1); -- should be faster
See also
Package sagbi/SB.GetTruncSAGBI