AUTHOR:
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.
TESTS:
sage: mupad.package('"MuPAD-Combinat"') # optional - mupad
sage: combinat = mupad.combinat # optional - mupad
sage: examples = mupad.examples # optional - mupad
sage: S = examples.SymmetricFunctions() # optional - mupad
sage: S.s[2,1]^2 # optional - mupad
s[3, 3] + s[4, 2] + s[2, 2, 1, 1] + s[2, 2, 2] + 2 s[3, 2, 1] + s[4, 1, 1] +
s[3, 1, 1, 1]
sage: S.omega( S.s[3] ) # optional - mupad
s[1, 1, 1]
sage: s = S.s # optional - mupad
sage: p = S.p # optional - mupad
sage: s(s[2,1] + p[2,1]) # optional - mupad
s[2, 1] + s[3] - s[1, 1, 1]
sage: s(_) # optional - mupad
s[2, 1] + s[3] - s[1, 1, 1]
sage: combinat.tableaux.list(3) # optional - mupad # note: the order of the result seems to depend on the version of MuPAD / MuPAD-Combinat
-- +---+ --
| | 3 | |
| +---+ +---+ +---+ |
| | 3 | | 2 | | 2 | |
| +---+---+---+ +---+---+ +---+---+ +---+ |
| | 1 | 2 | 3 |, | 1 | 2 |, | 1 | 3 |, | 1 | |
-- +---+---+---+ +---+---+ +---+---+ +---+ --
sage: three = mupad(3) # optional - mupad
sage: three.combinat.tableaux.list() # optional - mupad
-- +---+ --
| | 3 | |
| +---+ +---+ +---+ |
| | 3 | | 2 | | 2 | |
| +---+---+---+ +---+---+ +---+---+ +---+ |
| | 1 | 2 | 3 |, | 1 | 2 |, | 1 | 3 |, | 1 | |
-- +---+---+---+ +---+---+ +---+---+ +---+ --
sage: t = _[1] # optional - mupad
sage: t # optional - mupad
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
sage: combinat.tableaux.conjugate(t) # optional - mupad
+---+
| 3 |
+---+
| 2 |
+---+
| 1 |
+---+
sage: combinat.ribbonsTableaux.list([2,2],[1,1],2) # optional - mupad
-- +---+---+ +---+---+ --
| | | 2 | | 2 | |
| + + +, +---+---+ |
| | 1 | | | 1 | |
-- +---+---+ +---+---+ --
sage: combinat.tableaux.kAtom([2,1],3) # optional - mupad
-- +---+ --
| | 2 | |
| +---+---+ |
| | 1 | 1 | |
-- +---+---+ --
sage: M = S.Macdonald() # optional - mupad
sage: a = M.P[1]^2 # optional - mupad
sage: mupad.mapcoeffs(a, 'normal') # optional - mupad
q - t + q t - 1
P[2] + --------------- P[1, 1]
q t - 1
Bases: sage.interfaces.expect.Expect
Interface to the MuPAD interpreter.
EXAMPLES:
sage: mupad.completions('linal') # optional - mupad
['linalg']
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: ...
EXAMPLES:
sage: t = mupad.cputime() #random, optional - MuPAD
0.11600000000000001
EXAMPLES:
sage: mupad.eval('2+2') # optional - mupad
4
EXAMPLES:
sage: a = mupad(1) # optional - mupad
sage: mupad.expect() # optional - mupad
<pexpect.spawn instance at 0x...>
Get the value of the variable var.
EXAMPLES:
sage: mupad.set('a', 4) # optional - mupad
sage: mupad.get('a').strip() # optional - mupad
'4'
Set the variable var to the given value.
EXAMPLES:
sage: mupad.set('a', 4) # optional - mupad
sage: mupad.get('a').strip() # optional - mupad
'4'
EXAMPLES:
sage: names = mupad.trait_names() # optional - mupad
sage: len(names) > 100 # optional - mupad
True
sage: 'combinat' in names # optional - mupad
True
Bases: sage.interfaces.expect.ExpectElement
EXAMPLES:
sage: mupad.package('"MuPAD-Combinat"') # optional - mupad-Combinat
sage: S = mupad.examples.SymmetricFunctions() # optional - mupad-Combinat
sage: 'HallLittlewood' in S.trait_names() # optional - mupad-Combinat
True
Bases: sage.interfaces.expect.ExpectFunction
EXAMPLES:
sage: mupad.linalg.trait_names() # optional - mupad
['addCol',
'addRow',
...
'wiedemann']
Bases: sage.interfaces.expect.FunctionElement
EXAMPLES:
sage: three = mupad(3) # optional - mupad
sage: 'list' in three.combinat.tableaux.trait_names() # optional - mupad
True
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: ...
EXAMPLES:
sage: from sage.interfaces.mupad import reduce_load_mupad
sage: reduce_load_mupad()
Mupad