hash
stringlengths
64
64
content
stringlengths
0
1.51M
023c8e2871e4c3d2bf509cfbc89f95d752ac3c6c8b3381d50f6564153c5b396a
"""Tests for user-friendly public interface to polynomial functions. """ import pickle from sympy.polys.polytools import ( Poly, PurePoly, poly, parallel_poly_from_expr, degree, degree_list, total_degree, LC, LM, LT, pdiv, prem, pquo, pexquo, div, rem, quo, exquo, half_gcdex, gcdex, in...
02f7b73d3b8646df219bd242bed8e34c5545d95382adbdc792966d25d460df6b
"""Tests for options manager for :class:`Poly` and public API functions. """ from sympy.polys.polyoptions import ( Options, Expand, Gens, Wrt, Sort, Order, Field, Greedy, Domain, Split, Gaussian, Extension, Modulus, Symmetric, Strict, Auto, Frac, Formal, Polys, Include, All, Gen, Symbols, Method) from sym...
68a080c2bcab6fe7e153572e87193b712bc00da35a40e3b144999d2484b162d2
"""Finite extensions of ring domains.""" from __future__ import print_function, division from sympy.polys.polyerrors import CoercionFailed from sympy.polys.polytools import Poly from sympy.printing.defaults import DefaultPrinting class ExtensionElement(DefaultPrinting): """ Element of a finite extension. ...
03f70bda8e9e4c5964b5721e1e8c62f37c232beb37a5ba91b0732efd74135848
"""Tests for classes defining properties of ground domains, e.g. ZZ, QQ, ZZ[x] ... """ from sympy import I, S, sqrt, sin, oo, Poly, Float, Rational, pi from sympy.abc import x, y, z from sympy.core.compatibility import HAS_GMPY from sympy.polys.domains import (ZZ, QQ, RR, CC, FF, GF, EX, ZZ_gmpy, ZZ_python, QQ_g...
4c0241825ddd5bbd20fcbd1794f4b804923261ae2abaf29d3e25ebb3200479a7
from sympy import sin, cos, pi from sympy.vector.coordsysrect import CoordSys3D from sympy.vector.parametricregion import ParametricRegion from sympy.testing.pytest import raises from sympy.abc import a, b, r, t, x, y, z, theta, phi C = CoordSys3D('C') def test_parametricregion(): point = ParametricRegion((3, 4)...
e6efc8eeaa86d22f94d591d25d5b52161eae6f39e492f9931c46c104a280ec89
from sympy.holonomic import (DifferentialOperator, HolonomicFunction, DifferentialOperators, from_hyper, from_meijerg, expr_to_holonomic) from sympy.holonomic.recurrence import RecurrenceOperators, HolonomicSequence from sympy import (symbols, hyper, S, sqrt, pi...
d173da490617549eb2e3b879e7d53e05c2483091b2f25204d8417111a3f690ba
from sympy.testing.pytest import raises, XFAIL from sympy.external import import_module from sympy import ( Symbol, Mul, Add, Eq, Abs, sin, asin, cos, Pow, csc, sec, Limit, oo, Derivative, Integral, factorial, sqrt, root, StrictLessThan, LessThan, StrictGreaterThan, GreaterThan, Sum, Product, E, log, t...
06a04cdc36e925c34865553f2c4e920e27706ab9a669ff549c940e2ca30e818f
# encoding: utf-8 # *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND *** # # Generated from ../LaTeX.g4, derived from latex2sympy # latex2sympy is licensed under the MIT license # https://github.com/augustt198/latex2sympy/blob/master/LICENSE.txt # # Generated with antlr4 # antlr4 is licensed under th...
52517f88aed9765d8de87c5d76d90715a9d1137a316758f2a4658a2c0a9ffbaa
# encoding: utf-8 # *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND *** # # Generated from ../LaTeX.g4, derived from latex2sympy # latex2sympy is licensed under the MIT license # https://github.com/augustt198/latex2sympy/blob/master/LICENSE.txt # # Generated with antlr4 # antlr4 is licensed under th...
6c206a76349f8dea117a238d26b35d6a4c9d5e7407584ffb35a025fb20b051b7
"""Quantum mechanical operators. TODO: * Fix early 0 in apply_operators. * Debug and test apply_operators. * Get cse working with classes in this file. * Doctests and documentation of special methods for InnerProduct, Commutator, AntiCommutator, represent, apply_operators. """ from __future__ import print_function...
534c9369b353e9ba2bc5ed77a26f295b17f26739a04147e83c9dd2854729711f
from __future__ import print_function, division from itertools import product from sympy import Tuple, Add, Mul, Matrix, log, expand, S from sympy.core.trace import Tr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.operator import Her...
7394a5277747b2cb2d4b30840dd0ce3413358aac9e9cfb954b29911a4bc03890
"""Quantum mechanical angular momemtum.""" from __future__ import print_function, division from sympy import (Add, binomial, cos, exp, Expr, factorial, I, Integer, Mul, pi, Rational, S, sin, simplify, sqrt, Sum, symbols, sympify, Tuple, Dummy) from sympy.core.compatibility import...
de84c02cf4992af5a23e8bbef2f97c2c3038f4ee542a8919d553521c12dab950
from sympy import Derivative from sympy.core.function import UndefinedFunction, AppliedUndef from sympy.core.symbol import Symbol from sympy.interactive.printing import init_printing from sympy.printing.conventions import split_super_sub from sympy.printing.latex import LatexPrinter, translate from sympy.printing.prett...
e187a46851971966240bbc9efd34aa64bbcc6a94ea19f9b201010714747315b5
from sympy.core.backend import (S, sympify, expand, sqrt, Add, zeros, ImmutableMatrix as Matrix) from sympy import trigsimp from sympy.printing.defaults import Printable from sympy.core.compatibility import unicode from sympy.utilities.misc import filldedent __all__ = ['Vector'] class Vector(Printable): """T...
6b95c4c2be82b5df97b4689685ae826d2cf834b5089ecb647293ce3660f9cc9a
from sympy.core.backend import sympify, Add, ImmutableMatrix as Matrix from sympy.core.compatibility import unicode from sympy.printing.defaults import Printable from .printing import (VectorLatexPrinter, VectorPrettyPrinter, VectorStrPrinter) __all__ = ['Dyadic'] class Dyadic(Printable): ...
9bc0e8b47e71a6ca7cf3564004c1d0fc8eb5d7c8eaf5d4fef0c0fb3375e21b50
""" This module can be used to solve 2D beam bending problems with singularity functions in mechanics. """ from __future__ import print_function, division from sympy.core import S, Symbol, diff, symbols from sympy.solvers import linsolve from sympy.printing import sstr from sympy.functions import SingularityFunction,...
4ae3d2f5b8ec4e4610b7b5d164beb035562ed4ae928b96f25719838abbbad587
from __future__ import print_function, division from sympy import Basic from sympy import S from sympy.core.expr import Expr from sympy.core.numbers import Integer from sympy.core.sympify import sympify from sympy.core.compatibility import SYMPY_INTS, Iterable from sympy.printing.defaults import Printable import iter...
46ab4f9a01f991ea74b5a372e9fb25af1090b4107e0f784231f5fe92a7b94cbc
from sympy import ( Rational, Symbol, N, I, Abs, sqrt, exp, Float, sin, cos, symbols) from sympy.matrices import eye, Matrix, dotprodsimp from sympy.core.singleton import S from sympy.testing.pytest import raises, XFAIL from sympy.matrices.matrices import NonSquareMatrixError, MatrixError from sympy.simplify.si...
25905b7993635a991989cea9b5e8ebdb76d4ee290b03adb95f5190f1e3fc1ee2
from sympy import ( I, Rational, S, Symbol, simplify, symbols, sympify, expand_mul) from sympy.matrices.matrices import (ShapeError, NonSquareMatrixError) from sympy.matrices import ( ImmutableMatrix, Matrix, eye, ones, ImmutableDenseMatrix, dotprodsimp) from sympy.testing.pytest import raises from sympy.matric...
5442ad6572c1f9ee7b2d719aba9e7c06229af52f114806e88369e7d7963237df
from sympy.assumptions import Q from sympy.core.expr import Expr from sympy.core.add import Add from sympy.core.function import Function from sympy.core.numbers import I, Integer, oo, pi, Rational from sympy.core.singleton import S from sympy.core.symbol import Symbol, symbols from sympy.functions.elementary.complexes ...
cb1bbd5ed9889c63ebeeba6c2faa4ceb0d97406caa4b7096519d86fdcf588333
import random from sympy import ( Abs, Add, E, Float, I, Integer, Max, Min, Poly, Pow, PurePoly, Rational, S, Symbol, cos, exp, log, oo, pi, signsimp, simplify, sin, sqrt, symbols, sympify, trigsimp, tan, sstr, diff, Function, expand) from sympy.matrices.matrices import (ShapeError, MatrixError, NonSqu...
5b3118e929a98da1d173099a6db414f88915585ef7ee94231dd62e7c4cfc6ca6
from sympy.core.expr import unchanged from sympy.sets import (ConditionSet, Intersection, FiniteSet, EmptySet, Union, Contains, ImageSet) from sympy import (Symbol, Eq, Ne, S, Abs, sin, asin, pi, Interval, And, Mod, oo, Function, Lambda, symbols) from sympy.testing.pytest import raises, warns_deprecated_sympy ...
283f50bd54cd334a633b3b65a1e6406f4bb1a89bf45ad898fa83fbae4fab668a
from sympy import (Symbol, Set, Union, Interval, oo, S, sympify, nan, Max, Min, Float, DisjointUnion, FiniteSet, Intersection, imageset, I, true, false, ProductSet, sqrt, Complement, EmptySet, sin, cos, Lambda, ImageSet, pi, Pow, Contains, Sum, rootof, SymmetricDifference, Piecewise, Matrix, Range, ...
137b0cd736cd25a392b008230208b0d4c7dcc480cfcb82802b748402c15607d4
#!/usr/bin/env python """Distutils based setup script for SymPy. This uses Distutils (https://python.org/sigs/distutils-sig/) the standard python mechanism for installing packages. Optionally, you can use Setuptools (https://setuptools.readthedocs.io/en/latest/) to automatically handle dependencies. For the easiest in...
70e698cddbcf8954e71016ffb0b1119e9b5054dc54dbf6db057e9fdc87b967b4
""" Continuous Random Variables - Prebuilt variables Contains ======== Arcsin Benini Beta BetaNoncentral BetaPrime BoundedPareto Cauchy Chi ChiNoncentral ChiSquared Dagum Erlang ExGaussian Exponential ExponentialPower FDistribution FisherZ Frechet Gamma GammaInverse Gumbel Gompertz Kumaraswamy Laplace Levy Logistic Lo...
6d52a02c4ae75d6ea78c7afb539509eca209c7a813dca2f68ce6689ab6b5e29a
""" Finite Discrete Random Variables - Prebuilt variable types Contains ======== FiniteRV DiscreteUniform Die Bernoulli Coin Binomial BetaBinomial Hypergeometric Rademacher """ from __future__ import print_function, division from sympy import (S, sympify, Rational, binomial, cacheit, Integer, Dumm...
7befd7aebe3bbdfbb88fb2633f1ae506ac256e8b2b8bf33af1a24ad77fe5e3f0
from __future__ import print_function, division import random import itertools from sympy import (Matrix, MatrixSymbol, S, Indexed, Basic, Set, And, Eq, FiniteSet, ImmutableMatrix, Lambda, Mul, Dummy, IndexedBase, Add, Interval, oo, linsolve, eye, Or, Not, Inte...
53c796f0f718410407216c95d069dd0b9f882c53177ab898ab227b0de03929cd
""" SymPy statistics module Introduces a random variable type into the SymPy language. Random variables may be declared using prebuilt functions such as Normal, Exponential, Coin, Die, etc... or built with functions like FiniteRV. Queries on random expressions can be made using the functions ======================...
04ffbb00fa7f6535b9f92f782b2c3691d8b254547fcae20af270a901a4eac090
from sympy import (sympify, S, pi, sqrt, exp, Lambda, Indexed, besselk, gamma, Interval, Range, factorial, Mul, Integer, Add, rf, Eq, Piecewise, ones, Symbol, Pow, Rational, Sum, Intersection, Matrix, symbols, Product, IndexedBase) from sympy.matrices import Immu...
f98a5df094fded8612f6929851b288c9e13f0e8ac541767ebf2004245d87445c
import itertools from sympy import (MatrixExpr, Expr, ShapeError, ZeroMatrix, Add, Mul, MatMul, S, expand as _expand) from sympy.stats.rv import RandomSymbol, is_random from sympy.core.sympify import _sympify from sympy.stats.symbolic_probability import Variance, Covariance, Expectation class Exp...
4456bfb026c59bb277e506eb3d833df48acb03452f6998a941e67d056903a3ca
""" Contains ======== Geometric Hermite Logarithmic NegativeBinomial Poisson Skellam YuleSimon Zeta """ from __future__ import print_function, division from sympy import (Basic, factorial, exp, S, sympify, I, zeta, polylog, log, beta, hyper, binomial, Piecewise, floor, besseli, sqrt, Sum, Dummy, ...
9eadd2e637aa15fdd2e6ce6350ac79312ac51f7501b2da25a63a7b6edc2b8438
from __future__ import print_function, division from sympy.sets import FiniteSet from sympy import (sqrt, log, exp, FallingFactorial, Rational, Eq, Dummy, piecewise_fold, solveset, Integral) from .rv import (probability, expectation, density, where, given, pspace, cdf, PSpace, character...
423d26bc99fc234f50db52984eb05c0e69bcac04c425474464a2c3d7bcd7fbde
""" Main Random Variables Module Defines abstract random variable type. Contains interfaces for probability space object (PSpace) as well as standard operators, P, E, sample, density, where, quantile See Also ======== sympy.stats.crv sympy.stats.frv sympy.stats.rv_interface """ from __future__ import print_function...
7b962fe527dd8fadfb6df3e873346edd91470943bbdc5794396b8fb451f7ade7
""" Joint Random Variables Module See Also ======== sympy.stats.rv sympy.stats.frv sympy.stats.crv sympy.stats.drv """ from __future__ import print_function, division from sympy import (Basic, Lambda, sympify, Indexed, Symbol, ProductSet, S, Dummy) from sympy.concrete.products import Product from ...
b1e155d62375b98a01595d5880420cda5dc128248e755ae937b0a21a1c232120
from sympy import Basic, integrate, Sum, Dummy, Lambda from sympy.stats.rv import (NamedArgsMixin, random_symbols, _symbol_converter, PSpace, RandomSymbol) from sympy.stats.crv import ContinuousDistribution, SingleContinuousPSpace from sympy.stats.drv import DiscreteDistribution, SingleDiscreteP...
dbb6aa4f70bc0c340b96f6d7a1000e588b7d3a83e6945a12abec519feeaa1001
import itertools from sympy import (Expr, Add, Mul, S, Integral, Eq, Sum, Symbol, expand as _expand, Not) from sympy.core.compatibility import default_sort_key from sympy.core.parameters import global_parameters from sympy.core.sympify import _sympify from sympy.core.relational import Relational fr...
a93efc246b6d2c8ab69cedcb6ab18e2ad2c68308cfab4c4f36ecc81ef0ee28fe
import random from collections import defaultdict from sympy.core.parameters import global_parameters from sympy.core.basic import Atom from sympy.core.expr import Expr from sympy.core.compatibility import \ is_sequence, reduce, as_int, Iterable from sympy.core.numbers import Integer from sympy.core.sympify import...
ad63fd1f854da284f3b1b643a5e8bb95de69872a3f5369e41e8f94d648be1844
from sympy.core.mul import Mul from sympy.core.singleton import S from sympy.concrete.expr_with_intlimits import ExprWithIntLimits from sympy.core.exprtools import factor_terms from sympy.functions.elementary.exponential import exp, log from sympy.polys import quo, roots from sympy.simplify import powsimp class Produ...
8ba483c47e456992ae13645bb4f125f0ebf98fc55258ac9f3589f747ae677e4b
""" 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...
65cb142be6ad0013ba867a90f2e56bd35dd032587737ae36817414822a4bcb81
from __future__ import print_function, division from sympy.core import S, Symbol, Add, sympify, Expr, PoleError, Mul from sympy.core.exprtools import factor_terms from sympy.core.symbol import Dummy from sympy.functions.combinatorial.factorials import factorial from sympy.functions.special.gamma_functions import gamma...
df0fd62a50015c2ce55a401bd9ef574a2da1c5d3502d0af04e5d96f117e23224
from __future__ import print_function, division from collections import defaultdict from sympy.core import (Basic, S, Add, Mul, Pow, Symbol, sympify, expand_func, Function, Dummy, Expr, factor_terms, expand_power_exp, Eq) from sympy.core.compatibility import iterable, o...
3daf8af8f4abf48fa927200fd44cce69bd38ead2d0f4ae48ddc3bf3b59463eb4
from __future__ import print_function, division from collections import defaultdict from sympy import SYMPY_DEBUG from sympy.core import expand_power_base, sympify, Add, S, Mul, Derivative, Pow, symbols, expand_mul from sympy.core.add import _unevaluated_Add from sympy.core.compatibility import iterable, ordered, de...
76cd205ff1548e181ed9bb1dec9744d85f086fb1bd48153de4424c6f3e5a737e
from __future__ import print_function, division from sympy.core import Mul from sympy.core.basic import preorder_traversal from sympy.core.function import count_ops from sympy.functions.combinatorial.factorials import binomial, factorial from sympy.functions import gamma from sympy.simplify.gammasimp import gammasimp,...
28412f604f7c8ee63471119777a7bb6b26c571212e05a2ae4c4758b6a62dfb8d
from collections import defaultdict from sympy.core.add import Add from sympy.core.basic import S from sympy.core.compatibility import ordered 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 fro...
14d51d41c5e381c9a586b704ea1a497d2f391284acf1557b2d07f34895f4b940
from sympy.core import S, Basic, Dict, Symbol, Tuple, sympify from sympy.core.compatibility import iterable from sympy.core.symbol import Str from sympy.sets import Set, FiniteSet, EmptySet class Class(Set): r""" The base class for any kind of class in the set-theoretic sense. In axiomatic set theories, ...
7168f837b01f360ad87062017b15fe52b5b17ddd5b3fd0d336a5262d6509f670
from .diffgeom import ( BaseCovarDerivativeOp, BaseScalarField, BaseVectorField, Commutator, contravariant_order, CoordSystem, CoordinateSymbol, CovarDerivativeOp, covariant_order, Differential, intcurve_diffequ, intcurve_series, LieDerivative, Manifold, metric_to_Christoffel_1st, metric_to_Christof...
1f326811230319a92b0281f72cb12b686b259c17389fd6a63b6f96c3daf28e31
"""Predefined R^n manifolds together with common coord. systems. Coordinate systems are predefined as well as the transformation laws between them. Coordinate functions can be accessed as attributes of the manifold (eg `R2.x`), as attributes of the coordinate systems (eg `R2_r.x` and `R2_p.theta`), or by using the us...
350343aa6f21ce4e195baf54c308cac5841bb842e988d015b62181043f4a08f5
from typing import Any, Set from itertools import permutations from sympy.combinatorics import Permutation from sympy.core import ( Basic, Expr, Function, diff, Pow, Mul, Add, Atom, Lambda, S, Tuple, Dict ) from sympy.core.cache import cacheit from sympy.core.compatibility import reduce from sympy.core.symbol...
3ca20ef31a3c40a36fc0825a0d8de7bec8a8c7a344b9b9f849ebb04329633e7c
""" 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* |--->AssignmentBase | ...
25bf6b7199a9678e86b182629f455e511bbb380720067c0373f6470376263e3e
""" This module contains SymPy functions mathcin corresponding to special math functions in the C standard library (since C99, also available in C++11). The functions defined in this module allows the user to express functions such as ``expm1`` as a SymPy function for symbolic manipulation. """ from sympy.core.functi...
f9c2f4cb168ef5603facbe94a0fcdee981ff1e147cb077f8f0340bd9575a1c36
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...
55f2fdf196ebc1c8b76f955d57c5085e50a52367feb70635dbaa103e651e97a2
""" 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...
7f980e0d9819133acb2a57debf1abaa4e5cba13d9a5c433d0a8d7955b532b85f
""" 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 __future__ import print_function, division fr...
f4341adbf8ed35153aec46804b1b32de44f5e18aabf9bbf3526c79c8ea52791f
""" 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...
0ca4f8af3581ed4dcfdc988646e74f13f408eda9ec737c704a2ad04cf1a90aaa
from sympy import Order, S, log, limit, lcm_list, im, re, Dummy from sympy.core import Add, Mul, Pow from sympy.core.basic import Basic from sympy.core.compatibility import iterable from sympy.core.expr import AtomicExpr, Expr from sympy.core.function import expand_mul from sympy.core.numbers import _sympifyit, oo from...
8dc37143e91f11e7124600cfd121364b1b39a156d12bf024b87e2efdabea3864
"""Miscellaneous stuff that doesn't really fit anywhere else.""" from typing import List import sys import os import re as _re import struct from textwrap import fill, dedent from sympy.core.compatibility import get_function_name, as_int from sympy.core.decorators import deprecated class Undecidable(ValueError): ...
d41fdf5f92915e5dd5f131ee36f9a324b781fe7f8bcc5fd3f3bf4fafea46c531
""" 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 .precedence import precedence from .codeprinter import CodePrinter _kw_py2and3 = { 'and', 'as...
8acd45b593be956f774a6234dba016cd6b2bac5dba7785deb921937970a3f2ae
""" A Printer for generating readable representation of most sympy classes. """ from __future__ import print_function, division from typing import Any, Dict from sympy.core import S, Rational, Pow, Basic, Mul, Number from sympy.core.mul import _keep_coeff from .printer import Printer from sympy.printing.precedence i...
60a2ea22f96cf52f49c46f3a792cef2c49e96c9bac6eb05f063753a8ea006224
""" A Printer which converts an expression into its LaTeX equivalent. """ from __future__ import print_function, division from typing import Any, Dict import itertools from sympy.core import Add, Mod, Mul, Number, S, Symbol from sympy.core.alphabets import greeks from sympy.core.containers import Tuple from sympy.c...
82249c0ba3eca6d5d3f26c8cffbcd1792e0c17092857698b79fd0edf3c0e0351
"""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...
9824bc61409b07f8dac8bd0783f79414cfc188cd0497f4ee6d528bf4b9a3deec
from __future__ import print_function, division import io from io import BytesIO import os from os.path import join import shutil import tempfile try: from subprocess import STDOUT, CalledProcessError, check_output except ImportError: pass from sympy.core.compatibility import unicode, u_decode from sympy.uti...
4e49d725483061a5dc1a2c533d7dc628c162f309c5274ef854ec9981bae67236
""" 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 __future__ import print_function, division from typing import Any, Dict from sympy.core.function import AppliedUndef...
9138ca8f3d3dea2b07cfdd8e354c3e656cc82d7c7a20b4310354f8d74bfcce7e
""" Integral Transforms """ from sympy.core import S from sympy.core.compatibility import reduce, iterable from sympy.core.function import Function from sympy.core.relational import _canonical, Ge, Gt from sympy.core.numbers import oo from sympy.core.symbol import Dummy from sympy.integrals import integrate, Integral ...
02a5c7f46302264e5cc4f5462ad11b17470542f5c53fdb804fac21055d2ea792
"""Base class for all the objects in SymPy""" from collections import defaultdict from itertools import chain, zip_longest from .assumptions import BasicMeta, ManagedProperties from .cache import cacheit from .sympify import _sympify, sympify, SympifyError from .compatibility import iterable, ordered, Mapping from .si...
a00317b387ae4c77ab2027ad4af5721b620cfe8491f24187e2ca534a91b0ab2e
from math import log as _log from .sympify import _sympify from .cache import cacheit from .singleton import S from .expr import Expr from .evalf import PrecisionExhausted from .function import (_coeff_isneg, expand_complex, expand_multinomial, expand_mul) from .logic import fuzzy_bool, fuzzy_not, fuzzy_and from ....
d48e3c83bb61f034323ed559a0cb6a8cf251a8480f4d6c42dd4e083361f45934
"""Singleton mechanism""" # from typing import Any, Dict, Type from .core import Registry from .assumptions import ManagedProperties from .sympify import sympify class SingletonRegistry(Registry): """ The registry for the singleton classes (accessible as ``S``). This class serves as two separate thing...
362e5db98e3426bba7c8a1f0ed7bb92363e9383a2371307e64b939fe1546d6ea
""" 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...
a9c4c3c9420f28a7eefebed7504fbf12ee1f528538122f6dbcc7e4b86754f6b7
from collections import defaultdict from functools import cmp_to_key from .basic import Basic from .compatibility import reduce, is_sequence from .parameters import global_parameters from .logic import _fuzzy_group, fuzzy_or, fuzzy_not from .singleton import S from .operations import AssocOp from .cache import cacheit ...
72edd88349535d86733a14ce8914c49851691fbfdad369753fc0e2e1bb2443f2
from typing import Tuple as tTuple from .sympify import sympify, _sympify, SympifyError from .basic import Basic, Atom from .singleton import S from .evalf import EvalfMixin, pure_complex from .decorators import call_highest_priority, sympify_method_args, sympify_return from .cache import cacheit from .compatibility i...
70039ef1ce31390c3ecc472c9c202a4947d11b0250ada220858a9a649b90dd19
# from typing import Dict, Union, Type from sympy.utilities.exceptions import SymPyDeprecationWarning from .basic import S, Atom from .compatibility import ordered from .basic import Basic from .evalf import EvalfMixin from .function import AppliedUndef from .sympify import _sympify, SympifyError from .parameters impo...
285980d69c582c020f29edae554ff6054fe0b35df612d765d725df38c123cf48
import numbers import decimal import fractions import math import re as regex from .containers import Tuple from .sympify import (SympifyError, converter, sympify, _convert_numpy_types, _sympify, _is_numpy_instance) from .singleton import S, Singleton from .expr import Expr, AtomicExpr from .eval...
c0ebbb4a0c4139bdb97810a6ca1ea0ef71914f5799549f5a3f5d45187f3ad81a
from sympy.core.numbers import nan from .function import Function class Mod(Function): """Represents a modulo operation on symbolic expressions. Receives two arguments, dividend p and divisor q. The convention used is the same as Python's: the remainder always has the same sign as the divisor. ...
166b2c9a54e979eca9e0736cc8ec3ca3f968fe2fc1c666d8e4d87abe4f28bc22
from sympy.core.assumptions import StdFactKB, _assume_defined from sympy.core.compatibility import is_sequence, ordered from .basic import Basic, Atom from .sympify import sympify from .singleton import S from .expr import Expr, AtomicExpr from .cache import cacheit from .function import FunctionClass from sympy.core.l...
1c02ee756a98800fb58b4a2238f07039a3b2f52546bf07c2b46f67d6a18cc07e
""" 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 typing import Tuple, Type import operator from collections import defaultdict from sympy.external import import_module """ Python...
b7e177d7e58c38419f4f86b02cd53e81f2c3eab8c482b08fa64333c36d88108a
"""sympify -- convert objects SymPy internal format""" # from typing import Any, Callable, Dict, Type from inspect import getmro from .compatibility import iterable from .parameters import global_parameters class SympifyError(ValueError): def __init__(self, expr, base_exc=None): self.expr = expr ...
a7c3e0f11ea713959d51b06fb9afcc8d8e41d75771fc015a0bf6a7dc86d5d837
"""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 sympy.core.basic import Basic from sympy.core.com...
c57d83ddb2d718cd612d49cb5d977b8e1df466c0f70bafa85be23f43ca0ff6d3
"""Logic expressions handling NOTE ---- at present this is mainly needed for facts.py , feel free however to improve this stuff for general purpose. """ # from typing import Dict, Type from typing import Union # Type of a fuzzy bool FuzzyBool = Union[bool, None] def _torf(args): """Return True if all args ar...
5277f2059f5df4525128b534b8eda21bd6276db65ff5beb666ba32fef7491337
from collections import defaultdict from functools import cmp_to_key import operator from .sympify import sympify from .basic import Basic from .singleton import S from .operations import AssocOp from .cache import cacheit from .logic import fuzzy_not, _fuzzy_group, fuzzy_and from .compatibility import reduce from .ex...
13f86e62a048aa65963778a91c5b4ef0876dced84042ccec73523125c5f5ffa9
from __future__ import print_function from sympy.core.sympify import _sympify from sympy.matrices.dense import MutableDenseMatrix from sympy.polys.fields import sfield from sympy.polys.polytools import Poly from sympy.polys.domains import EX class MutablePolyDenseMatrix(MutableDenseMatrix): """ A mutable m...
d59e2ec19cc141ac09929841fc5381a3bc5fe57108f2bfacdbee4f9efdfee127
"""Implementation of RootOf class and related tools. """ from __future__ import print_function, division from sympy import Basic from sympy.core import (S, Expr, Integer, Float, I, oo, Add, Lambda, symbols, sympify, Rational, Dummy) from sympy.core.cache import cacheit from sympy.core.compatibility import ordered...
ec51d8f2bd04e71e3f4ae77dfb68f4dcf8d899f3715968919035a4b921d96228
"""User-friendly public interface to polynomial functions. """ from __future__ import print_function, division from functools import wraps, reduce from operator import mul from sympy.core import ( S, Basic, Expr, I, Integer, Add, Mul, Dummy, Tuple ) from sympy.core.basic import preorder_traversal from sympy.core...
2cb7378c8e29e1bce0f2f7d096e21116cb63f5feec6bf3c10d598acb509e0db3
"""Options manager for :class:`~.Poly` and public API functions. """ from __future__ import print_function, division __all__ = ["Options"] # from typing import Dict, Type from typing import List, Optional from sympy.core import Basic, sympify from sympy.polys.polyerrors import GeneratorsError, OptionError, FlagErro...
36df3207b66c5857f13b883ee56de1fde479943b3948d2cd8d00a58ce8277b17
"""Low-level linear systems solver. """ from __future__ import print_function, division from sympy.utilities.iterables import connected_components from sympy.matrices import MutableDenseMatrix from sympy.polys.domains import EX from sympy.polys.rings import sring from sympy.polys.polyerrors import NotInvertible from...
7fe14a16c4295713bebd6710185bff32b502377be4e1d2912c980202189a1b29
""" This is our testing framework. Goals: * it should be compatible with py.test and operate very similarly (or identically) * doesn't require any external dependencies * preferably all the functionality should be in this file only * no magic, just import the test file and execute the test functions, that's it * po...
4b1e7b97bf551ef41f89e50123df352851cce419c3fd27ffe4459a18d8fbbb36
from sympy.core.basic import Basic from sympy import (sympify, eye, sin, cos, rot_axis1, rot_axis2, rot_axis3, ImmutableMatrix as Matrix) from sympy.core.cache import cacheit from sympy.core.symbol import Str import sympy.vector class Orienter(Basic): """ Super-class for all orienter classe...
b47e7330e9d36270b2d38bc1c7b3f4fbce1ae690cfe925b1cacbc31abe13b5df
from sympy.utilities.exceptions import SymPyDeprecationWarning from sympy.core.basic import Basic from sympy.core.compatibility import Callable from sympy.core.cache import cacheit from sympy.core import S, Dummy, Lambda from sympy.core.symbol import Str from sympy import symbols, MatrixBase, ImmutableDenseMatrix from ...
5ccedefe9448296c60b030e207b13c0e6b54fd093a765f2a6471440471538f34
from sympy.utilities.exceptions import SymPyDeprecationWarning from sympy.core import Basic from sympy.vector.operators import gradient, divergence, curl class Del(Basic): """ Represents the vector differential operator, usually represented in mathematical expressions as the 'nabla' symbol. """ d...
2553cc0f06695ad9fe8e2859fa7cc78ae1e57fc567a4a32ed9b65d868ce32bd0
from sympy.vector.coordsysrect import CoordSys3D, CoordSysCartesian from sympy.vector.vector import (Vector, VectorAdd, VectorMul, BaseVector, VectorZero, Cross, Dot, cross, dot) from sympy.vector.dyadic import (Dyadic, DyadicAdd, DyadicMul, BaseDyadic, ...
cd62c3c4e647d665191f959aab163e3390e9cc6b1a61dbc9b27acd67c86667f7
from typing import Any, Dict from sympy.simplify import simplify as simp, trigsimp as tsimp from sympy.core.decorators import call_highest_priority, _sympifyit from sympy.core.assumptions import StdFactKB from sympy import factor as fctr, diff as df, Integral from sympy.core import S, Add, Mul from sympy.core.expr imp...
f98334f5bb38e91570a751581bcb2b6215648f9a621a68ce5ad6712b283758f7
from typing import Type from sympy.core.assumptions import StdFactKB from sympy.core import S, Pow, sympify from sympy.core.expr import AtomicExpr, Expr from sympy.core.compatibility import default_sort_key from sympy import sqrt, ImmutableMatrix as Matrix, Add from sympy.vector.coordsysrect import CoordSys3D from sym...
a336252279e5b2622928112be548b7df54f5967001e734b6fe91d887d93f78cb
from sympy.core.basic import Basic from sympy.core.symbol import Str from sympy.vector.vector import Vector from sympy.vector.coordsysrect import CoordSys3D from sympy.vector.functions import _path from sympy.core.cache import cacheit class Point(Basic): """ Represents a point in 3-D space. """ def _...
36ecdff3c7e7c0245c296e18cd250a484c5b8a7cd990a8b378014d64c50af350
from sympy.core import AtomicExpr, Symbol, S from sympy.core.sympify import _sympify from sympy.printing.pretty.stringpict import prettyForm from sympy.printing.precedence import PRECEDENCE class BaseScalar(AtomicExpr): """ A coordinate symbol/base scalar. Ideally, users should not instantiate this class...
4f2fc30b378b133b66a4e1f87a5d45be9e98bb8ebd7d58d38d00eae54c562da4
from sympy import S, simplify from sympy.core import Basic, diff from sympy.matrices import Matrix from sympy.vector import CoordSys3D, Vector, ParametricRegion, parametric_region_list from sympy.vector.operators import _get_coord_sys_from_expr from sympy.integrals import Integral, integrate from sympy.utilities.iterab...
7f655c07dcbc259b60e0439922a9b6fe291e02143a1df15ae94f85b47a326473
from functools import singledispatch from sympy import pi from sympy.core import Basic, Tuple from sympy.core.symbol import _symbol from sympy.solvers import solve from sympy.geometry import Point, Segment, Curve, Ellipse, Polygon class ParametricRegion(Basic): """ Represents a parametric region in space. ...
fb78a7772cef126c4dea9cf2726ff02fc6c067396d33228f7f55ac9cf1f91beb
from typing import Type from sympy.vector.basisdependent import (BasisDependent, BasisDependentAdd, BasisDependentMul, BasisDependentZero) from sympy.core import S, Pow from sympy.core.expr import AtomicExpr from sympy import ImmutableMatrix as Matrix import sympy.vector clas...
eae3137551ecd942c37fe66a8a28e6c95f7bbc0af2329b3625ca1ae92fbaa758
"""Transform a string with Python-like source code into SymPy expression. """ from __future__ import print_function, division from tokenize import (generate_tokens, untokenize, TokenError, NUMBER, STRING, NAME, OP, ENDMARKER, ERRORTOKEN, NEWLINE) from keyword import iskeyword import ast import unicodedata from...
cf246d38309d36e0e9f6eb8a55a79b28a8037e45b46f0baf7dc769cc27b58cb4
""" This module defines tensors with abstract index notation. The abstract index notation has been first formalized by Penrose. Tensor indices are formal objects, with a tensor type; there is no notion of index range, it is only possible to assign the dimension, used to trace the Kronecker delta; the dimension can be...
916a005c0850ecbeda7e0f2c9bb4bcc36998d45d1217ac095dc5878a6538df6d
r"""Module that defines indexed objects The classes ``IndexedBase``, ``Indexed``, and ``Idx`` represent a matrix element ``M[i, j]`` as in the following diagram:: 1) The Indexed class represents the entire indexed object. | ___|___ ' ' M[i, j]...
b920babf506c40d1b2de5eee1b20e75191c6b2ac5eb33db8eb7957bd7d7a8d83
from mpmath.matrices.matrices import _matrix from sympy.core import Basic, Dict, Integer, Tuple from sympy.core.cache import cacheit from sympy.core.sympify import converter as sympify_converter, _sympify from sympy.matrices.dense import DenseMatrix from sympy.matrices.expressions import MatrixExpr from sympy.matrices...
27480eaa1d23fcc3a0c7cab2d8e54bb5b38aa245b56fd89331eb1e0e08ede5ce
""" Basic methods common to all matrices to be used when creating more advanced matrices (e.g., matrices over rings, etc.). """ from sympy.core.logic import FuzzyBool from collections import defaultdict from inspect import isfunction from sympy.assumptions.refine import refine from sympy.core import SympifyError, Ad...