code
stringlengths
17
6.64M
class Gp(ExtraTabCompletion, Expect): "\n Interface to the PARI gp interpreter.\n\n Type ``gp.[tab]`` for a list of all the functions\n available from your Gp install. Type ``gp.[tab]?`` for\n Gp's help about a given function. Type ``gp(...)`` to\n create a new Gp object, and ``gp.eval(...)`` to ev...
@instancedoc class GpElement(ExpectElement, sage.interfaces.abc.GpElement): "\n EXAMPLES: This example illustrates dumping and loading GP elements\n to compressed strings.\n\n ::\n\n sage: a = gp(39393)\n sage: loads(a.dumps()) == a\n True\n\n Since dumping and loading uses the st...
def is_GpElement(x): '\n Return True if ``x`` is of type :class:`GpElement`\n\n This function is deprecated; use :func:`isinstance`\n (of :class:`sage.interfaces.abc.GpElement`) instead.\n\n EXAMPLES::\n\n sage: from sage.interfaces.gp import is_GpElement\n sage: is_GpElement(gp(2))\n ...
def reduce_load_GP(): '\n Returns the GP interface object defined in sage.interfaces.gp.\n\n EXAMPLES::\n\n sage: from sage.interfaces.gp import reduce_load_GP\n sage: reduce_load_GP()\n PARI/GP interpreter\n ' return gp
def gp_console(): '\n Spawn a new GP command-line session.\n\n EXAMPLES::\n\n sage: gp.console() # not tested\n GP/PARI CALCULATOR Version 2.4.3 (development svn-12577)\n amd64 running linux (x86-64/GMP-4.2.1 kernel) 64-bit version\n compiled: Jul 21 2010, gcc-4.6.0 20100705 (ex...
def gp_version(): "\n EXAMPLES::\n\n sage: gp.version() # not tested\n ((2, 4, 3), 'GP/PARI CALCULATOR Version 2.4.3 (development svn-12577)')\n " v = gp.eval('\\v') i = v.find('Version ') w = v[(i + len('Version ')):] i = w.find(' ') w = w[:i] t = tuple([int(n) for n ...
class AsciiArtString(str): def __repr__(self): return str(self)
class Interface(WithEqualityById, ParentWithBase): '\n Interface interface object.\n\n .. NOTE::\n\n Two interfaces compare equal if and only if they are identical\n objects (this is a critical constraint so that caching of\n representations of objects in interfaces works\n corre...
@instancedoc class InterfaceFunction(SageObject): '\n Interface function.\n ' def __init__(self, parent, name): self._parent = parent self._name = name def _repr_(self): return ('%s' % self._name) def __call__(self, *args, **kwds): return self._parent.function_...
@instancedoc class InterfaceFunctionElement(SageObject): '\n Interface function element.\n ' def __init__(self, obj, name): self._obj = obj self._name = name def _repr_(self): return ('%s' % self._name) def __call__(self, *args, **kwds): return self._obj.parent...
def is_InterfaceElement(x): '\n Return True if ``x`` is of type :class:`InterfaceElement`.\n\n EXAMPLES::\n\n sage: from sage.interfaces.interface import is_InterfaceElement\n sage: is_InterfaceElement(2)\n doctest:...: DeprecationWarning: the function is_InterfaceElement is deprecated;...
@instancedoc class InterfaceElement(Element): '\n Interface element.\n ' def __init__(self, parent, value, is_name=False, name=None): Element.__init__(self, parent) self._create = value if (parent is None): return if is_name: self._name = value ...
class JmolData(SageObject): '\n .. TODO::\n\n Create an animated image file (GIF) if spin is on and put data\n extracted from a file into a variable/string/structure to return\n ' def __init__(self): '\n EXAMPLES:\n\n Create a JmolData object::\n\n sage: f...
class Kash(Expect): '\n Interface to the Kash interpreter.\n\n AUTHORS:\n\n - William Stein and David Joyner\n ' def __init__(self, max_workspace_size=None, maxread=None, script_subdirectory=None, restart_on_ctrlc=True, logfile=None, server=None, server_tmpdir=None): '\n INPUT:\n ...
@instancedoc class KashElement(ExpectElement): def __mod__(self, other): self._check_valid() if (not isinstance(other, KashElement)): other = self.parent()(other) other._check_valid() return self.parent()(('%s mod %s' % (self._name, other._name))) def __len__(self...
class KashDocumentation(list): def __repr__(self): if (len(self) == 0): return 'No matches.' return '\n'.join(self)
def is_KashElement(x): '\n Returns True if ``x`` is of type :class:`KashElement`.\n\n EXAMPLES::\n\n sage: from sage.interfaces.kash import is_KashElement\n sage: is_KashElement(2)\n doctest:...: DeprecationWarning: the function is_KashElement is deprecated; use isinstance(x, sage.inter...
def reduce_load_Kash(): return kash
def kash_console(): from sage.repl.rich_output.display_manager import get_display_manager if (not get_display_manager().is_in_terminal()): raise RuntimeError('Can use the console only in the terminal. Try %%kash magics instead.') os.system('kash3 ')
def kash_version(): return kash.eval('VERSION')
def __doctest_cleanup(): import sage.interfaces.quit sage.interfaces.quit.expect_quitall()
def Sphere(n): '\n Return the ``n`` dimensional sphere as a Kenzo simplicial set.\n\n INPUT:\n\n - ``n`` -- the dimension of the sphere\n\n OUTPUT:\n\n - A :class:`KenzoSimplicialSet`\n\n EXAMPLES::\n\n sage: # optional - kenzo\n sage: from sage.interfaces.kenzo import Sphere\n ...
def MooreSpace(m, n): "\n Return the Moore space ``M(m, n)`` as a Kenzo simplicial set.\n\n The Moore space ``M(m, n)`` is the space whose n'th homology group\n is isomorphic to the cyclic group of order ``m``, and the rest of the\n homology groups are trivial.\n\n INPUT:\n\n - ``m`` -- A positi...
def EilenbergMacLaneSpace(G, n): "\n Return the Eilenberg-MacLane space ``K(G, n)`` as a Kenzo simplicial group.\n\n The Eilenberg-MacLane space ``K(G, n)`` is the space whose has n'th homotopy\n group isomorphic to ``G``, and the rest of the homotopy groups are trivial.\n\n INPUT:\n\n - ``G`` -- g...
class KenzoObject(SageObject): '\n Wrapper to Kenzo objects\n\n INPUT:\n\n - ``kenzo_object`` -- a wrapper around a Kenzo object\n (which is an ecl object).\n ' def __init__(self, kenzo_object): "\n Construct the chain complex.\n\n TESTS::\n\n sage: # optiona...
class KenzoSpectralSequence(KenzoObject): '\n Wrapper around Kenzo spectral sequences\n ' def group(self, p, i, j): "\n Return the ``i,j``'th group of the ``p`` page.\n\n INPUT:\n\n - ``p`` -- the page to take the group from.\n\n - ``i`` -- the column where the group...
class KenzoChainComplex(KenzoObject): '\n Wrapper to Kenzo chain complexes. Kenzo simplicial sets are a particular case\n of Kenzo chain complexes.\n ' def homology(self, n): "\n Return the ``n``'th homology group of the chain complex associated to this\n kenzo object.\n\n ...
class KenzoSimplicialSet(KenzoChainComplex): '\n Wrapper to Kenzo simplicial sets.\n\n In Kenzo, the homology of a simplicial set in computed from its associated\n chain complex. Hence, this class inherits from `KenzoChainComplex`.\n ' def loop_space(self, n=1): "\n Return the ``n`...
class KenzoSimplicialGroup(KenzoSimplicialSet): '\n Wrapper around Kenzo simplicial groups.\n ' def classifying_space(self): "\n Return the classifying space.\n\n OUTPUT:\n\n - A :class:`KenzoSimplicialGroup`\n\n EXAMPLES::\n\n sage: # optional - kenzo\n ...
def k2s_matrix(kmatrix): '\n Convert an array of ECL to a matrix of Sage.\n\n INPUT:\n\n - ``kmatrix`` -- An array in ECL\n\n EXAMPLES::\n\n sage: from sage.interfaces.kenzo import k2s_matrix # optional - kenzo\n sage: from sage.libs.ecl import EclObject\n sage: M = EclObj...
def s2k_matrix(smatrix): '\n Convert a matrix of Sage to an array of ECL.\n\n INPUT:\n\n - ``smatrix`` -- A matrix in Sage\n\n OUTPUT:\n\n - A :class:`EclObject`\n\n EXAMPLES::\n\n sage: from sage.interfaces.kenzo import s2k_matrix # optional - kenzo\n sage: A = Matrix([[1,2,3...
def s2k_dictmat(sdictmat): '\n Convert a dictionary in Sage, whose values are matrices, to an assoc list\n in ECL.\n\n INPUT:\n\n - ``sdictmat`` -- A dictionary in Sage\n\n OUTPUT:\n\n - A :class:`EclObject`\n\n EXAMPLES::\n\n sage: from sage.interfaces.kenzo import s2k_dictmat # opt...
def pairing(slist): '\n Convert a list of Sage (which has an even length) to an assoc list in ECL.\n\n INPUT:\n\n - ``slist`` -- A list in Sage\n\n OUTPUT:\n\n - A :class:`EclObject`\n\n EXAMPLES::\n\n sage: from sage.interfaces.kenzo import pairing # optional - kenzo\n sage: l =...
def KChainComplex(chain_complex): '\n Construct a KenzoChainComplex from a ChainComplex of degree = -1 in\n Sage.\n\n INPUT:\n\n - ``chain_complex`` -- A ChainComplex of degree = -1\n\n OUTPUT:\n\n - A KenzoChainComplex\n\n EXAMPLES::\n\n sage: # optional - kenzo\n sage: from sa...
def SChainComplex(kchaincomplex, start=0, end=15): '\n Convert the KenzoChainComplex ``kchcm`` (between dimensions ``start`` and\n ``end``) to a ChainComplex.\n\n INPUT:\n\n - ``kchaincomplex`` -- A KenzoChainComplex\n\n - ``start`` -- An integer number (optional, default 0)\n\n - ``end`` -- An ...
def SAbstractSimplex(simplex, dim): '\n Convert an abstract simplex of Kenzo to an AbstractSimplex.\n\n INPUT:\n\n - ``simplex`` -- An abstract simplex of Kenzo.\n\n - ``dim``-- The dimension of ``simplex``.\n\n OUTPUT:\n\n - An AbstractSimplex.\n\n EXAMPLES::\n\n sage: # optional - ke...
def KAbstractSimplex(simplex): "\n Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo.\n\n INPUT:\n\n - ``simplex`` -- An AbstractSimplex.\n\n OUTPUT:\n\n - An abstract simplex of Kenzo.\n\n EXAMPLES::\n\n sage: # optional - kenzo\n sage: from sage.topology.simplici...
def KFiniteSimplicialSet(sset): "\n Convert a finite SimplicialSet in Sage to a finite simplicial set of Kenzo.\n\n INPUT:\n\n - ``sset`` -- A finite SimplicialSet.\n\n OUTPUT:\n\n - A finite simplicial set of Kenzo.\n\n EXAMPLES::\n\n sage: # optional - kenzo\n sage: from sage.top...
def SFiniteSimplicialSet(ksimpset, limit): "\n Convert the ``limit``-skeleton of a finite simplicial set in Kenzo to a\n finite SimplicialSet in Sage.\n\n INPUT:\n\n - ``ksimpset`` -- A finite simplicial set in Kenzo.\n\n - ``limit`` -- A natural number.\n\n OUTPUT:\n\n - A finite SimplicialS...
class KenzoChainComplexMorphism(KenzoObject): '\n Wrapper to Kenzo morphisms between chain complexes.\n ' def source_complex(self): '\n Return the source chain complex of the morphism.\n\n OUTPUT:\n\n - A :class:`KenzoChainComplex`\n\n EXAMPLES::\n\n sage:...
def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): '\n Build a morphism of chain complexes by means of the corresponding build-mrph Kenzo\n function.\n\n INPUT:\n\n - ``source_complex`` -- The source object as a KenzoChainComplex instance\n\n - ``target_complex``...
def morphism_dictmat(morphism): '\n Computes a list of matrices in ECL associated to a morphism in Sage.\n\n INPUT:\n\n - ``morphism`` -- A morphism of chain complexes\n\n OUTPUT:\n\n - A :class:`EclObject`\n\n EXAMPLES::\n\n sage: from sage.interfaces.kenzo import morphism_dictmat # o...
def KChainComplexMorphism(morphism): '\n Construct a KenzoChainComplexMorphism from a ChainComplexMorphism in Sage.\n\n INPUT:\n\n - ``morphism`` -- A morphism of chain complexes\n\n OUTPUT:\n\n - A :class:`KenzoChainComplexMorphism`\n\n EXAMPLES::\n\n sage: # optional - kenzo\n sa...
def s2k_listofmorphisms(l): '\n Computes a list of morphisms of chain complexes in Kenzo from a list of morphisms in Sage.\n\n INPUT:\n\n - ``l`` -- A list of morphisms of chain complexes\n\n OUTPUT:\n\n - A :class:`EclObject`\n\n EXAMPLES::\n\n sage: from sage.interfaces.kenzo import s2k...
def BicomplexSpectralSequence(l): '\n Construct the spectral sequence associated to the bicomplex given by a list of morphisms.\n\n INPUT:\n\n - ``l`` -- A list of morphisms of chain complexes\n\n OUTPUT:\n\n - A :class:`KenzoSpectralSequence`\n\n EXAMPLES::\n\n sage: # optional - kenzo\n...
def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, raw_output=False, verbose=False, **kwds): "\n Call to the program count from LattE integrale\n\n INPUT:\n\n - ``arg`` -- a cdd or LattE description string\n\n - ``ehrhart_polynomial``, ``multivariate_generating_function``...
def integrate(arg, polynomial=None, algorithm='triangulate', raw_output=False, verbose=False, **kwds): "\n Call to the function integrate from LattE integrale.\n\n INPUT:\n\n - ``arg`` -- a cdd or LattE description string.\n\n - ``polynomial`` -- multivariate polynomial or valid LattE polynomial descr...
def to_latte_polynomial(polynomial): "\n Helper function to transform a polynomial to its LattE description.\n\n INPUT:\n\n - ``polynomial`` -- a multivariate polynomial.\n\n OUTPUT:\n\n A string that describes the monomials list and exponent vectors.\n\n TESTS:\n\n Testing a polynomial in th...
class LiE(ExtraTabCompletion, Expect): "\n Interface to the LiE interpreter.\n\n Type ``lie.[tab]`` for a list of all the functions available\n from your LiE install. Type ``lie.[tab]?`` for LiE's\n help about a given function. Type ``lie(...)`` to create\n a new LiE object, and ``lie.eval(...)``...
@instancedoc class LiEElement(ExtraTabCompletion, ExpectElement): def _tab_completion(self): "\n Return the possible tab completions for ``self``.\n\n EXAMPLES::\n\n sage: a4 = lie('A4') # optional - lie\n sage: a4._tab_completion() # optional - lie\n ['Ca...
@instancedoc class LiEFunctionElement(FunctionElement): def _instancedoc_(self): "\n EXAMPLES::\n\n sage: a4 = lie('A4') # optional - lie\n sage: a4.diagram.__doc__ # optional - lie\n 'diagram(g)...'\n " M = self._obj.parent() return M.help...
@instancedoc class LiEFunction(ExpectFunction): def _instancedoc_(self): "\n Return the help for ``self``.\n\n EXAMPLES::\n\n sage: lie.diagram.__doc__ # optional - lie\n 'diagram(g)...'\n " M = self._parent return M.help(self._name)
def is_LiEElement(x) -> bool: '\n EXAMPLES::\n\n sage: from sage.interfaces.lie import is_LiEElement\n sage: is_LiEElement(2)\n doctest:...: DeprecationWarning: the function is_LiEElement is deprecated; use isinstance(x, sage.interfaces.abc.LiEElement) instead\n See https://github.c...
def reduce_load_lie(): '\n EXAMPLES::\n\n sage: from sage.interfaces.lie import reduce_load_lie\n sage: reduce_load_lie()\n LiE Interpreter\n ' return lie
def lie_console(): '\n Spawn a new LiE command-line session.\n\n EXAMPLES::\n\n sage: from sage.interfaces.lie import lie_console\n sage: lie_console() # not tested\n LiE version 2.2.2 created on Sep 26 2007 at 18:13:19\n Authors: Arjeh M. Cohen, Marc van Leeuw...
def lie_version(): "\n EXAMPLES::\n\n sage: from sage.interfaces.lie import lie_version\n sage: lie_version() # optional - lie\n '2.2'\n " with open(os.path.join(LIE_INFO_DIR, 'INFO.0')) as f: lines = f.readlines() i = lines.index('@version()\n') return lines[(i + 1)...
class Lisp(Expect): def __init__(self, maxread=None, script_subdirectory=None, logfile=None, server=None, server_tmpdir=None): '\n EXAMPLES::\n\n sage: lisp == loads(dumps(lisp))\n True\n ' Expect.__init__(self, name='Lisp', prompt='> ', command='ecl', server=s...
@instancedoc class LispElement(RingElement, ExpectElement): def _richcmp_(self, other, op): '\n EXAMPLES::\n\n sage: one = lisp(1); two = lisp(2)\n sage: one == one\n True\n sage: one != two\n True\n sage: one < two\n Tru...
@instancedoc class LispFunctionElement(FunctionElement): def _instancedoc_(self): '\n EXAMPLES::\n\n sage: two = lisp(2)\n sage: two.sin.__doc__\n Traceback (most recent call last):\n ...\n NotImplementedError\n ' M = self._obj....
@instancedoc class LispFunction(ExpectFunction): def _instancedoc_(self): '\n EXAMPLES::\n\n sage: lisp.sin.__doc__\n Traceback (most recent call last):\n ...\n NotImplementedError\n ' M = self._parent return M.help(self._name)
def is_LispElement(x): '\n EXAMPLES::\n\n sage: from sage.interfaces.lisp import is_LispElement\n sage: is_LispElement(2)\n doctest:...: DeprecationWarning: the function is_LispElement is deprecated; use isinstance(x, sage.interfaces.abc.LispElement) instead\n See https://github.com...
def reduce_load_Lisp(): '\n EXAMPLES::\n\n sage: from sage.interfaces.lisp import reduce_load_Lisp\n sage: reduce_load_Lisp()\n Lisp Interpreter\n ' return lisp
def lisp_console(): "\n Spawn a new Lisp command-line session.\n\n EXAMPLES::\n\n sage: lisp.console() #not tested\n ECL (Embeddable Common-Lisp) ...\n Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya\n Copyright (C) 1993 Giuseppe Attardi\n Copyright (C) 2000 Juan J. Gar...
def remove_output_labels(s) -> str: "\n Remove output labels of Macaulay2 from a string.\n\n - s: output of Macaulay2\n\n - s: string\n\n Returns: the input string with `n` symbols removed from the beginning of\n each line, where `n` is the minimal number of spaces or symbols of\n Macaulay2 outp...
class Macaulay2(ExtraTabCompletion, Expect): '\n Interface to the Macaulay2 interpreter.\n ' def __init__(self, maxread=None, script_subdirectory=None, logfile=None, server=None, server_tmpdir=None, command=None): '\n Initialize a Macaulay2 interface instance.\n\n We replace the s...
@instancedoc class Macaulay2Element(ExtraTabCompletion, ExpectElement, sage.interfaces.abc.Macaulay2Element): '\n Instances of this class represent objects in Macaulay2.\n\n Using the method :meth:`sage` we can translate some of them to\n SageMath objects:\n\n .. automethod:: _sage_\n ' def _l...
@instancedoc class Macaulay2Function(ExpectFunction): "\n TESTS::\n\n sage: gb = macaulay2.gb # optional - macaulay2\n sage: type(gb) # optional - macaulay2\n <class 'sage.interfaces.macaulay2.Macaulay2Function'>\n sage: gb._name # optional - macaulay2\n ...
@instancedoc class Macaulay2FunctionElement(FunctionElement): def _instancedoc_(self): '\n TESTS:\n\n Since :trac:`28565`, the help output includes all documentation nodes\n that can take ``self._obj`` as first argument. This also checks that\n detex is disabled, so that the o...
def is_Macaulay2Element(x): '\n Return True if ``x`` is a :class:`Macaulay2Element`\n\n This function is deprecated; use :func:`isinstance`\n (of :class:`sage.interfaces.abc.Macaulay2Element`) instead.\n\n EXAMPLES::\n\n sage: from sage.interfaces.macaulay2 import is_Macaulay2Element\n s...
def macaulay2_console(): '\n Spawn a new M2 command-line session.\n\n EXAMPLES::\n\n sage: macaulay2_console() # not tested\n Macaulay 2, version 1.1\n with packages: Classic, Core, Elimination, IntegralClosure, LLLBases, Parsing, PrimaryDecomposition, SchurRings, Tan...
def reduce_load_macaulay2(): '\n Used for reconstructing a copy of the Macaulay2 interpreter from a pickle.\n\n EXAMPLES::\n\n sage: from sage.interfaces.macaulay2 import reduce_load_macaulay2\n sage: reduce_load_macaulay2()\n Macaulay2\n ' return macaulay2
def extcode_dir(iface=None): "\n Return directory that contains all the Magma extcode. This is put\n in a writable directory owned by the user, since when attached,\n Magma has to write sig and lck files.\n\n EXAMPLES::\n\n sage: sage.interfaces.magma.extcode_dir()\n '...dir_.../data/'\...
class Magma(ExtraTabCompletion, Expect): "\n Interface to the Magma interpreter.\n\n Type ``magma.[tab]`` for a list of all the functions\n available from your Magma install. Type\n ``magma.Function?`` for Magma's help about a given ``Function``\n Type ``magma(...)`` to create a new Magma\n obje...
@instancedoc class MagmaFunctionElement(FunctionElement): def __call__(self, *args, **kwds): "\n Return the result of calling this Magma function at given inputs.\n\n Use the optional nvals keyword argument to specify that there are\n multiple return values.\n\n EXAMPLES: We c...
@instancedoc class MagmaFunction(ExpectFunction): def __call__(self, *args, **kwds): "\n Return the result of calling this Magma function at given inputs.\n\n Use the optional nvals keyword argument to specify that there are\n multiple return values.\n\n EXAMPLES: We create a ...
def is_MagmaElement(x): '\n Return True if ``x`` is of type :class:`MagmaElement`, and False otherwise.\n\n INPUT:\n\n - ``x`` - any object\n\n OUTPUT: bool\n\n EXAMPLES::\n\n sage: from sage.interfaces.magma import is_MagmaElement\n sage: is_MagmaElement(2)\n doctest:...: Dep...
@instancedoc class MagmaElement(ExtraTabCompletion, ExpectElement, sage.interfaces.abc.MagmaElement): def _ref(self): "\n Return a variable name that is a new reference to this particular\n MagmaElement in Magma. This keeps this object from being garbage\n collected by Magma, even if...
def reduce_load_Magma(): '\n Used in unpickling a Magma interface.\n\n This functions just returns the global default Magma interface.\n\n EXAMPLES::\n\n sage: sage.interfaces.magma.reduce_load_Magma()\n Magma\n ' return magma
def magma_console(): '\n Run a command line Magma session.\n\n EXAMPLES::\n\n sage: magma_console() # not tested\n Magma V2.14-9 Sat Oct 11 2008 06:36:41 on one [Seed = 1157408761]\n Type ? for help. Type <Ctrl>-D to quit.\n >\n Total time: 2.820 seco...
class MagmaGBLogPrettyPrinter(): '\n A device which filters Magma Groebner basis computation logs.\n ' cmd_inpt = re.compile('^>>>$') app_inpt = re.compile('^Append\\(~_sage_, 0\\);$') deg_curr = re.compile('^Basis length\\: (\\d+), queue length\\: (\\d+), step degree\\: (\\d+), num pairs\\: (\\...
class MagmaGBDefaultContext(): "\n Context to force preservation of verbosity options for Magma's\n Groebner basis computation.\n " def __init__(self, magma=None): "\n INPUT:\n\n - ``magma`` - (default: ``magma_default``)\n\n EXAMPLES::\n\n sage: from sage.int...
def magma_gb_standard_options(func): '\n Decorator to force default options for Magma.\n\n EXAMPLES::\n\n sage: P.<a,b,c,d,e> = PolynomialRing(GF(127))\n sage: J = sage.rings.ideal.Cyclic(P).homogenize()\n sage: from sage.misc.sageinspect import sage_getsource\n sage: "mself" in ...
class MagmaExpr(str): def __repr__(self): return str(self)
def magma_free_eval(code, strip=True, columns=0): '\n Use the free online MAGMA calculator to evaluate the given\n input code and return the answer as a string.\n\n LIMITATIONS: The code must evaluate in at most 20 seconds\n and there is a limitation on the amount of RAM.\n\n EXAMPLES::\n\n ...
class MagmaFree(): '\n Evaluate MAGMA code without requiring that MAGMA be installed\n on your computer by using the free online MAGMA calculator.\n\n EXAMPLES::\n\n sage: magma_free("Factorization(9290348092384)") # optional - internet\n [ <2, 5>, <290323377887, 1> ]\n ' def eval(...
class Maple(ExtraTabCompletion, Expect): "\n Interface to the Maple interpreter.\n\n Type ``maple.[tab]`` for a list of all the functions\n available from your Maple install. Type\n ``maple.[tab]?`` for Maple's help about a given\n function. Type ``maple(...)`` to create a new Maple\n object, an...
@instancedoc class MapleFunction(ExpectFunction): def _instancedoc_(self): '\n Return the Maple help for this function. This gets called when\n doing "?" on self.\n\n EXAMPLES::\n\n sage: txt = maple.igcd._instancedoc_() # optional - maple\n sage: txt.find(\'ig...
@instancedoc class MapleFunctionElement(FunctionElement): def _instancedoc_(self): '\n Return the Maple help for this function.\n\n This gets called when doing "?" on ``self``.\n\n EXAMPLES::\n\n sage: two = maple(2) # optional - maple\n sage: txt = two.igcd._i...
@instancedoc class MapleElement(ExtraTabCompletion, ExpectElement): def __float__(self): "\n Return a floating point version of self.\n\n EXAMPLES::\n\n sage: float(maple(1/2)) # optional - maple\n 0.5\n sage: type(_) # optional - maple\n ...
def reduce_load_Maple(): '\n Return the maple object created in sage.interfaces.maple.\n\n EXAMPLES::\n\n sage: from sage.interfaces.maple import reduce_load_Maple\n sage: reduce_load_Maple()\n Maple\n ' return maple
def maple_console(): '\n Spawn a new Maple command-line session.\n\n EXAMPLES::\n\n sage: maple_console() #not tested\n |^/| Maple 11 (IBM INTEL LINUX)\n ._|\\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2007\n \\ MAPLE / All rights reserved. M...
def __doctest_cleanup(): '\n EXAMPLES::\n\n sage: from sage.interfaces.maple import __doctest_cleanup\n sage: m = maple(2) # optional - maple\n sage: maple.is_running() # optional - maple\n True\n sage: __doctest_cleanup()\n sage: maple.is_running()\n ...
def clean_output(s): if (s is None): return '' i = s.find('Out[') j = (i + s[i:].find('=')) s = ((s[:i] + (' ' * ((j + 1) - i))) + s[(j + 1):]) s = s.replace('\\\n', '') return s.strip('\n')
def _un_camel(name): "\n Convert `CamelCase` to `camel_case`.\n\n EXAMPLES::\n\n sage: sage.interfaces.mathematica._un_camel('CamelCase')\n 'camel_case'\n sage: sage.interfaces.mathematica._un_camel('EllipticE')\n 'elliptic_e'\n sage: sage.interfaces.mathematica._un_camel(...
class Mathematica(ExtraTabCompletion, Expect): '\n Interface to the Mathematica interpreter.\n ' def __init__(self, maxread=None, script_subdirectory=None, logfile=None, server=None, server_tmpdir=None, command=None, verbose_start=False): '\n TESTS:\n\n Test that :trac:`28075` is ...
@instancedoc class MathematicaElement(ExpectElement): def __getitem__(self, n): return self.parent().new(('%s[[%s]]' % (self._name, n))) def __getattr__(self, attrname): self._check_valid() if (attrname[:1] == '_'): raise AttributeError return MathematicaFunctionE...
@instancedoc class MathematicaFunction(ExpectFunction): def _instancedoc_(self): M = self._parent return M.help(self._name)
@instancedoc class MathematicaFunctionElement(FunctionElement): def _instancedoc_(self): M = self._obj.parent() return M.help(self._name)
def reduce_load(X): return mathematica(X)
def mathematica_console(readline=True): from sage.repl.rich_output.display_manager import get_display_manager if (not get_display_manager().is_in_terminal()): raise RuntimeError('Can use the console only in the terminal. Try %%mathematica magics instead.') if (not readline): os.system('mat...