hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
793ecd5b197aa5e1e6645ed5a59bc7d60b5181868b6f03bbfe8e625e7ed6d99b | from sympy.core.add import Add
from sympy.core.containers import Tuple
from sympy.core.expr import Expr
from sympy.core.function import AppliedUndef, UndefinedFunction
from sympy.core.mul import Mul
from sympy.core.relational import Equality, Relational
from sympy.core.singleton import S
from sympy.core.symbol import S... |
d4999f8132ab57d9ac72bd631d8c4713536406be7f52acea4784da7d86c497c7 | from typing import Tuple as tTuple
from sympy.calculus.singularities import is_decreasing
from sympy.calculus.accumulationbounds import AccumulationBounds
from .expr_with_intlimits import ExprWithIntLimits
from .expr_with_limits import AddWithLimits
from .gosper import gosper_sum
from sympy.core.expr import Expr
from ... |
db4a85b74fa69b91df3b1b502aba7bb35586b9312c5b1bbdc29f1805b9fd76e0 | from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.polys.polytools import lcm
from sympy.utilities import public
@public
def approximants(l, X=Symbol('x'), simplify=False):
"""
Return a generator for consecutive Pade approximants for a series.
It can also be used for computi... |
6ad64aedba3f9ebdc30aa545a790c498a35e9a72d023bb6f98337cb60052e736 | """
Limits
======
Implemented according to the PhD thesis
http://www.cybertester.com/data/gruntz.pdf, which contains very thorough
descriptions of the algorithm including many examples. We summarize here
the gist of it.
All functions are sorted according to how rapidly varying they are at
infinity using the followin... |
4b6fc6b4788f63dab6069cdb56026c0f8a417ff7b8c96bde13096e5fdad21c5e | from sympy.core.basic import Basic
from sympy.core.cache import cacheit
from sympy.core.containers import Tuple
from sympy.core.decorators import call_highest_priority
from sympy.core.parameters import global_parameters
from sympy.core.function import AppliedUndef, expand
from sympy.core.mul import Mul
from sympy.core.... |
42309439a9c8de27afd0faa58f995a15aa162ddeadd42b9ac882ffb9f2f30274 | from sympy.calculus.accumulationbounds import AccumBounds
from sympy.core import S, Symbol, Add, sympify, Expr, PoleError, Mul
from sympy.core.exprtools import factor_terms
from sympy.core.numbers import Float, _illegal
from sympy.functions.combinatorial.factorials import factorial
from sympy.functions.elementary.compl... |
4015a68fd540d5f96a38513ad381f56061366b5747369a06022bba6d382bcc0c | """Fourier Series"""
from sympy.core.numbers import (oo, pi)
from sympy.core.symbol import Wild
from sympy.core.expr import Expr
from sympy.core.add import Add
from sympy.core.containers import Tuple
from sympy.core.singleton import S
from sympy.core.symbol import Dummy, Symbol
from sympy.core.sympify import sympify
f... |
49acff54d886f12959478b6e55918db9387aca565d05edb84694056f7165dfc2 | """Formal Power Series"""
from collections import defaultdict
from sympy.core.numbers import (nan, oo, zoo)
from sympy.core.add import Add
from sympy.core.expr import Expr
from sympy.core.function import Derivative, Function, expand
from sympy.core.mul import Mul
from sympy.core.numbers import Rational
from sympy.cor... |
7a17a315cfb1ea242314102419f61f6a74e84c7b135143bde59b935600cd9010 | from sympy.core import S, sympify, Expr, Dummy, Add, Mul
from sympy.core.cache import cacheit
from sympy.core.containers import Tuple
from sympy.core.function import Function, PoleError, expand_power_base, expand_log
from sympy.core.sorting import default_sort_key
from sympy.functions.elementary.exponential import exp,... |
6e9cab1f790acafa58b7de13e34daba7865be646e4345650bcb33074368a2e9f | """
Expand Hypergeometric (and Meijer G) functions into named
special functions.
The algorithm for doing this uses a collection of lookup tables of
hypergeometric functions, and various of their properties, to expand
many hypergeometric functions in terms of special functions.
It is based on the following paper:
... |
27e68853c6b622c83f9f30fccf51c6a832a689b639e7f26075cb6f172471e280 | from collections import defaultdict
from sympy.concrete.products import Product
from sympy.concrete.summations import Sum
from sympy.core import (Basic, S, Add, Mul, Pow, Symbol, sympify,
expand_func, Function, Dummy, Expr, factor_terms,
expand_power_exp, Eq)
from sympy.... |
a67fedf58ae4fd22f55f4be5fb3551eb265ac64636e43e0cc1306fe32c270f56 | from sympy.core.traversal import use as _use
from sympy.utilities.decorator import deprecated
use = deprecated(
"""
Using use from the sympy.simplify.traversaltools submodule is
deprecated.
Instead, use use from the top-level sympy namespace, like
sympy.use
""",
deprecated_since_versi... |
f5861d500f1c8907452faf9f28bd00ba0ce95a41f896b29ceaf96ed86a20691a | from collections import defaultdict
from functools import reduce
from sympy.core.function import expand_log, count_ops, _coeff_isneg
from sympy.core import sympify, Basic, Dummy, S, Add, Mul, Pow, expand_mul, factor_terms
from sympy.core.sorting import ordered, default_sort_key
from sympy.core.numbers import Integer, ... |
bec4a414de5387cc8b447ace1808bd5c95976353db3058cfe046b2929954187e | from collections import defaultdict
from functools import reduce
from sympy.core import (sympify, Basic, S, Expr, factor_terms,
Mul, Add, bottom_up)
from sympy.core.cache import cacheit
from sympy.core.function import (count_ops, _mexpand, FunctionClass, expand,
... |
4a76ffb11bc9532886f66b21f209b2a705a5367157eeeb91565fdf5c061f2b54 | """ Tools for doing common subexpression elimination.
"""
from collections import defaultdict
from sympy.core import Basic, Mul, Add, Pow, sympify
from sympy.core.containers import Tuple, OrderedSet
from sympy.core.exprtools import factor_terms
from sympy.core.singleton import S
from sympy.core.sorting import ordered
... |
ff0394b246e118732a8274b7eb258552edf16c5bc174d5c21fef514e77ab480c | from collections import defaultdict
from sympy.core.add import Add
from sympy.core.expr import Expr
from sympy.core.exprtools import Factors, gcd_terms, factor_terms
from sympy.core.function import expand_mul
from sympy.core.mul import Mul
from sympy.core.numbers import pi, I
from sympy.core.power import Pow
from symp... |
1c4a9e68a1cea04955eb79b411eda278385ae68e0a3c9b7ff4eac0ebb18d90c2 | from sympy.core.numbers import Rational
from sympy.core.singleton import S
from sympy.functions.elementary.complexes import (conjugate, im, re, sign)
from sympy.functions.elementary.exponential import (exp, log as ln)
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.elementary.trigonometri... |
0533e6cb3cce6ccd3228d8cb507c13b678afcc85e08aac4f081e2cc91972c515 | from typing import Any, Set as tSet
from functools import reduce
from itertools import permutations
from sympy.combinatorics import Permutation
from sympy.core import (
Basic, Expr, Function, diff,
Pow, Mul, Add, Lambda, S, Tuple, Dict
)
from sympy.core.cache import cacheit
from sympy.core.symbol import Symb... |
3a6f8405f61db8517deed817385ebcaebf3361b9e07a6f640519bd48988a2d23 | """
AST nodes specific to C++.
"""
from sympy.codegen.ast import Attribute, String, Token, Type, none
class using(Token):
""" Represents a 'using' statement in C++ """
__slots__ = _fields = ('type', 'alias')
defaults = {'alias': none}
_construct_type = Type
_construct_alias = String
constexpr = A... |
4d8e1e71fb6a9f29b9be26089e76f9f7318f3c55dd792190c22fbec53cfa3efa | """This module provides containers for python objects that are valid
printing targets but are not a subclass of SymPy's Printable.
"""
from sympy.core.containers import Tuple
class List(Tuple):
"""Represents a (frozen) (Python) list (for code printing purposes)."""
def __eq__(self, other):
if isinst... |
6450711ec44151c435e0425151165787d1234ec492246c265ae6df9a9134fa9e | """
AST nodes specific to the C family of languages
"""
from sympy.codegen.ast import (
Attribute, Declaration, Node, String, Token, Type, none,
FunctionCall, CodeBlock
)
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.sympify import sympify
void = Type('void')
... |
c74a8255e52c1e5a1c4c582bab1ce253d66d7eb5b18a9157a3d93409b6290a36 | """
AST nodes specific to Fortran.
The functions defined in this module allows the user to express functions such as ``dsign``
as a SymPy function for symbolic manipulation.
"""
from sympy.codegen.ast import (
Attribute, CodeBlock, FunctionCall, Node, none, String,
Token, _mk_Tuple, Variable
)
from sympy.core... |
35ea3580543d902df54fe807f1379e09a0c335a0dee5d7883fdecc4591603079 | from .abstract_nodes import List as AbstractList
from .ast import Token
class List(AbstractList):
pass
class NumExprEvaluate(Token):
"""represents a call to :class:`numexpr`s :func:`evaluate`"""
__slots__ = _fields = ('expr',)
|
6410183d330632a1e2e23381b4893b62d3bd2248bc005c79f3f704c0b5e879cd | """
Types used to represent a full function/module as an Abstract Syntax Tree.
Most types are small, and are merely used as tokens in the AST. A tree diagram
has been included below to illustrate the relationships between the AST types.
AST Type Tree
-------------
::
*Basic*
|
|
CodegenAST
... |
1e18a9d1c6c18f6ee2fb82705629e412de0f1d16c021ee44471c32cb0a12266f | """
Additional AST nodes for operations on matrices. The nodes in this module
are meant to represent optimization of matrix expressions within codegen's
target languages that cannot be represented by SymPy expressions.
As an example, we can use :meth:`sympy.codegen.rewriting.optimize` and the
``matin_opt`` optimizatio... |
af5343005f062c06f6de40db60c6d21a84defcf36de94152aa76a931ebea433f | """
This file contains some classical ciphers and routines
implementing a linear-feedback shift register (LFSR)
and the Diffie-Hellman key exchange.
.. warning::
This module is intended for educational purposes only. Do not use the
functions in this module for real cryptographic applications. If you wish
to ... |
3092aaaa813db9a4549f581c611ff5e96ee1bc661172847eba35e386447a2d73 | """Module for querying SymPy objects about assumptions."""
from sympy.assumptions.assume import (global_assumptions, Predicate,
AppliedPredicate)
from sympy.assumptions.cnf import CNF, EncodedCNF, Literal
from sympy.core import sympify
from sympy.core.kind import BooleanKind
from sympy.core.relational import E... |
ab448355bce6538ebff267fadd46a8e69604e0c832ae147dbe7f78409a904aff | """
Known facts in assumptions module.
This module defines the facts between unary predicates in ``get_known_facts()``,
and supports functions to generate the contents in
``sympy.assumptions.ask_generated`` file.
"""
from sympy.assumptions.ask import Q
from sympy.assumptions.assume import AppliedPredicate
from sympy.... |
7fae50fcf0e54e164c8a9ba3bac316fc7300ba3393fc019d6526a9b7c8b1faf4 | """A module which implements predicates and assumption context."""
from contextlib import contextmanager
import inspect
from sympy.core.assumptions import ManagedProperties
from sympy.core.symbol import Str
from sympy.core.sympify import _sympify
from sympy.logic.boolalg import Boolean, false, true
from sympy.multiple... |
cd3b2eb3d40a5a5258da40473cd6869d7dc61596bdc5cb0e1154d79416de4efe | """
The classes used here are for the internal use of assumptions system
only and should not be used anywhere else as these do not possess the
signatures common to SymPy objects. For general use of logic constructs
please refer to sympy.logic classes And, Or, Not, etc.
"""
from itertools import combinations, product, z... |
c129e48b2da710bd11d6a7f1628e9d5dfba5a88e5cf04e7d1d59e252d45a14a9 | from sympy.core.add import Add
from sympy.core.exprtools import factor_terms
from sympy.core.function import expand_log, _mexpand
from sympy.core.power import Pow
from sympy.core.singleton import S
from sympy.core.sorting import ordered
from sympy.core.symbol import Dummy
from sympy.functions.elementary.exponential imp... |
ea82538352f1cb71631634c4f49f04bac94326afc8becba6616ef450bf2109fb | r"""
This module is intended for solving recurrences or, in other words,
difference equations. Currently supported are linear, inhomogeneous
equations with polynomial or rational coefficients.
The solutions are obtained among polynomials, rational functions,
hypergeometric terms, or combinations of hypergeometric term... |
7564256bb869ec0e11a88d9ad2a44d40b58d3c4baeafaf250f77554f292d7415 | from sympy.core import (Function, Pow, sympify, Expr)
from sympy.core.relational import Relational
from sympy.core.singleton import S
from sympy.polys import Poly, decompose
from sympy.utilities.misc import func_name
from sympy.functions.elementary.miscellaneous import Min, Max
def decompogen(f, symbol):
"""
... |
ef820d4d18b398c3a1fdfae85280b8a78c9cca2747d6a916c31438c35336807e | """
This module contains functions to:
- solve a single equation for a single variable, in any domain either real or complex.
- solve a single transcendental equation for a single variable in any domain either real or complex.
(currently supports solving in real domain only)
- solve a system of lin... |
75d27f64c47a3093852c8fad836d732f712ef86e8a6a2cea5423fba2918c53d4 | """
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classif... |
e05840beb34aaf39a913d5ac0cdfa744c82c725463ec38c93b971de92a8a90d9 | """Utility functions for classifying and solving
ordinary and partial differential equations.
Contains
========
_preprocess
ode_order
_desolve
"""
from sympy.core import Pow
from sympy.core.function import Derivative, AppliedUndef
from sympy.core.relational import Equality
from sympy.core.symbol import Wild
def _pre... |
ef0e137b03b5f0fc6f8d0071c302cfdeedd533c190ef3250d49d42286370dac1 | """Solvers of systems of polynomial equations. """
from sympy.core import S
from sympy.core.sorting import default_sort_key
from sympy.polys import Poly, groebner, roots
from sympy.polys.polytools import parallel_poly_from_expr
from sympy.polys.polyerrors import (ComputationFailed,
PolificationFailed, CoercionFail... |
58e9c71b81ae2c21ba20cbd4499b2ba2c60cbe5e9415b3034983c2fe3a267b5a | """Tools for solving inequalities and systems of inequalities. """
from sympy.calculus.util import (continuous_domain, periodicity,
function_range)
from sympy.core import Symbol, Dummy, sympify
from sympy.core.exprtools import factor_terms
from sympy.core.relational import Relational, Eq, Ge, Lt
from sympy.sets.se... |
699a806e5692e5c165b40887ec680464e6990f3282bc7cea3659ae46f1890e0d | """
This module contain solvers for all kinds of equations:
- algebraic or transcendental, use solve()
- recurrence, use rsolve()
- differential, use dsolve()
- nonlinear (numerically), use nsolve()
(you will need a good starting point)
"""
from sympy.core import (S, Add, Symbol, Dummy, Expr... |
c4b92583c639b38d237bab17c262e61bd8b2622f58124f4aa314d2173d46b5d2 | from sympy.core import Atom, Basic
class CartanType_generator():
"""
Constructor for actually creating things
"""
def __call__(self, *args):
c = args[0]
if isinstance(c, list):
letter, n = c[0], int(c[1])
elif isinstance(c, str):
letter, n = c[0], int(c[... |
2160dceaa3db11c5b24e6f5033a57cbd202cfb93ad18d8a38a6ca4a16cf70a57 | """Calculus-related methods."""
from .euler import euler_equations
from .singularities import (singularities, is_increasing,
is_strictly_increasing, is_decreasing,
is_strictly_decreasing, is_monotonic)
from .finite_diff import finite_diff_weights, apply_finite_di... |
414b43b603b7b3aa319181ac5e726d38fb5461793fbaa91088d59f0a6a7d19ce | from sympy.core import Add, Mul, Pow, S
from sympy.core.basic import Basic
from sympy.core.expr import Expr
from sympy.core.numbers import _sympifyit, oo, zoo
from sympy.core.relational import is_le, is_lt, is_ge, is_gt
from sympy.core.sympify import _sympify
from sympy.functions.elementary.miscellaneous import Min, Ma... |
1c965d269b9bae194dc43a42a7361fc492af266b27ac1eac2e8c7c915e6a8d11 | """
Finite difference weights
=========================
This module implements an algorithm for efficient generation of finite
difference weights for ordinary differentials of functions for
derivatives from 0 (interpolation) up to arbitrary order.
The core algorithm is provided in the finite difference weight generat... |
550e18a38800cafb9a1379869cef1f07d28df2ddf00621563c7df6acce2139d9 | from .accumulationbounds import AccumBounds, AccumulationBounds # noqa: F401
from .singularities import singularities
from sympy.core import Pow, S
from sympy.core.function import diff, expand_mul
from sympy.core.kind import NumberKind
from sympy.core.mod import Mod
from sympy.core.relational import Relational
from sym... |
17d4c636da0dbd051d96de47614d3ce084cd99ceffffb3010922cbba506533f6 | """
.. deprecated:: 1.6
sympy.utilities.pytest has been renamed to sympy.testing.pytest.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning("The sympy.utilities.pytest submodule is deprecated. Use sympy.testing.pytest instead.",
deprecated_since_version="1.6",
ac... |
f6c954c4c5d7cfe7a9b467f339dfe23c3bccc1ccd129d4df801b6d9655732c11 | """
This module adds several functions for interactive source code inspection.
"""
from sympy.utilities.decorator import deprecated
import inspect
@deprecated(
"""
The source() function is deprecated. Use inspect.getsource() instead, or
if you are in IPython or Jupyter, the ?? feature.
""",
depre... |
1ae249dd35553eaa5dd085e90707d1518eeb00939666d7d688710b8be6f1632d | """
This module provides convenient functions to transform SymPy expressions to
lambda functions which can be used to calculate numerical values very fast.
"""
from typing import Any, Dict as tDict, Iterable, Union as tUnion, TYPE_CHECKING
import builtins
import inspect
import keyword
import textwrap
import linecache... |
5ef0a8b9cddec18c59b891e9670f8fadff6bc25bef2c6dbfa91c226878ae4d0e | """
.. deprecated:: 1.6
sympy.utilities.benchmarking has been renamed to sympy.testing.benchmarking.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning("The sympy.utilities.benchmarking submodule is deprecated. Use sympy.testing.benchmarking instead.",
deprecated_sin... |
badf3d68684fcadf0812f644edefab6b9f4d897fc9ce5cbd499196555e3da90d | """
Algorithms and classes to support enumerative combinatorics.
Currently just multiset partitions, but more could be added.
Terminology (following Knuth, algorithm 7.1.2.5M TAOCP)
*multiset* aaabbcccc has a *partition* aaabc | bccc
The submultisets, aaabc and bccc of the partition are called
*parts*, or sometimes ... |
83d7e02c28eb92e624f88997fd5e36bded9721ac8ad359969a55ca3885665bff | """
General SymPy exceptions and warnings.
"""
import warnings
import contextlib
from textwrap import dedent
class SymPyDeprecationWarning(DeprecationWarning):
r"""
A warning for deprecated features of SymPy.
See the :ref:`deprecation-policy` document for details on when and how
things should be de... |
cd1b078a398648e6dfc0d724f0485b001fefffaf8ce854ec6b0b1e0ccfe19dea | """Useful utility decorators. """
import sys
import types
import inspect
from functools import wraps, update_wrapper
from sympy.testing.runtests import DependencyError, SymPyDocTests, PyTestReporter
from sympy.utilities.exceptions import sympy_deprecation_warning
def threaded_factory(func, use_add):
"""A factory... |
dee14d8c27c32c0d47dd49f4114563c3d08c9d289811991743dfdf5c0412954f | """
The objects in this module allow the usage of the MatchPy pattern matching
library on SymPy expressions.
"""
import re
from typing import List, Callable
from sympy.core.sympify import _sympify
from sympy.external import import_module
from sympy.functions import (log, sin, cos, tan, cot, csc, sec, erf, gamma, upper... |
d0a47155178a024d13336b2615e10862ca3e10e8f25eef8cfa3c0deec6d472df | from collections import defaultdict, OrderedDict
from itertools import (
chain, combinations, combinations_with_replacement, cycle, islice,
permutations, product
)
# For backwards compatibility
from itertools import product as cartes # noqa: F401
from operator import gt
# this is the logical location of the... |
8589c336214d9c38d07171b4e3fde5ccf15b533ea2d00519dab67f444095a03a | """
.. deprecated:: 1.6
sympy.utilities.runtests has been renamed to sympy.testing.runtests.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning("The sympy.utilities.runtests submodule is deprecated. Use sympy.testing.runtests instead.",
deprecated_since_version="1.6... |
698517fe68264327d174c8c4396687339d3a099e9650ad1e16e7b0d2f153c11b | """
.. deprecated:: 1.6
sympy.utilities.randtest has been renamed to sympy.core.random.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning("The sympy.utilities.randtest submodule is deprecated. Use sympy.core.random instead.",
deprecated_since_version="1.6",
acti... |
e03bb9557cb8a4a9ed6c44875cb1587743b007663b40beeb3a8027ffe40f35d4 | """Miscellaneous stuff that does not really fit anywhere else."""
from typing import List
import operator
import sys
import os
import re as _re
import struct
from textwrap import fill, dedent
class Undecidable(ValueError):
# an error to be raised when a decision cannot be made definitively
# where a definit... |
c8e8dbb3dd2c12d55cd34619caf7b26e54fcce4c23e28ef4fd19ae10a74aabfb | """
.. deprecated:: 1.6
sympy.utilities.tmpfiles has been renamed to sympy.testing.tmpfiles.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning("The sympy.utilities.tmpfiles submodule is deprecated. Use sympy.testing.tmpfiles instead.",
deprecated_since_version="1.6"... |
653cbab7a1ecd8bfd7f8772ece250a79e93df86eecf107445cff2634a324eac7 | """
.. deprecated:: 1.7
cxxcode.py was deprecated and renamed to cxx.py. This is a shim file to
provide backwards compatibility.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning(
"""
The sympy.printing.cxxcode submodule is deprecated. It has been renamed t... |
d656f467f75c511e66655cd61403f91d7f4622ad3eff24c343177f5ed5461cdd | from sympy.core import S
from sympy.core.function import Lambda
from sympy.core.power import Pow
from .pycode import PythonCodePrinter, _known_functions_math, _print_known_const, _print_known_func, _unpack_integral_limits, ArrayPrinter
from .codeprinter import CodePrinter
_not_in_numpy = 'erf erfc factorial gamma log... |
130c17bb580866d86533bf0f1681cf754f42ed4304103a00f63f989780e0afb2 | """
Python code printers
This module contains Python code printers for plain Python as well as NumPy & SciPy enabled code.
"""
from collections import defaultdict
from itertools import chain
from sympy.core import S
from sympy.core.mod import Mod
from .precedence import precedence
from .codeprinter import CodePrinter
... |
b39519b1936de619eb99c1e904438c696ef819bb2f432f5fe5f410357a09850a | """
A Printer for generating readable representation of most SymPy classes.
"""
from typing import Any, Dict as tDict
from sympy.core import S, Rational, Pow, Basic, Mul, Number
from sympy.core.mul import _keep_coeff
from sympy.core.relational import Relational
from sympy.core.sorting import default_sort_key
from sym... |
c790d6054fc07785e040f2157a3ca17d44e9157a6b9d4c8f42a5cb9ec8ee065a | """
A Printer which converts an expression into its LaTeX equivalent.
"""
from typing import Any, Dict as tDict
import itertools
from sympy.core import Add, Float, Mod, Mul, Number, S, Symbol
from sympy.core.alphabets import greeks
from sympy.core.containers import Tuple
from sympy.core.function import AppliedUndef,... |
df7dc631949c3e5e26f0162c725466a247bed5782e305a87755f9568ae46dc2f | """Printing subsystem driver
SymPy's printing system works the following way: Any expression can be
passed to a designated Printer who then is responsible to return an
adequate representation of that expression.
**The basic concept is the following:**
1. Let the object print itself if it knows how.
2. Take the bes... |
fb57757309a7a6b24a3d7a558936d0c69c32df04fb2bc2a33c3e470b28db0c69 | from sympy.core.containers import Tuple
from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.core.sympify import SympifyError
from types import FunctionType
class TableForm:
r"""
Create a nice table representation of data.
Examples
========
>>> from sympy import Ta... |
d6375f9ffc2c3aebd96921a7b63c8439a24d3447463e85ecf18768dc27adb065 | from .pycode import (
PythonCodePrinter,
MpmathPrinter,
)
from .numpy import NumPyPrinter # NumPyPrinter is imported for backward compatibility
from sympy.core.sorting import default_sort_key
__all__ = [
'PythonCodePrinter',
'MpmathPrinter', # MpmathPrinter is published for backward compatibility
... |
712363adb25d7db7027832df24ea6cf60a3419bd6a63c0f709bd7606f01fae61 | """
.. deprecated:: 1.7
ccode.py was deprecated and renamed to c.py. This is a shim file to provide
backwards compatibility.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning(
"""
The sympy.printing.ccode submodule is deprecated. It has been renamed to
... |
72952883a7ad43f083d56c81e0f8c5db090fb8300ec752f412fa905fafe91d09 | """
A MathML printer.
"""
from typing import Any, Dict as tDict
from sympy.core.mul import Mul
from sympy.core.singleton import S
from sympy.core.sorting import default_sort_key
from sympy.core.sympify import sympify
from sympy.printing.conventions import split_super_sub, requires_partial
from sympy.printing.preceden... |
393ab226f10fe30c80b2e5afdf52abc347025ff7436ed91eb8584f3efe927783 | """
.. deprecated:: 1.7
fcode.py was deprecated and renamed to fortran.py. This is a shim file to
provide backwards compatibility.
"""
from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning(
"""
The sympy.printing.fcode submodule is deprecated. It has been renamed t... |
3a9bb67dede459ffcf183a57b1c8ceb9f6146faecacd0903702947e9aef29443 | """
Maple code printer
The MapleCodePrinter converts single SymPy expressions into single
Maple expressions, using the functions defined in the Maple objects where possible.
FIXME: This module is still under actively developed. Some functions may be not completed.
"""
from sympy.core import S
from sympy.core.number... |
28774930730139a2641cef3fb817d84477815b6548ce2bff618a88577d03f9d0 | from sympy.external.importtools import version_tuple
from collections.abc import Iterable
from sympy.core.mul import Mul
from sympy.core.singleton import S
from sympy.codegen.cfunctions import Sqrt
from sympy.external import import_module
from sympy.printing.precedence import PRECEDENCE
from sympy.printing.pycode impo... |
09f28108a3691b17ec7e0e57729250f0ce919aa279641087402f95c6e8997277 | from sympy.core.basic import Basic
from sympy.core.expr import Expr
from sympy.core.symbol import Symbol
from sympy.core.numbers import Integer, Rational, Float
from sympy.printing.repr import srepr
__all__ = ['dotprint']
default_styles = (
(Basic, {'color': 'blue', 'shape': 'ellipse'}),
(Expr, {'color': 'bl... |
ca31c0d1704e1af31e37493414dea668d00bae04abe9562e6629a7037650af9f | """
A Printer for generating executable code.
The most important function here is srepr that returns a string so that the
relation eval(srepr(expr))=expr holds in an appropriate environment.
"""
from typing import Any, Dict as tDict
from sympy.core.function import AppliedUndef
from sympy.core.mul import Mul
from mpm... |
93999fb149fa2a73456fe699bb18264a8657366d447ffb1ab295e7d66f369d7c | """
.. deprecated:: 1.8
``sympy.printing.theanocode`` is deprecated. Theano has been renamed to
Aesara. Use ``sympy.printing.aesaracode`` instead. See
:ref:`theanocode-deprecated` for more information.
"""
from typing import Any, Dict as tDict
from sympy.external import import_module
from sympy.printing.printe... |
3903cfd375b52d86ebcdcaff55ac04256fccd4037079bcfbc72b736a0e5c7ccc | """Integration method that emulates by-hand techniques.
This module also provides functionality to get the steps used to evaluate a
particular integral, in the ``integral_steps`` function. This will return
nested namedtuples representing the integration rules used. The
``manualintegrate`` function computes the integra... |
b3efb4c91160b9fbb87012b616777ac7f058514b63ae514a9dd858564b029ea0 | """ Integral Transforms """
from functools import reduce, wraps
from itertools import repeat
from sympy.core import S, pi, I
from sympy.core.add import Add
from sympy.core.function import (AppliedUndef, count_ops, Derivative, expand,
expand_complex, expand_mul, Function, Lambda,
... |
4b73d450bd77962cba837e73bb48bba5ebff34242ff49fc8d8fe99a2fc7a9ab1 | """
Module to implement integration of uni/bivariate polynomials over
2D Polytopes and uni/bi/trivariate polynomials over 3D Polytopes.
Uses evaluation techniques as described in Chin et al. (2015) [1].
References
===========
.. [1] Chin, Eric B., Jean B. Lasserre, and N. Sukumar. "Numerical integration
of homogene... |
6c4302de7bce87e70f95a1fdecf310fb9a2655b5764eacd54d221b9bd881b2b7 | from typing import Tuple as tTuple
from sympy.concrete.expr_with_limits import AddWithLimits
from sympy.core.add import Add
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.expr import Expr
from sympy.core.exprtools import factor_terms
from sympy.core.function import diff
from... |
d4e32146130143b8a0c36fd85f9591e2aebd401fc7d3332d185b5491c6d50f74 | """This module implements tools for integrating rational functions. """
from sympy.core.function import Lambda
from sympy.core.numbers import I
from sympy.core.singleton import S
from sympy.core.symbol import (Dummy, Symbol, symbols)
from sympy.functions.elementary.exponential import log
from sympy.functions.elementar... |
cac2102dd441706fd847e6d50e8c6dfacc44554f131bbee84a033e274808d261 | from sympy.core.mul import Mul
from sympy.core.singleton import S
from sympy.core.sorting import default_sort_key
from sympy.functions import DiracDelta, Heaviside
from .integrals import Integral, integrate
def change_mul(node, x):
"""change_mul(node, x)
Rearranges the operands of a product, bringing to f... |
6867b1d047b85fa5c89bf82f166211b44f56d9f81c9e9bb2f8704c59d1f95fee | """
Algorithms for solving Parametric Risch Differential Equations.
The methods used for solving Parametric Risch Differential Equations parallel
those for solving Risch Differential Equations. See the outline in the
docstring of rde.py for more information.
The Parametric Risch Differential Equation problem is, giv... |
ec56a4777b1eff122cecf817778bedf90cdf018fddbc06fef20fa9f574a0e72f | """
Integrate functions by rewriting them as Meijer G-functions.
There are three user-visible functions that can be used by other parts of the
sympy library to solve various integration problems:
- meijerint_indefinite
- meijerint_definite
- meijerint_inversion
They can be used to compute, respectively, indefinite i... |
be3cae81af037c96ad4d2c163f19998b8e6e700256c6d08dcdc88f0ff7274f99 | """Base class for all the objects in SymPy"""
from collections import defaultdict
from collections.abc import Mapping
from itertools import chain, zip_longest
from typing import Set, Tuple, Any
from .assumptions import ManagedProperties
from .cache import cacheit
from .core import BasicMeta
from .sympify import _sympi... |
ed959ccfec26e6deeed03e60d0c35e7c2f8b18ac43081afe9463b045e2bfd8b9 | from typing import Callable, Tuple as tTuple
from math import log as _log, sqrt as _sqrt
from itertools import product
from .sympify import _sympify
from .cache import cacheit
from .singleton import S
from .expr import Expr
from .evalf import PrecisionExhausted
from .function import (expand_complex, expand_multinomial... |
247f28d8f7bc49e82028a3aca9704974c9a1c10fdea4f5ab2096f778ec905dae | """Tools for manipulating of large commutative expressions. """
from .add import Add
from .mul import Mul, _keep_coeff
from .power import Pow
from .basic import Basic
from .expr import Expr
from .sympify import sympify
from .numbers import Rational, Integer, Number, I
from .singleton import S
from .sorting import defa... |
098eb280553be9eb2aca9c971dc93504a93aa0b198d84eecf11cf6482b161f4a | from collections import defaultdict
from .sympify import sympify, SympifyError
from sympy.utilities.iterables import iterable, uniq
__all__ = ['default_sort_key', 'ordered']
def default_sort_key(item, order=None):
"""Return a key that can be used for sorting.
The key has the structure:
(class_key, (l... |
20c0263db7ad15d036140af5589c03843fcca52b509023d3560dea04bddfa49a | """Singleton mechanism"""
from .core import Registry
from .assumptions import ManagedProperties
from .sympify import sympify
class SingletonRegistry(Registry):
"""
The registry for the singleton classes (accessible as ``S``).
Explanation
===========
This class serves as two separate things.
... |
2125e46882d19068495e51eeb1083345bc3c4dede8665e9bcbcd5995ef9feee9 | """
There are three types of functions implemented in SymPy:
1) defined functions (in the sense that they can be evaluated) like
exp or sin; they have a name and a body:
f = exp
2) undefined function which have a name but no body. Undefined
functions can be defined using a Function cla... |
624dba41907bd6580ad4aed633b9fe3b709508d3c7b2fe560f167c98e8520cab | from typing import Tuple as tTuple
from collections import defaultdict
from functools import cmp_to_key, reduce
from operator import attrgetter
from .basic import Basic
from .parameters import global_parameters
from .logic import _fuzzy_group, fuzzy_or, fuzzy_not
from .singleton import S
from .operations import AssocOp... |
df86c36e723405c3a30995b9ea7e602f27ca6892a01fc7b6bd057e86f39ad36a | from typing import Tuple as tTuple, TYPE_CHECKING
from collections.abc import Iterable
from functools import reduce
from .sympify import sympify, _sympify
from .basic import Basic, Atom
from .singleton import S
from .evalf import EvalfMixin, pure_complex, DEFAULT_MAXPREC
from .decorators import call_highest_priority, ... |
3943d94132f888d44c21206cd0b972cd0260dc617a385158e55a9b63c9f85b6c | """
When you need to use random numbers in SymPy library code, import from here
so there is only one generator working for SymPy. Imports from here should
behave the same as if they were being imported from Python's random module.
But only the routines currently used in SymPy are included here. To use others
import ``r... |
23cf6f8f170eb560d36f0f06a51bc994c3e7679181b45df145311659935397fc | from typing import Dict as tDict, Union as tUnion, Type
from .basic import Atom, Basic
from .sorting import ordered
from .evalf import EvalfMixin
from .function import AppliedUndef
from .singleton import S
from .sympify import _sympify, SympifyError
from .parameters import global_parameters
from .logic import fuzzy_bo... |
7e6d14634a9b749ec5037ab5c642ec7219464f0454802dd999aff48728d1a952 | import numbers
import decimal
import fractions
import math
import re as regex
import sys
from functools import lru_cache
from typing import Set as tSet, Tuple as tTuple
from .containers import Tuple
from .sympify import (SympifyError, _sympy_converter, sympify, _convert_numpy_types,
_sympify, _is_numpy_i... |
3230623b567b3afaa9522f5e615e8374750484447b20351aafcc508c2dad254f | from operator import attrgetter
from typing import Tuple as tTuple, Type
from collections import defaultdict
from sympy.utilities.exceptions import sympy_deprecation_warning
from .sympify import _sympify as _sympify_, sympify
from .basic import Basic
from .cache import cacheit
from .sorting import ordered
from .logic... |
0ea2338644fd4a1b3e6e3ec764fe3ccb21a7c9f01dcf94cfe080b62b9179f6a9 | from .assumptions import StdFactKB, _assume_defined
from .basic import Basic, Atom
from .cache import cacheit
from .containers import Tuple
from .expr import Expr, AtomicExpr
from .function import AppliedUndef, FunctionClass
from .kind import NumberKind, UndefinedKind
from .logic import fuzzy_bool
from .singleton impor... |
5d01fb7b39918ba977476dea307376c1f03e60c4566e1d986233d8ecb468de5a | """
.. deprecated:: 1.10
``sympy.core.compatibility`` is deprecated. See
:ref:`sympy-core-compatibility`.
Reimplementations of constructs introduced in later versions of Python than
we support. Also some functions that are needed SymPy-wide and are located
here for easy import.
"""
from sympy.utilities.excep... |
9f07c6fe669b7c7ae4a8e08e46084171e749fa0b2b2364ceef253fbaacbf5aec | """sympify -- convert objects SymPy internal format"""
import typing
if typing.TYPE_CHECKING:
from typing import Any, Callable, Dict as tDict, Type
from inspect import getmro
import string
from sympy.core.random import choice
from .parameters import global_parameters
from sympy.utilities.exceptions import sympy... |
f560bca773a904be9374799958c0caf636821bed7a7f8b99576569b5db951fdf | from sympy.utilities.exceptions import sympy_deprecation_warning
sympy_deprecation_warning(
"""
sympy.core.trace is deprecated. Use sympy.physics.quantum.trace
instead.
""",
deprecated_since_version="1.10",
active_deprecations_target="sympy-core-trace-deprecated",
)
from sympy.physics.quantum.... |
3588e8021256cbf27fe083c4e6c659fc2d4d251c39a4b750a8a342f5001310de | """
Adaptive numerical evaluation of SymPy expressions, using mpmath
for mathematical functions.
"""
from typing import Tuple as tTuple, Optional, Union as tUnion, Callable, List, Dict as tDict, Type, TYPE_CHECKING, \
Any, overload
import math
import mpmath.libmp as libmp
from mpmath import (
make_mpc, make_... |
5ff6e5cff665d453d8b23680bb563a1750a4bf8130ff91556029a6a781deb938 | """Module for SymPy containers
(SymPy objects that store other SymPy objects)
The containers implemented in this module are subclassed to Basic.
They are supposed to work seamlessly within the SymPy framework.
"""
from collections import OrderedDict
from collections.abc import MutableSet
from typing impo... |
6ff2292353edbf521aa0cb72b3f9f1ecb5006304f29d7988b971be16652477a2 | from typing import Tuple as tTuple
from collections import defaultdict
from functools import cmp_to_key, reduce
from itertools import product
import operator
from .sympify import sympify
from .basic import Basic
from .singleton import S
from .operations import AssocOp, AssocOpDispatcher
from .cache import cacheit
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.