zook

10 Reputation

2 Badges

12 years, 245 days

MaplePrimes Activity


These are replies submitted by zook

@Christopher2222 Well, of course I can change the condition but that's not the condition I want. What I want is Maple to notice that zeta^6 is a power of zeta with exponent >=3. That's what my remark in brackets was about: the pattern matcher notices "great, I can match the expression, d'oh the condition is not satisfied" but then does not go on to try to match the expression in a different way where it would satisfy the condition (namely, n=6, x=1, y=zeta^2). This is not about not knowing the language, it's about a bug that exists at least since version 14.

My statement that so much does not work was not founded on this one example. The path to actually having to try this awkward approach was quite long. I don't see why it's unfair to say that so much does not work. And I don't think a personal license covers usage for research while the GPL does. Anyway, I won't keep you from using Maple, but I will rather try something else.

I second the lobby campaign. An important first step would be to have the present pattern matching actually work. I have experienced recently, that it produces completely random results. And a feature that is documented but does not work is maybe even worse than a feature that is not there (because it costs much more time to debug).

Here is an example

> zetatab := [conditional(Zeta^n::posint*x::anything+y::anything = Zeta^(n-3)*(Zeta-1)*x+y, n >= 3)];
> tab := compiletable(zetatab);
> tablelook(Zeta^2+Zeta^6, tab);
                              FAIL

(Here the problem might be that the pattern matcher does not expect that the regex might match in more than one way but only one of them satisfies the condition. I know that his is not the right way to implement a finite field but it should work nonetheless. It is part of my last desperate attempt to implement function fields over finite fields in Maple.)

Apart from that it would be important to have substitutions of subexpressions. For example, above I would actually not want to say "substitute every occurence of zeta in a sum of fractions of products of powers..." but just "substitute every occurence of zeta".

I found it really frustrating to work with Maple because so much does not work (but this forum was very helpful). And I don't need a 1000$ software to do arbitrary precision arithmetic, symbolic differentiation or to multiply matrices, there is tons of free software for that. Speaking of free software: I just did with Sage in a day, what I had tried to do with Maple in a week (this is not about pattern matching, though, but about Sage knowing function fields and finite fields *and* how to combine both concepts and even to form matrices with entries in them).

Ok. But why does changing the coefficient or the exponent affect whether or not a term can be matched by "anything"?

The second question was meant to ask for a pattern matcher that also finds subpatterns.

Ok. But why does changing the coefficient or the exponent affect whether or not a term can be matched by "anything"?

The second question was meant to ask for a pattern matcher that also finds subpatterns.

Thank you for the nice explanation! In particular, the hint to "showstat" is most helpful.

Thank you for the nice explanation! In particular, the hint to "showstat" is most helpful.

Has there been any progress on this? It seems that the answers below provide a nice workaround. Has this been moved into some Maple package?

@acer Sorry for the confusion. Yes, I did want phi(x*sigma)=phi(x)*sigma in the end. How I thought about my question was this:

* Main question: "How would I go about defining my own version of 'linear'?"

* Extra question: "The reason is, that extending linear by something does not work as expected. Why is that?"

So I was mostly thinking about reproducing linearity and only the last example was about extending. And I agree that linear plus phi(sigma)=sigma shouldn't produce phi(x*sigma)=phi(x)*sigma but I still don't really see why the second attempt doesn't work.

@acer Sorry for the confusion. Yes, I did want phi(x*sigma)=phi(x)*sigma in the end. How I thought about my question was this:

* Main question: "How would I go about defining my own version of 'linear'?"

* Extra question: "The reason is, that extending linear by something does not work as expected. Why is that?"

So I was mostly thinking about reproducing linearity and only the last example was about extending. And I agree that linear plus phi(sigma)=sigma shouldn't produce phi(x*sigma)=phi(x)*sigma but I still don't really see why the second attempt doesn't work.

Yes, linearity implies additivity for no matter what expressions (as it should):

> define('phi', 'linear');
> phi(a+b);
                        phi(a) + phi(b)

and that's also what I want (among other things). The behavoir I want is linearity plus phi(sigma)=sigma, so in two steps:

> define('phi', 'linear');
> phi(a+4*sigma+z);
                 phi(a) + 4 phi(sigma) + phi(z)
> undefine('phi'); define('phi', phi(sigma) = sigma);
> %;
                   phi(a) + 4 sigma + phi(z)
I guess that leads me to

define('phi',phi(x::`+`)='map'(phi,x),
             phi(x::nonunit(constant)*y::anything)=x*phi(y),
             phi(sigma)=sigma);

which works for me. So thank you a lot for you help!

Yes, linearity implies additivity for no matter what expressions (as it should):

> define('phi', 'linear');
> phi(a+b);
                        phi(a) + phi(b)

and that's also what I want (among other things). The behavoir I want is linearity plus phi(sigma)=sigma, so in two steps:

> define('phi', 'linear');
> phi(a+4*sigma+z);
                 phi(a) + 4 phi(sigma) + phi(z)
> undefine('phi'); define('phi', phi(sigma) = sigma);
> %;
                   phi(a) + 4 sigma + phi(z)
I guess that leads me to

define('phi',phi(x::`+`)='map'(phi,x),
             phi(x::nonunit(constant)*y::anything)=x*phi(y),
             phi(sigma)=sigma);

which works for me. So thank you a lot for you help!

Page 1 of 1