Comments Off on Magma

Ins­tal­led version : 2.23-9, 2.25-7, 2.26-8, 2.27-7 (défault).
2.26-8 and 2.27-7 versions financed by MIS.
Official documentation and wikipédia.

Magma can only be run on the magma partition !


Magma is a software package designed for computations in algebra, number theory, algebraic geometry, and algebraic combinatorics. It provides a mathematically rigorous environment for defining and working with structures such as groups, rings, fields, modules, algebras, schemes, curves, graphs, designs, codes, and many others. Magma also supports a number of databases designed to aid computational research in those areas of mathematics which are algebraic in nature.

Setting up the Magma environment

ml math/magma


An example of a magma program – Syracuse sequence

  • Display the Syracuse sequence from a random number between 1 and 100.
  • Edit file :
x := Random(1, 100);
while x gt 1 do
     if IsEven(x) then
       x div:= 2;
        x := 3*x+1;
     end if;
end while;

Magma job submission with as input

Edit file

#SBATCH --job-name=testmagma
#SBATCH --partition=magma
echo "=== TEST 2.27-7 ==="
ml math/magma/2.27-7
magma job submission


Magma in interactive

ml math/magma
srun --partition=magma magma
Magma V2.27-7     Thu Feb 23 2023 10:02:20 on bignode11 [Seed = 228148732]
Type ? for help.  Type <Ctrl>-D to quit.