Interface to MuPAD#

AUTHOR:

  • Mike Hansen

  • William Stein

You must have the optional commercial MuPAD interpreter installed and available as the command code{mupkern} in your PATH in order to use this interface. You do not have to install any optional sage packages.

class sage.interfaces.mupad.Mupad(maxread=None, script_subdirectory=None, server=None, server_tmpdir=None, logfile=None)#

Bases: ExtraTabCompletion, Expect

Interface to the MuPAD interpreter.

completions(string, strip=False)#

EXAMPLES:

sage: mupad.completions('linal') # optional - mupad
['linalg']
console()#

Spawn a new MuPAD command-line session.

EXAMPLES:

sage: mupad.console() #not tested

   *----*    MuPAD Pro 4.0.2 -- The Open Computer Algebra System
  /|   /|
 *----* |    Copyright (c)  1997 - 2007  by SciFace Software
 | *--|-*                   All rights reserved.
 |/   |/
 *----*      Licensed to:   ...
cputime(t=None)#

EXAMPLES:

sage: t = mupad.cputime() #random, optional - MuPAD
0.11600000000000001
eval(code, strip=True, **kwds)#

EXAMPLES:

sage: mupad.eval('2+2')   # optional - mupad
                                       4
expect()#

EXAMPLES:

sage: a = mupad(1)   # optional - mupad
sage: mupad.expect() # optional - mupad
<pexpect.spawn instance at 0x...>
get(var)#

Get the value of the variable var.

EXAMPLES:

sage: mupad.set('a', 4) # optional - mupad
sage: mupad.get('a').strip() # optional - mupad
'4'
set(var, value)#

Set the variable var to the given value.

EXAMPLES:

sage: mupad.set('a', 4) # optional - mupad
sage: mupad.get('a').strip() # optional - mupad
'4'
class sage.interfaces.mupad.MupadElement(parent, value, is_name=False, name=None)#

Bases: ExtraTabCompletion, ExpectElement

class sage.interfaces.mupad.MupadFunction(parent, name)#

Bases: ExtraTabCompletion, ExpectFunction

class sage.interfaces.mupad.MupadFunctionElement(obj, name)#

Bases: ExtraTabCompletion, FunctionElement

sage.interfaces.mupad.mupad_console()#

Spawn a new MuPAD command-line session.

EXAMPLES:

sage: from sage.interfaces.mupad import mupad_console
sage: mupad_console() #not tested

   *----*    MuPAD Pro 4.0.2 -- The Open Computer Algebra System
  /|   /|
 *----* |    Copyright (c)  1997 - 2007  by SciFace Software
 | *--|-*                   All rights reserved.
 |/   |/
 *----*      Licensed to:   ...
sage.interfaces.mupad.reduce_load_mupad()#

EXAMPLES:

sage: from sage.interfaces.mupad import reduce_load_mupad
sage: reduce_load_mupad()
Mupad