code stringlengths 17 6.64M |
|---|
def function_factory(name, nargs=0, latex_name=None, conversions=None, evalf_params_first=True, eval_func=None, evalf_func=None, conjugate_func=None, real_part_func=None, imag_part_func=None, derivative_func=None, tderivative_func=None, power_func=None, series_func=None, print_func=None, print_latex_func=None):
"... |
def unpickle_function(name, nargs, latex_name, conversions, evalf_params_first, pickled_funcs):
"\n This is returned by the ``__reduce__`` method of symbolic functions to be\n called during unpickling to recreate the given function.\n\n It calls :meth:`function_factory` with the supplied arguments.\n\n ... |
def function(s, **kwds) -> Union[(SymbolicFunction, list[SymbolicFunction])]:
'\n Create a formal symbolic function with the name *s*.\n\n INPUT:\n\n - ``nargs=0`` - number of arguments the function accepts, defaults to\n variable number of arguments, or 0\n - ``latex_name`` - name used when prin... |
def maxima_integrator(expression, v, a=None, b=None):
"\n Integration using Maxima\n\n EXAMPLES::\n\n sage: from sage.symbolic.integration.external import maxima_integrator\n sage: maxima_integrator(sin(x), x)\n -cos(x)\n sage: maxima_integrator(cos(x), x)\n sin(x)\n ... |
def sympy_integrator(expression, v, a=None, b=None):
'\n Integration using SymPy\n\n EXAMPLES::\n\n sage: from sage.symbolic.integration.external import sympy_integrator\n sage: sympy_integrator(sin(x), x) # needs sympy\n -cos(x)\n sa... |
def mma_free_integrator(expression, v, a=None, b=None):
'\n Integration using Mathematica\'s online integrator\n\n EXAMPLES::\n\n sage: from sage.symbolic.integration.external import mma_free_integrator\n sage: mma_free_integrator(sin(x), x) # optional - internet\n -cos(x)\n\n A defi... |
def fricas_integrator(expression, v, a=None, b=None, noPole=True):
'\n Integration using FriCAS\n\n EXAMPLES::\n\n sage: # optional - fricas\n sage: from sage.symbolic.integration.external import fricas_integrator\n sage: fricas_integrator(sin(x), x)\n -cos(x)\n sage: fric... |
def giac_integrator(expression, v, a=None, b=None):
"\n Integration using Giac\n\n EXAMPLES::\n\n sage: from sage.symbolic.integration.external import giac_integrator\n sage: giac_integrator(sin(x), x)\n -cos(x)\n sage: giac_integrator(1/(x^2+6), x, -oo, oo)\n 1/6*sqrt(6)*... |
def libgiac_integrator(expression, v, a=None, b=None):
"\n Integration using libgiac\n\n EXAMPLES::\n\n sage: import sage.libs.giac\n ...\n sage: from sage.symbolic.integration.external import libgiac_integrator\n sage: libgiac_integrator(sin(x), x)\n -cos(x)\n sage... |
class IndefiniteIntegral(BuiltinFunction):
def __init__(self):
'\n Class to represent an indefinite integral.\n\n EXAMPLES::\n\n sage: from sage.symbolic.integration.integral import indefinite_integral\n sage: indefinite_integral(log(x), x) #indirect doctest\n ... |
class DefiniteIntegral(BuiltinFunction):
def __init__(self):
"\n The symbolic function representing a definite integral.\n\n EXAMPLES::\n\n sage: from sage.symbolic.integration.integral import definite_integral\n sage: definite_integral(sin(x),x,0,pi)\n 2\n\... |
def _normalize_integral_input(f, v, a=None, b=None):
'\n Validate and return variable and endpoints for an integral.\n\n INPUT:\n\n - ``f`` -- an expression to integrate\n\n - ``v`` -- a variable of integration or a triple\n\n - ``a`` -- (optional) the left endpoint of integration\n\n - ``b`` --... |
def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
'\n Return the indefinite integral with respect to the variable\n `v`, ignoring the constant of integration. Or, if endpoints\n `a` and `b` are specified, returns the definite\n integral over the interval `[a, b]`.\n\n I... |
@instancedoc
class MaximaFunctionElementWrapper(MaximaFunctionElement):
def __call__(self, *args, **kwds):
'\n Return a Sage expression instead of a Maxima pexpect interface element.\n\n EXAMPLES::\n\n sage: t = sin(x)^2 + cos(x)^2; t\n cos(x)^2 + sin(x)^2\n ... |
class MaximaWrapper(SageObject):
def __init__(self, exp):
"\n Wrapper around Sage expressions to give access to Maxima methods.\n\n We convert the given expression to Maxima and convert the return value\n back to a Sage expression. Tab completion and help strings of Maxima\n m... |
def add_vararg(first, *rest):
"\n Return the sum of all the arguments.\n\n INPUT:\n\n - ``first``, ``*rest`` -- arguments to add\n\n OUTPUT: sum of the arguments\n\n EXAMPLES::\n\n sage: from sage.symbolic.operators import add_vararg\n sage: add_vararg(1, 2, 3, 4, 5, 6, 7)\n 28... |
def mul_vararg(first, *rest):
"\n Return the product of all the arguments.\n\n INPUT:\n\n - ``first``, ``*rest`` -- arguments to multiply\n\n OUTPUT: product of the arguments\n\n EXAMPLES::\n\n sage: from sage.symbolic.operators import mul_vararg\n sage: mul_vararg(9, 8, 7, 6, 5, 4)\n... |
class FDerivativeOperator():
'\n Function derivative operators.\n\n A function derivative operator represents a partial derivative\n of a function with respect to some variables.\n\n The underlying data are the function, and the parameter set,\n a list recording the indices of the variables with re... |
class DerivativeOperator():
"\n Derivative operator.\n\n Acting with this operator onto a function gives a new operator (of\n type :class:`FDerivativeOperator`) representing the function\n differentiated with respect to one or multiple of its arguments.\n\n This operator takes a list of indices spe... |
def _mk_full_functions():
'\n A simple function that returns a list of all Pynac functions of known\n arity, sorted by name.\n\n EXAMPLES::\n\n sage: from sage.symbolic.random_tests import _mk_full_functions\n sage: [f for (one,f,arity) in _mk_full_functions()] # random\n [Ei, abs, a... |
def normalize_prob_list(pl, extra=()):
'\n INPUT:\n\n - ``pl`` - A list of tuples, where the first element of each tuple is\n a floating-point number (representing a relative probability). The\n second element of each tuple may be a list or any other kind of object.\n\n - ``extra`` - A tuple w... |
def choose_from_prob_list(lst):
'\n INPUT:\n\n - ``lst`` - A list of tuples, where the first element of each tuple\n is a nonnegative float (a probability), and the probabilities sum\n to one.\n\n OUTPUT:\n\n A tuple randomly selected from the list according to the given\n probabilities.\... |
def random_integer_vector(n, length):
'\n Give a random list of length *length*, consisting of nonnegative\n integers that sum to *n*.\n\n This is an approximation to IntegerVectors(n, length).random_element().\n That gives values uniformly at random, but might be slow; this\n routine is not unifor... |
def random_expr_helper(n_nodes, internal, leaves, verbose):
'\n Produce a random symbolic expression of size *n_nodes* (or slightly\n larger). Internal nodes are selected from the *internal* probability\n list; leaves are selected from *leaves*. If *verbose* is True,\n then a message is printed befo... |
def random_expr(size, nvars=1, ncoeffs=None, var_frac=0.5, internal=full_internal, nullary=full_nullary, nullary_frac=0.2, coeff_generator=QQ.random_element, verbose=False):
'\n Produce a random symbolic expression of the given size. By\n default, the expression involves (at most) one variable, an arbitrar... |
def assert_strict_weak_order(a, b, c, cmp_func):
'\n Check that ``cmp_func`` is a strict weak order on the elements a,b,c.\n\n A strict weak order is a binary relation ``<`` such that\n\n * For all `x`, it is not the case that `x < x` (irreflexivity).\n\n * For all `x\\not=y`, if `x < y` then it is no... |
def test_symbolic_expression_order(repetitions=100):
'\n Tests whether the comparison of random symbolic expressions\n satisfies the strict weak order axioms.\n\n This is important because the C++ extension class uses\n ``std::sort()`` which requires a strict weak order. See also\n :trac:`9880`.\n\... |
def test_relation_maxima(relation):
"\n Return True if this (in)equality is definitely true. Return False\n if it is false or the algorithm for testing (in)equality is\n inconclusive.\n\n EXAMPLES::\n\n sage: from sage.symbolic.relation import test_relation_maxima\n sage: k = var('k')\n ... |
def string_to_list_of_solutions(s):
"\n Used internally by the symbolic solve command to convert the output\n of Maxima's solve command to a list of solutions in Sage's symbolic\n package.\n\n EXAMPLES:\n\n We derive the (monic) quadratic formula::\n\n sage: var('x,a,b')\n (x, a, b)\n... |
def solve(f, *args, **kwds):
'\n Algebraically solve an equation or system of equations (over the\n complex numbers) for given variables. Inequalities and systems\n of inequalities are also supported.\n\n INPUT:\n\n - ``f`` - equation or system of equations (given by a\n list or tuple)\n\n ... |
def _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain):
"\n Solve an expression ``f``. For more information, see :func:`solve`.\n\n .. NOTE::\n\n This is an auxiliary function only meant to be called\n from :func:`solve`.\n\n TESTS:\... |
def _giac_solver(f, x, solution_dict=False):
"\n Solve a system of equations using libgiac.\n\n INPUT:\n\n - ``f`` -- equation or list of equations\n - ``x`` -- variable or list of variables\n - ``solution_dict`` -- optional boolean (default ``False``)\n\n EXAMPLES::\n\n sage: solve([(2/3... |
def solve_mod(eqns, modulus, solution_dict=False):
'\n Return all solutions to an equation or list of equations modulo the\n given integer modulus. Each equation must involve only polynomials\n in 1 or many variables.\n\n By default the solutions are returned as `n`-tuples, where `n`\n is the numbe... |
def _solve_mod_prime_power(eqns, p, m, vars):
"\n Internal help function for solve_mod, does little checking since it expects\n solve_mod to do that\n\n Return all solutions to an equation or list of equations modulo p^m.\n Each equation must involve only polynomials\n in 1 or many variables.\n\n ... |
def solve_ineq_univar(ineq):
'\n Function solves rational inequality in one variable.\n\n INPUT:\n\n - ``ineq`` - inequality in one variable\n\n OUTPUT:\n\n - ``list`` -- output is list of solutions as a list of simple inequalities\n output [A,B,C] means (A or B or C) each A, B, C is again a l... |
def solve_ineq_fourier(ineq, vars=None):
"\n Solves system of inequalities using Maxima and Fourier elimination\n\n Can be used for system of linear inequalities and for some types\n of nonlinear inequalities. For examples, see the example section\n below and http://maxima.cvs.sourceforge.net/viewvc/m... |
def solve_ineq(ineq, vars=None):
"\n Solves inequalities and systems of inequalities using Maxima.\n Switches between rational inequalities\n (sage.symbolic.relation.solve_ineq_rational)\n and Fourier elimination (sage.symbolic.relation.solve_ineq_fouried).\n See the documentation of these function... |
class SymbolicSubringFactory(UniqueFactory):
"\n A factory creating a symbolic subring.\n\n INPUT:\n\n Specify one of the following keywords to create a subring.\n\n - ``accepting_variables`` (default: ``None``) -- a tuple or other\n iterable of variables. If specified, then a symbolic subring of... |
class GenericSymbolicSubring(SymbolicRing):
def __init__(self, vars):
"\n An abstract base class for a symbolic subring.\n\n INPUT:\n\n - ``vars`` -- a tuple of symbolic variables.\n\n TESTS::\n\n sage: from sage.symbolic.subring import SymbolicSubring\n ... |
class GenericSymbolicSubringFunctor(ConstructionFunctor):
'\n A base class for the functors constructing symbolic subrings.\n\n INPUT:\n\n - ``vars`` -- a tuple, set, or other iterable of symbolic variables.\n\n EXAMPLES::\n\n sage: from sage.symbolic.subring import SymbolicSubring\n sag... |
class SymbolicSubringAcceptingVars(GenericSymbolicSubring):
'\n The symbolic subring consisting of symbolic expressions in the given variables.\n '
def _repr_(self):
"\n Return a representation string of this symbolic subring.\n\n OUTPUT:\n\n A string.\n\n TESTS::\n\... |
class SymbolicSubringAcceptingVarsFunctor(GenericSymbolicSubringFunctor):
_functor_name = 'SymbolicSubringAcceptingVarsFunctor'
_repr_type_ = 'accepting'
def merge(self, other):
"\n Merge this functor with ``other`` if possible.\n\n INPUT:\n\n - ``other`` -- a functor.\n\n ... |
class SymbolicSubringRejectingVars(GenericSymbolicSubring):
'\n The symbolic subring consisting of symbolic expressions whose variables\n are none of the given variables.\n '
def _repr_(self):
"\n Return a representation string of this symbolic subring.\n\n OUTPUT:\n\n A... |
class SymbolicSubringRejectingVarsFunctor(GenericSymbolicSubringFunctor):
_functor_name = 'SymbolicSubringRejectingVarsFunctor'
_repr_type_ = 'rejecting'
def merge(self, other):
"\n Merge this functor with ``other`` if possible.\n\n INPUT:\n\n - ``other`` -- a functor.\n\n ... |
class SymbolicConstantsSubring(SymbolicSubringAcceptingVars):
'\n The symbolic subring consisting of symbolic constants.\n '
def _repr_(self):
'\n Return a representation string of this symbolic subring.\n\n OUTPUT:\n\n A string.\n\n TESTS::\n\n sage: from... |
def register_symbol(obj, conversions, nargs=None):
"\n Add an object to the symbol table, along with how to convert it to\n other systems such as Maxima, Mathematica, etc. This table is used\n to convert *from* other systems back to Sage.\n\n INPUT:\n\n - ``obj`` -- a symbolic object or function.\... |
def rational_powers_memleak():
'\n Check that there is no memory leak in rational powers\n\n OUTPUT:\n\n Boolean. Whether the memory leak was detected.\n\n See :trac:`9129`.\n\n EXAMPLES::\n\n sage: from sage.symbolic.tests import rational_powers_memleak\n sage: rational_powers_memlea... |
def evalunitdict():
'\n Replace all the string values of the unitdict variable by their\n evaluated forms, and builds some other tables for ease of use.\n This function is mainly used internally, for efficiency (and\n flexibility) purposes, making it easier to describe the units.\n\n EXAMPLES::\n\n... |
def vars_in_str(s):
"\n Given a string like 'mass/(length*time)', return the list\n ['mass', 'length', 'time'].\n\n INPUT:\n\n - ``s`` -- a string\n\n OUTPUT:\n\n - a list of strings (unit names)\n\n EXAMPLES::\n\n sage: sage.symbolic.units.vars_in_str('mass/(length*time)')\n ['... |
def unit_derivations_expr(v):
"\n Given derived units name, returns the corresponding units\n expression. For example, given 'acceleration' output the symbolic\n expression length/time^2.\n\n INPUT:\n\n - ``v`` -- a string, name of a unit type such as 'area', 'volume', etc.\n\n OUTPUT:\n\n -... |
@instancedoc
class UnitExpression(Expression):
"\n A symbolic unit.\n\n EXAMPLES::\n\n sage: acre = units.area.acre\n sage: type(acre)\n <class 'sage.symbolic.units.UnitExpression'>\n\n TESTS::\n\n sage: bool(loads(dumps(acre)) == acre)\n True\n sage: type(loads(... |
def str_to_unit(name):
"\n Create the symbolic unit with given name. A symbolic unit is a\n class that derives from symbolic expression, and has a specialized\n docstring.\n\n INPUT:\n\n - ``name`` -- a string\n\n OUTPUT:\n\n - a :class:`UnitExpression`\n\n\n EXAMPLES::\n\n sage: s... |
class Units(ExtraTabCompletion):
'\n A collection of units of some type.\n\n EXAMPLES::\n\n sage: units.power\n Collection of units of power: cheval_vapeur horsepower watt\n '
def __init__(self, data, name=''):
"\n EXAMPLES::\n\n sage: sage.symbolic.units.Unit... |
def unitdocs(unit):
"\n Returns docstring for the given unit.\n\n INPUT:\n\n - ``unit`` -- a unit\n\n OUTPUT:\n\n - a string\n\n EXAMPLES::\n\n sage: sage.symbolic.units.unitdocs('meter')\n 'SI base unit of length.\\nDefined to be the distance light travels in vacuum in 1/299792458... |
def is_unit(s) -> bool:
"\n Return a boolean when asked whether the input is in the list of units.\n\n INPUT:\n\n - ``s`` -- an object\n\n OUTPUT:\n\n - a boolean\n\n EXAMPLES::\n\n sage: sage.symbolic.units.is_unit(1)\n False\n sage: sage.symbolic.units.is_unit(units.length... |
def convert(expr, target):
'\n Converts units between expr and target. If target is None then converts to SI base units.\n\n INPUT:\n\n - ``expr`` -- the symbolic expression converting from\n\n - ``target`` -- (default None) the symbolic expression converting to\n\n OUTPUT:\n\n - a symbolic expr... |
def base_units(unit):
"\n Converts unit to base SI units.\n\n INPUT:\n\n - ``unit`` -- a unit\n\n OUTPUT:\n\n - a symbolic expression\n\n EXAMPLES::\n\n sage: sage.symbolic.units.base_units(units.length.foot)\n 381/1250*meter\n\n If unit is already a base unit, it just returns t... |
def convert_temperature(expr, target):
'\n Function for converting between temperatures.\n\n INPUT:\n\n - ``expr`` -- a unit of temperature\n - ``target`` -- a units of temperature\n\n OUTPUT:\n\n - a symbolic expression\n\n EXAMPLES::\n\n sage: t = 32*units.temperature.fahrenheit\n ... |
class AlternatingContrTensor(FreeModuleTensor):
"\n Alternating contravariant tensor on a free module of finite rank\n over a commutative ring.\n\n This is a Sage *element* class, the corresponding *parent* class being\n :class:`~sage.tensor.modules.ext_pow_free_module.ExtPowerFreeModule`.\n\n INPU... |
class Components(SageObject):
'\n Indexed set of ring elements forming some components with respect\n to a given "frame".\n\n The "frame" can be a basis of some vector space or a vector frame on some\n manifold (i.e. a field of bases).\n The stored quantities can be tensor components or non-tensori... |
class CompWithSym(Components):
'\n Indexed set of ring elements forming some components with respect to a\n given "frame", with symmetries or antisymmetries regarding permutations\n of the indices.\n\n The "frame" can be a basis of some vector space or a vector frame on some\n manifold (i.e. a fiel... |
class CompFullySym(CompWithSym):
'\n Indexed set of ring elements forming some components with respect to a\n given "frame" that are fully symmetric with respect to any permutation\n of the indices.\n\n The "frame" can be a basis of some vector space or a vector frame on some\n manifold (i.e. a fie... |
class CompFullyAntiSym(CompWithSym):
'\n Indexed set of ring elements forming some components with respect to a\n given "frame" that are fully antisymmetric with respect to any permutation\n of the indices.\n\n The "frame" can be a basis of some vector space or a vector frame on some\n manifold (i.... |
class KroneckerDelta(CompFullySym):
"\n Kronecker delta `\\delta_{ij}`.\n\n INPUT:\n\n - ``ring`` -- commutative ring in which each component takes its value\n - ``frame`` -- frame with respect to which the components are defined;\n whatever type ``frame`` is, it should have some method ``__len__... |
class ExtPowerFreeModule(FiniteRankFreeModule_abstract):
"\n Exterior power of a free module of finite rank over a commutative\n ring.\n\n Given a free module `M` of finite rank over a commutative ring `R`\n and a positive integer `p`, the `p`-*th exterior power of* `M` is\n the set `\\Lambda^p(M)`... |
class ExtPowerDualFreeModule(FiniteRankFreeModule_abstract):
"\n Exterior power of the dual of a free module of finite rank\n over a commutative ring.\n\n Given a free module `M` of finite rank over a commutative ring `R`\n and a positive integer `p`, the `p`-*th exterior power of the dual of*\n `M... |
class FiniteRankFreeModule_abstract(UniqueRepresentation, ReflexiveModule_abstract):
'\n Abstract base class for free modules of finite rank over a commutative ring.\n '
def __init__(self, ring, rank, name=None, latex_name=None, category=None, ambient=None):
"\n See :class:`FiniteRankFre... |
class FiniteRankFreeModule(ReflexiveModule_base, FiniteRankFreeModule_abstract):
"\n Free module of finite rank over a commutative ring.\n\n A *free module of finite rank* over a commutative ring `R` is a module `M`\n over `R` that admits a *finite basis*, i.e. a finite family of linearly\n independen... |
class FiniteRankDualFreeModule(ReflexiveModule_dual, FiniteRankFreeModule_abstract):
"\n Dual of a free module of finite rank over a commutative ring.\n\n Given a free module `M` of finite rank over a commutative ring `R`,\n the *dual of* `M` is the set `M^*` of all linear forms on `M`,\n i.e., linear... |
def is_atomic(expr, sep=['+', '-']):
'\n Helper function to check whether some LaTeX expression is atomic.\n\n Adapted from method\n :meth:`~sage.tensor.differential_form_element.DifferentialFormFormatter._is_atomic`\n of class\n :class:`~sage.tensor.differential_form_element.DifferentialFormFormat... |
def is_atomic_wedge_txt(expression):
'\n Helper function to check whether some text-formatted expression is atomic\n in terms of wedge products.\n\n Adapted from method\n :meth:`~sage.tensor.differential_form_element.DifferentialFormFormatter._is_atomic`\n of class\n :class:`~sage.tensor.differe... |
def is_atomic_wedge_latex(expression):
'\n Helper function to check whether LaTeX-formatted expression is atomic in\n terms of wedge products.\n\n Adapted from method\n :meth:`~sage.tensor.differential_form_element.DifferentialFormFormatter._is_atomic`\n of class\n :class:`~sage.tensor.different... |
def format_mul_txt(name1, operator, name2):
"\n Helper function for text-formatted names of results of multiplication or\n tensor product.\n\n EXAMPLES::\n\n sage: from sage.tensor.modules.format_utilities import format_mul_txt\n sage: format_mul_txt('a', '*', 'b')\n 'a*b'\n s... |
def format_mul_latex(name1, operator, name2):
"\n Helper function for LaTeX names of results of multiplication or tensor\n product.\n\n EXAMPLES::\n\n sage: from sage.tensor.modules.format_utilities import format_mul_latex\n sage: format_mul_latex('a', '*', 'b')\n 'a*b'\n sage... |
def format_unop_txt(operator, name):
"\n Helper function for text-formatted names of results of unary operator.\n\n EXAMPLES::\n\n sage: from sage.tensor.modules.format_utilities import format_unop_txt\n sage: format_unop_txt('-', 'a')\n '-a'\n sage: format_unop_txt('-', 'a+b')\n... |
def format_unop_latex(operator, name):
"\n Helper function for LaTeX names of results of unary operator.\n\n EXAMPLES::\n\n sage: from sage.tensor.modules.format_utilities import format_unop_latex\n sage: format_unop_latex('-', 'a')\n '-a'\n sage: format_unop_latex('-', 'a+b')\n ... |
class FormattedExpansion(SageObject):
"\n Helper class for displaying tensor expansions.\n\n EXAMPLES::\n\n sage: from sage.tensor.modules.format_utilities import FormattedExpansion\n sage: f = FormattedExpansion('v', r'\\tilde v')\n sage: f\n v\n sage: latex(f)\n \... |
class FreeModuleAltForm(FreeModuleTensor):
"\n Alternating form on a free module of finite rank over a commutative ring.\n\n This is a Sage *element* class, the corresponding *parent* class being\n :class:`~sage.tensor.modules.ext_pow_free_module.ExtPowerDualFreeModule`.\n\n INPUT:\n\n - ``fmodule`... |
class FreeModuleAutomorphism(FreeModuleTensor, MultiplicativeGroupElement):
"\n Automorphism of a free module of finite rank over a commutative ring.\n\n This is a Sage *element* class, the corresponding *parent* class being\n :class:`~sage.tensor.modules.free_module_linear_group.FreeModuleLinearGroup`.\... |
class Basis_abstract(UniqueRepresentation, AbstractFamily):
"\n Abstract base class for (dual) bases of free modules.\n\n A basis is an :class:`~sage.sets.family.AbstractFamily`, hence like\n :class:`collections.abc.Mapping` subclasses such as :class:`dict`, it is\n an associative :class:`Container`, ... |
class FreeModuleCoBasis(Basis_abstract):
"\n Dual basis of a free module over a commutative ring.\n\n INPUT:\n\n - ``basis`` -- basis of a free module `M` of which ``self`` is the dual\n (must be an instance of :class:`FreeModuleBasis`)\n - ``symbol`` -- either a string, to be used as a common ba... |
class FreeModuleBasis(Basis_abstract):
"\n Basis of a free module over a commutative ring `R`.\n\n INPUT:\n\n - ``fmodule`` -- free module `M` (as an instance of\n :class:`FiniteRankFreeModule`)\n - ``symbol`` -- either a string, to be used as a common base for the\n symbols of the elements ... |
class FiniteRankFreeModuleElement(AlternatingContrTensor):
"\n Element of a free module of finite rank over a commutative ring.\n\n This is a Sage *element* class, the corresponding *parent* class being\n :class:`~sage.tensor.modules.finite_rank_free_module.FiniteRankFreeModule`.\n\n The class :class:... |
class FreeModuleHomset(Homset):
'\n Set of homomorphisms between free modules of finite rank over a\n commutative ring.\n\n Given two free modules `M` and `N` of respective ranks `m` and `n` over a\n commutative ring `R`, the class :class:`FreeModuleHomset` implements the\n set `\\mathrm{Hom}(M,N)`... |
class FreeModuleLinearGroup(UniqueRepresentation, Parent):
"\n General linear group of a free module of finite rank over a commutative\n ring.\n\n Given a free module of finite rank `M` over a commutative ring `R`, the\n *general linear group* of `M` is the group `\\mathrm{GL}(M)` of\n automorphism... |
class FiniteRankFreeModuleMorphism(Morphism):
"\n Homomorphism between free modules of finite rank over a commutative ring.\n\n An instance of this class is a homomorphism\n\n .. MATH::\n\n \\phi:\\ M \\longrightarrow N,\n\n where `M` and `N` are two free modules of finite rank over the same\n ... |
class FreeModuleTensor(ModuleElementWithMutability):
"\n Tensor over a free module of finite rank over a commutative ring.\n\n This is a Sage *element* class, the corresponding *parent* class being\n :class:`~sage.tensor.modules.tensor_free_module.TensorFreeModule`.\n\n INPUT:\n\n - ``fmodule`` -- ... |
class ReflexiveModule_abstract(Parent):
'\n Abstract base class for reflexive modules.\n\n An `R`-module `M` is *reflexive* if the natural map from `M` to its double\n dual `M^{**}` is an isomorphism.\n\n In the category of `R`-modules, the dual module `M^*` is\n the `R`-module of linear functional... |
class ReflexiveModule_base(ReflexiveModule_abstract):
"\n Abstract base class for reflexive modules that are base modules.\n\n TESTS::\n\n sage: from sage.tensor.modules.reflexive_module import ReflexiveModule_base\n sage: M = FiniteRankFreeModule(ZZ, 3, name='M')\n sage: isinstance(M, ... |
class ReflexiveModule_dual(ReflexiveModule_abstract):
"\n Abstract base class for reflexive modules that are the duals of base modules.\n\n TESTS::\n\n sage: from sage.tensor.modules.reflexive_module import ReflexiveModule_dual\n sage: M = FiniteRankFreeModule(ZZ, 3, name='M')\n sage: i... |
class ReflexiveModule_tensor(ReflexiveModule_abstract):
"\n Abstract base class for reflexive modules that are tensor products of base modules.\n\n TESTS::\n\n sage: from sage.tensor.modules.reflexive_module import ReflexiveModule_tensor\n sage: M = FiniteRankFreeModule(ZZ, 3, name='M')\n ... |
class TensorFreeModule(ReflexiveModule_tensor, FiniteRankFreeModule_abstract):
"\n Class for the free modules over a commutative ring `R` that are\n tensor products of a given free module `M` over `R` with itself and its\n dual `M^*`:\n\n .. MATH::\n\n T^{(k,l)}(M) = \\underbrace{M\\otimes\\cdo... |
class TensorFreeSubmodule_sym(TensorFreeModule):
"\n Class for free submodules of tensor products of free modules\n that are defined by some monoterm symmetries.\n\n EXAMPLES::\n\n sage: M = FiniteRankFreeModule(ZZ, 3, name='M')\n sage: e = M.basis('e')\n sage: T60M = M.tensor_module... |
class TensorFreeSubmoduleBasis_sym(Basis_abstract):
"\n Standard basis of a free submodule of a tensor module with prescribed monoterm symmetries.\n\n EXAMPLES::\n\n sage: M = FiniteRankFreeModule(ZZ, 3, name='M')\n sage: T11 = M.tensor_module(1,1)\n sage: e11 = T11.basis('e')\n ... |
class TensorWithIndices(SageObject):
'\n Index notation for tensors.\n\n This is a technical class to allow one to write some tensor operations\n (contractions and symmetrizations) in index notation.\n\n INPUT:\n\n - ``tensor`` -- a tensor (or a tensor field)\n - ``indices`` -- string containing... |
def CompleteMatchings(n):
'\n Return a generator for the complete matchings of the set [1..n].\n\n INPUT:\n\n n -- nonnegative integer\n\n OUTPUT:\n\n A generator for the complete matchings of the set [1..n], or,\n what is basically the same thing, complete matchings of the\n graph K_n. Each ... |
def matchingsset(L):
"\n Return a generator for complete matchings of the sequence L.\n\n This is not really meant to be called directly, but rather by\n CompleteMatchings().\n\n INPUT:\n\n L -- a sequence. Lists, tuples, et cetera; anything that\n supports len() and slicing should work.\n\n ... |
def dcrossing(m_):
"\n Return the largest k for which the given matching or set\n partition has a k-distant crossing.\n\n INPUT:\n\n m -- a matching or set partition, as a list of 2-element tuples\n representing the edges. You'll need to call setp_to_edges() on\n the objects returned by SetParti... |
def setp_to_edges(p):
'\n Transform a set partition into a list of edges.\n\n INPUT:\n\n p -- a Sage set partition.\n\n OUTPUT:\n\n A list of non-loop edges of the set partition. As this code just\n works with crossings, we can ignore the loops.\n\n EXAMPLES:\n\n The main example from the ... |
def dcrossvec_setp(n):
"\n Return a list with the distribution of k-dcrossings on set partitions of [1..n].\n\n INPUT:\n\n n -- a nonnegative integer.\n\n OUTPUT:\n\n A list whose k'th entry is the number of set partitions p for\n which dcrossing(p) = k. For example, let L = dcrossvec_setp(3).\n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.