Differences between revisions 1 and 2
Revision 1 as of 2006-07-29 14:30:20
Size: 2403
Editor: anonymous
Comment:
Revision 2 as of 2006-07-29 15:44:42
Size: 2554
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
{{{
Line 17: Line 18:
}}}
Line 18: Line 20:
Then you will need to set the variable DEVEL=True in setup.py. If you type sage -b now the finite_field_ext_givaro.pyx file should be compiled and the linbox module be built. Then you will need to set the variable {{{#!python
DEVEL=True
}}} in `setup.py`
. If you type `sage -b` now the file `finite_field_ext_givaro.pyx` should be compiled and the `linbox` module should be built.
Line 21: Line 25:
Right now only the Gfq class is covered by the SAGE wrapper to supply fast finite (extension) field arithmetic. You may construct it similar to the usual finite fields in SAGE:
k=linbox.GFq(256,repr="poly"). This k may be used as a base ring for (multivariate) polynomial rings, matrix spaces, etc.
Right now only the `Gfq` class is covered by the SAGE wrapper to supply fast finite (extension) field arithmetic. You may construct it similar to the usual finite fields in SAGE:
{{{#!python
k=linbox.GFq(256,repr="poly")}}}. This `k` may be used as a base ring for (multivariate) polynomial rings, matrix spaces, etc.
{{{#!python
R.<x,y> = PolynomialRing(k,2)
MS = MatrixSpace(k,200,200)
}}}
Line 25: Line 34:
 * linbox.GFq only supports finete fields $k$ of $\#k \leq 2^{16}$
 * linbox.GFq offers three ways to perform basic arithmetic. Let $e$ and $f$ be elements of the field $k$. Then the usual $e+f$ performs the most generic addition. A little speedup (~ 10%) may be achieved by calling e.g., e.add(f), which avoids type checks. The fastest method is to use k._add(e.logint(),f.logint()) which does not create new GFq_element instances but returns and accepts ints (which Givaro uses internally to represent finite field elements).
 * `linbox.GFq` only supports finete fields $k$ of $\#k \leq 2^{16}$
 * `linbox.GFq` offers three ways to perform basic arithmetic. Let `e` and `f` be elements of the field `k`. Then the usual `e+f` performs the most generic addition. A little speedup (~ 10%) may be achieved by calling e.g., `e.add(f)`, which avoids type checks. The fastest method is to use `k._add(e.logint(),f.logint())` which does not create new GFq_element instances but returns and accepts `ints` (which Givaro uses internally to represent finite field elements).

Description

From the Givaro website:

"In the joint CNRS-INRIA / INPG-UJF project APACHE, Givaro is a C++ library for arithmetic and algebraic computations. Its main features are implementations of the basic arithmetic of many mathematical entities: Primes fields, Extensions Fields, Finite Fields, Finite Rings, Polynomials, Algebraic numbers, Arbitrary precision integers and rationals (C++ wrappers over gmp) It also provides data-structures and templated classes for the manipulation of basic algebraic objects, such as vectors, matrices (dense, sparse, structured), univariate polynomials (and therefore recursive multivariate). It contains different program modules and is fully compatible with the ["LinBox"] linear algebra library and the Athapascan environment, which permits parallel programming."

Website

http://www-lmc.imag.fr/Logiciels/givaro/

Integration into SAGE

Building the Givaro wrapper

Even though Givaro is included in the SAGE standard distribution it is not included into the build process by default. This is due to the fact that SAGE wraps the LinBox wrapper of Givaro and LinBox is not included with SAGE by default but may be installed as optional package.

To build Givaro you will need to install the optional LinBox package:

sage -i linbox-1.0.0-20060727

Then you will need to set the variable

   1 DEVEL=True

in setup.py. If you type sage -b now the file finite_field_ext_givaro.pyx should be compiled and the linbox module should be built.

What's covered of Givaro

Right now only the Gfq class is covered by the SAGE wrapper to supply fast finite (extension) field arithmetic. You may construct it similar to the usual finite fields in SAGE:

   1 k=linbox.GFq(256,repr="poly")

. This k may be used as a base ring for (multivariate) polynomial rings, matrix spaces, etc.

   1 R.<x,y> = PolynomialRing(k,2)
   2 MS = MatrixSpace(k,200,200)

Tips, Tricks, and Pitfalls

  • linbox.GFq only supports finete fields k of \#k \leq 2^{16}

  • linbox.GFq offers three ways to perform basic arithmetic. Let e and f be elements of the field k. Then the usual e+f performs the most generic addition. A little speedup (~ 10%) may be achieved by calling e.g., e.add(f), which avoids type checks. The fastest method is to use k._add(e.logint(),f.logint()) which does not create new GFq_element instances but returns and accepts ints (which Givaro uses internally to represent finite field elements).