code
stringlengths
17
6.64M
def library_interact(decorator_target: Callable[(..., Any)]=None, **widgets: Callable[(..., Any)]): "\n This is a decorator for using interacts in the Sage library.\n\n This is essentially a wrapper around the ``interact`` function.\n\n INPUT:\n\n - ``**widgets`` -- keyword arguments that are passed t...
def html(obj): '\n Shorthand to pretty print HTML\n\n EXAMPLES::\n\n sage: from sage.interacts.library import html\n sage: html("<h1>Hello world</h1>")\n <h1>Hello world</h1>\n ' from sage.misc.html import html pretty_print(html(obj))
@library_interact(n=(lambda : slider(range(10))), m=(lambda : slider(range(10)))) def demo(n: int, m: int): "\n This is a demo interact that sums two numbers.\n\n INPUT:\n\n - ``n`` -- integer\n - ``m`` -- integer\n\n EXAMPLES:\n\n Invoked in the notebook, the following command will produce\n ...
@library_interact(title=(lambda : text_control('<h2>Taylor polynomial</h2>')), f=(lambda : input_box((sin(x) * exp((- x))), label='$f(x)=$')), order=(lambda : slider(range(1, 13)))) def taylor_polynomial(title, f, order: int): "\n Illustrate the Taylor polynomial approximation\n of various orders around `x=...
@library_interact(title=(lambda : text_control('<h2>Definite integral</h2>')), f=(lambda : input_box(default='3*x', label='$f(x)=$')), g=(lambda : input_box(default='x^2', label='$g(x)=$')), interval=(lambda : range_slider((- 10), 10, default=(0, 3), label='Interval')), x_range=(lambda : range_slider((- 10), 10, defa...
@library_interact(title=(lambda : text_control('<h2>Derivative grapher</h2>')), function=(lambda : input_box(default='x^5-3*x^3+1', label='Function:')), x_range=(lambda : range_slider((- 15), 15, 0.1, default=((- 2), 2), label='Range (x)')), y_range=(lambda : range_slider((- 15), 15, 0.1, default=((- 8), 6), label='R...
@library_interact(title=(lambda : text_control('<h2>Difference quotient</h2>')), f=(lambda : input_box(default='sin(x)', label='f(x)')), interval=(lambda : range_slider(0, 10, 0.1, default=(0.0, 10.0), label='Range')), a=(lambda : slider(0, 10, None, 5.5, label='$a$')), x0=(lambda : slider(0, 10, None, 2.5, label='$x...
@library_interact(A=(lambda : slider((- 7), 7, 1, 1)), B=(lambda : slider((- 7), 7, 1, 1)), C=(lambda : slider((- 7), 7, 1, (- 2)))) def quadratic_equation(A, B, C): "\n This is a demo interact for solving quadratic equations based on work by\n Lauri Ruotsalainen, 2010.\n\n INPUT:\n\n - ``A`` -- integ...
@library_interact(a0=(lambda : slider(0, 360, 1, 30, label='A')), a1=(lambda : slider(0, 360, 1, 180, label='B')), a2=(lambda : slider(0, 360, 1, 300, label='C'))) def trigonometric_properties_triangle(a0, a1, a2): "\n This is an interact for demonstrating trigonometric properties\n in a triangle based on w...
@library_interact(function=(lambda : selector([(0, sin(x)), (1, cos(x)), (2, tan(x))])), x=(lambda : slider(0, (2 * pi), (0.005 * pi), 0))) def unit_circle(function, x): "\n This is an interact for Sin, Cos and Tan in the Unit Circle\n based on work by Lauri Ruotsalainen, 2010.\n\n INPUT:\n\n - ``func...
@library_interact(title=(lambda : text_control('<h2>Special points in triangle</h2>')), a0=(lambda : slider(0, 360, 1, 30, label='A')), a1=(lambda : slider(0, 360, 1, 180, label='B')), a2=(lambda : slider(0, 360, 1, 300, label='C')), show_median=(lambda : checkbox(False, label='Medians')), show_pb=(lambda : checkbox(...
@library_interact(n=(lambda : slider(2, 10000, 100, default=1000, label='Number of Tosses')), interval=(lambda : range_slider(0.0, 1.0, default=(0.45, 0.55), label='Plotting range (y)'))) def coin(n, interval): "\n This interact demo simulates repeated tosses of a coin,\n based on work by Lauri Ruotsalainen...
@library_interact(title=(lambda : text_control('<h2>Bisection method</h2>')), f=(lambda : input_box('x^2-2', label='f(x)')), interval=(lambda : range_slider((- 5), 5, default=(0, 4), label='range')), d=(lambda : slider(1, 8, 1, 3, label='$10^{-d}$ precision')), maxn=(lambda : slider(0, 50, 1, 10, label='max iteration...
@library_interact(title=(lambda : text_control('<h2>Secant method for numerical root finding</h2>')), f=(lambda : input_box('x^2-2', label='f(x)')), interval=(lambda : range_slider((- 5), 5, default=(0, 4), label='range')), d=(lambda : slider(1, 16, 1, 3, label='10^-d precision')), maxn=(lambda : slider(0, 15, 1, 10,...
@library_interact(title=(lambda : text_control('<h2>Newton method</h2>')), f=(lambda : input_box('x^2 - 2')), c=(lambda : slider((- 10), 10, default=6, label='Start ($x$)')), d=(lambda : slider(1, 16, 1, 3, label='$10^{-d}$ precision')), maxn=(lambda : slider(0, 15, 1, 10, label='max iterations')), interval=(lambda :...
@library_interact(title=(lambda : text_control('<h2>Trapezoid integration</h2>')), f=(lambda : input_box(default='x^2-5*x + 10', label='$f(x)=$')), n=(lambda : slider(1, 100, 1, 5, label='# divisions')), interval_input=(lambda : selector(['from slider', 'from keyboard'], label='Integration interval', buttons=True)), ...
@library_interact(title=(lambda : text_control('<h2>Simpson integration</h2>')), f=(lambda : input_box(default='x*sin(x)+x+1', label='$f(x)=$')), n=(lambda : slider(2, 100, 2, 6, label='# divisions')), interval_input=(lambda : selector(['from slider', 'from keyboard'], label='Integration interval', buttons=True)), in...
@library_interact(title=(lambda : text_control('<h2>Riemann integral with random sampling</h2>')), f=(lambda : input_box('x^2+1', label='$f(x)=$', width=40)), n=(lambda : slider(1, 30, 1, 5, label='# divisions')), hr1=(lambda : text_control('<hr>')), interval_input=(lambda : selector(['from slider', 'from keyboard'],...
@library_interact(f=(lambda : sin(x)), g=(lambda : cos(x)), xrange=(lambda : range_slider((- 3), 3, default=(0, 1), label='x-range')), yrange=(lambda : 'auto'), a=(lambda : 1), action=(lambda : selector(['f', 'df/dx', 'int f', 'num f', 'den f', '1/f', 'finv', 'f+a', 'f-a', 'f*a', 'f/a', 'f^a', 'f(x+a)', 'f(x*a)', 'f+...
@library_interact(expo=(lambda : slider((- 10), 10, 0.1, 2)), c_real=(lambda : slider((- 2), 2, 0.01, 0.5, label='real part const.')), c_imag=(lambda : slider((- 2), 2, 0.01, 0.5, label='imag part const.')), iterations=(lambda : slider(1, 100, 1, 20, label='# iterations')), zoom_x=(lambda : range_slider((- 2), 2, 0.0...
@library_interact(expo=(lambda : slider((- 10), 10, 0.1, 2)), iterations=(lambda : slider(1, 100, 1, 20, label='# iterations')), zoom_x=(lambda : range_slider((- 2), 2, 0.01, ((- 2), 1), label='Zoom X')), zoom_y=(lambda : range_slider((- 2), 2, 0.01, ((- 1.5), 1.5), label='Zoom Y')), plot_points=(lambda : slider(20, ...
@library_interact(N=(lambda : slider(1, 500, 1, label='Number of iterations', default=100)), rule_number=(lambda : slider(0, 255, 1, default=110, label='Rule number')), size=(lambda : slider(1, 11, step_size=1, default=6, label='size of graphic'))) def cellular_automaton(N, rule_number, size): "\n Yields a mat...
@library_interact(interval=(lambda : range_slider(1, 4000, 10, default=(1, 1000), label='range')), show_factors=(lambda : True), highlight_primes=(lambda : True), show_curves=(lambda : True), n=(lambda : slider(1, 200, 1, default=89, label='number $n$')), dpi=(lambda : slider(10, 300, 10, default=100, label='dpi'))) ...
class AxiomElement(): '\n Abstract base class for :class:`~sage.interfaces.axiom.AxiomElement`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage.interfaces....
class ExpectElement(): '\n Abstract base class for :class:`~sage.interfaces.expect.ExpectElement`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage.interfac...
class FriCASElement(): '\n Abstract base class for :class:`~sage.interfaces.fricas.FriCASElement`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage.interfac...
class GapElement(): '\n Abstract base class for :class:`~sage.interfaces.gap.GapElement`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage.interfaces.abc.Ga...
class GpElement(): '\n Abstract base class for :class:`~sage.interfaces.gp.GpElement`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage.interfaces.abc.GpEle...
class Macaulay2Element(): '\n Abstract base class for :class:`~sage.interfaces.macaulay2.Macaulay2Element`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage...
class MagmaElement(): '\n Abstract base class for :class:`~sage.interfaces.magma.MagmaElement`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage.interfaces....
class SingularElement(): '\n Abstract base class for :class:`~sage.interfaces.singular.SingularElement`.\n\n This class is defined for the purpose of ``isinstance`` tests. It should not be\n instantiated.\n\n EXAMPLES:\n\n By design, there is a unique direct subclass::\n\n sage: len(sage.in...
class PanAxiom(ExtraTabCompletion, Expect): '\n Interface to a PanAxiom interpreter.\n ' def __init__(self, name='axiom', command='axiom -nox -noclef', script_subdirectory=None, logfile=None, server=None, server_tmpdir=None, init_code=[')lisp (si::readline-off)']): '\n Create an instance...
class Axiom(PanAxiom): def __reduce__(self): '\n EXAMPLES::\n\n sage: Axiom().__reduce__()\n (<function reduce_load_Axiom at 0x...>, ())\n sage: f, args = _\n sage: f(*args)\n Axiom\n ' return (reduce_load_Axiom, tuple([])) ...
@instancedoc class PanAxiomElement(ExpectElement, sage.interfaces.abc.AxiomElement): def __call__(self, x): '\n EXAMPLES::\n\n sage: f = axiom(x+2) #optional - axiom\n sage: f(2) #optional - axiom\n 4\n ' self._check_valid() P = sel...
@instancedoc class PanAxiomFunctionElement(FunctionElement): def __init__(self, object, name): '\n TESTS::\n\n sage: # optional - axiom\n sage: a = axiom(\'"Hello"\')\n sage: a.upperCase_q\n upperCase?\n sage: a.upperCase_e\n upperC...
@instancedoc class PanAxiomExpectFunction(ExpectFunction): def __init__(self, parent, name): '\n TESTS::\n\n sage: axiom.upperCase_q\n upperCase?\n sage: axiom.upperCase_e\n upperCase!\n ' if name.endswith('_q'): name = (name[:...
def is_AxiomElement(x): '\n Return True if ``x`` is of type :class:`AxiomElement`.\n\n EXAMPLES::\n\n sage: from sage.interfaces.axiom import is_AxiomElement\n sage: is_AxiomElement(2)\n doctest:...: DeprecationWarning: the function is_AxiomElement is deprecated; use isinstance(x, sage....
def reduce_load_Axiom(): '\n Returns the Axiom interface object defined in\n sage.interfaces.axiom.\n\n EXAMPLES::\n\n sage: from sage.interfaces.axiom import reduce_load_Axiom\n sage: reduce_load_Axiom()\n Axiom\n ' return axiom
def axiom_console(): '\n Spawn a new Axiom command-line session.\n\n EXAMPLES::\n\n sage: axiom_console() #not tested\n AXIOM Computer Algebra System\n Version: Axiom (January 2009)\n Timestamp: Sunday January 25, 200...
def have_chomp(program='homsimpl'): "\n Return True if this computer has ``program`` installed.\n\n The first time it is run, this function caches its result in the\n variable ``_have_chomp`` -- a dictionary indexed by program name\n -- and any subsequent time, it just checks the value of the\n var...
class CHomP(): "\n Interface to the CHomP package.\n\n :param program: which CHomP program to use\n :type program: string\n :param complex: a simplicial or cubical complex\n :param subcomplex: a subcomplex of ``complex`` or None (the default)\n :param base_ring: ring over which to perform comput...
def homsimpl(complex=None, subcomplex=None, **kwds): "\n Compute the homology of a simplicial complex using the CHomP\n program ``homsimpl``. If the argument ``subcomplex`` is present,\n compute homology of ``complex`` relative to ``subcomplex``.\n\n This function is deprecated: see :trac:`33777`.\n\...
def homcubes(complex=None, subcomplex=None, **kwds): '\n Compute the homology of a cubical complex using the CHomP program\n ``homcubes``. If the argument ``subcomplex`` is present, compute\n homology of ``complex`` relative to ``subcomplex``.\n\n This function is deprecated: see :trac:`33777`.\n\n ...
def homchain(complex=None, **kwds): '\n Compute the homology of a chain complex using the CHomP program\n ``homchain``.\n\n This function is deprecated: see :trac:`33777`.\n\n :param complex: a chain complex\n :param generators: if True, also return list of generators\n :type generators: boolean...
def process_generators_cubical(gen_string, dim): '\n Process CHomP generator information for cubical complexes.\n\n This function is deprecated: see :trac:`33777`.\n\n :param gen_string: generator output from CHomP\n :type gen_string: string\n :param dim: dimension in which to find generators\n ...
def process_generators_simplicial(gen_string, dim, complex): '\n Process CHomP generator information for simplicial complexes.\n\n This function is deprecated: see :trac:`33777`\n\n :param gen_string: generator output from CHomP\n :type gen_string: string\n :param dim: dimension in which to find ge...
def process_generators_chain(gen_string, dim, base_ring=None): '\n Process CHomP generator information for simplicial complexes.\n\n This function is deprecated: see :trac:`33777`.\n\n :param gen_string: generator output from CHomP\n :type gen_string: string\n :param dim: dimension in which to find...
def start_cleaner(): '\n Start ``sage-cleaner`` in a new process group.\n ' if (not os.fork()): os.setpgid(os.getpid(), os.getpid()) with open(os.devnull, 'r+') as f: os.dup2(f.fileno(), 0) os.dup2(f.fileno(), 1) os.dup2(f.fileno(), 2) try: ...
class ECM(SageObject): def __init__(self, B1=10, B2=None, **kwds): '\n Create an interface to the GMP-ECM elliptic curve method\n factorization program.\n\n See https://gitlab.inria.fr/zimmerma/ecm\n\n INPUT:\n\n - ``B1`` -- integer. Stage 1 bound\n\n - ``B2`` --...
class gc_disabled(): '\n This is a "with" statement context manager. Garbage collection is\n disabled within its scope. Nested usage is properly handled.\n\n EXAMPLES::\n\n sage: import gc\n sage: from sage.interfaces.expect import gc_disabled\n sage: gc.isenabled()\n True\n ...
class Expect(Interface): '\n Expect interface object.\n ' def __init__(self, name, prompt, command=None, env={}, server=None, server_tmpdir=None, ulimit=None, maxread=None, script_subdirectory=None, restart_on_ctrlc=False, verbose_start=False, init_code=[], max_startup_time=None, logfile=None, eval_usi...
@instancedoc class ExpectFunction(InterfaceFunction): '\n Expect function.\n ' pass
@instancedoc class FunctionElement(InterfaceFunctionElement): '\n Expect function element.\n ' pass
def is_ExpectElement(x): '\n Return True if ``x`` is of type :class:`ExpectElement`\n\n This function is deprecated; use :func:`isinstance`\n (of :class:`sage.interfaces.abc.ExpectElement`) instead.\n\n EXAMPLES::\n\n sage: from sage.interfaces.expect import is_ExpectElement\n sage: is_E...
@instancedoc class ExpectElement(InterfaceElement, sage.interfaces.abc.ExpectElement): '\n Expect element.\n ' def __init__(self, parent, value, is_name=False, name=None): RingElement.__init__(self, parent) self._create = value if (parent is None): return if ...
class StdOutContext(): '\n A context in which all communication between Sage and a subprocess\n interfaced via pexpect is printed to stdout.\n ' def __init__(self, interface, silent=False, stdout=None): "\n Construct a new context in which all communication between Sage\n and a...
class FourTi2(): '\n An interface to the program 4ti2.\n\n Each 4ti2 command is exposed as a method of this class.\n ' def __init__(self, directory=None): '\n Initialize this object.\n\n INPUT:\n\n - ``directory`` -- 4ti2 only deals with files, and this is the\n ...
class FriCAS(ExtraTabCompletion, Expect): '\n Interface to a FriCAS interpreter.\n ' def __init__(self, name='fricas', command=None, script_subdirectory=None, logfile=None, server=None, server_tmpdir=None): '\n Create an instance of the FriCAS interpreter.\n\n TESTS::\n\n ...
@instancedoc class FriCASElement(ExpectElement, sage.interfaces.abc.FriCASElement): '\n Instances of this class represent objects in FriCAS.\n\n Using the method :meth:`sage` we can translate some of them to\n SageMath objects:\n\n .. automethod:: _sage_\n ' def __len__(self): "\n ...
@instancedoc class FriCASFunctionElement(FunctionElement): def __init__(self, object, name): '\n Make FriCAS operation names valid python function identifiers.\n\n TESTS::\n\n sage: a = fricas(\'"Hello"\')\n sage: a.upperCase_q\n upperCase?\n sage...
@instancedoc class FriCASExpectFunction(ExpectFunction): def __init__(self, parent, name): '\n Translate the pythonized function identifier back to a FriCAS\n operation name.\n\n TESTS::\n\n sage: fricas.upperCase_q\n upperCase?\n sage: fricas.upperCa...
def is_FriCASElement(x): '\n Return ``True`` if ``x`` is of type :class:`FriCASElement`.\n\n EXAMPLES::\n\n sage: from sage.interfaces.fricas import is_FriCASElement\n sage: is_FriCASElement(2)\n doctest:...: DeprecationWarning: the function is_FriCASElement is deprecated; use isinstanc...
def reduce_load_fricas(): '\n Return the FriCAS interface object defined in :mod:`sage.interfaces.fricas`.\n\n EXAMPLES::\n\n sage: from sage.interfaces.fricas import reduce_load_fricas\n sage: reduce_load_fricas()\n FriCAS\n ' return fricas
def fricas_console(): '\n Spawn a new FriCAS command-line session.\n\n EXAMPLES::\n\n sage: fricas_console() # not tested\n FriCAS (AXIOM fork) Computer Algebra System\n Version: FriCAS 1.0.5\n...
def __doctest_cleanup(): '\n EXAMPLES::\n\n sage: from sage.interfaces.fricas import __doctest_cleanup\n sage: a = FriCAS()\n sage: two = a(2)\n sage: a.is_running()\n True\n sage: __doctest_cleanup()\n sage: a.is_running()\n False\n ' import sage....
class Frobby(): def __call__(self, action, input=None, options=[], verbose=False): '\n This function calls Frobby as a command line program using streams\n for input and output. Strings passed as part of the command get\n broken up at whitespace. This is not done to the data passed\n...
def gap_command(use_workspace_cache=True, local=True): if use_workspace_cache: if local: return (('%s -L %s' % (gap_cmd, WORKSPACE)), False) else: return (gap_cmd, False) else: return (gap_cmd, True)
class Gap_generic(ExtraTabCompletion, Expect): '\n Generic interface to the GAP3/GAP4 interpreters.\n\n AUTHORS:\n\n - William Stein and David Joyner (interface for GAP4)\n\n - Franco Saliola (Feb 2010): refactored to separate out the generic\n code\n\n ' _identical_function = 'IsIdentical...
@instancedoc class GapElement_generic(ModuleElement, ExtraTabCompletion, ExpectElement): '\n Generic interface to the GAP3/GAP4 interpreters.\n\n AUTHORS:\n\n - William Stein and David Joyner (interface for GAP4)\n\n - Franco Saliola (Feb 2010): refactored to separate out the generic\n code\n ...
class Gap(Gap_generic): '\n Interface to the GAP interpreter.\n\n AUTHORS:\n\n - William Stein and David Joyner\n ' def __init__(self, max_workspace_size=None, maxread=None, script_subdirectory=None, use_workspace_cache=True, server=None, server_tmpdir=None, logfile=None, seed=None, env={}): ...
def gap_reset_workspace(max_workspace_size=None, verbose=False): '\n Call this to completely reset the GAP workspace, which is used by\n default when Sage first starts GAP.\n\n The first time you start GAP from Sage, it saves the startup state\n of GAP in a file ``$HOME/.sage/gap/workspace-gap-HASH``,...
@instancedoc class GapElement(GapElement_generic, sage.interfaces.abc.GapElement): def __getitem__(self, n): '\n EXAMPLES::\n\n sage: a = gap([1,2,3])\n sage: a[1]\n 1\n ' self._check_valid() if (not isinstance(n, tuple)): return ...
@instancedoc class GapFunctionElement(FunctionElement): def _instancedoc_(self): "\n EXAMPLES::\n\n sage: gap = Gap(env={'LC_CTYPE': 'en_US.UTF-8'})\n sage: print(gap(4).SymmetricGroup.__doc__)\n <BLANKLINE>\n 50.1-... SymmetricGroup\n <BLAN...
@instancedoc class GapFunction(ExpectFunction): def _instancedoc_(self): "\n EXAMPLES::\n\n sage: gap = Gap(env={'LC_CTYPE': 'en_US.UTF-8'})\n sage: print(gap.SymmetricGroup.__doc__)\n <BLANKLINE>\n 50.1-... SymmetricGroup\n <BLANKLINE>\n ...
def is_GapElement(x): '\n Return True if ``x`` is a :class:`GapElement`\n\n This function is deprecated; use :func:`isinstance`\n (of :class:`sage.interfaces.abc.GapElement`) instead.\n\n EXAMPLES::\n\n sage: from sage.interfaces.gap import is_GapElement\n sage: is_GapElement(gap(2))\n ...
def gfq_gap_to_sage(x, F): "\n INPUT:\n\n - ``x`` -- GAP finite field element\n\n - ``F`` -- Sage finite field\n\n OUTPUT: element of ``F``\n\n EXAMPLES::\n\n sage: x = gap('Z(13)')\n sage: F = GF(13, 'a')\n sage: F(x)\n 2\n sage: F(gap('0*Z(13)'))\n 0\n ...
def intmod_gap_to_sage(x): '\n INPUT:\n\n - x -- Gap integer mod ring element\n\n EXAMPLES::\n\n sage: a = gap(Mod(3, 18)); a\n ZmodnZObj( 3, 18 )\n sage: b = sage.interfaces.gap.intmod_gap_to_sage(a); b\n 3\n sage: b.parent()\n Ring of integers modulo 18\n\n ...
def reduce_load_GAP(): '\n Returns the GAP interface object defined in sage.interfaces.gap.\n\n EXAMPLES::\n\n sage: from sage.interfaces.gap import reduce_load_GAP\n sage: reduce_load_GAP()\n Gap\n ' return gap
def gap_console(): '\n Spawn a new GAP command-line session.\n\n Note that in gap-4.5.7 you cannot use a workspace cache that had\n no commandline to restore a gap session with commandline.\n\n EXAMPLES::\n\n sage: gap_console() # not tested\n ********* GAP, Version 4.5.7 of 14-Dec-20...
class Gap3(Gap_generic): "\n A simple Expect interface to GAP3.\n\n EXAMPLES::\n\n sage: from sage.interfaces.gap3 import Gap3\n sage: gap3 = Gap3(command='gap3')\n\n TESTS::\n\n sage: gap3(2) == gap3(3) #optional - gap3\n False\n sage: gap3(2)...
class GAP3Element(GapElement_generic): "\n A GAP3 element\n\n .. NOTE::\n\n If the corresponding GAP3 element is a GAP3 record,\n then the class is changed to a ``GAP3Record``.\n\n INPUT:\n\n - ``parent`` -- the GAP3 session\n\n - ``value`` -- the GAP3 command as a string\n\n - ``i...
class GAP3Record(GAP3Element): '\n A GAP3 record\n\n .. NOTE::\n\n This class should not be called directly, use GAP3Element instead.\n If the corresponding GAP3 element is a GAP3 record, then the class\n is changed to a ``GAP3Record``.\n\n AUTHORS:\n\n - Franco Saliola (Feb 2010)...
def gap3_console(): '\n Spawn a new GAP3 command-line session.\n\n EXAMPLES::\n\n sage: gap3.console() # not tested\n\n ######## Lehrstuhl D fuer Mathematik\n ### #### RWTH Aachen\n ## #...
def gap3_version(): "\n Return the version of GAP3 that you have in your PATH on your computer.\n\n EXAMPLES::\n\n sage: gap3_version() # random, optional - gap3\n 'lib: v3r4p4 1997/04/18, src: v3r4p0 1994/07/10, sys: usg gcc ansi'\n " return ga...
def gap_workspace_file(system='gap', name='workspace', dir=None): '\n Return the filename for the GAP workspace.\n\n INPUT:\n\n - ``system`` -- the name of the system, either ``"gap"`` or\n ``"libgap"``\n\n - ``name`` -- the kind of workspace, usually ``"workspace"`` but\n the library interf...
def prepare_workspace_dir(dir=None): '\n Create and clean up the directory for GAP workspaces.\n\n INPUT:\n\n - ``dir`` -- the directory where the workspaces should be stored.\n By default, this is ``DOT_SAGE/gap``\n\n OUTPUT: the actual workspace directory\n\n EXAMPLES::\n\n sage: from...
class ReductionData(SageObject): '\n Reduction data for a genus 2 curve.\n\n How to read ``local_data`` attribute, i.e., if this\n class is R, then the following is the meaning of\n ``R.local_data[p]``.\n\n For each prime number `p` dividing the discriminant of\n `y^2+Q(x)y=P(x)`, there are two ...
def divisors_to_string(divs): '\n Convert a list of numbers (representing the orders of cyclic groups\n in the factorization of a finite abelian group) to a string\n according to the format shown in the examples.\n\n INPUT:\n\n - ``divs`` -- a (possibly empty) list of numbers\n\n OUTPUT: a strin...
class Genus2reduction(SageObject): "\n Conductor and Reduction Types for Genus 2 Curves.\n\n Use ``R = genus2reduction(Q, P)`` to obtain reduction\n information about the Jacobian of the projective smooth curve\n defined by `y^2 + Q(x)y = P(x)`. Type ``R?``\n for further documentation and a descrip...
def _reduce_load_genus2reduction(): return genus2reduction
class Gfan(): "\n Interface to Anders Jensen's Groebner Fan program.\n " @rename_keyword(deprecation=33468, I='input') def __call__(self, input, cmd='', verbose=False, format=None): "\n Call Groebner Fan program with given input\n\n INPUT:\n\n - ``input`` -- string, inp...
class Giac(Expect): "\n Interface to the Giac interpreter.\n\n You must have the optional Giac interpreter installed and available as the command ``giac`` in your PATH in order to use this interface. Try the command: print(giac._install_hints()) for more informations on giac installation.\n\n Type ``gia...
@instancedoc class GiacFunction(ExpectFunction): def _instancedoc_(self): '\n Return the Giac help for this function. This gets called when\n doing "?" on self.\n\n EXAMPLES::\n\n sage: giac.gcd.__doc__ # random\n "gcd - greatest common divisor of polynomials.....
@instancedoc class GiacFunctionElement(FunctionElement): def _instancedoc_(self): '\n Return the Giac help for this function. This gets called when\n doing "?" on self.\n\n EXAMPLES::\n\n sage: two = giac(2)\n sage: two.gcd.__doc__ # random\n "...gcd...
@instancedoc class GiacElement(ExpectElement): def __float__(self): "\n Return a floating point version of self.\n\n EXAMPLES::\n\n sage: float(giac(1/2))\n 0.5\n sage: type(_)\n <class 'float'>\n " return float(giac.eval(('evalf(%s...
def reduce_load_Giac(): '\n Return the giac object created in sage.interfaces.giac.\n\n EXAMPLES::\n\n sage: from sage.interfaces.giac import reduce_load_Giac\n sage: reduce_load_Giac()\n Giac\n ' return giac
def giac_console(): '\n Spawn a new Giac command-line session.\n\n EXAMPLES::\n\n sage: giac.console() # not tested - giac\n ...\n Homepage http://www-fourier.ujf-grenoble.fr/~parisse/giac.html\n Released under the GPL license 3.0 or above\n See http://www.gnu.org for lic...
def __doctest_cleanup(): '\n EXAMPLES::\n\n sage: from sage.interfaces.giac import __doctest_cleanup\n sage: m = giac(2)\n sage: giac.is_running()\n True\n sage: __doctest_cleanup()\n sage: giac.is_running()\n False\n ' import sage.interfaces.quit sag...
class Gnuplot(SageObject): '\n Interface to the Gnuplot interpreter.\n ' def _quit_string(self): return 'quit' def gnuplot(self): try: return self._gnuplot except AttributeError: try: import Gnuplot as GP self._gnuplot...
def gnuplot_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 %%gnuplot magics instead.') os.system('gnuplot')