Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Some small tricks needed (computing discriminants)
PostPosted: Sat Oct 08, 2011 5:07 am 

Joined: Mon Jun 29, 2009 1:51 pm
Posts: 20
I am working with (global) discriminants of algebraic hypersurfaces in P^n.
Namely, a hypersurface (of some fixed degree d) is singular iff its coefficients satisfy some polynomial equation (this polynomial is the global discriminant).
(Note, this is the global version, not the local one, which is the discriminant in the miniversal deformation).


I am trying to check that some particular monomial appears in such discriminants (for some small d,n).

Is there some standard command in Singular to produce this polynomial?
(I can get it "by hands", declaring e.g.
ring r=0,(x,y,z,..coefficients..)
and then eliminating x,y,z. But its painful to declare all the coefficients as variables, even in the small d,n cases.)

Suppose I get the discriminant, some terrible polynomial. Is there some standard command to check the coefficient of some given monomial in a polynomial? Alternatively, is there a nice way to compute higher derivatives (with respect to several variables)?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Some small tricks needed (computing discriminants)
PostPosted: Sat Oct 08, 2011 5:19 pm 

Joined: Wed Mar 03, 2010 5:08 pm
Posts: 108
Location: Germany, Münster
Dmitry wrote:
[...] its painful to declare all the coefficients as variables, even in the small d,n cases.)

You may use multiindexed variables. This faciliates the input a bit.

Quote:
Suppose I get the discriminant, some terrible polynomial. Is there some standard command to check the coefficient of some given monomial in a polynomial?

Yes, supposed you get it ... Let me know how far you can go
I have my doubts, the computations will become massive.


Here is such a proc I use.
If the monomial h occurs in the polynomial f, then it returns
the coefficient, otherwise it returns 0

Code:
> proc getcoef(poly f,poly h)
{
  return(jet(f/monomial(leadexp(h)),0));
}
> ring r=0,(x,y,z),dp;
> poly f = 3x5y2z3-4x6y2z+5xyz+6;
3x5y2z3-4x6y2z+5xyz+6
> getcoef(f,xyz);
5
> getcoef(f,1);
6
> getcoef(f,x5y2z3);
3
> getcoef(f,x5);
0


Quote:
Alternatively, is there a nice way to compute higher derivatives (with respect to several variables)?


You can the command diff in its second variant.

The first argument is then interpreted as the (higher) differential operator.
http://www.singular.uni-kl.de/Manual/la ... htm#SEC244

-----
Christian

P.S: I have some hints in mind for your other open question.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Some small tricks needed (computing discriminants)
PostPosted: Sun Oct 09, 2011 5:10 am 

Joined: Mon Jun 29, 2009 1:51 pm
Posts: 20
Thanks a lot! Now I can compute.

Unfortunately already for n=2 and d=4 the computation is very slow. (Even if I work in characteristic 5.)

In fact I want to check a guess. Compute the discriminant for the generic polynomial
x^d_0 a_0+x^d_1 a_1+...+x^d_n a_n +(all the other terms)

Then the monomial a^{(p-1)^n}_0\times...\times a^{(p-1)^n}_n
participates in the discriminant. This is true for n=1 and low p. I wanted to check it at least for n=2, p<6 and for n=3, p<4. Is there some way to speed up the computation?


What are your ideas about my other question?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Some small tricks needed (computing discriminants)
PostPosted: Wed Oct 12, 2011 12:24 pm 

Joined: Wed May 25, 2005 4:16 pm
Posts: 275
Some hints:
instead of
Code:
proc getcoef(poly f,poly h)
{
  return(jet(f/monomial(leadexp(h)),0));
}
[\code]
one should use
[code]
proc getcoef(poly f,poly h)
{
  return ((f/leadmonom(h))[1]);
}

because jet requires that only constants have degree 0 (not always true)
and leadmonom is more efficient then 2 function calls


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Some small tricks needed (computing discriminants)
PostPosted: Tue Jan 10, 2012 5:50 pm 

Joined: Wed Mar 03, 2010 5:08 pm
Posts: 108
Location: Germany, Münster
@hannes

Yes, leadmonom is shorter, but /monomial(leadexp(h)) works nice
in case h is zero.

Actually, I forgot that the command leadmonom exists.
It only became necessary when integers as coefficients were introduced.

Yet, I can't follow your objection agains the use of jet:

You say
hannes wrote:
jet requires that only constants have degree 0 (not always true)

Since I don't see this, we have to go into some subtle details of the commands
jet http://www.singular.uni-kl.de/Manual/la ... htm#SEC285
and deg http://www.singular.uni-kl.de/Manual/la ... htm#SEC240

I guess you want to say the following:

Supposed we have a basering with a ordering defined by a weight vector
having positive and negative weights.
Then non-constant monomials may have zero-degree w.r.t. to this ordering.

Here I agree; but, unlike deg, the command jet computes
by default w.r.t. to the standard weights (1,...,1).

Thus jet(f,0) always give the constant term.

Problems only occur when jet is called with the weight vector.

However your solution needs that the user is working in a local ordering,
(but Dmitry wants to work globally) otherwise the result is false.

Example:
Code:
> ring rw = 0,(x,y),ws(2,-3);
> poly f = x3y2 + 8x2y + 4xy2 + 11;
> deg(f);   // degree w.r.t. to the weighted degree order
1
> jet(f,0);  // constant term independet of the ordering
11
> jet(f,0,intvec(2,-3));
4xy2+11+x3y2
> // with my proc we get
> getcoef(f,x2y);
8
> // with yours we obtain
> getcoef(f,x2y);
xy

In case that there are really problems that I have overlooked
one should use subst (resp. substitute) after division to get the coefficient]


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 11:07 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group