PoslavskySV

45 Reputation

5 Badges

9 years, 6 days

MaplePrimes Activity


These are questions asked by PoslavskySV

Hi,

 

I'm using Java OpenMaple interface to call Maple functions from Java on Ubuntu Linux. I'm following the examples provided on Maple website. My Java code:

 

import com.maplesoft.openmaple.*;

import com.maplesoft.externalcall.MapleException;

class test {

    public static void main( String args[] ) throws Exception {

        String[] a = {"java"};

        Engine  t = new Engine( a, new EngineCallBacksDefault(), null, null );

        try {

            t.evaluate( "factor(-8*((16*I)*g**4*(-4*mc**2+u)**(-2)*(4*mb**2-u)**(-2)*u**(-1)*(12*mb**2-u)*(-4*s*mb**2+16*mb**4-4*u*mb**2+t*u-4*t*mb**2)*s*(4*s*mb**2+4*mc**2*s+16*mc**2*mb**2-s**2-4*t*mc**2+t**2-4*t*mb**2)*(12*mc**2-u)+(16*I)*(4*s*mb**2+4*mc**2*s+u**2-4*mc**2*u+16*mc**2*mb**2-4*u*mb**2-s**2)*(12*mc**2-t)*g**4*(t-4*mb**2)**(-2)*(4*mc**2-t)**(-2)*(-t+12*mb**2)*(-4*s*mb**2+16*mb**4-4*u*mb**2+t*u-4*t*mb**2)*s*t**(-1))**2);" );

        }

        catch ( MapleException e ) {

            System.out.println(e);

        }

    }

}

 

Maple throws exception:

com.maplesoft.externalcall.MapleException: Error, (in evala/Factors) input must be polynomials over the integers

The input polynoial is valid (when coping and pasting `factor(...)` directly into Maple interface, all works). When trying to factor simple polynomials like "x**2 - I*x" all goes fine too. Tried both Maple 17 and 18 (Linux).

PS. There is no problem when running this code on OS X (I tried Maple 16, 17, 18),  but I need to be able to run Maple with Java on my Linux cluster.

 

I have a big file (~30Mb) with a single algebraic expression (file contains only one string of the form `expr := a*b + ... :` ). I would like to import this expression into Maple and I use `read` function for that:

    read "s.maple":

I wait for 2 hours, but Maple does not response and no any output provided. Is there any special function for import such data?

I use console Maple18 Linux x86 64.

 

Update. All goes fine in Maple 16, so the issue is relevant for Maple17 and Maple18.

Good day,

 

I am working under paper which contains comparison of different tensor software packages focusing on the algebraic manipulations with tensors (namely Maple Physics, Mathematica xAct, Cadabra and Redberry). When doing comparison we’ve found that Maple Physics `Simplify` function sometimes fails to perform even trivial simplifications and almost does not work on harder examples. For example, one can easily see that all expressions below are zero while Maple Physics is unable to simplify them:

 

with(Physics):with(Library):Setup(spacetimeindices = lowercaselatin):

Define(A[a]):Define(B[a,b]):Define(F[a,b,c]):Define(H[a,b,c,d]):Define(J[a,b,c,d,e]):

 

#Does not give zero:

Simplify(J[~g,g,f,a,~f]-J[~f,f,g,a,~g]);

 

#Does not give zero:

Simplify(J[~f,a,b,g,c]*F[~e,f,~d]*F[e,d,~g]-J[~e,a,b,f,c]*F[~d,e,~g]*F[d,g,~f]);

 

#Does not give zero:

Simplify(A[c]*J[e,~h,h,i,b]*J[~d,~i,d,a,~e]-A[c]*J[d,~h,h,e,b]*J[~i,~e,i,a,~d]);

 

#Does not give zero:

Simplify(H[~e,b,~f,d]*J[f,c,a,~d,e]-H[~f,b,~d,e]*J[d,c,a,~e,f]);

 

#Does not give zero:

Simplify(F[d,~e,e]*F[~d,~f,f]-F[~e,~d,d]*F[e,~f,f]);

 

#Does not give zero:

Simplify(J[g,c,k,~j,~e]*H[i,h,a,~h]*H[e,b,~i,~g]*F[d,~k,j]-H[h,b,~g,~j]*F[d,~k,e]*J[j,c,k,~e,~h]*H[g,i,a,~i]);

 

#Does not give zero:

