Interface to mwrank

sage.interfaces.mwrank.Mwrank(options='', server=None, server_tmpdir=None)

Create and return an mwrank interpreter, with given options.


  • options - string; passed when starting mwrank. The format is:

    -h       help            prints this info and quits
    -q       quiet           turns OFF banner display and prompt
    -v n     verbosity       sets verbosity to n (default=1)
    -o       PARI/GP output  turns ON extra PARI/GP short output (default is OFF)
    -p n     precision       sets precision to n decimals (default=15)
    -b n     quartic bound   bound on quartic point search (default=10)
    -x n     n aux           number of aux primes used for sieving (default=6)
    -l       list            turns ON listing of points (default ON unless v=0)
    -s       selmer_only     if set, computes Selmer rank only (default: not set)
    -d       skip_2nd_descent        if set, skips the second descent for curves with 2-torsion (default: not set)
    -S n     sat_bd          upper bound on saturation primes (default=100, -1 for automatic)


sage: M = Mwrank('-v 0 -l')
sage: print M('0 0 1 -1 0')
Curve [0,0,1,-1,0] :    Rank = 1
Generator 1 is [0:-1:1]; height 0.0511114082399688
Regulator = 0.0511114082399688
class sage.interfaces.mwrank.Mwrank_class(options='', server=None, server_tmpdir=None)

Bases: sage.interfaces.expect.Expect

Interface to the Mwrank interpreter.


Start the mwrank console.


sage: mwrank.console() # not tested: expects console input
Program mwrank: ...
eval(*args, **kwds)

Send a line of input to mwrank, then when it finishes return everything that mwrank output.


If a RuntimeError exception is raised, then the mwrank interface is restarted and the command is retried once.


sage: mwrank.eval('12 3 4 5 6')
'Curve [12,3,4,5,6] :...'

Quit the mwrank process using kill -9 (so exit doesn’t dump core, etc.).


  • verbose – ignored


sage: m = Mwrank()
sage: e = m('1 2 3 4 5')
sage: m.quit()

Start the mwrank console.


sage: mwrank_console() # not tested: expects console input
Program mwrank: ...

Previous topic

Interface to Mathematica

Next topic

Interface to GNU Octave

This Page