hash
stringlengths
64
64
content
stringlengths
0
1.51M
14a68675488b27893e738fdcd04d8fb4c1711e68a8ac07cbedf4fe682308a98b
from sympy.core.containers import Tuple from sympy.core.function import (Function, Lambda, nfloat, diff) from sympy.core.mod import Mod from sympy.core.numbers import (E, I, Rational, oo, pi, Integer) from sympy.core.relational import (Eq, Gt, Ne, Ge) from sympy.core.singleton import S from sympy.core.sorting import or...
7f9e8deb57b7c00cd1dd475404d96296a1fa458171f144b8499f03b79c55e853
from sympy.assumptions.ask import (Q, ask) from sympy.core.add import Add from sympy.core.containers import Tuple from sympy.core.function import (Derivative, Function, diff) from sympy.core.mul import Mul from sympy.core import (GoldenRatio, TribonacciConstant) from sympy.core.numbers import (E, Float, I, Rational, oo...
3f5264efd080601f392fe3b729124aa6caafc15260aaa27fbb8e0d8a0196b1a0
"""Tests for solvers of systems of polynomial equations. """ from sympy.core.numbers import (I, Integer, Rational) from sympy.core.singleton import S from sympy.core.symbol import symbols from sympy.functions.elementary.miscellaneous import sqrt from sympy.polys.domains.rationalfield import QQ from sympy.polys.polyerro...
64e603eb28ba9a66d98112f314a20157d488b8e55860ef7dcae3d3bd55774085
from itertools import product import math import inspect import mpmath from sympy.testing.pytest import raises, warns_deprecated_sympy from sympy.concrete.summations import Sum from sympy.core.function import (Function, Lambda, diff) from sympy.core.numbers import (E, Float, I, Rational, oo, pi) from sympy.core.relati...
1b34235d6009ef79866e499e31efbcbf3ab4c06690d8d534a7660c0c3b9d63d7
from sympy.core import ( S, pi, oo, symbols, Rational, Integer, Float, Mod, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy, nan, Mul, Pow, UnevaluatedExpr ) from sympy.core.relational import (Eq, Ge, Gt, Le, Lt, Ne) from sympy.functions import ( Abs, acos, acosh, asin, asinh, atan, atanh, atan2, ceiling, c...
e1775568c31e344fd5c010bb457aa01600fef7319feb98cd62285c63a8e9770c
from sympy.algebras.quaternion import Quaternion from sympy.calculus.accumulationbounds import AccumBounds from sympy.combinatorics.permutations import Cycle, Permutation, AppliedPermutation from sympy.concrete.products import Product from sympy.concrete.summations import Sum from sympy.core.containers import Tuple, Di...
132ddfcccb716397a90e35532601b0963c75cdbeddb3c3b24b2d8a51c237660c
from sympy.functions.elementary.complexes import Abs from sympy.functions.elementary.miscellaneous import sqrt from sympy.core import S, Rational from sympy.integrals.intpoly import (decompose, best_origin, distance_to_side, polytope_integrate, point_sort, ...
ded56251a4bc7c934d4f6e35009403e8709238b1d333e5902e801048c7adb5bb
from sympy.concrete.summations import (Sum, summation) from sympy.core.add import Add from sympy.core.containers import Tuple from sympy.core.expr import Expr from sympy.core.function import (Derivative, Function, Lambda, diff) from sympy.core import EulerGamma from sympy.core.numbers import (E, Float, I, Rational, nan...
64d8bd764d36a771e183a415e371167cece78506e90b27df3fa2ff293a1d084c
from sympy.core.expr import Expr from sympy.core.function import (Derivative, Function, diff, expand) from sympy.core.numbers import (I, Rational, pi) from sympy.core.relational import Ne from sympy.core.singleton import S from sympy.core.symbol import (Dummy, Symbol, symbols) from sympy.functions.elementary.exponentia...
68ec15d82cc32a208acbdf35b6663059b9bb1d19efe491f5828b6bb98c1a6cbb
from sympy.integrals.transforms import (mellin_transform, inverse_mellin_transform, laplace_transform, inverse_laplace_transform, fourier_transform, inverse_fourier_transform, sine_transform, inverse_sine_transform, cosine_transform, inverse_cosine_transform, hankel_transform, inverse_hankel_transfo...
3cbd7d7e1337d066806a90bb445d6bd2abee537780ff3035ae9153d6327f44b3
"""Test whether all elements of cls.args are instances of Basic. """ # NOTE: keep tests sorted by (module, class name) key. If a class can't # be instantiated, add it here anyway with @SKIP("abstract class) (see # e.g. Function). import os import re from sympy.assumptions.ask import Q from sympy.core.basic import Ba...
b71f12ffbe9eb436deed33f9caa6a2f1aaf436640bd4980f9106dc9fb6418853
from sympy.core import ( Basic, Rational, Symbol, S, Float, Integer, Mul, Number, Pow, Expr, I, nan, pi, symbols, oo, zoo, N) from sympy.core.parameters import global_parameters from sympy.core.tests.test_evalf import NS from sympy.core.function import expand_multinomial from sympy.functions.elementary.miscella...
db5eca5b2f78ec52d2cd98e3c3157cf0d16376b968be4018ba5f32621ec064f0
from sympy.core.add import Add from sympy.core.basic import Basic from sympy.core.mod import Mod from sympy.core.mul import Mul from sympy.core.numbers import (Float, I, Integer, Rational, comp, nan, oo, pi, zoo) from sympy.core.power import Pow from sympy.core.singleton import S from sympy.core.symbol import (Dumm...
fb8acb628877221b14471d3d3ad2d1dc0dbd34b0e2fd13be43358edd11a8cbc4
"""Implementation of :class:`RationalField` class. """ from sympy.external.gmpy import MPQ from sympy.polys.domains.groundtypes import SymPyRational from sympy.polys.domains.characteristiczero import CharacteristicZero from sympy.polys.domains.field import Field from sympy.polys.domains.simpledomain import SimpleDo...
2250b5a5978ba549feef4d8eae553b466f30911d8bb614c5980d86f49b4a67d3
"""Implementation of :class:`AlgebraicField` class. """ from sympy.core.add import Add from sympy.core.mul import Mul from sympy.core.singleton import S from sympy.polys.domains.characteristiczero import CharacteristicZero from sympy.polys.domains.field import Field from sympy.polys.domains.simpledomain import Simple...
4d9429abac02738b995589588ba37249a11893039b5254554e0ece7f92486e36
"""Implementation of :class:`IntegerRing` class. """ from sympy.external.gmpy import MPZ, HAS_GMPY from sympy.polys.domains.groundtypes import ( SymPyInteger, factorial, gcdex, gcd, lcm, sqrt, ) from sympy.polys.domains.characteristiczero import CharacteristicZero from sympy.polys.domains.ring import Rin...
afc342157d9c86edc804d76725e68281d01001fd803f42eb28d5ff9babb4e74f
"""Implementation of :class:`Domain` class. """ from typing import Any, Optional, Type from sympy.core.numbers import AlgebraicNumber from sympy.core import Basic, sympify from sympy.core.sorting import default_sort_key, ordered from sympy.external.gmpy import HAS_GMPY from sympy.polys.domains.domainelement import D...
906b591d912054a8f57136c66ac592abaddea44851cde13e37c9afb762ac41eb
"""Tests for algorithms for computing symbolic roots of polynomials. """ from sympy.core.numbers import (I, Rational, pi) from sympy.core.singleton import S from sympy.core.symbol import (Symbol, Wild, symbols) from sympy.functions.elementary.complexes import (conjugate, im, re) from sympy.functions.elementary.exponen...
73415f388dfaaf8681a9d618406bddc752e956e2fd90cc10656baa60284921db
"""Prime ideals in number fields. """ from sympy.core.expr import Expr from sympy.polys.polytools import Poly from sympy.polys.domains.finitefield import FF from sympy.polys.domains.rationalfield import QQ from sympy.polys.domains.integerring import ZZ from sympy.polys.matrices.domainmatrix import DomainMatrix from sy...
38d05577db26bfca041c8e170c4ede291b4ec6748e5f207b4afd883edd0de80d
r"""Modules in number fields. The classes defined here allow us to work with finitely generated, free modules, whose generators are algebraic numbers. There is an abstract base class called :py:class:`~.Module`, which has two concrete subclasses, :py:class:`~.PowerBasis` and :py:class:`~.Submodule`. Every module is ...
2e851fbb1eb08a3571ee1a72387b7fa193ef99d5933073b4feb4e4c21b9f0978
"""Computing integral bases for number fields. """ from sympy.polys.polytools import Poly from sympy.polys.domains.algebraicfield import AlgebraicField from sympy.polys.domains.integerring import ZZ from sympy.polys.domains.rationalfield import QQ from sympy.polys.polyerrors import CoercionFailed from sympy.utilities....
fecf2ee1ad72d4be07868284a687a64af36b5dd5b4321e18beb50ea33abf96f7
r""" Functions in ``polys.numberfields.subfield`` solve the "Subfield Problem" and allied problems, for algebraic number fields. Following Cohen (see [Cohen93]_ Section 4.5), we can define the main problem as follows: * **Subfield Problem:** Given two number fields $\mathbb{Q}(\alpha)$, $\mathbb{Q}(\beta)$ via t...
d4fb1c9072015cc4059beb20483323894a2bd9cfb4d34884661aaa3d5f697d1e
"""Tests for classes defining properties of ground domains, e.g. ZZ, QQ, ZZ[x] ... """ from sympy.core.numbers import (AlgebraicNumber, E, Float, I, Integer, Rational, oo, pi, _illegal) from sympy.core.singleton import S from sympy.functions.elementary.exponential import exp from sympy.functions.elementary.miscell...
31937d6042f6de369c27f92d9688a2697dad295129e4ce05d8cbbb40720d20b6
from sympy.abc import x from sympy.core import S from sympy.core.numbers import AlgebraicNumber from sympy.functions.elementary.miscellaneous import sqrt from sympy.polys import Poly, cyclotomic_poly from sympy.polys.domains import QQ from sympy.polys.matrices import DomainMatrix, DM from sympy.polys.numberfields.basis...
88490a4c6892c05ddefca344ff903e60cfd6c4532df72d7be2317dddb1dd4852
from sympy import QQ, ZZ, S from sympy.abc import x, theta from sympy.core.mul import prod from sympy.ntheory import factorint from sympy.ntheory.residue_ntheory import n_order from sympy.polys import Poly, cyclotomic_poly from sympy.polys.matrices import DomainMatrix from sympy.polys.numberfields.basis import round_tw...
c158a50f91fe3211e25b9f104fa3f953bb93efd25d2879bd0fb2606688ba044e
from sympy.core.relational import Eq from sympy.core.singleton import S from sympy.abc import x, y, z, s, t from sympy.sets import FiniteSet, EmptySet from sympy.geometry import Point from sympy.vector import ImplicitRegion from sympy.testing.pytest import raises def test_ImplicitRegion(): ellipse = ImplicitRegio...
a1ef41bf27be90b8dd84fddbc093c1d0dd7ec032f772657060b84486b1803c79
from sympy.core import expand from sympy.core.numbers import (Rational, oo, pi) from sympy.core.relational import Eq from sympy.core.singleton import S from sympy.core.symbol import (Symbol, symbols) from sympy.functions.elementary.complexes import Abs from sympy.functions.elementary.miscellaneous import sqrt from symp...
a83efeed36305b4f2d0a7cfa80ef214f89efceb82a6adb7fc36c6ca9de09be9d
from sympy import sin, Function, symbols, Dummy, Lambda, cos from sympy.parsing.mathematica import parse_mathematica, MathematicaParser from sympy.core.sympify import sympify from sympy.abc import n, w, x, y, z from sympy.testing.pytest import raises def test_mathematica(): d = { '- 6x': '-6*x', '...
fdfc06cae7dbc479f37e1a6b37dd438aa7b9e6686cf2651d8b0ce22ef4fc2359
# coding=utf-8 from abc import ABC, abstractmethod from sympy.core.numbers import pi from sympy.physics.mechanics.body import Body from sympy.physics.vector import Vector, dynamicsymbols, cross from sympy.physics.vector.frame import ReferenceFrame import warnings __all__ = ['Joint', 'PinJoint', 'PrismaticJoint'] ...
2c765fbe5101c3209644e3b9a9cc8f89e1c7a4efdf0655b1dc5d61380a4d03d1
""" Unit system for physical quantities; include definition of constants. """ from typing import Dict as tDict, Set as tSet from sympy.core.add import Add from sympy.core.function import (Derivative, Function) from sympy.core.mul import Mul from sympy.core.power import Pow from sympy.core.singleton import S from symp...
4cbf18a36a7c2c33b472c570744238cdf11d937c7d387726c1d5dd00e44efce1
""" Definition of physical dimensions. Unit systems will be constructed on top of these dimensions. Most of the examples in the doc use MKS system and are presented from the computer point of view: from a human point, adding length to time is not legal in MKS but it is in natural system; for a computer in natural sys...
e7e55e9c602cb7436c1712cbfbc4647bbb710e20f29574a8a6a7ed9441cff2ca
""" Module defining unit prefixe class and some constants. Constant dict for SI and binary prefixes are defined as PREFIXES and BIN_PREFIXES. """ from sympy.core.expr import Expr from sympy.core.sympify import sympify class Prefix(Expr): """ This class represent prefixes, with their name, symbol and factor. ...
7526c8acc6008aa37b2aec927e5600077da30f6e964593d6c378e98c0133873b
""" Several methods to simplify expressions involving unit objects. """ from functools import reduce from collections.abc import Iterable from typing import Optional from sympy import default_sort_key from sympy.core.add import Add from sympy.core.containers import Tuple from sympy.core.mul import Mul from sympy.core....
fb31a59b8484510b8d00428683e924069e8561e13c0c339c156acde8ca09b22f
""" Physical quantities. """ from sympy.core.expr import AtomicExpr from sympy.core.symbol import Symbol from sympy.core.sympify import sympify from sympy.physics.units.dimensions import _QuantityMapper from sympy.physics.units.prefixes import Prefix from sympy.utilities.exceptions import (sympy_deprecation_warning, ...
e315866e2200c4538659a12d8d45a39aa632dfae056411f3de35c15c4d87b108
from sympy.core.backend import (S, sympify, expand, sqrt, Add, zeros, acos, ImmutableMatrix as Matrix, _simplify_matrix) from sympy.simplify.trigsimp import trigsimp from sympy.printing.defaults import Printable from sympy.utilities.misc import filldedent from sympy.core.evalf import Eva...
9f3a991a61a2b5036cf1d4c5ab03289b70e291666fa5f274cac909f6bdaa641e
from .vector import Vector, _check_vector from .frame import _check_frame from warnings import warn __all__ = ['Point'] class Point: """This object represents a point in a dynamic system. It stores the: position, velocity, and acceleration of a point. The position is a vector defined as the vector dista...
fd21397d65a39c4fc2f4c7ecccece6cf9e89b25b98c9705f7498e13079ddd56c
from sympy.core.function import expand_mul from sympy.core.numbers import pi from sympy.core.singleton import S from sympy.functions.elementary.miscellaneous import sqrt from sympy.functions.elementary.trigonometric import (cos, sin) from sympy.matrices.dense import Matrix from sympy.core.backend import _simplify_matri...
1fa624ff7d5f9ce58c42a16dd4276c232ed5b81ae80734245714d6f9693e5653
from sympy.physics.units.definitions.dimension_definitions import current, temperature, amount_of_substance, \ luminous_intensity, angle, charge, voltage, impedance, conductance, capacitance, inductance, magnetic_density, \ magnetic_flux, information from sympy.core.numbers import (Rational, pi) from sympy.cor...
677797f7258af4176f128b0244e2b6a912ad28560e8ed439d0993abc54fb0106
""" MKS unit system. MKS stands for "meter, kilogram, second". """ from sympy.physics.units import UnitSystem from sympy.physics.units.definitions import gravitational_constant, hertz, joule, newton, pascal, watt, speed_of_light, gram, kilogram, meter, second from sympy.physics.units.definitions.dimension_definitions...
7734337b478da94e61fc26059a6cbe251bf9a5c27a4cd583fef54dcbc139995a
""" MKS unit system. MKS stands for "meter, kilogram, second, ampere". """ from typing import List from sympy.physics.units.definitions import Z0, ampere, coulomb, farad, henry, siemens, tesla, volt, weber, ohm from sympy.physics.units.definitions.dimension_definitions import ( capacitance, charge, conductance, ...
db3895e8fc17f1081cac071a3542f5e2ae726471984308cad82a33ee04cca444
""" SI unit system. Based on MKSA, which stands for "meter, kilogram, second, ampere". Added kelvin, candela and mole. """ from typing import List from sympy.physics.units import DimensionSystem, Dimension, dHg0 from sympy.physics.units.quantities import Quantity from sympy.core.numbers import (Rational, pi) from ...
5d7badf4da2875e30d6d699081bc6b7c775badbb38838257f5c3b04dbeda1fa7
import warnings from sympy.core.add import Add from sympy.core.function import (Function, diff) from sympy.core.numbers import (Number, Rational) from sympy.core.singleton import S from sympy.core.symbol import (Symbol, symbols) from sympy.functions.elementary.complexes import Abs from sympy.functions.elementary.expon...
d5787bf3ff216effb23f8202588fdd52b3a79377229a5bcffd584ef845ce6bb4
from sympy.physics.units import DimensionSystem, joule, second, ampere from sympy.core.numbers import Rational from sympy.core.singleton import S from sympy.physics.units.definitions import c, kg, m, s from sympy.physics.units.definitions.dimension_definitions import length, time from sympy.physics.units.quantities im...
97392019f117307c41f08cefee7453376b8e10f87ae4b5cf61a1bc2abe47d39a
from sympy.physics.units.systems.si import dimsys_SI from sympy.core.numbers import pi from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.functions.elementary.complexes import Abs from sympy.functions.elementary.exponential import log from sympy.functions.elementary.miscellaneous import...
7f6a4ec552c0ada8b9130440ae23e1f6b41dc48ca1169678bfb584074088f922
from sympy.core.containers import Tuple from sympy.core.numbers import pi from sympy.core.power import Pow from sympy.core.symbol import symbols from sympy.core.sympify import sympify from sympy.printing.str import sstr from sympy.physics.units import ( G, centimeter, coulomb, day, degree, gram, hbar, hour, inch, j...
b36ff644027039a3ce4efc888803bd4986a9dfbe32b59a966dab5690b0a76d25
from sympy.core.symbol import symbols from sympy.matrices.dense import (Matrix, eye) from sympy.physics.units.definitions.dimension_definitions import ( action, current, length, mass, time, velocity) from sympy.physics.units.dimensions import DimensionSystem def test_extend(): ms = DimensionSystem((length...
266e837a2cd0c4a63e083efbdb6fbe2a8d3bddb70de23249fa0791a0d9287ece
from sympy.core.numbers import (Float, pi) from sympy.core.symbol import symbols from sympy.core.sorting import ordered from sympy.functions.elementary.trigonometric import (cos, sin) from sympy.matrices.immutable import ImmutableDenseMatrix as Matrix from sympy.physics.vector import ReferenceFrame, Vector, dynamicsymb...
713c651537dde14fae1c14a0b548c7ef3e273961c18c0eb71f5d03508d7da850
from sympy.physics.vector import dynamicsymbols, Point, ReferenceFrame from sympy.testing.pytest import raises, ignore_warnings import warnings def test_point_v1pt_theorys(): q, q2 = dynamicsymbols('q q2') qd, q2d = dynamicsymbols('q q2', 1) qdd, q2dd = dynamicsymbols('q q2', 2) N = ReferenceFrame('N')...
332edd09c32f11d011e5f77483fbc30c644c5a0bc6153fbf9a4f516b47c5f33f
from sympy.core.function import expand_mul from sympy.core.numbers import I, Rational from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.functions.elementary.miscellaneous import sqrt from sympy.functions.elementary.complexes import Abs from sympy.simplify.simplify import simplify from s...
502ee280f719c4600457770d598f5115667f6603420ce9dd133cdc5aed5e90d5
import random import concurrent.futures from collections.abc import Hashable from sympy.core.add import Add from sympy.core.function import (Function, diff, expand) from sympy.core.numbers import (E, Float, I, Integer, Rational, nan, oo, pi) from sympy.core.power import Pow from sympy.core.singleton import S from symp...
8bc7a54462db05f7d612d538b5b9d3fbb0c500385adf2fdc4b9d3e2dd7177368
""" Some examples have been taken from: http://www.math.uwaterloo.ca/~hwolkowi//matrixcookbook.pdf """ from sympy import KroneckerProduct from sympy.combinatorics import Permutation from sympy.concrete.summations import Sum from sympy.core.numbers import Rational from sympy.core.singleton import S from sympy.core.symb...
62048e73db987238ea0e04f2a752c17bc5c0fb3c939b41ac1134be4e592c51b7
#!/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...
d65b26c3fc58aa68590f692ae5d1c4d457b7ac768df211ebc3df75723bc4b918
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import os from itertools import chain import json import sys import warnings import pytest from sympy.testing.runtests import setup_pprint, _get_doctest_blacklist durations_path = os.path.join(os.path.dirname(__file__), '.ci', '...
bc5e3b345c9aff373f1557a3724ede41547d4db6c87891629a81002b36cd78be
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A tool to generate AUTHORS. We started tracking authors before moving to git, so we have to do some manual rearrangement of the git history authors in order to get the order in AUTHORS. bin/mailmap_check.py should be run before committing the results. See here for inst...
f3ceda529c84be3fdcd06cc93ff393f42a3b3fcc8efc640611e49e901bf42ab8
#!/usr/bin/env python3 from pathlib import Path from tempfile import TemporaryDirectory from subprocess import check_call PY_VERSIONS = '3.8', '3.9', '3.10' def main(version, outdir): for pyversion in PY_VERSIONS: test_sdist(pyversion, version, outdir) test_wheel(pyversion, version, outdir) ...
fe67ec9ca62e303ba1b6b07a9bf23dcf29bf195939c4a94192b7f7be5b0dc17d
""" SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python. It depends on mpmath, and other external libraries may be option...
0fa4fcc83f006cac201e5c89942e079ff0df32d27f491e35362a7e512302d418
# # SymPy documentation build configuration file, created by # sphinx-quickstart.py on Sat Mar 22 19:34:32 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are...
e0241d7c3573dab7bc3785d1d4f816e2c1279b5d4bc8d6507468a1988d1d5987
""" 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 functools import singledispatch...
cfd79fd4884e7cd58ba09e011a7960a3215ed685a1bcef91f45ff74bf989cf2c
from __future__ import annotations from sympy.core.function import Function from sympy.core.numbers import igcd, igcdex, mod_inverse from sympy.core.power import isqrt from sympy.core.singleton import S from sympy.polys import Poly from sympy.polys.domains import ZZ from sympy.polys.galoistools import gf_crt1, gf_crt2...
0f49ae33da14968c1e0c772268b8415ca2d5b942d1eeb51ab7a1cab08305bef8
""" Primality testing """ from sympy.core.numbers import igcd from sympy.core.power import integer_nthroot from sympy.core.sympify import sympify from sympy.external.gmpy import HAS_GMPY from sympy.utilities.misc import as_int from mpmath.libmp import bitcount as _bitlength def _int_tuple(*i): return tuple(int...
c445e7a48f77210ff1fc33ef9ab38eca07a8e997e63eaeeb8625a1f0dac4cc02
from math import log from itertools import chain, islice, product from sympy.combinatorics import Permutation from sympy.combinatorics.permutations import (_af_commutes_with, _af_invert, _af_rmul, _af_rmuln, _af_pow, Cycle) from sympy.combinatorics.util import (_check_cycles_alt_sym, _distribute_gens_by_base,...
8a26e1e1942a4a119d902353b6ca5f8048946598e93f60d441aab4821d988fc1
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 ...
caf9a16d431e2641089b433984095d9d88b630f1d53fc72ac5f6a8ea71688eb7
"""Tools to assist importing optional external modules.""" import sys import re # Override these in the module to change the default warning behavior. # For example, you might set both to False before running the tests so that # warnings are not printed to the console, or set both to True for debugging. WARN_NOT_INS...
58e313bc7c582d7369fef4351778c4fe169e4659c689c6d19424cea7864dba8f
""" PythonMPQ: Rational number type based on Python integers. This class is intended as a pure Python fallback for when gmpy2 is not installed. If gmpy2 is installed then its mpq type will be used instead. The mpq type is around 20x faster. We could just use the stdlib Fraction class here but that is slower: from...
1beff67ca8d2f2002349443e4365ecdd447b442407d85cf650a6f6f4b02b1e6e
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...
86f813a89f26613648bb7d178baf69753bd8303c49b688ec1dad6fbcf96308a7
""" 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 import builtins import inspect import keyword import textwrap import linecache # Required despite static analysis claim...
134f6a79d8edf217f8cdcfe61c0988f17cf5503a6c2816449075d5252921b9f2
""" 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, Add from sympy.core.mul import _keep_coeff from sympy.core.relational import Relational from sympy.core.sorting import default_sort_key fro...
4a7b432803a97212ad56f6115c4be19d00cd10f27e7c8890460e06ed6d5f785c
""" 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,...
d68355825eab89667cbe6adcf2ae674faadb80c3926a81068ab2a3a90306194a
""" 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...
987680b5d351cb954398c025ad0f18aaecfeeeed731a7209373546927278b4a3
"""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...
04e0c582c1b35dc8d10cc8de32fa572e5fa419ea7866c28c301718d46344561a
from __future__ import annotations from typing import Callable 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, ...
29924145ec6bf2e61434981ef932c2ecfc157046bee0b8bf49ce7c54486b7d57
""" 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...
aa2c0f6d0944ff7fcfc2fad19b349d819dbb08be14c827ddfe01b255d1ba4109
from __future__ import annotations from typing import TYPE_CHECKING from collections.abc import Iterable from functools import reduce import re from .sympify import sympify, _sympify from .basic import Basic, Atom from .singleton import S from .evalf import EvalfMixin, pure_complex, DEFAULT_MAXPREC from .decorators i...
33febf2095f53b5710440054164864df1a54c924dbfce04ebf7aa247ecb04277
"""Power series evaluation and manipulation using sparse Polynomials Implementing a new function --------------------------- There are a few things to be kept in mind when adding a new function here:: - The implementation should work on all possible input domains/rings. Special cases include the ``EX`` rin...
46705ce084cc87b04da9b3b2d151fcab1d85ebe1402a98fb3d70e67c6944d2b4
"""Implementation of RootOf class and related tools. """ from sympy.core.basic 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.relational import is_le from sympy.core.sorting import ordered fr...
806c115195c016fd77d9ff7ab8e35ce986df87cc72c8ff69028b8d63a7d7fae4
"""Useful utilities for higher level polynomial classes. """ from sympy.core import (S, Add, Mul, Pow, Eq, Expr, expand_mul, expand_multinomial) from sympy.core.exprtools import decompose_power, decompose_power_rat from sympy.core.numbers import _illegal from sympy.polys.polyerrors import PolynomialError, Generat...
020861c07567ff026c101068f931e6308293f73afe80126590b4dcb49ad3fde6
"""Polynomial factorization routines in characteristic zero. """ from sympy.core.random import _randint from sympy.polys.galoistools import ( gf_from_int_poly, gf_to_int_poly, gf_lshift, gf_add_mul, gf_mul, gf_div, gf_rem, gf_gcdex, gf_sqf_p, gf_factor_sqf, gf_factor) from sympy.polys.denseba...
165814ad79acaf6c4d2f91671a1b7b98ba4e5dd002af92523070f96b57c460db
import re import typing from itertools import product from typing import Any, Dict as tDict, Tuple as tTuple, List, Optional, Union as tUnion, Callable import sympy from sympy import Mul, Add, Pow, log, exp, sqrt, cos, sin, tan, asin, acos, acot, asec, acsc, sinh, cosh, tanh, asinh, \ acosh, atanh, acoth, asech, a...
3d6b80a0d3d9ebe0bc1c26181821bdb4c0a0c2e3338bf79bc88a854890aa93a9
""" This module implements the functionality to take any Python expression as a string and fix all numbers and other things before evaluating it, thus 1/2 returns Integer(1)/Integer(2) We use the ast module for this. It is well documented at docs.python.org. Some tips to understand how this works: use dump() to ge...
5287906ff29b7f08297bc39ae30d24f07fb93e3a012744eee08cc5da5331cdc9
from sympy.concrete.products import Product from sympy.concrete.summations import Sum from sympy.core.numbers import (Rational, oo, pi) from sympy.core.relational import Eq from sympy.core.singleton import S from sympy.core.symbol import symbols from sympy.functions.combinatorial.factorials import (RisingFactorial, fac...
078642ed906b483e880904f8ebcacecbec6b3a0403b9e72c1dad3325eb007981
from functools import singledispatch from sympy.external import import_module from sympy.stats.crv_types import BetaDistribution, ChiSquaredDistribution, ExponentialDistribution, GammaDistribution, \ LogNormalDistribution, NormalDistribution, ParetoDistribution, UniformDistribution, FDistributionDistribution, Gumb...
16cd330e4306bb3dec1fe80bcdd6d6575384d80a5a1a57f6f18e3f06e0e5823c
from sympy.core.numbers import Rational from sympy.core.singleton import S from sympy.external import import_module from sympy.stats import Binomial, sample, Die, FiniteRV, DiscreteUniform, Bernoulli, BetaBinomial, Hypergeometric, \ Rademacher from sympy.testing.pytest import skip, raises def test_given_sample(): ...
16545afda35ad38203e4702d2e197cfa5f17019c7da794cd5b454e60c2dde8fb
from sympy.core.numbers import oo from sympy.core.symbol import Symbol from sympy.functions.elementary.exponential import exp from sympy.sets.sets import Interval from sympy.external import import_module from sympy.stats import Beta, Chi, Normal, Gamma, Exponential, LogNormal, Pareto, ChiSquared, Uniform, sample, \ ...
96feb111cf13969b7cb5ed25516ee6db5f97c94d6d84f29ec896e28759d78b8d
from sympy.concrete.products import (Product, product) from sympy.concrete.summations import (Sum, summation) from sympy.core.function import (Derivative, Function) from sympy.core.mul import prod from sympy.core import (Catalan, EulerGamma) from sympy.core.numbers import (E, I, Rational, nan, oo, pi) from sympy.core.r...
1d996394837f5e1f21e42b4deb163581a584b9dfeda140245df456c8342bd5d9
import sympy import tempfile import os from sympy.core.mod import Mod from sympy.core.relational import Eq from sympy.core.symbol import symbols from sympy.external import import_module from sympy.tensor import IndexedBase, Idx from sympy.utilities.autowrap import autowrap, ufuncify, CodeWrapError from sympy.testing.py...
d450830563a3d0831dde94034b62736b836347cf6654ddcffae84c775ce16f60
from sympy.core.evalf import N from sympy.core.function import (Derivative, Function, PoleError, Subs) from sympy.core.numbers import (E, Rational, oo, pi, I) from sympy.core.singleton import S from sympy.core.symbol import (Symbol, symbols) from sympy.functions.elementary.exponential import (LambertW, exp, log) from s...
5edccf3433ac5d23b4f04e617956601caa018c6980690d6cabedef715fbb5fab
from itertools import product from sympy.concrete.summations import Sum from sympy.core.function import (Function, diff) from sympy.core import EulerGamma from sympy.core.numbers import (E, I, Rational, oo, pi, zoo) from sympy.core.singleton import S from sympy.core.symbol import (Symbol, symbols) from sympy.functions...
922cef2e08f35f55546759fce2e4fab653acffc35f4015b5259568d1f24b91d3
r''' This module contains the implementation of the 2nd_hypergeometric hint for dsolve. This is an incomplete implementation of the algorithm described in [1]. The algorithm solves 2nd order linear ODEs of the form .. math:: y'' + A(x) y' + B(x) y = 0\text{,} where `A` and `B` are rational functions. The algorithm sh...
5bd12d38d5df1c19eafc3003d323bee0ec71154509e47d903db48cc1d0ae08fa
from sympy.core.function import (Derivative, Function, Subs, diff) from sympy.core.numbers import (E, I, Rational, pi) from sympy.core.relational import Eq from sympy.core.singleton import S from sympy.core.symbol import (Symbol, symbols) from sympy.functions.elementary.complexes import (im, re) from sympy.functions.el...
48dd53ace2462d680fc30cbd4d7934d87707a61683582105ac77a957e3e59a76
from sympy.core.numbers import (I, Rational, oo) from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.functions.elementary.exponential import (exp, log) from sympy.functions.elementary.miscellaneous import sqrt from sympy.calculus.singularities import ( singularities, is_increasing...
71ec9cace251d8afae6c460dd3293f52f857ac810aff0aed029e153490c9f3fd
from itertools import product import math import inspect import mpmath from sympy.testing.pytest import raises, warns_deprecated_sympy from sympy.concrete.summations import Sum from sympy.core.function import (Function, Lambda, diff) from sympy.core.numbers import (E, Float, I, Rational, oo, pi) from sympy.core.relati...
6fbfadc2079444a5bd38ff6e543d9395cf9d53644fb01e7788948da78dd00c2a
import itertools from sympy.core import S from sympy.core.add import Add from sympy.core.containers import Tuple from sympy.core.function import Function from sympy.core.mul import Mul from sympy.core.numbers import Number, Rational from sympy.core.power import Pow from sympy.core.sorting import default_sort_key from ...
d9eec2bd52a4039a93a6f0bdbc0a632a6aa4da8a17d07e03d8bdbbade0faa6ca
from sympy import MatAdd from sympy.algebras.quaternion import Quaternion from sympy.assumptions.ask import Q from sympy.calculus.accumulationbounds import AccumBounds from sympy.combinatorics.partitions import Partition from sympy.concrete.summations import (Sum, summation) from sympy.core.add import Add from sympy.co...
fdd816a69ea007555c7787b725453fe1121a4b3fe762fba3f86971446158de2f
from sympy import MatAdd, MatMul from sympy.algebras.quaternion import Quaternion from sympy.calculus.accumulationbounds import AccumBounds from sympy.combinatorics.permutations import Cycle, Permutation, AppliedPermutation from sympy.concrete.products import Product from sympy.concrete.summations import Sum from sympy...
9a06c40da94445ef1a22f473b284883d128f19b855d9f95c85c546a24b9a3836
# -*- coding: utf-8 -*- from sympy.concrete.products import Product from sympy.concrete.summations import Sum from sympy.core.add import Add from sympy.core.basic import Basic from sympy.core.containers import (Dict, Tuple) from sympy.core.function import (Derivative, Function, Lambda, Subs) from sympy.core.mul import ...
bcd447280f3ec0d2ed4122fbce8da944aff3517271cb14b87cd4516c67d5fe41
from sympy.concrete.summations import (Sum, summation) from sympy.core.add import Add from sympy.core.containers import Tuple from sympy.core.expr import Expr from sympy.core.function import (Derivative, Function, Lambda, diff) from sympy.core import EulerGamma from sympy.core.numbers import (E, Float, I, Rational, nan...
967bd6858ce5981479850d93153aa99a951ddb27847bddb3bb0eeead6a427800
from sympy.core.expr import Expr from sympy.core.function import (Derivative, Function, diff, expand) from sympy.core.numbers import (I, Rational, pi) from sympy.core.relational import Ne from sympy.core.singleton import S from sympy.core.symbol import (Dummy, Symbol, symbols) from sympy.functions.elementary.exponentia...
78fb6d282b38d3394b63c67e311654205c7fe8330d9f915038add14d159b854e
from sympy.assumptions.refine import refine from sympy.concrete.summations import Sum from sympy.core.add import Add from sympy.core.basic import Basic from sympy.core.containers import Tuple from sympy.core.expr import (ExprBuilder, unchanged, Expr, UnevaluatedExpr) from sympy.core.function import (Function, expan...
1690ef6485597e9360705d02680511c765788f4f43bfc62b30f987dd51b3dd05
from sympy.concrete.summations import Sum from sympy.core.basic import Basic, _aresame from sympy.core.cache import clear_cache from sympy.core.containers import Dict, Tuple from sympy.core.expr import Expr, unchanged from sympy.core.function import (Subs, Function, diff, Lambda, expand, nfloat, Derivative) from sy...
4dc89406e2631d0fcd408fa4fc29bad16e8d75fc29006ee3bdbe8e3660442054
"""Tests for the implementation of RootOf class and related tools. """ from sympy.polys.polytools import Poly import sympy.polys.rootoftools as rootoftools from sympy.polys.rootoftools import (rootof, RootOf, CRootOf, RootSum, _pure_key_dict as D) from sympy.polys.polyerrors import ( MultivariatePolynomialErr...