pml-mapml Library

pml GitHub repository

G. Villard


Next: 

Software library for exact matrix polynomials and polynomial matrices using PML from Maple

mapml is a experimental maple interface to the libraries flint and pml, developed jointly with pml. See [Hyun, Neiger, Schost 2019].

Problem and bug reports may be sent to gilles.villard@ens-lyon.fr


Next: , Up: Top

Installing

Currently developed and tested with macOS >= 26.3.1 or linux, typically, and the compilers

      # clang version 21.0.0 (clang-2100.1.1.101)
      # Target: M2 Pro arm64-apple-darwin25.3.0      

      # gcc version 12.2.0 (Debian 12.2.0-14)
      # Target: x86_64-linux-gnu

Should operate more generally.

Mandatory libraries for pml, and mapml:

(currently tested with:)

- GNU MP (6.3.0): http://gmplib.org

- For FLINT: MPFR (4.2.2): http://www.mpfr.org

FLINT temporary requirement

https://flintlib.org

- A recent FLINT development version is mandatory (>= Wed. 20 may 2026 12:51:14 CEST): https://github.com/flintlib. Currently, pml+mapml requires building FLINT with support for AVX2 or NEON instructions.

PML Installation

Download from pml GitHub repository.

Go to the pml*/flint-extras directory:

      ./bootstrap.sh
      ./configure
      make
      make install    

If gmp or flint are installed under non-standard directories you can specify their locations by using configure with the options --with-gmp, --with-flint. By default, make install installs files under /usr/local, you can specify another installation directory by giving ./configure the option --prefix=dirname. Run ./configure --help for further details.

Another example:

      ./bootstrap.sh
      ./configure --with-gmp=/opt/homebrew --with-flint=/usr/local 
      make
      sudo make install 
      make check  

PML-MAPML Installation (maple mandatory)

Works with Maple 2025 and 2026, should be checked for previous versions.

If maple is installed in a non standard directory (e.g. not in /Library/Frameworks using macos), for reasons related to maple libraries, the environment variables DYLD_LIBRARY_PATH or LD_LIBRARY_PATH must indicate the maple library directory. That is the directory where libmaplec.dylib or libmaplec.so can be found (kernelopts(bindir); command in maple). For example:

      (csh and linux)  setenv LD_LIBRARY_PATH /opt/maple/bin.X86_64_LINUX (do not forget ${LD_LIBRARY_PATH}: if already set)
      (bash and macos) export DYLD_LIBRARY_PATH=/mymaplelib/bin.APPLE_UNIVERSAL_OSX (do not forget $DYLD_LIBRARY_PATH: if already set)

Then, do the same as for pml only, specifying at the same time the maple directories in order to find maple include directory (cat(kernelopts(mapledir),"/extern"); command in maple) and maple libraries (kernelopts(bindir); command in maple):

      ./bootstrap.sh
      ./configure --with-gmp=/opt/homebrew --with-flint=/usr/local \ 
        --with-maplec=/Library/Frameworks/Maple.framework/Versions/2026/extern \
        --with-maplelib=/Library/Frameworks/Maple.framework/Versions/2026/bin.APPLE_UNIVERSAL_OSX \
        --prefix=some_directory_where_to_install
      make
      make install    

Another example:

      ./bootstrap.sh
      ./configure --with-gmp=/opt/homebrew \
        --with-maplec=/Library/Frameworks/Maple.framework/Versions/2026/extern \
        --with-maplelib=/Library/Frameworks/Maple.framework/Versions/2026/bin.APPLE_ARM64_MACOS 
      make
      sudo make install 

Note that the compilation flag -Wstrict-prototypes in PML may produce four warnings related to the Maple library. They seem to be inconsequential.

Using

mapml routines are then available by reading from maple the file mapml.mpl found in the pml include directory determined by pml installation (see --prefix). The default is:

      read("/usr/local/include/pml/mapml.mpl");

For example, see the maple worksheet maple_check.mw from the pml examples directory. By specifying an appropriate directory for the mapml.mpl file, it should execute correctly.

 


Next: , Previous: Installing, Up: Top

Available routines

Routines to manipulate matrices with univariate polynomial entries in Maple, in line with the LinearAlgebra package. Currently, these routines are global (not private to the mapml module).

    MDeterminant(A, x) mod q;

    WeakPopov(A, x, shift) mod q; 
        unimodular column transformation, shift is a list of integers, of length the row dimension of A 

    RowWeakPopov(A, x, shift) mod q; 
        unimodular row transformation, shift is a list of integers, of length the column dimension of A 

    PMBasis(A, x, shift, sigma) mod q; 
        approximant basis B and resulting defects such that A.B has order at lest sigma 
        shift is a list of integers, of length the column dimension of A 
    
    RowPMBasis(A, x, shift, sigma) mod q; 
        approximant basis B and resulting defects such that B.A has order at lest sigma 
        shift is a list of integers, of length the row dimension of A 

    MBasis(A, x, shift, sigma) mod q; 
        approximant basis B and resulting defects such that A.B has order at lest sigma 
        shift is a list of integers, of length the column dimension of A 
    
    RowMBasis(A, x, shift, sigma) mod q; 
        approximant basis B and resulting defects such that B.A has order at lest sigma 
        shift is a list of integers, of length the row dimension of A 

    RightDescription(M, x, d) mod q;
        M is a matrix of rational fractions in x, with power series expansion at x=0
        tries computes a matrix fraction description P,Q of degree at most d (reduced) such that M=PQ^(-1) 

    LeftDescription(M, x, d) mod q;
        M is a matrix of rational fractions in x, with power series expansion at x=0
        tries to compute a matrix fraction description Q,P of degree at most d (reduced) such that M=Q^(-1)P  

    Kernel(A, x, shift) mod q; 
        Normalized minimal kernel basis N such that A.N is zero  
        shift is a list of integers, of length the column dimension of A 

    RowKernel(A, x, shift) mod q; 
        Normalized minimal kernel basis N such that N.A is zero  
        shift is a list of integers, of length the row dimension of A 

    PMNullspace(A x) mod q; 
        Direct interface to flint nmod_poly_mat_nullspace 
        right (rational) nullspace polynomial matrix N such that A.N is zero 
    

 


Previous: Available routines, Up: Top

Known issues

 


Valid XHTML 1.0 Strict