Simplify(B[~e,~c]*H[~f,g,c,e]*B[a,~d]*H[~g,b,f,d]-H[~f,b,g,e]*B[~d,~c]*B[a,~e]*H[~g,f,c,d]);

 

#Does not give zero:

Simplify(A[~c]*H[d,h,c,b]*F[~h,~d,f]*H[a,e,~e,~f]-A[~h]*H[a,c,~c,~f]*F[~e,~d,f]*H[d,e,h,b]);

 

I’ve attached a single Maple file with about 250 such examples (Maple18_failSimple.txt) and a file (Maple18_allSimple.txt) with 1000 simple examples I used: some of them work correctly, while some fails. All these examples perfectly work in other systems (Mathematica xAct, Cadabra and Redberry).

 

We use Maple18 with latests Physics package version (December 12), but we also tried latest Maple17 and other versions of Physics: none of them work. In all these examples all tensors have no symmetries, but we observe even worse results in case when tensors have symmetries (nearly all tests fail).

 

What is important is that when we try to test a little bit more complicated examples, which can be simplified by other packages within milliseconds, Maple Physics not able to perform basic simplification in nearly all cases. I have attached a file (Maple18_failMedium.txt with failed examples and Maple18_allMedium.txt with all examples we used) with more complicated but still simple examples (one can check each example by hand): Physics not able to simplify more than 50% of examples. Finally, I’ve attached harder examples which perfectly work in all three other systems, but none of them work in Maple Physics (Maple18_allHarder.txt).  

 

So, my question is why `Simplify` is not able to perform such basic simplification of tensorial expressions? May be I miss something and I need to use another special command?

 

If we are using `Simplify` in a right way, Maple Physics can not be considered as a package for tensorial algebra (in the opposite to what is declared on the Maple website) until these basic simplification functionality will work.

 

PS

For generating input expressions we’ve written a little program that allows to generate random typical tensorial expressions arising in real computations (like calculation of Feynman diagrams etc.) and to run different system on such expressions in order to simplify them. Specifically we generate an expression (nested sums/products of tensors), then rewrite it in equivalent form (by renaming dummies, shuffling summands and multipliers and expand) and then subtract the result from initial expression. Obviously, simplification of such a prepared source must give zero.  

Maple18_failSimple.txt

Maple18_allSimple.txt

Maple18_failMedium.txt

Maple18_allMedium.txt

Maple18_allHarder.txt

 

 

Edit: Here are some trivial examples that the latest fixed version (version 41.1 Dec/15) still fails to resolve correctly (besides Maple18_allHarder.txt that are still not working in the fixed version):

 

with(Physics): with(Library): Setup(spacetimeindices = lowercaselatin):

Define(A[a]):

Define(B[a,b], antisymmetric={{a,b}}):

Define(H[a,b,c,d], antisymmetric={{a,b,c,d}}):

 

#Does not give zero

Simplify(A[c]*B[d,~e]*B[~d,f]*H[e,~f,b,a], tryhard);

 

Without symmetries:

 

with(Physics):with(Library):Setup(spacetimeindices = lowercaselatin):

Define(A[a]):Define(B[a,b]):Define(F[a,b,c]):Define(H[a,b,c,d]):Define(L[a,b,c,d,e,f,g]):

 

#Does not give zero

Simplify(F[~f,~h,j]*L[~k,~i,h,k,~j,c,m]*H[e,b,a,~d]*H[d,~l,i,~e]*F[~m,f,l]-H[f,b,a,~k]*H[k,~l,j,~f]*F[~i,m,l]*L[~e,~j,d,e,~h,c,i]*F[~m,~d,h],tryhard);

 

etc.

Another important issue is that with the current fixed version, the time used by `Simplify` became unacceptably large. As in the notebook that ecterrab provided, Maple Physics takes about 20 minutes on 100 medium examples (Download Simplified100MediumExamples.mw), while other packages spend just few seconds.

 

We are looking forward for the future updates that will solve these issues.

 

 

Good day.

Reading the documentation on Physics package in Maple, I did not find information about how Maple handle dummy indices of tensorial expressions. For example, suppose I have the following tensorial expression in Maple: 

    A[mu] * B[~mu] 

with dummy index mu. Then I want to apply the following simple substitution rule:

    A[alpha] = C[alpha]*C[mu]*C[~mu]  

Here, free index alpha should be...

Page 1 of 1