From 2ffb0acf6463eabc275281c510b96a0a3b9ed4a3 Mon Sep 17 00:00:00 2001 From: rchiodo Date: Thu, 21 Mar 2024 10:59:29 -0700 Subject: [PATCH] actually submit the add --- stubs/sympy-stubs/README.md | 156 +++ stubs/sympy-stubs/__init__.pyi | 38 + stubs/sympy-stubs/algebras/__init__.pyi | 3 + stubs/sympy-stubs/algebras/quaternion.pyi | 173 +++ stubs/sympy-stubs/assumptions/__init__.pyi | 6 + stubs/sympy-stubs/assumptions/ask.pyi | 243 ++++ .../sympy-stubs/assumptions/ask_generated.pyi | 12 + stubs/sympy-stubs/assumptions/assume.pyi | 100 ++ stubs/sympy-stubs/assumptions/cnf.pyi | 169 +++ stubs/sympy-stubs/assumptions/facts.pyi | 25 + .../assumptions/handlers/__init__.pyi | 3 + .../assumptions/handlers/calculus.pyi | 62 + .../assumptions/handlers/common.pyi | 84 ++ .../assumptions/handlers/matrices.pyi | 420 +++++++ .../assumptions/handlers/ntheory.pyi | 106 ++ .../assumptions/handlers/order.pyi | 184 +++ .../sympy-stubs/assumptions/handlers/sets.pyi | 284 +++++ .../assumptions/predicates/common.pyi | 18 + .../assumptions/predicates/matrices.pyi | 86 ++ .../assumptions/predicates/ntheory.pyi | 23 + .../assumptions/predicates/order.pyi | 55 + stubs/sympy-stubs/assumptions/refine.pyi | 35 + .../assumptions/relation/__init__.pyi | 3 + .../assumptions/relation/binrel.pyi | 51 + .../assumptions/relation/equality.pyi | 104 ++ stubs/sympy-stubs/assumptions/satask.pyi | 21 + stubs/sympy-stubs/assumptions/sathandlers.pyi | 82 ++ stubs/sympy-stubs/assumptions/wrapper.pyi | 52 + stubs/sympy-stubs/calculus/__init__.pyi | 7 + .../calculus/accumulationbounds.pyi | 84 ++ stubs/sympy-stubs/calculus/euler.pyi | 7 + stubs/sympy-stubs/calculus/finite_diff.pyi | 13 + stubs/sympy-stubs/calculus/singularities.pyi | 22 + stubs/sympy-stubs/calculus/util.pyi | 32 + stubs/sympy-stubs/categories/__init__.pyi | 4 + stubs/sympy-stubs/categories/baseclasses.pyi | 124 ++ .../categories/diagram_drawing.pyi | 85 ++ stubs/sympy-stubs/codegen/__init__.pyi | 3 + stubs/sympy-stubs/codegen/ast.pyi | 394 ++++++ stubs/sympy-stubs/codegen/cfunctions.pyi | 97 ++ stubs/sympy-stubs/codegen/cnodes.pyi | 57 + stubs/sympy-stubs/codegen/fnodes.pyi | 185 +++ stubs/sympy-stubs/codegen/pynodes.pyi | 11 + .../sympy-stubs/combinatorics/coset_table.pyi | 114 ++ stubs/sympy-stubs/combinatorics/fp_groups.pyi | 169 +++ .../sympy-stubs/combinatorics/free_groups.pyi | 239 ++++ stubs/sympy-stubs/combinatorics/galois.pyi | 115 ++ .../sympy-stubs/combinatorics/generators.pyi | 20 + stubs/sympy-stubs/combinatorics/graycode.pyi | 56 + .../combinatorics/group_constructs.pyi | 5 + .../combinatorics/homomorphisms.pyi | 57 + .../combinatorics/named_groups.pyi | 26 + .../sympy-stubs/combinatorics/partitions.pyi | 92 ++ stubs/sympy-stubs/combinatorics/pc_groups.pyi | 56 + .../sympy-stubs/combinatorics/perm_groups.pyi | 318 +++++ .../combinatorics/permutations.pyi | 275 +++++ .../sympy-stubs/combinatorics/polyhedron.pyi | 57 + stubs/sympy-stubs/combinatorics/prufer.pyi | 58 + .../combinatorics/rewritingsystem.pyi | 29 + .../combinatorics/rewritingsystem_fsm.pyi | 22 + stubs/sympy-stubs/combinatorics/subsets.pyi | 95 ++ .../sympy-stubs/combinatorics/tensor_can.pyi | 40 + stubs/sympy-stubs/combinatorics/testutil.pyi | 8 + stubs/sympy-stubs/concrete/__init__.pyi | 4 + stubs/sympy-stubs/concrete/delta.pyi | 15 + .../concrete/expr_with_intlimits.pyi | 29 + .../sympy-stubs/concrete/expr_with_limits.pyi | 56 + stubs/sympy-stubs/concrete/gosper.pyi | 11 + stubs/sympy-stubs/concrete/products.pyi | 33 + stubs/sympy-stubs/concrete/summations.pyi | 60 + stubs/sympy-stubs/conftest.pyi | 26 + stubs/sympy-stubs/core/__init__.pyi | 28 + stubs/sympy-stubs/core/add.pyi | 82 ++ stubs/sympy-stubs/core/assumptions.pyi | 43 + stubs/sympy-stubs/core/basic.pyi | 220 ++++ stubs/sympy-stubs/core/cache.pyi | 37 + stubs/sympy-stubs/core/containers.pyi | 147 +++ stubs/sympy-stubs/core/core.pyi | 12 + stubs/sympy-stubs/core/decorators.pyi | 27 + stubs/sympy-stubs/core/evalf.pyi | 174 +++ stubs/sympy-stubs/core/expr.pyi | 409 +++++++ stubs/sympy-stubs/core/exprtools.pyi | 143 +++ stubs/sympy-stubs/core/facts.pyi | 66 + stubs/sympy-stubs/core/function.pyi | 304 +++++ stubs/sympy-stubs/core/kind.pyi | 68 ++ stubs/sympy-stubs/core/logic.pyi | 85 ++ stubs/sympy-stubs/core/mod.pyi | 10 + stubs/sympy-stubs/core/mul.pyi | 82 ++ stubs/sympy-stubs/core/multidimensional.pyi | 21 + stubs/sympy-stubs/core/numbers.pyi | 1071 +++++++++++++++++ stubs/sympy-stubs/core/operations.pyi | 64 + stubs/sympy-stubs/core/parameters.pyi | 22 + stubs/sympy-stubs/core/power.pyi | 72 ++ stubs/sympy-stubs/core/random.pyi | 23 + stubs/sympy-stubs/core/relational.pyi | 187 +++ stubs/sympy-stubs/core/rules.pyi | 16 + stubs/sympy-stubs/core/singleton.pyi | 27 + stubs/sympy-stubs/core/sorting.pyi | 8 + stubs/sympy-stubs/core/symbol.pyi | 119 ++ stubs/sympy-stubs/core/sympify.pyi | 25 + stubs/sympy-stubs/core/traversal.pyi | 35 + stubs/sympy-stubs/crypto/crypto.pyi | 191 +++ stubs/sympy-stubs/diffgeom/__init__.pyi | 3 + stubs/sympy-stubs/diffgeom/diffgeom.pyi | 370 ++++++ stubs/sympy-stubs/discrete/__init__.pyi | 4 + stubs/sympy-stubs/discrete/convolutions.pyi | 24 + stubs/sympy-stubs/discrete/recurrences.pyi | 7 + stubs/sympy-stubs/discrete/transforms.pyi | 26 + stubs/sympy-stubs/external/importtools.pyi | 11 + stubs/sympy-stubs/external/pythonmpq.pyi | 85 ++ .../functions/combinatorial/factorials.pyi | 65 + .../functions/combinatorial/numbers.pyi | 161 +++ .../functions/elementary/complexes.pyi | 135 +++ .../functions/elementary/exponential.pyi | 107 ++ .../functions/elementary/hyperbolic.pyi | 252 ++++ .../functions/elementary/miscellaneous.pyi | 99 ++ .../functions/elementary/piecewise.pyi | 81 ++ .../functions/elementary/trigonometric.pyi | 296 +++++ .../sympy-stubs/functions/special/bessel.pyi | 181 +++ .../functions/special/beta_functions.pyi | 39 + .../functions/special/bsplines.pyi | 15 + .../functions/special/delta_functions.pyi | 37 + .../functions/special/elliptic_integrals.pyi | 43 + .../functions/special/error_functions.pyi | 244 ++++ .../functions/special/gamma_functions.pyi | 88 ++ stubs/sympy-stubs/functions/special/hyper.pyi | 169 +++ .../functions/special/mathieu_functions.pyi | 48 + .../functions/special/polynomials.pyi | 134 +++ .../special/singularity_functions.pyi | 16 + .../functions/special/spherical_harmonics.pyi | 27 + .../functions/special/tensor_functions.pyi | 65 + .../functions/special/zeta_functions.pyi | 50 + stubs/sympy-stubs/geometry/curve.pyi | 55 + stubs/sympy-stubs/geometry/ellipse.pyi | 167 +++ stubs/sympy-stubs/geometry/entity.pyi | 102 ++ stubs/sympy-stubs/geometry/line.pyi | 257 ++++ stubs/sympy-stubs/geometry/parabola.pyi | 49 + stubs/sympy-stubs/geometry/plane.pyi | 81 ++ stubs/sympy-stubs/geometry/point.pyi | 208 ++++ stubs/sympy-stubs/geometry/polygon.pyi | 280 +++++ stubs/sympy-stubs/geometry/util.pyi | 36 + stubs/sympy-stubs/holonomic/__init__.pyi | 4 + stubs/sympy-stubs/holonomic/holonomic.pyi | 160 +++ stubs/sympy-stubs/holonomic/recurrence.pyi | 64 + stubs/sympy-stubs/integrals/__init__.pyi | 5 + .../sympy-stubs/integrals/deltafunctions.pyi | 10 + stubs/sympy-stubs/integrals/heurisch.pyi | 37 + stubs/sympy-stubs/integrals/integrals.pyi | 45 + stubs/sympy-stubs/integrals/laplace.pyi | 43 + .../sympy-stubs/integrals/manualintegrate.pyi | 707 +++++++++++ stubs/sympy-stubs/integrals/meijerint.pyi | 22 + stubs/sympy-stubs/integrals/prde.pyi | 63 + stubs/sympy-stubs/integrals/rationaltools.pyi | 17 + stubs/sympy-stubs/integrals/rde.pyi | 45 + stubs/sympy-stubs/integrals/risch.pyi | 131 ++ .../integrals/singularityfunctions.pyi | 6 + stubs/sympy-stubs/integrals/transforms.pyi | 199 +++ stubs/sympy-stubs/interactive/__init__.pyi | 5 + stubs/sympy-stubs/interactive/printing.pyi | 5 + stubs/sympy-stubs/interactive/session.pyi | 27 + stubs/sympy-stubs/interactive/traversal.pyi | 4 + stubs/sympy-stubs/liealgebras/cartan_type.pyi | 29 + stubs/sympy-stubs/liealgebras/type_a.pyi | 39 + stubs/sympy-stubs/liealgebras/type_b.pyi | 36 + stubs/sympy-stubs/liealgebras/type_c.pyi | 36 + stubs/sympy-stubs/liealgebras/type_d.pyi | 36 + stubs/sympy-stubs/liealgebras/type_e.pyi | 33 + stubs/sympy-stubs/liealgebras/type_f.pyi | 35 + stubs/sympy-stubs/liealgebras/type_g.pyi | 31 + stubs/sympy-stubs/logic/__init__.pyi | 4 + stubs/sympy-stubs/logic/algorithms/dpll.pyi | 32 + stubs/sympy-stubs/logic/algorithms/dpll2.pyi | 17 + .../logic/algorithms/minisat22_wrapper.pyi | 4 + .../logic/algorithms/pycosat_wrapper.pyi | 4 + stubs/sympy-stubs/logic/boolalg.pyi | 366 ++++++ stubs/sympy-stubs/logic/inference.pyi | 48 + stubs/sympy-stubs/matrices/__init__.pyi | 14 + stubs/sympy-stubs/matrices/dense.pyi | 103 ++ .../matrices/expressions/__init__.pyi | 22 + .../matrices/expressions/adjoint.pyi | 19 + .../matrices/expressions/applyfunc.pyi | 25 + .../matrices/expressions/blockmatrix.pyi | 139 +++ .../matrices/expressions/companion.pyi | 16 + .../matrices/expressions/determinant.pyi | 44 + .../matrices/expressions/diagonal.pyi | 45 + .../matrices/expressions/dotproduct.pyi | 13 + .../matrices/expressions/factorizations.pyi | 91 ++ .../matrices/expressions/fourier.pyi | 15 + .../matrices/expressions/funcmatrix.pyi | 18 + .../matrices/expressions/hadamard.pyi | 45 + .../matrices/expressions/inverse.pyi | 26 + .../matrices/expressions/kronecker.pyi | 57 + .../matrices/expressions/matadd.pyi | 36 + .../matrices/expressions/matexpr.pyi | 280 +++++ .../matrices/expressions/matmul.pyi | 70 ++ .../matrices/expressions/matpow.pyi | 27 + .../matrices/expressions/permutation.pyi | 36 + .../sympy-stubs/matrices/expressions/sets.pyi | 19 + .../matrices/expressions/slice.pyi | 30 + .../matrices/expressions/special.pyi | 116 ++ .../matrices/expressions/trace.pyi | 25 + .../matrices/expressions/transpose.pyi | 25 + stubs/sympy-stubs/matrices/immutable.pyi | 56 + stubs/sympy-stubs/matrices/normalforms.pyi | 11 + stubs/sympy-stubs/matrices/repmatrix.pyi | 70 ++ stubs/sympy-stubs/matrices/sparse.pyi | 61 + stubs/sympy-stubs/matrices/utilities.pyi | 15 + .../sympy-stubs/multipledispatch/__init__.pyi | 5 + .../sympy-stubs/multipledispatch/conflict.pyi | 26 + stubs/sympy-stubs/multipledispatch/core.pyi | 9 + .../multipledispatch/dispatcher.pyi | 108 ++ stubs/sympy-stubs/multipledispatch/utils.pyi | 10 + stubs/sympy-stubs/ntheory/__init__.pyi | 13 + .../ntheory/continued_fraction.pyi | 21 + stubs/sympy-stubs/ntheory/digits.pyi | 11 + stubs/sympy-stubs/ntheory/ecm.pyi | 23 + .../sympy-stubs/ntheory/egyptian_fraction.pyi | 20 + stubs/sympy-stubs/ntheory/factor_.pyi | 148 +++ stubs/sympy-stubs/ntheory/generate.pyi | 77 ++ stubs/sympy-stubs/ntheory/modular.pyi | 16 + stubs/sympy-stubs/ntheory/multinomial.pyi | 13 + stubs/sympy-stubs/ntheory/partitions_.pyi | 6 + stubs/sympy-stubs/ntheory/primetest.pyi | 25 + stubs/sympy-stubs/ntheory/qs.pyi | 20 + stubs/sympy-stubs/ntheory/residue_ntheory.pyi | 54 + stubs/sympy-stubs/parsing/__init__.pyi | 3 + stubs/sympy-stubs/parsing/sympy_parser.pyi | 112 ++ stubs/sympy-stubs/physics/__init__.pyi | 4 + .../sympy-stubs/physics/control/__init__.pyi | 4 + .../physics/control/control_plots.pyi | 47 + stubs/sympy-stubs/physics/control/lti.pyi | 421 +++++++ stubs/sympy-stubs/physics/matrices.pyi | 17 + stubs/sympy-stubs/physics/units/__init__.pyi | 18 + .../physics/units/definitions/__init__.pyi | 3 + .../sympy-stubs/physics/units/dimensions.pyi | 144 +++ stubs/sympy-stubs/physics/units/prefixes.pyi | 73 ++ .../sympy-stubs/physics/units/quantities.pyi | 54 + .../sympy-stubs/physics/units/unitsystem.pyi | 59 + stubs/sympy-stubs/physics/units/util.pyi | 12 + stubs/sympy-stubs/plotting/__init__.pyi | 7 + .../plotting/intervalmath/__init__.pyi | 4 + .../intervalmath/interval_arithmetic.pyi | 76 ++ .../intervalmath/interval_membership.pyi | 38 + .../plotting/intervalmath/lib_interval.pyi | 72 ++ stubs/sympy-stubs/plotting/plot.pyi | 291 +++++ stubs/sympy-stubs/plotting/plot_implicit.pyi | 21 + .../plotting/pygletplot/__init__.pyi | 7 + .../plotting/pygletplot/color_scheme.pyi | 37 + .../plotting/pygletplot/managed_window.pyi | 26 + .../sympy-stubs/plotting/pygletplot/plot.pyi | 67 ++ .../plotting/pygletplot/plot_axes.pyi | 80 ++ .../plotting/pygletplot/plot_camera.pyi | 43 + .../plotting/pygletplot/plot_controller.pyi | 35 + .../plotting/pygletplot/plot_curve.pyi | 13 + .../plotting/pygletplot/plot_interval.pyi | 74 ++ .../plotting/pygletplot/plot_mode.pyi | 21 + .../plotting/pygletplot/plot_mode_base.pyi | 47 + .../plotting/pygletplot/plot_modes.pyi | 55 + .../plotting/pygletplot/plot_object.pyi | 7 + .../plotting/pygletplot/plot_rotation.pyi | 21 + .../plotting/pygletplot/plot_surface.pyi | 13 + .../plotting/pygletplot/plot_window.pyi | 23 + .../sympy-stubs/plotting/pygletplot/util.pyi | 68 ++ stubs/sympy-stubs/plotting/textplot.pyi | 16 + stubs/sympy-stubs/polys/__init__.pyi | 20 + stubs/sympy-stubs/polys/agca/extensions.pyi | 132 ++ .../sympy-stubs/polys/agca/homomorphisms.pyi | 81 ++ stubs/sympy-stubs/polys/agca/ideals.pyi | 103 ++ stubs/sympy-stubs/polys/agca/modules.pyi | 310 +++++ stubs/sympy-stubs/polys/appellseqs.pyi | 38 + stubs/sympy-stubs/polys/compatibility.pyi | 896 ++++++++++++++ stubs/sympy-stubs/polys/constructor.pyi | 8 + stubs/sympy-stubs/polys/densearith.pyi | 194 +++ stubs/sympy-stubs/polys/densebasic.pyi | 199 +++ stubs/sympy-stubs/polys/densetools.pyi | 110 ++ stubs/sympy-stubs/polys/dispersion.pyi | 7 + .../sympy-stubs/polys/distributedmodules.pyi | 71 ++ stubs/sympy-stubs/polys/domains/__init__.pyi | 28 + .../polys/domains/algebraicfield.pyi | 108 ++ .../polys/domains/characteristiczero.pyi | 11 + .../polys/domains/complexfield.pyi | 108 ++ .../polys/domains/compositedomain.pyi | 13 + stubs/sympy-stubs/polys/domains/domain.pyi | 288 +++++ .../polys/domains/expressiondomain.pyi | 171 +++ .../polys/domains/expressionrawdomain.pyi | 40 + stubs/sympy-stubs/polys/domains/field.pyi | 38 + .../sympy-stubs/polys/domains/finitefield.pyi | 74 ++ .../polys/domains/fractionfield.pyi | 115 ++ .../polys/domains/gaussiandomains.pyi | 234 ++++ .../polys/domains/gmpyintegerring.pyi | 65 + .../polys/domains/gmpyrationalfield.pyi | 65 + .../sympy-stubs/polys/domains/integerring.pyi | 92 ++ .../polys/domains/modularinteger.pyi | 99 ++ .../sympy-stubs/polys/domains/mpelements.pyi | 40 + .../polys/domains/old_fractionfield.pyi | 89 ++ .../polys/domains/old_polynomialring.pyi | 137 +++ .../polys/domains/polynomialring.pyi | 120 ++ .../polys/domains/pythonintegerring.pyi | 61 + .../polys/domains/pythonrational.pyi | 6 + .../polys/domains/pythonrationalfield.pyi | 45 + .../polys/domains/quotientring.pyi | 106 ++ .../polys/domains/rationalfield.pyi | 84 ++ stubs/sympy-stubs/polys/domains/realfield.pyi | 95 ++ stubs/sympy-stubs/polys/domains/ring.pyi | 52 + .../polys/domains/simpledomain.pyi | 8 + stubs/sympy-stubs/polys/euclidtools.pyi | 138 +++ stubs/sympy-stubs/polys/factortools.pyi | 108 ++ stubs/sympy-stubs/polys/fglmtools.pyi | 5 + stubs/sympy-stubs/polys/fields.pyi | 177 +++ stubs/sympy-stubs/polys/galoistools.pyi | 214 ++++ stubs/sympy-stubs/polys/groebnertools.pyi | 80 ++ stubs/sympy-stubs/polys/heuristicgcd.pyi | 6 + stubs/sympy-stubs/polys/matrices/__init__.pyi | 3 + stubs/sympy-stubs/polys/matrices/ddm.pyi | 169 +++ stubs/sympy-stubs/polys/matrices/dense.pyi | 47 + .../polys/matrices/domainmatrix.pyi | 239 ++++ .../polys/matrices/domainscalar.pyi | 65 + stubs/sympy-stubs/polys/matrices/eigen.pyi | 8 + stubs/sympy-stubs/polys/matrices/linsolve.pyi | 4 + stubs/sympy-stubs/polys/matrices/lll.pyi | 7 + .../polys/matrices/normalforms.pyi | 15 + stubs/sympy-stubs/polys/matrices/sdm.pyi | 193 +++ stubs/sympy-stubs/polys/monomials.pyi | 123 ++ .../polys/numberfields/__init__.pyi | 8 + .../sympy-stubs/polys/numberfields/basis.pyi | 11 + .../polys/numberfields/galois_resolvents.pyi | 54 + .../polys/numberfields/galoisgroups.pyi | 18 + .../polys/numberfields/minpoly.pyi | 11 + .../polys/numberfields/modules.pyi | 370 ++++++ .../sympy-stubs/polys/numberfields/primes.pyi | 60 + .../polys/numberfields/subfield.pyi | 25 + .../polys/numberfields/utilities.pyi | 49 + stubs/sympy-stubs/polys/orderings.pyi | 124 ++ stubs/sympy-stubs/polys/orthopolys.pyi | 67 ++ stubs/sympy-stubs/polys/partfrac.pyi | 25 + stubs/sympy-stubs/polys/polyclasses.pyi | 740 ++++++++++++ stubs/sympy-stubs/polys/polyconfig.pyi | 18 + stubs/sympy-stubs/polys/polyerrors.pyi | 166 +++ stubs/sympy-stubs/polys/polyfuncs.pyi | 23 + stubs/sympy-stubs/polys/polymatrix.pyi | 98 ++ stubs/sympy-stubs/polys/polyoptions.pyi | 339 ++++++ stubs/sympy-stubs/polys/polyquinticconst.pyi | 51 + stubs/sympy-stubs/polys/polyroots.pyi | 36 + stubs/sympy-stubs/polys/polytools.pyi | 889 ++++++++++++++ stubs/sympy-stubs/polys/polyutils.pyi | 38 + stubs/sympy-stubs/polys/rationaltools.pyi | 11 + stubs/sympy-stubs/polys/ring_series.pyi | 111 ++ stubs/sympy-stubs/polys/rings.pyi | 530 ++++++++ stubs/sympy-stubs/polys/rootisolation.pyi | 214 ++++ stubs/sympy-stubs/polys/rootoftools.pyi | 109 ++ stubs/sympy-stubs/polys/solvers.pyi | 24 + stubs/sympy-stubs/polys/specialpolys.pyi | 48 + stubs/sympy-stubs/polys/sqfreetools.pyi | 53 + stubs/sympy-stubs/printing/__init__.pyi | 24 + stubs/sympy-stubs/printing/c.pyi | 53 + stubs/sympy-stubs/printing/codeprinter.pyi | 69 ++ stubs/sympy-stubs/printing/conventions.pyi | 9 + stubs/sympy-stubs/printing/cxx.pyi | 31 + stubs/sympy-stubs/printing/dot.pyi | 24 + stubs/sympy-stubs/printing/fortran.pyi | 21 + stubs/sympy-stubs/printing/glsl.pyi | 26 + stubs/sympy-stubs/printing/gtk.pyi | 3 + stubs/sympy-stubs/printing/jscode.pyi | 22 + stubs/sympy-stubs/printing/julia.pyi | 25 + stubs/sympy-stubs/printing/lambdarepr.pyi | 29 + stubs/sympy-stubs/printing/latex.pyi | 57 + stubs/sympy-stubs/printing/maple.pyi | 23 + stubs/sympy-stubs/printing/mathematica.pyi | 22 + stubs/sympy-stubs/printing/mathml.pyi | 60 + stubs/sympy-stubs/printing/numpy.pyi | 61 + stubs/sympy-stubs/printing/octave.pyi | 29 + stubs/sympy-stubs/printing/precedence.pyi | 32 + .../sympy-stubs/printing/pretty/__init__.pyi | 3 + stubs/sympy-stubs/printing/pretty/pretty.pyi | 47 + .../printing/pretty/pretty_symbology.pyi | 86 ++ .../printing/pretty/stringpict.pyi | 102 ++ stubs/sympy-stubs/printing/preview.pyi | 13 + stubs/sympy-stubs/printing/printer.pyi | 50 + stubs/sympy-stubs/printing/pycode.pyi | 52 + stubs/sympy-stubs/printing/python.pyi | 16 + stubs/sympy-stubs/printing/rcode.pyi | 25 + stubs/sympy-stubs/printing/repr.pyi | 18 + stubs/sympy-stubs/printing/rust.pyi | 23 + stubs/sympy-stubs/printing/str.pyi | 32 + stubs/sympy-stubs/printing/tableform.pyi | 22 + stubs/sympy-stubs/printing/tensorflow.pyi | 32 + stubs/sympy-stubs/printing/tree.pyi | 13 + stubs/sympy-stubs/py.typed | 1 + stubs/sympy-stubs/series/__init__.pyi | 15 + stubs/sympy-stubs/series/approximants.pyi | 7 + stubs/sympy-stubs/series/formal.pyi | 220 ++++ stubs/sympy-stubs/series/fourier.pyi | 122 ++ stubs/sympy-stubs/series/gruntz.pyi | 87 ++ stubs/sympy-stubs/series/limits.pyi | 27 + stubs/sympy-stubs/series/limitseq.pyi | 13 + stubs/sympy-stubs/series/order.pyi | 50 + stubs/sympy-stubs/series/sequences.pyi | 250 ++++ stubs/sympy-stubs/series/series_class.pyi | 42 + stubs/sympy-stubs/sets/__init__.pyi | 18 + stubs/sympy-stubs/sets/conditionset.pyi | 25 + stubs/sympy-stubs/sets/contains.pyi | 19 + stubs/sympy-stubs/sets/fancysets.pyi | 209 ++++ stubs/sympy-stubs/sets/handlers/add.pyi | 47 + stubs/sympy-stubs/sets/handlers/functions.pyi | 56 + .../sets/handlers/intersection.pyi | 105 ++ stubs/sympy-stubs/sets/handlers/issubset.pyi | 70 ++ stubs/sympy-stubs/sets/handlers/mul.pyi | 39 + stubs/sympy-stubs/sets/handlers/power.pyi | 34 + stubs/sympy-stubs/sets/handlers/union.pyi | 77 ++ stubs/sympy-stubs/sets/ordinals.pyi | 114 ++ stubs/sympy-stubs/sets/powerset.pyi | 24 + stubs/sympy-stubs/sets/setexpr.pyi | 62 + stubs/sympy-stubs/sets/sets.pyi | 510 ++++++++ stubs/sympy-stubs/simplify/__init__.pyi | 14 + stubs/sympy-stubs/simplify/combsimp.pyi | 7 + stubs/sympy-stubs/simplify/cse_main.pyi | 73 ++ stubs/sympy-stubs/simplify/cse_opts.pyi | 8 + stubs/sympy-stubs/simplify/epathtools.pyi | 22 + stubs/sympy-stubs/simplify/fu.pyi | 108 ++ stubs/sympy-stubs/simplify/gammasimp.pyi | 14 + stubs/sympy-stubs/simplify/hyperexpand.pyi | 283 +++++ stubs/sympy-stubs/simplify/powsimp.pyi | 8 + stubs/sympy-stubs/simplify/radsimp.pyi | 48 + stubs/sympy-stubs/simplify/ratsimp.pyi | 7 + stubs/sympy-stubs/simplify/simplify.pyi | 77 ++ stubs/sympy-stubs/simplify/sqrtdenest.pyi | 24 + stubs/sympy-stubs/simplify/trigsimp.pyi | 23 + stubs/sympy-stubs/solvers/__init__.pyi | 15 + stubs/sympy-stubs/solvers/bivariate.pyi | 6 + stubs/sympy-stubs/solvers/decompogen.pyi | 11 + stubs/sympy-stubs/solvers/deutils.pyi | 4 + .../solvers/diophantine/__init__.pyi | 3 + .../solvers/diophantine/diophantine.pyi | 293 +++++ stubs/sympy-stubs/solvers/inequalities.pyi | 28 + stubs/sympy-stubs/solvers/ode/__init__.pyi | 6 + .../solvers/ode/hypergeometric.pyi | 17 + stubs/sympy-stubs/solvers/ode/lie_group.pyi | 36 + stubs/sympy-stubs/solvers/ode/ode.pyi | 79 ++ stubs/sympy-stubs/solvers/ode/riccati.pyi | 72 ++ stubs/sympy-stubs/solvers/ode/single.pyi | 231 ++++ stubs/sympy-stubs/solvers/ode/subscheck.pyi | 10 + stubs/sympy-stubs/solvers/ode/systems.pyi | 37 + stubs/sympy-stubs/solvers/pde.pyi | 31 + stubs/sympy-stubs/solvers/polysys.pyi | 18 + stubs/sympy-stubs/solvers/recurr.pyi | 14 + stubs/sympy-stubs/solvers/solvers.pyi | 52 + stubs/sympy-stubs/solvers/solveset.pyi | 52 + stubs/sympy-stubs/stats/__init__.pyi | 13 + stubs/sympy-stubs/stats/compound_rv.pyi | 93 ++ stubs/sympy-stubs/stats/crv.pyi | 170 +++ stubs/sympy-stubs/stats/crv_types.pyi | 837 +++++++++++++ stubs/sympy-stubs/stats/drv.pyi | 140 +++ stubs/sympy-stubs/stats/drv_types.pyi | 162 +++ stubs/sympy-stubs/stats/frv.pyi | 241 ++++ stubs/sympy-stubs/stats/frv_types.pyi | 289 +++++ stubs/sympy-stubs/stats/joint_rv.pyi | 143 +++ stubs/sympy-stubs/stats/joint_rv_types.pyi | 202 ++++ .../stats/matrix_distributions.pyi | 156 +++ stubs/sympy-stubs/stats/random_matrix.pyi | 17 + .../stats/random_matrix_models.pyi | 136 +++ stubs/sympy-stubs/stats/rv.pyi | 407 +++++++ stubs/sympy-stubs/stats/rv_interface.pyi | 61 + .../stats/sampling/sample_numpy.pyi | 86 ++ .../stats/sampling/sample_pymc.pyi | 69 ++ .../stats/sampling/sample_scipy.pyi | 98 ++ .../sympy-stubs/stats/stochastic_process.pyi | 36 + .../stats/stochastic_process_types.pyi | 336 ++++++ .../symbolic_multivariate_probability.pyi | 46 + .../stats/symbolic_probability.pyi | 94 ++ stubs/sympy-stubs/strategies/__init__.pyi | 7 + .../strategies/branch/__init__.pyi | 5 + stubs/sympy-stubs/strategies/branch/core.pyi | 35 + stubs/sympy-stubs/strategies/branch/tools.pyi | 4 + .../strategies/branch/traverse.pyi | 8 + stubs/sympy-stubs/strategies/core.pyi | 38 + stubs/sympy-stubs/strategies/rl.pyi | 26 + stubs/sympy-stubs/strategies/tools.pyi | 10 + stubs/sympy-stubs/strategies/traverse.pyi | 17 + stubs/sympy-stubs/strategies/tree.pyi | 13 + stubs/sympy-stubs/tensor/__init__.pyi | 6 + stubs/sympy-stubs/tensor/array/__init__.pyi | 8 + .../tensor/array/array_comprehension.pyi | 70 ++ .../tensor/array/array_derivatives.pyi | 13 + stubs/sympy-stubs/tensor/array/arrayop.pyi | 36 + .../tensor/array/dense_ndim_array.pyi | 59 + .../array/expressions/array_expressions.pyi | 314 +++++ .../expressions/arrayexpr_derivatives.pyi | 86 ++ .../expressions/from_array_to_indexed.pyi | 16 + .../expressions/from_array_to_matrix.pyi | 90 ++ .../expressions/from_indexed_to_array.pyi | 6 + .../tensor/array/mutable_ndim_array.pyi | 12 + stubs/sympy-stubs/tensor/array/ndim_array.pyi | 101 ++ .../tensor/array/sparse_ndim_array.pyi | 53 + stubs/sympy-stubs/tensor/functions.pyi | 30 + stubs/sympy-stubs/tensor/index_methods.pyi | 15 + stubs/sympy-stubs/tensor/indexed.pyi | 123 ++ stubs/sympy-stubs/tensor/tensor.pyi | 869 +++++++++++++ stubs/sympy-stubs/testing/__init__.pyi | 3 + stubs/sympy-stubs/testing/runtests.pyi | 174 +++ stubs/sympy-stubs/unify/__init__.pyi | 4 + stubs/sympy-stubs/unify/core.pyi | 74 ++ stubs/sympy-stubs/unify/rewrite.pyi | 6 + stubs/sympy-stubs/unify/usympy.pyi | 34 + stubs/sympy-stubs/utilities/__init__.pyi | 7 + stubs/sympy-stubs/utilities/decorator.pyi | 37 + stubs/sympy-stubs/utilities/enumerative.pyi | 76 ++ stubs/sympy-stubs/utilities/exceptions.pyi | 28 + stubs/sympy-stubs/utilities/iterables.pyi | 185 +++ stubs/sympy-stubs/utilities/lambdify.pyi | 56 + stubs/sympy-stubs/utilities/magic.pyi | 4 + .../sympy-stubs/utilities/mathml/__init__.pyi | 15 + stubs/sympy-stubs/utilities/memoization.pyi | 8 + stubs/sympy-stubs/utilities/misc.pyi | 46 + stubs/sympy-stubs/utilities/source.pyi | 8 + stubs/sympy-stubs/utilities/timeutils.pyi | 12 + stubs/sympy-stubs/vector/basisdependent.pyi | 129 ++ stubs/sympy-stubs/vector/coordsysrect.pyi | 69 ++ stubs/sympy-stubs/vector/deloperator.pyi | 24 + stubs/sympy-stubs/vector/dyadic.pyi | 70 ++ stubs/sympy-stubs/vector/functions.pyi | 34 + stubs/sympy-stubs/vector/implicitregion.pyi | 38 + stubs/sympy-stubs/vector/integrals.pyi | 22 + stubs/sympy-stubs/vector/operators.pyi | 50 + stubs/sympy-stubs/vector/orienters.pyi | 98 ++ stubs/sympy-stubs/vector/parametricregion.pyi | 56 + stubs/sympy-stubs/vector/point.pyi | 21 + stubs/sympy-stubs/vector/scalar.pyi | 21 + stubs/sympy-stubs/vector/vector.pyi | 124 ++ 528 files changed, 43444 insertions(+) create mode 100644 stubs/sympy-stubs/README.md create mode 100644 stubs/sympy-stubs/__init__.pyi create mode 100644 stubs/sympy-stubs/algebras/__init__.pyi create mode 100644 stubs/sympy-stubs/algebras/quaternion.pyi create mode 100644 stubs/sympy-stubs/assumptions/__init__.pyi create mode 100644 stubs/sympy-stubs/assumptions/ask.pyi create mode 100644 stubs/sympy-stubs/assumptions/ask_generated.pyi create mode 100644 stubs/sympy-stubs/assumptions/assume.pyi create mode 100644 stubs/sympy-stubs/assumptions/cnf.pyi create mode 100644 stubs/sympy-stubs/assumptions/facts.pyi create mode 100644 stubs/sympy-stubs/assumptions/handlers/__init__.pyi create mode 100644 stubs/sympy-stubs/assumptions/handlers/calculus.pyi create mode 100644 stubs/sympy-stubs/assumptions/handlers/common.pyi create mode 100644 stubs/sympy-stubs/assumptions/handlers/matrices.pyi create mode 100644 stubs/sympy-stubs/assumptions/handlers/ntheory.pyi create mode 100644 stubs/sympy-stubs/assumptions/handlers/order.pyi create mode 100644 stubs/sympy-stubs/assumptions/handlers/sets.pyi create mode 100644 stubs/sympy-stubs/assumptions/predicates/common.pyi create mode 100644 stubs/sympy-stubs/assumptions/predicates/matrices.pyi create mode 100644 stubs/sympy-stubs/assumptions/predicates/ntheory.pyi create mode 100644 stubs/sympy-stubs/assumptions/predicates/order.pyi create mode 100644 stubs/sympy-stubs/assumptions/refine.pyi create mode 100644 stubs/sympy-stubs/assumptions/relation/__init__.pyi create mode 100644 stubs/sympy-stubs/assumptions/relation/binrel.pyi create mode 100644 stubs/sympy-stubs/assumptions/relation/equality.pyi create mode 100644 stubs/sympy-stubs/assumptions/satask.pyi create mode 100644 stubs/sympy-stubs/assumptions/sathandlers.pyi create mode 100644 stubs/sympy-stubs/assumptions/wrapper.pyi create mode 100644 stubs/sympy-stubs/calculus/__init__.pyi create mode 100644 stubs/sympy-stubs/calculus/accumulationbounds.pyi create mode 100644 stubs/sympy-stubs/calculus/euler.pyi create mode 100644 stubs/sympy-stubs/calculus/finite_diff.pyi create mode 100644 stubs/sympy-stubs/calculus/singularities.pyi create mode 100644 stubs/sympy-stubs/calculus/util.pyi create mode 100644 stubs/sympy-stubs/categories/__init__.pyi create mode 100644 stubs/sympy-stubs/categories/baseclasses.pyi create mode 100644 stubs/sympy-stubs/categories/diagram_drawing.pyi create mode 100644 stubs/sympy-stubs/codegen/__init__.pyi create mode 100644 stubs/sympy-stubs/codegen/ast.pyi create mode 100644 stubs/sympy-stubs/codegen/cfunctions.pyi create mode 100644 stubs/sympy-stubs/codegen/cnodes.pyi create mode 100644 stubs/sympy-stubs/codegen/fnodes.pyi create mode 100644 stubs/sympy-stubs/codegen/pynodes.pyi create mode 100644 stubs/sympy-stubs/combinatorics/coset_table.pyi create mode 100644 stubs/sympy-stubs/combinatorics/fp_groups.pyi create mode 100644 stubs/sympy-stubs/combinatorics/free_groups.pyi create mode 100644 stubs/sympy-stubs/combinatorics/galois.pyi create mode 100644 stubs/sympy-stubs/combinatorics/generators.pyi create mode 100644 stubs/sympy-stubs/combinatorics/graycode.pyi create mode 100644 stubs/sympy-stubs/combinatorics/group_constructs.pyi create mode 100644 stubs/sympy-stubs/combinatorics/homomorphisms.pyi create mode 100644 stubs/sympy-stubs/combinatorics/named_groups.pyi create mode 100644 stubs/sympy-stubs/combinatorics/partitions.pyi create mode 100644 stubs/sympy-stubs/combinatorics/pc_groups.pyi create mode 100644 stubs/sympy-stubs/combinatorics/perm_groups.pyi create mode 100644 stubs/sympy-stubs/combinatorics/permutations.pyi create mode 100644 stubs/sympy-stubs/combinatorics/polyhedron.pyi create mode 100644 stubs/sympy-stubs/combinatorics/prufer.pyi create mode 100644 stubs/sympy-stubs/combinatorics/rewritingsystem.pyi create mode 100644 stubs/sympy-stubs/combinatorics/rewritingsystem_fsm.pyi create mode 100644 stubs/sympy-stubs/combinatorics/subsets.pyi create mode 100644 stubs/sympy-stubs/combinatorics/tensor_can.pyi create mode 100644 stubs/sympy-stubs/combinatorics/testutil.pyi create mode 100644 stubs/sympy-stubs/concrete/__init__.pyi create mode 100644 stubs/sympy-stubs/concrete/delta.pyi create mode 100644 stubs/sympy-stubs/concrete/expr_with_intlimits.pyi create mode 100644 stubs/sympy-stubs/concrete/expr_with_limits.pyi create mode 100644 stubs/sympy-stubs/concrete/gosper.pyi create mode 100644 stubs/sympy-stubs/concrete/products.pyi create mode 100644 stubs/sympy-stubs/concrete/summations.pyi create mode 100644 stubs/sympy-stubs/conftest.pyi create mode 100644 stubs/sympy-stubs/core/__init__.pyi create mode 100644 stubs/sympy-stubs/core/add.pyi create mode 100644 stubs/sympy-stubs/core/assumptions.pyi create mode 100644 stubs/sympy-stubs/core/basic.pyi create mode 100644 stubs/sympy-stubs/core/cache.pyi create mode 100644 stubs/sympy-stubs/core/containers.pyi create mode 100644 stubs/sympy-stubs/core/core.pyi create mode 100644 stubs/sympy-stubs/core/decorators.pyi create mode 100644 stubs/sympy-stubs/core/evalf.pyi create mode 100644 stubs/sympy-stubs/core/expr.pyi create mode 100644 stubs/sympy-stubs/core/exprtools.pyi create mode 100644 stubs/sympy-stubs/core/facts.pyi create mode 100644 stubs/sympy-stubs/core/function.pyi create mode 100644 stubs/sympy-stubs/core/kind.pyi create mode 100644 stubs/sympy-stubs/core/logic.pyi create mode 100644 stubs/sympy-stubs/core/mod.pyi create mode 100644 stubs/sympy-stubs/core/mul.pyi create mode 100644 stubs/sympy-stubs/core/multidimensional.pyi create mode 100644 stubs/sympy-stubs/core/numbers.pyi create mode 100644 stubs/sympy-stubs/core/operations.pyi create mode 100644 stubs/sympy-stubs/core/parameters.pyi create mode 100644 stubs/sympy-stubs/core/power.pyi create mode 100644 stubs/sympy-stubs/core/random.pyi create mode 100644 stubs/sympy-stubs/core/relational.pyi create mode 100644 stubs/sympy-stubs/core/rules.pyi create mode 100644 stubs/sympy-stubs/core/singleton.pyi create mode 100644 stubs/sympy-stubs/core/sorting.pyi create mode 100644 stubs/sympy-stubs/core/symbol.pyi create mode 100644 stubs/sympy-stubs/core/sympify.pyi create mode 100644 stubs/sympy-stubs/core/traversal.pyi create mode 100644 stubs/sympy-stubs/crypto/crypto.pyi create mode 100644 stubs/sympy-stubs/diffgeom/__init__.pyi create mode 100644 stubs/sympy-stubs/diffgeom/diffgeom.pyi create mode 100644 stubs/sympy-stubs/discrete/__init__.pyi create mode 100644 stubs/sympy-stubs/discrete/convolutions.pyi create mode 100644 stubs/sympy-stubs/discrete/recurrences.pyi create mode 100644 stubs/sympy-stubs/discrete/transforms.pyi create mode 100644 stubs/sympy-stubs/external/importtools.pyi create mode 100644 stubs/sympy-stubs/external/pythonmpq.pyi create mode 100644 stubs/sympy-stubs/functions/combinatorial/factorials.pyi create mode 100644 stubs/sympy-stubs/functions/combinatorial/numbers.pyi create mode 100644 stubs/sympy-stubs/functions/elementary/complexes.pyi create mode 100644 stubs/sympy-stubs/functions/elementary/exponential.pyi create mode 100644 stubs/sympy-stubs/functions/elementary/hyperbolic.pyi create mode 100644 stubs/sympy-stubs/functions/elementary/miscellaneous.pyi create mode 100644 stubs/sympy-stubs/functions/elementary/piecewise.pyi create mode 100644 stubs/sympy-stubs/functions/elementary/trigonometric.pyi create mode 100644 stubs/sympy-stubs/functions/special/bessel.pyi create mode 100644 stubs/sympy-stubs/functions/special/beta_functions.pyi create mode 100644 stubs/sympy-stubs/functions/special/bsplines.pyi create mode 100644 stubs/sympy-stubs/functions/special/delta_functions.pyi create mode 100644 stubs/sympy-stubs/functions/special/elliptic_integrals.pyi create mode 100644 stubs/sympy-stubs/functions/special/error_functions.pyi create mode 100644 stubs/sympy-stubs/functions/special/gamma_functions.pyi create mode 100644 stubs/sympy-stubs/functions/special/hyper.pyi create mode 100644 stubs/sympy-stubs/functions/special/mathieu_functions.pyi create mode 100644 stubs/sympy-stubs/functions/special/polynomials.pyi create mode 100644 stubs/sympy-stubs/functions/special/singularity_functions.pyi create mode 100644 stubs/sympy-stubs/functions/special/spherical_harmonics.pyi create mode 100644 stubs/sympy-stubs/functions/special/tensor_functions.pyi create mode 100644 stubs/sympy-stubs/functions/special/zeta_functions.pyi create mode 100644 stubs/sympy-stubs/geometry/curve.pyi create mode 100644 stubs/sympy-stubs/geometry/ellipse.pyi create mode 100644 stubs/sympy-stubs/geometry/entity.pyi create mode 100644 stubs/sympy-stubs/geometry/line.pyi create mode 100644 stubs/sympy-stubs/geometry/parabola.pyi create mode 100644 stubs/sympy-stubs/geometry/plane.pyi create mode 100644 stubs/sympy-stubs/geometry/point.pyi create mode 100644 stubs/sympy-stubs/geometry/polygon.pyi create mode 100644 stubs/sympy-stubs/geometry/util.pyi create mode 100644 stubs/sympy-stubs/holonomic/__init__.pyi create mode 100644 stubs/sympy-stubs/holonomic/holonomic.pyi create mode 100644 stubs/sympy-stubs/holonomic/recurrence.pyi create mode 100644 stubs/sympy-stubs/integrals/__init__.pyi create mode 100644 stubs/sympy-stubs/integrals/deltafunctions.pyi create mode 100644 stubs/sympy-stubs/integrals/heurisch.pyi create mode 100644 stubs/sympy-stubs/integrals/integrals.pyi create mode 100644 stubs/sympy-stubs/integrals/laplace.pyi create mode 100644 stubs/sympy-stubs/integrals/manualintegrate.pyi create mode 100644 stubs/sympy-stubs/integrals/meijerint.pyi create mode 100644 stubs/sympy-stubs/integrals/prde.pyi create mode 100644 stubs/sympy-stubs/integrals/rationaltools.pyi create mode 100644 stubs/sympy-stubs/integrals/rde.pyi create mode 100644 stubs/sympy-stubs/integrals/risch.pyi create mode 100644 stubs/sympy-stubs/integrals/singularityfunctions.pyi create mode 100644 stubs/sympy-stubs/integrals/transforms.pyi create mode 100644 stubs/sympy-stubs/interactive/__init__.pyi create mode 100644 stubs/sympy-stubs/interactive/printing.pyi create mode 100644 stubs/sympy-stubs/interactive/session.pyi create mode 100644 stubs/sympy-stubs/interactive/traversal.pyi create mode 100644 stubs/sympy-stubs/liealgebras/cartan_type.pyi create mode 100644 stubs/sympy-stubs/liealgebras/type_a.pyi create mode 100644 stubs/sympy-stubs/liealgebras/type_b.pyi create mode 100644 stubs/sympy-stubs/liealgebras/type_c.pyi create mode 100644 stubs/sympy-stubs/liealgebras/type_d.pyi create mode 100644 stubs/sympy-stubs/liealgebras/type_e.pyi create mode 100644 stubs/sympy-stubs/liealgebras/type_f.pyi create mode 100644 stubs/sympy-stubs/liealgebras/type_g.pyi create mode 100644 stubs/sympy-stubs/logic/__init__.pyi create mode 100644 stubs/sympy-stubs/logic/algorithms/dpll.pyi create mode 100644 stubs/sympy-stubs/logic/algorithms/dpll2.pyi create mode 100644 stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi create mode 100644 stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi create mode 100644 stubs/sympy-stubs/logic/boolalg.pyi create mode 100644 stubs/sympy-stubs/logic/inference.pyi create mode 100644 stubs/sympy-stubs/matrices/__init__.pyi create mode 100644 stubs/sympy-stubs/matrices/dense.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/__init__.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/adjoint.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/applyfunc.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/blockmatrix.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/companion.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/determinant.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/diagonal.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/dotproduct.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/factorizations.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/fourier.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/funcmatrix.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/hadamard.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/inverse.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/kronecker.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/matadd.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/matexpr.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/matmul.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/matpow.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/permutation.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/sets.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/slice.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/special.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/trace.pyi create mode 100644 stubs/sympy-stubs/matrices/expressions/transpose.pyi create mode 100644 stubs/sympy-stubs/matrices/immutable.pyi create mode 100644 stubs/sympy-stubs/matrices/normalforms.pyi create mode 100644 stubs/sympy-stubs/matrices/repmatrix.pyi create mode 100644 stubs/sympy-stubs/matrices/sparse.pyi create mode 100644 stubs/sympy-stubs/matrices/utilities.pyi create mode 100644 stubs/sympy-stubs/multipledispatch/__init__.pyi create mode 100644 stubs/sympy-stubs/multipledispatch/conflict.pyi create mode 100644 stubs/sympy-stubs/multipledispatch/core.pyi create mode 100644 stubs/sympy-stubs/multipledispatch/dispatcher.pyi create mode 100644 stubs/sympy-stubs/multipledispatch/utils.pyi create mode 100644 stubs/sympy-stubs/ntheory/__init__.pyi create mode 100644 stubs/sympy-stubs/ntheory/continued_fraction.pyi create mode 100644 stubs/sympy-stubs/ntheory/digits.pyi create mode 100644 stubs/sympy-stubs/ntheory/ecm.pyi create mode 100644 stubs/sympy-stubs/ntheory/egyptian_fraction.pyi create mode 100644 stubs/sympy-stubs/ntheory/factor_.pyi create mode 100644 stubs/sympy-stubs/ntheory/generate.pyi create mode 100644 stubs/sympy-stubs/ntheory/modular.pyi create mode 100644 stubs/sympy-stubs/ntheory/multinomial.pyi create mode 100644 stubs/sympy-stubs/ntheory/partitions_.pyi create mode 100644 stubs/sympy-stubs/ntheory/primetest.pyi create mode 100644 stubs/sympy-stubs/ntheory/qs.pyi create mode 100644 stubs/sympy-stubs/ntheory/residue_ntheory.pyi create mode 100644 stubs/sympy-stubs/parsing/__init__.pyi create mode 100644 stubs/sympy-stubs/parsing/sympy_parser.pyi create mode 100644 stubs/sympy-stubs/physics/__init__.pyi create mode 100644 stubs/sympy-stubs/physics/control/__init__.pyi create mode 100644 stubs/sympy-stubs/physics/control/control_plots.pyi create mode 100644 stubs/sympy-stubs/physics/control/lti.pyi create mode 100644 stubs/sympy-stubs/physics/matrices.pyi create mode 100644 stubs/sympy-stubs/physics/units/__init__.pyi create mode 100644 stubs/sympy-stubs/physics/units/definitions/__init__.pyi create mode 100644 stubs/sympy-stubs/physics/units/dimensions.pyi create mode 100644 stubs/sympy-stubs/physics/units/prefixes.pyi create mode 100644 stubs/sympy-stubs/physics/units/quantities.pyi create mode 100644 stubs/sympy-stubs/physics/units/unitsystem.pyi create mode 100644 stubs/sympy-stubs/physics/units/util.pyi create mode 100644 stubs/sympy-stubs/plotting/__init__.pyi create mode 100644 stubs/sympy-stubs/plotting/intervalmath/__init__.pyi create mode 100644 stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi create mode 100644 stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi create mode 100644 stubs/sympy-stubs/plotting/intervalmath/lib_interval.pyi create mode 100644 stubs/sympy-stubs/plotting/plot.pyi create mode 100644 stubs/sympy-stubs/plotting/plot_implicit.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/__init__.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/managed_window.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_axes.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_camera.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_controller.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_curve.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_mode.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_modes.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_object.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_rotation.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_surface.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/plot_window.pyi create mode 100644 stubs/sympy-stubs/plotting/pygletplot/util.pyi create mode 100644 stubs/sympy-stubs/plotting/textplot.pyi create mode 100644 stubs/sympy-stubs/polys/__init__.pyi create mode 100644 stubs/sympy-stubs/polys/agca/extensions.pyi create mode 100644 stubs/sympy-stubs/polys/agca/homomorphisms.pyi create mode 100644 stubs/sympy-stubs/polys/agca/ideals.pyi create mode 100644 stubs/sympy-stubs/polys/agca/modules.pyi create mode 100644 stubs/sympy-stubs/polys/appellseqs.pyi create mode 100644 stubs/sympy-stubs/polys/compatibility.pyi create mode 100644 stubs/sympy-stubs/polys/constructor.pyi create mode 100644 stubs/sympy-stubs/polys/densearith.pyi create mode 100644 stubs/sympy-stubs/polys/densebasic.pyi create mode 100644 stubs/sympy-stubs/polys/densetools.pyi create mode 100644 stubs/sympy-stubs/polys/dispersion.pyi create mode 100644 stubs/sympy-stubs/polys/distributedmodules.pyi create mode 100644 stubs/sympy-stubs/polys/domains/__init__.pyi create mode 100644 stubs/sympy-stubs/polys/domains/algebraicfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/characteristiczero.pyi create mode 100644 stubs/sympy-stubs/polys/domains/complexfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/compositedomain.pyi create mode 100644 stubs/sympy-stubs/polys/domains/domain.pyi create mode 100644 stubs/sympy-stubs/polys/domains/expressiondomain.pyi create mode 100644 stubs/sympy-stubs/polys/domains/expressionrawdomain.pyi create mode 100644 stubs/sympy-stubs/polys/domains/field.pyi create mode 100644 stubs/sympy-stubs/polys/domains/finitefield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/fractionfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/gaussiandomains.pyi create mode 100644 stubs/sympy-stubs/polys/domains/gmpyintegerring.pyi create mode 100644 stubs/sympy-stubs/polys/domains/gmpyrationalfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/integerring.pyi create mode 100644 stubs/sympy-stubs/polys/domains/modularinteger.pyi create mode 100644 stubs/sympy-stubs/polys/domains/mpelements.pyi create mode 100644 stubs/sympy-stubs/polys/domains/old_fractionfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/old_polynomialring.pyi create mode 100644 stubs/sympy-stubs/polys/domains/polynomialring.pyi create mode 100644 stubs/sympy-stubs/polys/domains/pythonintegerring.pyi create mode 100644 stubs/sympy-stubs/polys/domains/pythonrational.pyi create mode 100644 stubs/sympy-stubs/polys/domains/pythonrationalfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/quotientring.pyi create mode 100644 stubs/sympy-stubs/polys/domains/rationalfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/realfield.pyi create mode 100644 stubs/sympy-stubs/polys/domains/ring.pyi create mode 100644 stubs/sympy-stubs/polys/domains/simpledomain.pyi create mode 100644 stubs/sympy-stubs/polys/euclidtools.pyi create mode 100644 stubs/sympy-stubs/polys/factortools.pyi create mode 100644 stubs/sympy-stubs/polys/fglmtools.pyi create mode 100644 stubs/sympy-stubs/polys/fields.pyi create mode 100644 stubs/sympy-stubs/polys/galoistools.pyi create mode 100644 stubs/sympy-stubs/polys/groebnertools.pyi create mode 100644 stubs/sympy-stubs/polys/heuristicgcd.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/__init__.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/ddm.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/dense.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/domainmatrix.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/domainscalar.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/eigen.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/linsolve.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/lll.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/normalforms.pyi create mode 100644 stubs/sympy-stubs/polys/matrices/sdm.pyi create mode 100644 stubs/sympy-stubs/polys/monomials.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/__init__.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/basis.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/galois_resolvents.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/galoisgroups.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/minpoly.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/modules.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/primes.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/subfield.pyi create mode 100644 stubs/sympy-stubs/polys/numberfields/utilities.pyi create mode 100644 stubs/sympy-stubs/polys/orderings.pyi create mode 100644 stubs/sympy-stubs/polys/orthopolys.pyi create mode 100644 stubs/sympy-stubs/polys/partfrac.pyi create mode 100644 stubs/sympy-stubs/polys/polyclasses.pyi create mode 100644 stubs/sympy-stubs/polys/polyconfig.pyi create mode 100644 stubs/sympy-stubs/polys/polyerrors.pyi create mode 100644 stubs/sympy-stubs/polys/polyfuncs.pyi create mode 100644 stubs/sympy-stubs/polys/polymatrix.pyi create mode 100644 stubs/sympy-stubs/polys/polyoptions.pyi create mode 100644 stubs/sympy-stubs/polys/polyquinticconst.pyi create mode 100644 stubs/sympy-stubs/polys/polyroots.pyi create mode 100644 stubs/sympy-stubs/polys/polytools.pyi create mode 100644 stubs/sympy-stubs/polys/polyutils.pyi create mode 100644 stubs/sympy-stubs/polys/rationaltools.pyi create mode 100644 stubs/sympy-stubs/polys/ring_series.pyi create mode 100644 stubs/sympy-stubs/polys/rings.pyi create mode 100644 stubs/sympy-stubs/polys/rootisolation.pyi create mode 100644 stubs/sympy-stubs/polys/rootoftools.pyi create mode 100644 stubs/sympy-stubs/polys/solvers.pyi create mode 100644 stubs/sympy-stubs/polys/specialpolys.pyi create mode 100644 stubs/sympy-stubs/polys/sqfreetools.pyi create mode 100644 stubs/sympy-stubs/printing/__init__.pyi create mode 100644 stubs/sympy-stubs/printing/c.pyi create mode 100644 stubs/sympy-stubs/printing/codeprinter.pyi create mode 100644 stubs/sympy-stubs/printing/conventions.pyi create mode 100644 stubs/sympy-stubs/printing/cxx.pyi create mode 100644 stubs/sympy-stubs/printing/dot.pyi create mode 100644 stubs/sympy-stubs/printing/fortran.pyi create mode 100644 stubs/sympy-stubs/printing/glsl.pyi create mode 100644 stubs/sympy-stubs/printing/gtk.pyi create mode 100644 stubs/sympy-stubs/printing/jscode.pyi create mode 100644 stubs/sympy-stubs/printing/julia.pyi create mode 100644 stubs/sympy-stubs/printing/lambdarepr.pyi create mode 100644 stubs/sympy-stubs/printing/latex.pyi create mode 100644 stubs/sympy-stubs/printing/maple.pyi create mode 100644 stubs/sympy-stubs/printing/mathematica.pyi create mode 100644 stubs/sympy-stubs/printing/mathml.pyi create mode 100644 stubs/sympy-stubs/printing/numpy.pyi create mode 100644 stubs/sympy-stubs/printing/octave.pyi create mode 100644 stubs/sympy-stubs/printing/precedence.pyi create mode 100644 stubs/sympy-stubs/printing/pretty/__init__.pyi create mode 100644 stubs/sympy-stubs/printing/pretty/pretty.pyi create mode 100644 stubs/sympy-stubs/printing/pretty/pretty_symbology.pyi create mode 100644 stubs/sympy-stubs/printing/pretty/stringpict.pyi create mode 100644 stubs/sympy-stubs/printing/preview.pyi create mode 100644 stubs/sympy-stubs/printing/printer.pyi create mode 100644 stubs/sympy-stubs/printing/pycode.pyi create mode 100644 stubs/sympy-stubs/printing/python.pyi create mode 100644 stubs/sympy-stubs/printing/rcode.pyi create mode 100644 stubs/sympy-stubs/printing/repr.pyi create mode 100644 stubs/sympy-stubs/printing/rust.pyi create mode 100644 stubs/sympy-stubs/printing/str.pyi create mode 100644 stubs/sympy-stubs/printing/tableform.pyi create mode 100644 stubs/sympy-stubs/printing/tensorflow.pyi create mode 100644 stubs/sympy-stubs/printing/tree.pyi create mode 100644 stubs/sympy-stubs/py.typed create mode 100644 stubs/sympy-stubs/series/__init__.pyi create mode 100644 stubs/sympy-stubs/series/approximants.pyi create mode 100644 stubs/sympy-stubs/series/formal.pyi create mode 100644 stubs/sympy-stubs/series/fourier.pyi create mode 100644 stubs/sympy-stubs/series/gruntz.pyi create mode 100644 stubs/sympy-stubs/series/limits.pyi create mode 100644 stubs/sympy-stubs/series/limitseq.pyi create mode 100644 stubs/sympy-stubs/series/order.pyi create mode 100644 stubs/sympy-stubs/series/sequences.pyi create mode 100644 stubs/sympy-stubs/series/series_class.pyi create mode 100644 stubs/sympy-stubs/sets/__init__.pyi create mode 100644 stubs/sympy-stubs/sets/conditionset.pyi create mode 100644 stubs/sympy-stubs/sets/contains.pyi create mode 100644 stubs/sympy-stubs/sets/fancysets.pyi create mode 100644 stubs/sympy-stubs/sets/handlers/add.pyi create mode 100644 stubs/sympy-stubs/sets/handlers/functions.pyi create mode 100644 stubs/sympy-stubs/sets/handlers/intersection.pyi create mode 100644 stubs/sympy-stubs/sets/handlers/issubset.pyi create mode 100644 stubs/sympy-stubs/sets/handlers/mul.pyi create mode 100644 stubs/sympy-stubs/sets/handlers/power.pyi create mode 100644 stubs/sympy-stubs/sets/handlers/union.pyi create mode 100644 stubs/sympy-stubs/sets/ordinals.pyi create mode 100644 stubs/sympy-stubs/sets/powerset.pyi create mode 100644 stubs/sympy-stubs/sets/setexpr.pyi create mode 100644 stubs/sympy-stubs/sets/sets.pyi create mode 100644 stubs/sympy-stubs/simplify/__init__.pyi create mode 100644 stubs/sympy-stubs/simplify/combsimp.pyi create mode 100644 stubs/sympy-stubs/simplify/cse_main.pyi create mode 100644 stubs/sympy-stubs/simplify/cse_opts.pyi create mode 100644 stubs/sympy-stubs/simplify/epathtools.pyi create mode 100644 stubs/sympy-stubs/simplify/fu.pyi create mode 100644 stubs/sympy-stubs/simplify/gammasimp.pyi create mode 100644 stubs/sympy-stubs/simplify/hyperexpand.pyi create mode 100644 stubs/sympy-stubs/simplify/powsimp.pyi create mode 100644 stubs/sympy-stubs/simplify/radsimp.pyi create mode 100644 stubs/sympy-stubs/simplify/ratsimp.pyi create mode 100644 stubs/sympy-stubs/simplify/simplify.pyi create mode 100644 stubs/sympy-stubs/simplify/sqrtdenest.pyi create mode 100644 stubs/sympy-stubs/simplify/trigsimp.pyi create mode 100644 stubs/sympy-stubs/solvers/__init__.pyi create mode 100644 stubs/sympy-stubs/solvers/bivariate.pyi create mode 100644 stubs/sympy-stubs/solvers/decompogen.pyi create mode 100644 stubs/sympy-stubs/solvers/deutils.pyi create mode 100644 stubs/sympy-stubs/solvers/diophantine/__init__.pyi create mode 100644 stubs/sympy-stubs/solvers/diophantine/diophantine.pyi create mode 100644 stubs/sympy-stubs/solvers/inequalities.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/__init__.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/hypergeometric.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/lie_group.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/ode.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/riccati.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/single.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/subscheck.pyi create mode 100644 stubs/sympy-stubs/solvers/ode/systems.pyi create mode 100644 stubs/sympy-stubs/solvers/pde.pyi create mode 100644 stubs/sympy-stubs/solvers/polysys.pyi create mode 100644 stubs/sympy-stubs/solvers/recurr.pyi create mode 100644 stubs/sympy-stubs/solvers/solvers.pyi create mode 100644 stubs/sympy-stubs/solvers/solveset.pyi create mode 100644 stubs/sympy-stubs/stats/__init__.pyi create mode 100644 stubs/sympy-stubs/stats/compound_rv.pyi create mode 100644 stubs/sympy-stubs/stats/crv.pyi create mode 100644 stubs/sympy-stubs/stats/crv_types.pyi create mode 100644 stubs/sympy-stubs/stats/drv.pyi create mode 100644 stubs/sympy-stubs/stats/drv_types.pyi create mode 100644 stubs/sympy-stubs/stats/frv.pyi create mode 100644 stubs/sympy-stubs/stats/frv_types.pyi create mode 100644 stubs/sympy-stubs/stats/joint_rv.pyi create mode 100644 stubs/sympy-stubs/stats/joint_rv_types.pyi create mode 100644 stubs/sympy-stubs/stats/matrix_distributions.pyi create mode 100644 stubs/sympy-stubs/stats/random_matrix.pyi create mode 100644 stubs/sympy-stubs/stats/random_matrix_models.pyi create mode 100644 stubs/sympy-stubs/stats/rv.pyi create mode 100644 stubs/sympy-stubs/stats/rv_interface.pyi create mode 100644 stubs/sympy-stubs/stats/sampling/sample_numpy.pyi create mode 100644 stubs/sympy-stubs/stats/sampling/sample_pymc.pyi create mode 100644 stubs/sympy-stubs/stats/sampling/sample_scipy.pyi create mode 100644 stubs/sympy-stubs/stats/stochastic_process.pyi create mode 100644 stubs/sympy-stubs/stats/stochastic_process_types.pyi create mode 100644 stubs/sympy-stubs/stats/symbolic_multivariate_probability.pyi create mode 100644 stubs/sympy-stubs/stats/symbolic_probability.pyi create mode 100644 stubs/sympy-stubs/strategies/__init__.pyi create mode 100644 stubs/sympy-stubs/strategies/branch/__init__.pyi create mode 100644 stubs/sympy-stubs/strategies/branch/core.pyi create mode 100644 stubs/sympy-stubs/strategies/branch/tools.pyi create mode 100644 stubs/sympy-stubs/strategies/branch/traverse.pyi create mode 100644 stubs/sympy-stubs/strategies/core.pyi create mode 100644 stubs/sympy-stubs/strategies/rl.pyi create mode 100644 stubs/sympy-stubs/strategies/tools.pyi create mode 100644 stubs/sympy-stubs/strategies/traverse.pyi create mode 100644 stubs/sympy-stubs/strategies/tree.pyi create mode 100644 stubs/sympy-stubs/tensor/__init__.pyi create mode 100644 stubs/sympy-stubs/tensor/array/__init__.pyi create mode 100644 stubs/sympy-stubs/tensor/array/array_comprehension.pyi create mode 100644 stubs/sympy-stubs/tensor/array/array_derivatives.pyi create mode 100644 stubs/sympy-stubs/tensor/array/arrayop.pyi create mode 100644 stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi create mode 100644 stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi create mode 100644 stubs/sympy-stubs/tensor/array/expressions/arrayexpr_derivatives.pyi create mode 100644 stubs/sympy-stubs/tensor/array/expressions/from_array_to_indexed.pyi create mode 100644 stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi create mode 100644 stubs/sympy-stubs/tensor/array/expressions/from_indexed_to_array.pyi create mode 100644 stubs/sympy-stubs/tensor/array/mutable_ndim_array.pyi create mode 100644 stubs/sympy-stubs/tensor/array/ndim_array.pyi create mode 100644 stubs/sympy-stubs/tensor/array/sparse_ndim_array.pyi create mode 100644 stubs/sympy-stubs/tensor/functions.pyi create mode 100644 stubs/sympy-stubs/tensor/index_methods.pyi create mode 100644 stubs/sympy-stubs/tensor/indexed.pyi create mode 100644 stubs/sympy-stubs/tensor/tensor.pyi create mode 100644 stubs/sympy-stubs/testing/__init__.pyi create mode 100644 stubs/sympy-stubs/testing/runtests.pyi create mode 100644 stubs/sympy-stubs/unify/__init__.pyi create mode 100644 stubs/sympy-stubs/unify/core.pyi create mode 100644 stubs/sympy-stubs/unify/rewrite.pyi create mode 100644 stubs/sympy-stubs/unify/usympy.pyi create mode 100644 stubs/sympy-stubs/utilities/__init__.pyi create mode 100644 stubs/sympy-stubs/utilities/decorator.pyi create mode 100644 stubs/sympy-stubs/utilities/enumerative.pyi create mode 100644 stubs/sympy-stubs/utilities/exceptions.pyi create mode 100644 stubs/sympy-stubs/utilities/iterables.pyi create mode 100644 stubs/sympy-stubs/utilities/lambdify.pyi create mode 100644 stubs/sympy-stubs/utilities/magic.pyi create mode 100644 stubs/sympy-stubs/utilities/mathml/__init__.pyi create mode 100644 stubs/sympy-stubs/utilities/memoization.pyi create mode 100644 stubs/sympy-stubs/utilities/misc.pyi create mode 100644 stubs/sympy-stubs/utilities/source.pyi create mode 100644 stubs/sympy-stubs/utilities/timeutils.pyi create mode 100644 stubs/sympy-stubs/vector/basisdependent.pyi create mode 100644 stubs/sympy-stubs/vector/coordsysrect.pyi create mode 100644 stubs/sympy-stubs/vector/deloperator.pyi create mode 100644 stubs/sympy-stubs/vector/dyadic.pyi create mode 100644 stubs/sympy-stubs/vector/functions.pyi create mode 100644 stubs/sympy-stubs/vector/implicitregion.pyi create mode 100644 stubs/sympy-stubs/vector/integrals.pyi create mode 100644 stubs/sympy-stubs/vector/operators.pyi create mode 100644 stubs/sympy-stubs/vector/orienters.pyi create mode 100644 stubs/sympy-stubs/vector/parametricregion.pyi create mode 100644 stubs/sympy-stubs/vector/point.pyi create mode 100644 stubs/sympy-stubs/vector/scalar.pyi create mode 100644 stubs/sympy-stubs/vector/vector.pyi diff --git a/stubs/sympy-stubs/README.md b/stubs/sympy-stubs/README.md new file mode 100644 index 00000000..4b9cf5af --- /dev/null +++ b/stubs/sympy-stubs/README.md @@ -0,0 +1,156 @@ +These stubs were generated by: + +- Running `pyright --createstub sympy` after installing sympy into a venv +- Running a script that uncommented all of the return values in the generated stubs +- Running a script that removed all doc strings from the stubs (as sympy has docstrings itself) +- Adding a `partial` py.typed file +- Fixing all import errors one at a time (using Pylance) + +The last part took the longest. It might be quicker to just add any changes by hand, rather than regenerating from scratch. + + +Scripts for future use: + +### Uncomment return values + +```python +import os +import re +import shutil +from typing import List + +SOURCE_DIR = "typings\\sympy" +DEST_DIR = "typings\\sympy-returnvalues" + +def read_file(file_path: str) -> List[str]: + with open(file_path, "r") as file: + return file.readlines() + +def write_file(file_path: str, lines: List[str]) -> None: + try: + os.makedirs(os.path.dirname(file_path)) + except FileExistsError: + pass + with open(file_path, "w") as file: + file.writelines(lines) + +def fix_file(file_path: str, dest_path: str, sub_package: str) -> None: + lines = read_file(file_path)[4:] + + # Turn the return type comments into actual return types + changed = [re.sub(r":\s+#(.*)", r"\1", line) for line in lines] + + # Replace `from .` imports with `from sympy..` + replace_str = f"from sympy.{sub_package + '.' if sub_package else ''}" + changed = [re.sub(r"from \.", replace_str, line) for line in changed] + any_changes = [line for line in changed if line not in lines] + + if len(any_changes) > 0: + # Find this same file in the '.venv/lib/site-packages/sympy' directory and see if it has typing information in it. + site_packages_file = file_path.replace(SOURCE_DIR, ".venv\\lib\\site-packages\\sympy").replace(".pyi", ".py") + if os.path.exists(site_packages_file): + site_packages_lines = read_file(site_packages_file) + if "->" in site_packages_lines: + return + else: + print(f"Writing {dest_path}") + write_file(dest_path, changed) + +def fix_all_stubs() -> None: + stubs_dir = SOURCE_DIR + dest_dir = DEST_DIR + shutil.rmtree(dest_dir, ignore_errors=True) + os.makedirs(dest_dir, exist_ok=True) + # First write a partial py.typed file to the destination directory + write_file(os.path.join(dest_dir, "py.typed"), ["partial"]) + + # Then iterate over all of the generated files and fix them up so they're valid + for root, dirs, files in os.walk(stubs_dir): + for file in files: + if file.endswith(".pyi"): + file_path = os.path.join(root, file) + dest_path = file_path.replace(stubs_dir, dest_dir) + sub_dir_pos = root.index(stubs_dir) + len(stubs_dir) + 1 + sub_dir = root[sub_dir_pos:] + sub_package = sub_dir.replace("\\", ".") + fix_file(file_path, dest_path, sub_package) + +fix_all_stubs() + +``` + +### Remove doc comments +```python + +from codecs import ignore_errors +import os +import shutil +from typing import List + + +SOURCE_DIR = "typings\\sympy-returnvalues" +DEST_DIR = "typings\\sympy-docs" + + +def fix_file(file_path:str, dest_path:str): + # Read the file one char at a time until we find one of r""", b""", or """ + with open(file_path, mode="r") as file: + lines = file.readlines() + contents = "".join(lines) + new_contents = "" + in_docstring = False + ignoring_line = False + line_start = 0 + i = 0 + while i < len(contents): + char = contents[i] + if contents[i] == "\n": + line_start = len(new_contents) + if ignoring_line and not in_docstring: + ignoring_line = False + + if contents[i:i+3] == "\"\"\"" or contents[i:i+3] == "\'\'\'": + in_docstring = not in_docstring + new_contents = new_contents[:line_start] + ignoring_line = True + i += 3 + elif contents[i:i+4] == "r\"\"\"" or contents[i:i+4] == "r\'\'\'" and not in_docstring: + in_docstring = True + new_contents = new_contents[:line_start] + ignoring_line = True + i += 4 + elif not in_docstring and not ignoring_line: + new_contents += char + i += 1 + else: + i += 1 + try: + os.makedirs(os.path.dirname(dest_path)) + except FileExistsError: + pass + + print(f"Writing {dest_path}") + with open(dest_path, mode="w") as file: + file.write(new_contents) + + +def fix_all_stubs() -> None: + stubs_dir = SOURCE_DIR + dest_dir = DEST_DIR + shutil.rmtree(dest_dir, ignore_errors=True) + os.makedirs(dest_dir, exist_ok=True) + + # Then iterate over all of the generated files and fix them up so they're valid + for root, dirs, files in os.walk(stubs_dir): + for file in files: + if file.endswith(".pyi"): + file_path = os.path.join(root, file) + dest_path = file_path.replace(stubs_dir, dest_dir) + sub_dir_pos = root.index(stubs_dir) + len(stubs_dir) + 1 + sub_dir = root[sub_dir_pos:] + sub_package = sub_dir.replace("\\", ".") + fix_file(file_path, dest_path) + +fix_all_stubs() +``` + diff --git a/stubs/sympy-stubs/__init__.pyi b/stubs/sympy-stubs/__init__.pyi new file mode 100644 index 00000000..7f6a6a0c --- /dev/null +++ b/stubs/sympy-stubs/__init__.pyi @@ -0,0 +1,38 @@ +import sys +import mpmath +from sympy.release import __version__ +from sympy.core.cache import lazy_function +from sympy.core import Add, AlgebraicNumber, Atom, AtomicExpr, Basic, Catalan, Derivative, Dict, Dummy, E, Eq, Equality, EulerGamma, Expr, Float, Function, FunctionClass, Ge, GoldenRatio, GreaterThan, Gt, I, Integer, Lambda, Le, LessThan, Lt, Mod, Mul, N, Ne, Number, NumberSymbol, PoleError, Pow, PrecisionExhausted, Rational, RealNumber, Rel, S, StrictGreaterThan, StrictLessThan, Subs, Symbol, SympifyError, TribonacciConstant, Tuple, Unequality, UnevaluatedExpr, Wild, WildFunction, arity, bottom_up, cacheit, comp, count_ops, default_sort_key, diff, evalf, evaluate, expand, expand_complex, expand_func, expand_log, expand_mul, expand_multinomial, expand_power_base, expand_power_exp, expand_trig, factor_nc, factor_terms, gcd_terms, integer_log, integer_nthroot, nan, nfloat, oo, ordered, pi, postorder_traversal, preorder_traversal, prod, seterr, symbols, sympify, use, var, vectorize, zoo, igcd, ilcm, mod_inverse +from sympy.logic import And, Equivalent, ITE, Implies, Nand, Nor, Not, Or, POSform, SOPform, Xor, bool_map, false, satisfiable, simplify_logic, to_cnf, to_dnf, to_nnf, true +from sympy.assumptions import AppliedPredicate, AssumptionsContext, Predicate, Q, ask, assuming, refine, register_handler, remove_handler +from sympy.polys import AlgebraicField, BasePolynomialError, CC, CRootOf, CoercionFailed, ComplexField, ComplexRootOf, ComputationFailed, Domain, DomainError, EX, EXRAW, EvaluationFailed, ExactQuotientFailed, ExpressionDomain, ExtraneousFactors, FF, FF_gmpy, FF_python, FiniteField, FlagError, FractionField, GF, GMPYFiniteField, GMPYIntegerRing, GMPYRationalField, GeneratorsError, GeneratorsNeeded, GroebnerBasis, HeuristicGCDFailed, HomomorphismFailed, IntegerRing, IsomorphismFailed, LC, LM, LT, Monomial, MultivariatePolynomialError, NotAlgebraic, NotInvertible, NotReversible, OperationNotSupported, OptionError, Options, PolificationFailed, Poly, PolynomialDivisionFailed, PolynomialError, PolynomialRing, PurePoly, PythonFiniteField, PythonIntegerRing, PythonRational, QQ, QQ_I, QQ_gmpy, QQ_python, RR, RationalField, RealField, RefinementFailed, RootOf, RootSum, UnificationFailed, UnivariatePolynomialError, ZZ, ZZ_I, ZZ_gmpy, ZZ_python, apart, apart_list, assemble_partfrac_list, cancel, chebyshevt_poly, chebyshevu_poly, cofactors, compose, construct_domain, content, count_roots, cyclotomic_poly, decompose, degree, degree_list, discriminant, div, exquo, factor, factor_list, field, field_isomorphism, galois_group, gcd, gcd_list, gcdex, gff, gff_list, grevlex, grlex, groebner, ground_roots, half_gcdex, hermite_poly, hermite_prob_poly, horner, igrevlex, igrlex, ilex, interpolate, interpolating_poly, intervals, invert, is_zero_dimensional, isolate, itermonomials, jacobi_poly, laguerre_poly, lcm, lcm_list, legendre_poly, lex, minimal_polynomial, minpoly, monic, nroots, nth_power_roots_poly, parallel_poly_from_expr, pdiv, pexquo, poly, poly_from_expr, pquo, prem, prime_decomp, prime_valuation, primitive, primitive_element, quo, random_poly, rational_interpolate, real_roots, reduced, refine_root, rem, resultant, ring, rootof, roots, round_two, sfield, sqf, sqf_list, sqf_norm, sqf_part, sring, sturm, subresultants, swinnerton_dyer_poly, symmetric_poly, symmetrize, terms_gcd, to_number_field, together, total_degree, trunc, vfield, viete, vring, xfield, xring +from sympy.series import EmptySequence, Limit, O, Order, SeqAdd, SeqFormula, SeqMul, SeqPer, approximants, difference_delta, fourier_series, fps, gruntz, limit, limit_seq, residue, sequence, series +from sympy.functions import Abs, Chi, Ci, DiracDelta, E1, Ei, Eijk, FallingFactorial, Heaviside, Id, KroneckerDelta, LambertW, LeviCivita, Li, Max, Min, Piecewise, Rem, RisingFactorial, Shi, Si, SingularityFunction, Ynm, Ynm_c, Znm, acos, acosh, acot, acoth, acsc, acsch, adjoint, airyai, airyaiprime, airybi, airybiprime, andre, appellf1, arg, asec, asech, asin, asinh, assoc_laguerre, assoc_legendre, atan, atan2, atanh, bell, bernoulli, besseli, besselj, besselk, bessely, beta, betainc, betainc_regularized, binomial, bspline_basis, bspline_basis_set, carmichael, catalan, cbrt, ceiling, chebyshevt, chebyshevt_root, chebyshevu, chebyshevu_root, conjugate, cos, cosh, cot, coth, csc, csch, digamma, dirichlet_eta, elliptic_e, elliptic_f, elliptic_k, elliptic_pi, erf, erf2, erf2inv, erfc, erfcinv, erfi, erfinv, euler, exp, exp_polar, expint, factorial, factorial2, ff, fibonacci, floor, frac, fresnelc, fresnels, gamma, gegenbauer, genocchi, hankel1, hankel2, harmonic, hermite, hermite_prob, hn1, hn2, hyper, im, interpolating_spline, jacobi, jacobi_normalized, jn, jn_zeros, laguerre, legendre, lerchphi, li, ln, log, loggamma, lowergamma, lucas, marcumq, mathieuc, mathieucprime, mathieus, mathieusprime, meijerg, motzkin, multigamma, partition, periodic_argument, piecewise_exclusive, piecewise_fold, polar_lift, polarify, polygamma, polylog, principal_branch, re, real_root, rf, riemann_xi, root, sec, sech, sign, sin, sinc, sinh, sqrt, stieltjes, subfactorial, tan, tanh, transpose, tribonacci, trigamma, unbranched_argument, unpolarify, uppergamma, yn, zeta +from sympy.ntheory import Sieve, abundance, binomial_coefficients, binomial_coefficients_list, composite, compositepi, continued_fraction, continued_fraction_convergents, continued_fraction_iterator, continued_fraction_periodic, continued_fraction_reduce, cycle_length, discrete_log, divisor_count, divisors, egyptian_fraction, factorint, factorrat, is_abundant, is_amicable, is_deficient, is_mersenne_prime, is_nthpow_residue, is_perfect, is_primitive_root, is_quad_residue, isprime, mersenne_prime_exponent, multinomial_coefficients, multiplicity, n_order, nextprime, npartitions, nthroot_mod, perfect_power, pollard_pm1, pollard_rho, prevprime, prime, primefactors, primerange, primitive_root, primorial, proper_divisor_count, proper_divisors, quadratic_congruence, quadratic_residues, randprime, sieve, sqrt_mod, sqrt_mod_iter, totient, trailing, divisor_sigma, reduced_totient, primenu, primeomega, legendre_symbol,jacobi_symbol, mobius +from sympy.concrete import Product, Sum, product, summation +from sympy.discrete import convolution, covering_product, fft, fwht, ifft, ifwht, intersecting_product, intt, inverse_mobius_transform, mobius_transform, ntt +from sympy.simplify import EPath, FU, besselsimp, collect, collect_const, combsimp, cse, denom, epath, exptrigsimp, fraction, fu, gammasimp, hyperexpand, hypersimilar, hypersimp, kroneckersimp, logcombine, nsimplify, numer, posify, powdenest, powsimp, radsimp, ratsimp, ratsimpmodprime, rcollect, separatevars, signsimp, simplify, sqrtdenest, trigsimp +from sympy.sets import Complement, ComplexRegion, Complexes, ConditionSet, Contains, DisjointUnion, EmptySet, FiniteSet, ImageSet, Integers, Intersection, Interval, Naturals, Naturals0, OmegaPower, Ordinal, PowerSet, ProductSet, Range, Rationals, Reals, Set, SymmetricDifference, Union, UniversalSet, imageset, ord0 +from sympy.solvers import check_assumptions, checkodesol, checkpdesol, checksol, classify_ode, classify_pde, decompogen, det_quick, diophantine, dsolve, failing_assumptions, homogeneous_order, inv_quick, linear_eq_to_matrix, linsolve, nonlinsolve, nsolve, ode_order, pde_separate, pde_separate_add, pde_separate_mul, pdsolve, reduce_abs_inequalities, reduce_abs_inequality, reduce_inequalities, rsolve, rsolve_hyper, rsolve_poly, rsolve_ratio, solve, solve_linear, solve_linear_system, solve_linear_system_LU, solve_poly_inequality, solve_poly_system, solve_rational_inequalities, solve_triangulated, solve_undetermined_coeffs, solve_univariate_inequality, solveset, substitution +from sympy.matrices import Adjoint, BlockDiagMatrix, BlockMatrix, DeferredVector, Determinant, DiagMatrix, DiagonalMatrix, DiagonalOf, DotProduct, FunctionMatrix, GramSchmidt, HadamardPower, HadamardProduct, Identity, ImmutableDenseMatrix, ImmutableMatrix, ImmutableSparseMatrix, Inverse, KroneckerProduct, MatAdd, MatMul, MatPow, Matrix, MatrixBase, MatrixExpr, MatrixPermute, MatrixSlice, MatrixSymbol, MutableDenseMatrix, MutableMatrix, MutableSparseMatrix, NonSquareMatrixError, OneMatrix, Permanent, PermutationMatrix, ShapeError, SparseMatrix, Trace, Transpose, ZeroMatrix, banded, block_collapse, blockcut, casoratian, det, diag, diagonalize_vector, eye, hadamard_product, hessian, jordan_cell, kronecker_product, list2numpy, matrix2numpy, matrix_multiply_elementwise, matrix_symbols, ones, per, randMatrix, rot_axis1, rot_axis2, rot_axis3, rot_ccw_axis1, rot_ccw_axis2, rot_ccw_axis3, rot_givens, symarray, trace, wronskian, zeros +from sympy.geometry import Circle, Curve, Ellipse, GeometryError, Line, Line2D, Line3D, Parabola, Plane, Point, Point2D, Point3D, Polygon, Ray, Ray2D, Ray3D, RegularPolygon, Segment, Segment2D, Segment3D, Triangle, are_similar, centroid, closest_points, convex_hull, deg, farthest_points, idiff, intersection, rad +from sympy.utilities import capture, dict_merge, filldedent, flatten, group, has_dups, has_variety, lambdify, memoize_property, numbered_symbols, postfixes, prefixes, public, reshape, rotations, sift, subsets, take, threaded, timed, topological_sort, unflatten, variations, xthreaded, cartes +from sympy.integrals import CosineTransform, FourierTransform, HankelTransform, Integral, InverseCosineTransform, InverseFourierTransform, InverseHankelTransform, InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform, LaplaceTransform, MellinTransform, SineTransform, cosine_transform, fourier_transform, hankel_transform, integrate, inverse_cosine_transform, inverse_fourier_transform, inverse_hankel_transform, inverse_laplace_transform, inverse_mellin_transform, inverse_sine_transform, laplace_transform, line_integrate, mellin_transform, sine_transform, singularityintegrate +from sympy.tensor import Array, DenseNDimArray, Idx, ImmutableDenseNDimArray, ImmutableSparseNDimArray, Indexed, IndexedBase, MutableDenseNDimArray, MutableSparseNDimArray, NDimArray, SparseNDimArray, derive_by_array, get_contraction_structure, get_indices, permutedims, shape, tensorcontraction, tensordiagonal, tensorproduct +from sympy.parsing import parse_expr +from sympy.calculus import AccumBounds, apply_finite_diff, differentiate_finite, euler_equations, finite_diff_weights, is_convex, is_decreasing, is_increasing, is_monotonic, is_strictly_decreasing, is_strictly_increasing, maximum, minimum, not_empty_in, periodicity, singularities, stationary_points +from sympy.algebras import Quaternion +from sympy.printing import StrPrinter, TableForm, ccode, cxxcode, dotprint, fcode, glsl_code, jscode, julia_code, latex, maple_code, mathematica_code, mathml, multiline_latex, octave_code, pager_print, pprint, pprint_try_use_unicode, pprint_use_unicode, pretty, pretty_print, preview, print_ccode, print_fcode, print_glsl, print_gtk, print_jscode, print_latex, print_maple_code, print_mathml, print_python, print_rcode, print_tree, pycode, python, rcode, rust_code, smtlib_code, srepr, sstr, sstrrepr +from sympy.plotting import plot, plot_backends, plot_implicit, plot_parametric, textplot +from sympy.interactive import init_printing, init_session, interactive_traversal + +if sys.version_info < (3, 8): + ... +if 'dev' in __version__: + def enable_warnings() -> None: + ... + +SYMPY_DEBUG: bool = ... +test = ... +doctest = ... +__all__ = ['__version__', 'sympify', 'SympifyError', 'cacheit', 'Basic', 'Atom', 'preorder_traversal', 'S', 'Expr', 'AtomicExpr', 'UnevaluatedExpr', 'Symbol', 'Wild', 'Dummy', 'symbols', 'var', 'Number', 'Float', 'Rational', 'Integer', 'NumberSymbol', 'RealNumber', 'igcd', 'ilcm', 'seterr', 'E', 'I', 'nan', 'oo', 'pi', 'zoo', 'AlgebraicNumber', 'comp', 'mod_inverse', 'Pow', 'integer_nthroot', 'integer_log', 'Mul', 'prod', 'Add', 'Mod', 'Rel', 'Eq', 'Ne', 'Lt', 'Le', 'Gt', 'Ge', 'Equality', 'GreaterThan', 'LessThan', 'Unequality', 'StrictGreaterThan', 'StrictLessThan', 'vectorize', 'Lambda', 'WildFunction', 'Derivative', 'diff', 'FunctionClass', 'Function', 'Subs', 'expand', 'PoleError', 'count_ops', 'expand_mul', 'expand_log', 'expand_func', 'expand_trig', 'expand_complex', 'expand_multinomial', 'nfloat', 'expand_power_base', 'expand_power_exp', 'arity', 'PrecisionExhausted', 'N', 'evalf', 'Tuple', 'Dict', 'gcd_terms', 'factor_terms', 'factor_nc', 'evaluate', 'Catalan', 'EulerGamma', 'GoldenRatio', 'TribonacciConstant', 'bottom_up', 'use', 'postorder_traversal', 'default_sort_key', 'ordered', 'to_cnf', 'to_dnf', 'to_nnf', 'And', 'Or', 'Not', 'Xor', 'Nand', 'Nor', 'Implies', 'Equivalent', 'ITE', 'POSform', 'SOPform', 'simplify_logic', 'bool_map', 'true', 'false', 'satisfiable', 'AppliedPredicate', 'Predicate', 'AssumptionsContext', 'assuming', 'Q', 'ask', 'register_handler', 'remove_handler', 'refine', 'Poly', 'PurePoly', 'poly_from_expr', 'parallel_poly_from_expr', 'degree', 'total_degree', 'degree_list', 'LC', 'LM', 'LT', 'pdiv', 'prem', 'pquo', 'pexquo', 'div', 'rem', 'quo', 'exquo', 'half_gcdex', 'gcdex', 'invert', 'subresultants', 'resultant', 'discriminant', 'cofactors', 'gcd_list', 'gcd', 'lcm_list', 'lcm', 'terms_gcd', 'trunc', 'monic', 'content', 'primitive', 'compose', 'decompose', 'sturm', 'gff_list', 'gff', 'sqf_norm', 'sqf_part', 'sqf_list', 'sqf', 'factor_list', 'factor', 'intervals', 'refine_root', 'count_roots', 'real_roots', 'nroots', 'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced', 'groebner', 'is_zero_dimensional', 'GroebnerBasis', 'poly', 'symmetrize', 'horner', 'interpolate', 'rational_interpolate', 'viete', 'together', 'BasePolynomialError', 'ExactQuotientFailed', 'PolynomialDivisionFailed', 'OperationNotSupported', 'HeuristicGCDFailed', 'HomomorphismFailed', 'IsomorphismFailed', 'ExtraneousFactors', 'EvaluationFailed', 'RefinementFailed', 'CoercionFailed', 'NotInvertible', 'NotReversible', 'NotAlgebraic', 'DomainError', 'PolynomialError', 'UnificationFailed', 'GeneratorsError', 'GeneratorsNeeded', 'ComputationFailed', 'UnivariatePolynomialError', 'MultivariatePolynomialError', 'PolificationFailed', 'OptionError', 'FlagError', 'minpoly', 'minimal_polynomial', 'primitive_element', 'field_isomorphism', 'to_number_field', 'isolate', 'round_two', 'prime_decomp', 'prime_valuation', 'galois_group', 'itermonomials', 'Monomial', 'lex', 'grlex', 'grevlex', 'ilex', 'igrlex', 'igrevlex', 'CRootOf', 'rootof', 'RootOf', 'ComplexRootOf', 'RootSum', 'roots', 'Domain', 'FiniteField', 'IntegerRing', 'RationalField', 'RealField', 'ComplexField', 'PythonFiniteField', 'GMPYFiniteField', 'PythonIntegerRing', 'GMPYIntegerRing', 'PythonRational', 'GMPYRationalField', 'AlgebraicField', 'PolynomialRing', 'FractionField', 'ExpressionDomain', 'FF_python', 'FF_gmpy', 'ZZ_python', 'ZZ_gmpy', 'QQ_python', 'QQ_gmpy', 'GF', 'FF', 'ZZ', 'QQ', 'ZZ_I', 'QQ_I', 'RR', 'CC', 'EX', 'EXRAW', 'construct_domain', 'swinnerton_dyer_poly', 'cyclotomic_poly', 'symmetric_poly', 'random_poly', 'interpolating_poly', 'jacobi_poly', 'chebyshevt_poly', 'chebyshevu_poly', 'hermite_poly', 'hermite_prob_poly', 'legendre_poly', 'laguerre_poly', 'apart', 'apart_list', 'assemble_partfrac_list', 'Options', 'ring', 'xring', 'vring', 'sring', 'field', 'xfield', 'vfield', 'sfield', 'Order', 'O', 'limit', 'Limit', 'gruntz', 'series', 'approximants', 'residue', 'EmptySequence', 'SeqPer', 'SeqFormula', 'sequence', 'SeqAdd', 'SeqMul', 'fourier_series', 'fps', 'difference_delta', 'limit_seq', 'factorial', 'factorial2', 'rf', 'ff', 'binomial', 'RisingFactorial', 'FallingFactorial', 'subfactorial', 'carmichael', 'fibonacci', 'lucas', 'motzkin', 'tribonacci', 'harmonic', 'bernoulli', 'bell', 'euler', 'catalan', 'genocchi', 'andre', 'partition', 'sqrt', 'root', 'Min', 'Max', 'Id', 'real_root', 'Rem', 'cbrt', 're', 'im', 'sign', 'Abs', 'conjugate', 'arg', 'polar_lift', 'periodic_argument', 'unbranched_argument', 'principal_branch', 'transpose', 'adjoint', 'polarify', 'unpolarify', 'sin', 'cos', 'tan', 'sec', 'csc', 'cot', 'sinc', 'asin', 'acos', 'atan', 'asec', 'acsc', 'acot', 'atan2', 'exp_polar', 'exp', 'ln', 'log', 'LambertW', 'sinh', 'cosh', 'tanh', 'coth', 'sech', 'csch', 'asinh', 'acosh', 'atanh', 'acoth', 'asech', 'acsch', 'floor', 'ceiling', 'frac', 'Piecewise', 'piecewise_fold', 'piecewise_exclusive', 'erf', 'erfc', 'erfi', 'erf2', 'erfinv', 'erfcinv', 'erf2inv', 'Ei', 'expint', 'E1', 'li', 'Li', 'Si', 'Ci', 'Shi', 'Chi', 'fresnels', 'fresnelc', 'gamma', 'lowergamma', 'uppergamma', 'polygamma', 'loggamma', 'digamma', 'trigamma', 'multigamma', 'dirichlet_eta', 'zeta', 'lerchphi', 'polylog', 'stieltjes', 'Eijk', 'LeviCivita', 'KroneckerDelta', 'SingularityFunction', 'DiracDelta', 'Heaviside', 'bspline_basis', 'bspline_basis_set', 'interpolating_spline', 'besselj', 'bessely', 'besseli', 'besselk', 'hankel1', 'hankel2', 'jn', 'yn', 'jn_zeros', 'hn1', 'hn2', 'airyai', 'airybi', 'airyaiprime', 'airybiprime', 'marcumq', 'hyper', 'meijerg', 'appellf1', 'legendre', 'assoc_legendre', 'hermite', 'hermite_prob', 'chebyshevt', 'chebyshevu', 'chebyshevu_root', 'chebyshevt_root', 'laguerre', 'assoc_laguerre', 'gegenbauer', 'jacobi', 'jacobi_normalized', 'Ynm', 'Ynm_c', 'Znm', 'elliptic_k', 'elliptic_f', 'elliptic_e', 'elliptic_pi', 'beta', 'mathieus', 'mathieuc', 'mathieusprime', 'mathieucprime', 'riemann_xi', 'betainc', 'betainc_regularized', 'nextprime', 'prevprime', 'prime', 'primerange', 'randprime', 'Sieve', 'sieve', 'primorial', 'cycle_length', 'composite', 'compositepi', 'isprime', 'divisors', 'proper_divisors', 'factorint', 'multiplicity', 'perfect_power', 'pollard_pm1', 'pollard_rho', 'primefactors', 'totient', 'trailing', 'divisor_count', 'proper_divisor_count', 'divisor_sigma', 'factorrat', 'reduced_totient', 'primenu', 'primeomega', 'mersenne_prime_exponent', 'is_perfect', 'is_mersenne_prime', 'is_abundant', 'is_deficient', 'is_amicable', 'abundance', 'npartitions', 'is_primitive_root', 'is_quad_residue', 'legendre_symbol', 'jacobi_symbol', 'n_order', 'sqrt_mod', 'quadratic_residues', 'primitive_root', 'nthroot_mod', 'is_nthpow_residue', 'sqrt_mod_iter', 'mobius', 'discrete_log', 'quadratic_congruence', 'binomial_coefficients', 'binomial_coefficients_list', 'multinomial_coefficients', 'continued_fraction_periodic', 'continued_fraction_iterator', 'continued_fraction_reduce', 'continued_fraction_convergents', 'continued_fraction', 'egyptian_fraction', 'product', 'Product', 'summation', 'Sum', 'fft', 'ifft', 'ntt', 'intt', 'fwht', 'ifwht', 'mobius_transform', 'inverse_mobius_transform', 'convolution', 'covering_product', 'intersecting_product', 'simplify', 'hypersimp', 'hypersimilar', 'logcombine', 'separatevars', 'posify', 'besselsimp', 'kroneckersimp', 'signsimp', 'nsimplify', 'FU', 'fu', 'sqrtdenest', 'cse', 'epath', 'EPath', 'hyperexpand', 'collect', 'rcollect', 'radsimp', 'collect_const', 'fraction', 'numer', 'denom', 'trigsimp', 'exptrigsimp', 'powsimp', 'powdenest', 'combsimp', 'gammasimp', 'ratsimp', 'ratsimpmodprime', 'Set', 'Interval', 'Union', 'EmptySet', 'FiniteSet', 'ProductSet', 'Intersection', 'imageset', 'DisjointUnion', 'Complement', 'SymmetricDifference', 'ImageSet', 'Range', 'ComplexRegion', 'Reals', 'Contains', 'ConditionSet', 'Ordinal', 'OmegaPower', 'ord0', 'PowerSet', 'Naturals', 'Naturals0', 'UniversalSet', 'Integers', 'Rationals', 'Complexes', 'solve', 'solve_linear_system', 'solve_linear_system_LU', 'solve_undetermined_coeffs', 'nsolve', 'solve_linear', 'checksol', 'det_quick', 'inv_quick', 'check_assumptions', 'failing_assumptions', 'diophantine', 'rsolve', 'rsolve_poly', 'rsolve_ratio', 'rsolve_hyper', 'checkodesol', 'classify_ode', 'dsolve', 'homogeneous_order', 'solve_poly_system', 'solve_triangulated', 'pde_separate', 'pde_separate_add', 'pde_separate_mul', 'pdsolve', 'classify_pde', 'checkpdesol', 'ode_order', 'reduce_inequalities', 'reduce_abs_inequality', 'reduce_abs_inequalities', 'solve_poly_inequality', 'solve_rational_inequalities', 'solve_univariate_inequality', 'decompogen', 'solveset', 'linsolve', 'linear_eq_to_matrix', 'nonlinsolve', 'substitution', 'ShapeError', 'NonSquareMatrixError', 'GramSchmidt', 'casoratian', 'diag', 'eye', 'hessian', 'jordan_cell', 'list2numpy', 'matrix2numpy', 'matrix_multiply_elementwise', 'ones', 'randMatrix', 'rot_axis1', 'rot_axis2', 'rot_axis3', 'symarray', 'wronskian', 'zeros', 'MutableDenseMatrix', 'DeferredVector', 'MatrixBase', 'Matrix', 'MutableMatrix', 'MutableSparseMatrix', 'banded', 'ImmutableDenseMatrix', 'ImmutableSparseMatrix', 'ImmutableMatrix', 'SparseMatrix', 'MatrixSlice', 'BlockDiagMatrix', 'BlockMatrix', 'FunctionMatrix', 'Identity', 'Inverse', 'MatAdd', 'MatMul', 'MatPow', 'MatrixExpr', 'MatrixSymbol', 'Trace', 'Transpose', 'ZeroMatrix', 'OneMatrix', 'blockcut', 'block_collapse', 'matrix_symbols', 'Adjoint', 'hadamard_product', 'HadamardProduct', 'HadamardPower', 'Determinant', 'det', 'diagonalize_vector', 'DiagMatrix', 'DiagonalMatrix', 'DiagonalOf', 'trace', 'DotProduct', 'kronecker_product', 'KroneckerProduct', 'PermutationMatrix', 'MatrixPermute', 'Permanent', 'per', 'rot_ccw_axis1', 'rot_ccw_axis2', 'rot_ccw_axis3', 'rot_givens', 'Point', 'Point2D', 'Point3D', 'Line', 'Ray', 'Segment', 'Line2D', 'Segment2D', 'Ray2D', 'Line3D', 'Segment3D', 'Ray3D', 'Plane', 'Ellipse', 'Circle', 'Polygon', 'RegularPolygon', 'Triangle', 'rad', 'deg', 'are_similar', 'centroid', 'convex_hull', 'idiff', 'intersection', 'closest_points', 'farthest_points', 'GeometryError', 'Curve', 'Parabola', 'flatten', 'group', 'take', 'subsets', 'variations', 'numbered_symbols', 'cartes', 'capture', 'dict_merge', 'prefixes', 'postfixes', 'sift', 'topological_sort', 'unflatten', 'has_dups', 'has_variety', 'reshape', 'rotations', 'filldedent', 'lambdify', 'threaded', 'xthreaded', 'public', 'memoize_property', 'timed', 'integrate', 'Integral', 'line_integrate', 'mellin_transform', 'inverse_mellin_transform', 'MellinTransform', 'InverseMellinTransform', 'laplace_transform', 'inverse_laplace_transform', 'LaplaceTransform', 'InverseLaplaceTransform', 'fourier_transform', 'inverse_fourier_transform', 'FourierTransform', 'InverseFourierTransform', 'sine_transform', 'inverse_sine_transform', 'SineTransform', 'InverseSineTransform', 'cosine_transform', 'inverse_cosine_transform', 'CosineTransform', 'InverseCosineTransform', 'hankel_transform', 'inverse_hankel_transform', 'HankelTransform', 'InverseHankelTransform', 'singularityintegrate', 'IndexedBase', 'Idx', 'Indexed', 'get_contraction_structure', 'get_indices', 'shape', 'MutableDenseNDimArray', 'ImmutableDenseNDimArray', 'MutableSparseNDimArray', 'ImmutableSparseNDimArray', 'NDimArray', 'tensorproduct', 'tensorcontraction', 'tensordiagonal', 'derive_by_array', 'permutedims', 'Array', 'DenseNDimArray', 'SparseNDimArray', 'parse_expr', 'euler_equations', 'singularities', 'is_increasing', 'is_strictly_increasing', 'is_decreasing', 'is_strictly_decreasing', 'is_monotonic', 'finite_diff_weights', 'apply_finite_diff', 'differentiate_finite', 'periodicity', 'not_empty_in', 'AccumBounds', 'is_convex', 'stationary_points', 'minimum', 'maximum', 'Quaternion', 'pager_print', 'pretty', 'pretty_print', 'pprint', 'pprint_use_unicode', 'pprint_try_use_unicode', 'latex', 'print_latex', 'multiline_latex', 'mathml', 'print_mathml', 'python', 'print_python', 'pycode', 'ccode', 'print_ccode', 'smtlib_code', 'glsl_code', 'print_glsl', 'cxxcode', 'fcode', 'print_fcode', 'rcode', 'print_rcode', 'jscode', 'print_jscode', 'julia_code', 'mathematica_code', 'octave_code', 'rust_code', 'print_gtk', 'preview', 'srepr', 'print_tree', 'StrPrinter', 'sstr', 'sstrrepr', 'TableForm', 'dotprint', 'maple_code', 'print_maple_code', 'plot', 'textplot', 'plot_backends', 'plot_implicit', 'plot_parametric', 'init_session', 'init_printing', 'interactive_traversal', 'test', 'doctest'] diff --git a/stubs/sympy-stubs/algebras/__init__.pyi b/stubs/sympy-stubs/algebras/__init__.pyi new file mode 100644 index 00000000..82027a46 --- /dev/null +++ b/stubs/sympy-stubs/algebras/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.algebras.quaternion import Quaternion + +__all__ = ["Quaternion"] diff --git a/stubs/sympy-stubs/algebras/quaternion.pyi b/stubs/sympy-stubs/algebras/quaternion.pyi new file mode 100644 index 00000000..03c7f889 --- /dev/null +++ b/stubs/sympy-stubs/algebras/quaternion.pyi @@ -0,0 +1,173 @@ +from types import NotImplementedType +from typing import Any, Literal, Self +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.core.power import Pow +from sympy.matrices.dense import MutableDenseMatrix + +class Quaternion(Expr): + _op_priority = ... + is_commutative = ... + def __new__(cls, a=..., b=..., c=..., d=..., real_field=..., norm=...) -> Self: + ... + + def set_norm(self, norm) -> None: + ... + + @property + def a(self): + ... + + @property + def b(self): + ... + + @property + def c(self): + ... + + @property + def d(self): + ... + + @property + def real_field(self): + ... + + @property + def product_matrix_left(self) -> MutableDenseMatrix: + ... + + @property + def product_matrix_right(self) -> MutableDenseMatrix: + ... + + def to_Matrix(self, vector_only=...) -> MutableDenseMatrix: + ... + + @classmethod + def from_Matrix(cls, elements) -> Quaternion: + ... + + @classmethod + def from_euler(cls, angles, seq) -> Any: + ... + + def to_euler(self, seq, angle_addition=..., avoid_square_root=...) -> tuple[int, ...]: + ... + + @classmethod + def from_axis_angle(cls, vector, angle) -> Self: + ... + + @classmethod + def from_rotation_matrix(cls, M) -> Quaternion: + ... + + def __add__(self, other) -> Quaternion: + ... + + def __radd__(self, other) -> Quaternion: + ... + + def __sub__(self, other) -> Quaternion: + ... + + def __mul__(self, other) -> Quaternion: + ... + + def __rmul__(self, other) -> Quaternion: + ... + + def __pow__(self, p) -> NotImplementedType | Quaternion | Literal[1]: + ... + + def __neg__(self) -> Quaternion: + ... + + def __truediv__(self, other): + ... + + def __rtruediv__(self, other): + ... + + def diff(self, *symbols, **kwargs) -> Self: + ... + + def add(self, other) -> Quaternion: + ... + + def mul(self, other) -> Quaternion: + ... + + def norm(self) -> Pow: + ... + + def normalize(self): + ... + + def inverse(self): + ... + + def pow(self, p) -> NotImplementedType | Quaternion | Literal[1]: + ... + + def exp(self) -> Quaternion: + ... + + def pow_cos_sin(self, p): + ... + + def integrate(self, *args) -> Quaternion: + ... + + @staticmethod + def rotate_point(pin, r) -> tuple[Any, Any, Any]: + ... + + def to_axis_angle(self) -> tuple[tuple[Any, Any, Any], Any]: + ... + + def to_rotation_matrix(self, v=..., homogeneous=...) -> MutableDenseMatrix: + ... + + def scalar_part(self): + ... + + def vector_part(self) -> Quaternion: + ... + + def axis(self) -> Quaternion: + ... + + def is_pure(self): + ... + + def is_zero_quaternion(self) -> bool | None: + ... + + def angle(self) -> type[UndefinedFunction]: + ... + + def arc_coplanar(self, other) -> bool | None: + ... + + @classmethod + def vector_coplanar(cls, q1, q2, q3) -> Any | bool | None: + ... + + def parallel(self, other): + ... + + def orthogonal(self, other): + ... + + def index_vector(self) -> Quaternion: + ... + + def mensor(self) -> type[UndefinedFunction]: + ... + + + diff --git a/stubs/sympy-stubs/assumptions/__init__.pyi b/stubs/sympy-stubs/assumptions/__init__.pyi new file mode 100644 index 00000000..6a69cd0a --- /dev/null +++ b/stubs/sympy-stubs/assumptions/__init__.pyi @@ -0,0 +1,6 @@ +from sympy.assumptions.assume import AppliedPredicate, AssumptionsContext, Predicate, assuming, global_assumptions +from sympy.assumptions.ask import Q, ask, register_handler, remove_handler +from sympy.assumptions.refine import refine +from sympy.assumptions.relation import AppliedBinaryRelation, BinaryRelation + +__all__ = ['AppliedPredicate', 'Predicate', 'AssumptionsContext', 'assuming', 'global_assumptions', 'Q', 'ask', 'register_handler', 'remove_handler', 'refine', 'BinaryRelation', 'AppliedBinaryRelation'] diff --git a/stubs/sympy-stubs/assumptions/ask.pyi b/stubs/sympy-stubs/assumptions/ask.pyi new file mode 100644 index 00000000..c24e4cf2 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/ask.pyi @@ -0,0 +1,243 @@ +from sympy.assumptions.assume import UndefinedPredicate +from sympy.assumptions.predicates.sets import * +from sympy.assumptions.predicates.calculus import * +from sympy.assumptions.predicates.order import * +from sympy.assumptions.predicates.ntheory import * +from sympy.assumptions.predicates.common import * +from sympy.assumptions.predicates.matrices import * +from sympy.assumptions.relation.equality import * +from sympy.utilities.decorator import memoize_property + +class AssumptionKeys: + @memoize_property + def hermitian(self) -> UndefinedPredicate | HermitianPredicate: + ... + + @memoize_property + def antihermitian(self) -> UndefinedPredicate | AntihermitianPredicate: + ... + + @memoize_property + def real(self) -> UndefinedPredicate | RealPredicate: + ... + + @memoize_property + def extended_real(self) -> UndefinedPredicate | ExtendedRealPredicate: + ... + + @memoize_property + def imaginary(self) -> UndefinedPredicate | ImaginaryPredicate: + ... + + @memoize_property + def complex(self) -> UndefinedPredicate | ComplexPredicate: + ... + + @memoize_property + def algebraic(self) -> UndefinedPredicate | AlgebraicPredicate: + ... + + @memoize_property + def transcendental(self) -> UndefinedPredicate | TranscendentalPredicate: + ... + + @memoize_property + def integer(self) -> UndefinedPredicate | IntegerPredicate: + ... + + @memoize_property + def rational(self) -> UndefinedPredicate | RationalPredicate: + ... + + @memoize_property + def irrational(self) -> UndefinedPredicate | IrrationalPredicate: + ... + + @memoize_property + def finite(self) -> UndefinedPredicate | FinitePredicate: + ... + + @memoize_property + def infinite(self) -> UndefinedPredicate | InfinitePredicate: + ... + + @memoize_property + def positive_infinite(self) -> UndefinedPredicate | PositiveInfinitePredicate: + ... + + @memoize_property + def negative_infinite(self) -> UndefinedPredicate | NegativeInfinitePredicate: + ... + + @memoize_property + def positive(self) -> UndefinedPredicate | PositivePredicate: + ... + + @memoize_property + def negative(self) -> UndefinedPredicate | NegativePredicate: + ... + + @memoize_property + def zero(self) -> UndefinedPredicate | ZeroPredicate: + ... + + @memoize_property + def extended_positive(self) -> UndefinedPredicate | ExtendedPositivePredicate: + ... + + @memoize_property + def extended_negative(self) -> UndefinedPredicate | ExtendedNegativePredicate: + ... + + @memoize_property + def nonzero(self) -> UndefinedPredicate | NonZeroPredicate: + ... + + @memoize_property + def nonpositive(self) -> UndefinedPredicate | NonPositivePredicate: + ... + + @memoize_property + def nonnegative(self) -> UndefinedPredicate | NonNegativePredicate: + ... + + @memoize_property + def extended_nonzero(self) -> UndefinedPredicate | ExtendedNonZeroPredicate: + ... + + @memoize_property + def extended_nonpositive(self) -> UndefinedPredicate | ExtendedNonPositivePredicate: + ... + + @memoize_property + def extended_nonnegative(self) -> UndefinedPredicate | ExtendedNonNegativePredicate: + ... + + @memoize_property + def even(self) -> UndefinedPredicate | EvenPredicate: + ... + + @memoize_property + def odd(self) -> UndefinedPredicate | OddPredicate: + ... + + @memoize_property + def prime(self) -> UndefinedPredicate | PrimePredicate: + ... + + @memoize_property + def composite(self) -> UndefinedPredicate | CompositePredicate: + ... + + @memoize_property + def commutative(self) -> UndefinedPredicate | CommutativePredicate: + ... + + @memoize_property + def is_true(self) -> UndefinedPredicate | IsTruePredicate: + ... + + @memoize_property + def symmetric(self) -> UndefinedPredicate | SymmetricPredicate: + ... + + @memoize_property + def invertible(self) -> UndefinedPredicate | InvertiblePredicate: + ... + + @memoize_property + def orthogonal(self) -> UndefinedPredicate | OrthogonalPredicate: + ... + + @memoize_property + def unitary(self) -> UndefinedPredicate | UnitaryPredicate: + ... + + @memoize_property + def positive_definite(self) -> UndefinedPredicate | PositiveDefinitePredicate: + ... + + @memoize_property + def upper_triangular(self) -> UndefinedPredicate | UpperTriangularPredicate: + ... + + @memoize_property + def lower_triangular(self) -> UndefinedPredicate | LowerTriangularPredicate: + ... + + @memoize_property + def diagonal(self) -> UndefinedPredicate | DiagonalPredicate: + ... + + @memoize_property + def fullrank(self) -> UndefinedPredicate | FullRankPredicate: + ... + + @memoize_property + def square(self) -> UndefinedPredicate | SquarePredicate: + ... + + @memoize_property + def integer_elements(self) -> UndefinedPredicate | IntegerElementsPredicate: + ... + + @memoize_property + def real_elements(self) -> UndefinedPredicate | RealElementsPredicate: + ... + + @memoize_property + def complex_elements(self) -> UndefinedPredicate | ComplexElementsPredicate: + ... + + @memoize_property + def singular(self) -> UndefinedPredicate | SingularPredicate: + ... + + @memoize_property + def normal(self) -> UndefinedPredicate | NormalPredicate: + ... + + @memoize_property + def triangular(self) -> UndefinedPredicate | TriangularPredicate: + ... + + @memoize_property + def unit_triangular(self) -> UndefinedPredicate | UnitTriangularPredicate: + ... + + @memoize_property + def eq(self) -> UndefinedPredicate | EqualityPredicate: + ... + + @memoize_property + def ne(self) -> UndefinedPredicate | UnequalityPredicate: + ... + + @memoize_property + def gt(self) -> UndefinedPredicate | StrictGreaterThanPredicate: + ... + + @memoize_property + def ge(self) -> UndefinedPredicate | GreaterThanPredicate: + ... + + @memoize_property + def lt(self) -> UndefinedPredicate | StrictLessThanPredicate: + ... + + @memoize_property + def le(self) -> UndefinedPredicate | LessThanPredicate: + ... + + + +Q = ... +def ask(proposition, assumptions=..., context=...) -> bool | None: + ... + +def register_handler(key, handler) -> None: + ... + +def remove_handler(key, handler) -> None: + ... + diff --git a/stubs/sympy-stubs/assumptions/ask_generated.pyi b/stubs/sympy-stubs/assumptions/ask_generated.pyi new file mode 100644 index 00000000..4f740c1e --- /dev/null +++ b/stubs/sympy-stubs/assumptions/ask_generated.pyi @@ -0,0 +1,12 @@ +from typing import Any +from sympy.assumptions.cnf import AND, OR, Literal +from sympy.core.cache import cacheit + +@cacheit +def get_all_known_facts() -> set[frozenset[OR | AND | Literal]]: + ... + +@cacheit +def get_known_facts_dict() -> dict[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/assumptions/assume.pyi b/stubs/sympy-stubs/assumptions/assume.pyi new file mode 100644 index 00000000..98bd9b01 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/assume.pyi @@ -0,0 +1,100 @@ +from contextlib import contextmanager +from typing import Any, Callable, Generator, Self +from sympy.core.basic import Basic +from sympy.logic.boolalg import Boolean + +class AssumptionsContext(set): + def add(self, *assumptions) -> None: + ... + + + +global_assumptions = ... +class AppliedPredicate(Boolean): + __slots__ = ... + def __new__(cls, predicate, *args) -> Self: + ... + + @property + def arg(self) -> Basic: + ... + + @property + def function(self) -> Basic: + ... + + @property + def arguments(self) -> tuple[Basic, ...]: + ... + + @property + def binary_symbols(self) -> set[Basic] | set[Any]: + ... + + + +class PredicateMeta(type): + def __new__(cls, clsname, bases, dct) -> Self: # type: ignore + ... + + @property + def __doc__(cls): + ... + + + +class Predicate(Boolean, metaclass=PredicateMeta): + is_Atom = ... + def __new__(cls, *args, **kwargs) -> UndefinedPredicate | Self: + ... + + @property + def name(self) -> str: + ... + + @classmethod + def register(cls, *types, **kwargs): + ... + + @classmethod + def register_many(cls, *types, **kwargs) -> Callable[..., None]: + ... + + def __call__(self, *args) -> AppliedPredicate: + ... + + def eval(self, args, assumptions=...) -> None: + ... + + + +class UndefinedPredicate(Predicate): + handler = ... + def __new__(cls, name, handlers=...) -> Self: + ... + + @property + def name(self) -> Basic: + ... + + def __getnewargs__(self) -> tuple[Basic]: + ... + + def __call__(self, expr) -> AppliedPredicate: + ... + + def add_handler(self, handler) -> None: + ... + + def remove_handler(self, handler) -> None: + ... + + def eval(self, args, assumptions=...) -> Any | None: + ... + + + +@contextmanager +def assuming(*assumptions) -> Generator[None, Any, None]: + ... + diff --git a/stubs/sympy-stubs/assumptions/cnf.pyi b/stubs/sympy-stubs/assumptions/cnf.pyi new file mode 100644 index 00000000..08dff1a7 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/cnf.pyi @@ -0,0 +1,169 @@ +from typing import Any, Self +from sympy.core.logic import And + +class Literal: + def __new__(cls, lit, is_Not=...) -> OR | AND | Literal | Self: + ... + + @property + def arg(self): + ... + + def rcall(self, expr) -> Self: + ... + + def __invert__(self) -> Literal: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +class OR: + def __init__(self, *args) -> None: + ... + + @property + def args(self) -> list[Any]: + ... + + def rcall(self, expr) -> Self: + ... + + def __invert__(self) -> AND: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + + +class AND: + def __init__(self, *args) -> None: + ... + + def __invert__(self) -> OR: + ... + + @property + def args(self) -> list[Any]: + ... + + def rcall(self, expr) -> Self: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + + +def to_NNF(expr, composite_map=...) -> OR | AND | Literal: + ... + +def distribute_AND_over_OR(expr) -> CNF | None: + ... + +class CNF: + def __init__(self, clauses=...) -> None: + ... + + def add(self, prop) -> None: + ... + + def __str__(self) -> str: + ... + + def extend(self, props) -> Self: + ... + + def copy(self) -> CNF: + ... + + def add_clauses(self, clauses) -> None: + ... + + @classmethod + def from_prop(cls, prop) -> Self: + ... + + def __iand__(self, other) -> Self: + ... + + def all_predicates(self) -> set[Any]: + ... + + def rcall(self, expr) -> CNF | None: + ... + + @classmethod + def all_or(cls, *cnfs): + ... + + @classmethod + def all_and(cls, *cnfs): + ... + + @classmethod + def to_CNF(cls, expr) -> CNF | None: + ... + + @classmethod + def CNF_to_cnf(cls, cnf) -> And: + ... + + + +class EncodedCNF: + def __init__(self, data=..., encoding=...) -> None: + ... + + def from_cnf(self, cnf) -> None: + ... + + @property + def symbols(self) -> list[Any]: + ... + + @property + def variables(self) -> range: + ... + + def copy(self) -> EncodedCNF: + ... + + def add_prop(self, prop) -> None: + ... + + def add_from_cnf(self, cnf) -> None: + ... + + def encode_arg(self, arg) -> int: + ... + + def encode(self, clause) -> set[int | Any]: + ... + + + diff --git a/stubs/sympy-stubs/assumptions/facts.pyi b/stubs/sympy-stubs/assumptions/facts.pyi new file mode 100644 index 00000000..e510f35d --- /dev/null +++ b/stubs/sympy-stubs/assumptions/facts.pyi @@ -0,0 +1,25 @@ +from typing import Any +from sympy.core.cache import cacheit +from sympy.core.logic import And + +@cacheit +def get_composite_predicates() -> dict[Any, Any]: + ... + +@cacheit +def get_known_facts(x=...) -> And: + ... + +def generate_known_facts_dict(keys, fact) -> dict[Any, Any]: + ... + +@cacheit +def get_known_facts_keys() -> list[Any]: + ... + +def single_fact_lookup(known_facts_keys, known_facts_cnf) -> dict[Any, Any]: + ... + +def ask_full_inference(proposition, assumptions, known_facts_cnf) -> bool | None: + ... + diff --git a/stubs/sympy-stubs/assumptions/handlers/__init__.pyi b/stubs/sympy-stubs/assumptions/handlers/__init__.pyi new file mode 100644 index 00000000..89ccaafa --- /dev/null +++ b/stubs/sympy-stubs/assumptions/handlers/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.assumptions.handlers.common import AskHandler, CommonHandler, test_closed_group + +__all__ = ['AskHandler', 'CommonHandler', 'test_closed_group'] diff --git a/stubs/sympy-stubs/assumptions/handlers/calculus.pyi b/stubs/sympy-stubs/assumptions/handlers/calculus.pyi new file mode 100644 index 00000000..f1cb208a --- /dev/null +++ b/stubs/sympy-stubs/assumptions/handlers/calculus.pyi @@ -0,0 +1,62 @@ +from typing import Literal +from sympy.core import Add, Mul, Pow, Symbol +from sympy.core.numbers import ComplexInfinity, Exp1, GoldenRatio, ImaginaryUnit, Infinity, NaN, NegativeInfinity, Number, Pi, TribonacciConstant +from sympy.functions import cos, exp, log, sign, sin +from sympy.assumptions.predicates.calculus import FinitePredicate, InfinitePredicate, NegativeInfinitePredicate, PositiveInfinitePredicate + +@FinitePredicate.register(Symbol) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@FinitePredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@FinitePredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@FinitePredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@FinitePredicate.register(exp) +def _(expr, assumptions) -> bool | None: + ... + +@FinitePredicate.register(log) +def _(expr, assumptions) -> bool | None: + ... + +@FinitePredicate.register_many(cos, sin, Number, Pi, Exp1, GoldenRatio, TribonacciConstant, ImaginaryUnit, sign) +def _(expr, assumptions) -> Literal[True]: + ... + +@FinitePredicate.register_many(ComplexInfinity, Infinity, NegativeInfinity) +def _(expr, assumptions) -> Literal[False]: + ... + +@FinitePredicate.register(NaN) +def _(expr, assumptions) -> None: + ... + +@InfinitePredicate.register_many(ComplexInfinity, Infinity, NegativeInfinity) +def _(expr, assumptions) -> Literal[True]: + ... + +@PositiveInfinitePredicate.register(Infinity) +def _(expr, assumptions) -> Literal[True]: + ... + +@PositiveInfinitePredicate.register_many(NegativeInfinity, ComplexInfinity) +def _(expr, assumptions) -> Literal[False]: + ... + +@NegativeInfinitePredicate.register(NegativeInfinity) +def _(expr, assumptions) -> Literal[True]: + ... + +@NegativeInfinitePredicate.register_many(Infinity, ComplexInfinity) +def _(expr, assumptions) -> Literal[False]: + ... + diff --git a/stubs/sympy-stubs/assumptions/handlers/common.pyi b/stubs/sympy-stubs/assumptions/handlers/common.pyi new file mode 100644 index 00000000..11f6f10f --- /dev/null +++ b/stubs/sympy-stubs/assumptions/handlers/common.pyi @@ -0,0 +1,84 @@ +from typing import Literal, Self +from sympy.assumptions import AppliedPredicate +from sympy.core import Basic, Symbol +from sympy.core.numbers import NaN, Number +from sympy.logic.boolalg import And, BooleanFalse, BooleanTrue, Equivalent, Implies, Not, Or +from sympy.assumptions.predicates.common import CommutativePredicate, IsTruePredicate + +class AskHandler: + def __new__(cls, *args, **kwargs) -> Self: + ... + + + +class CommonHandler(AskHandler): + @staticmethod + def AlwaysTrue(expr, assumptions) -> Literal[True]: + ... + + @staticmethod + def AlwaysFalse(expr, assumptions) -> Literal[False]: + ... + + @staticmethod + def AlwaysNone(expr, assumptions) -> None: + ... + + NaN = ... + + +@CommutativePredicate.register(Symbol) +def _(expr, assumptions) -> bool: + ... + +@CommutativePredicate.register(Basic) +def _(expr, assumptions) -> bool: + ... + +@CommutativePredicate.register(Number) +def _(expr, assumptions) -> Literal[True]: + ... + +@CommutativePredicate.register(NaN) +def _(expr, assumptions) -> Literal[True]: + ... + +@IsTruePredicate.register(bool) +def _(expr, assumptions): + ... + +@IsTruePredicate.register(BooleanTrue) +def _(expr, assumptions) -> Literal[True]: + ... + +@IsTruePredicate.register(BooleanFalse) +def _(expr, assumptions) -> Literal[False]: + ... + +@IsTruePredicate.register(AppliedPredicate) +def _(expr, assumptions) -> bool | None: + ... + +@IsTruePredicate.register(Not) +def _(expr, assumptions) -> bool | None: + ... + +@IsTruePredicate.register(Or) +def _(expr, assumptions) -> bool | None: + ... + +@IsTruePredicate.register(And) +def _(expr, assumptions) -> bool | None: + ... + +@IsTruePredicate.register(Implies) +def _(expr, assumptions) -> bool | None: + ... + +@IsTruePredicate.register(Equivalent) +def _(expr, assumptions) -> bool | None: + ... + +def test_closed_group(expr, assumptions, key) -> bool | None: + ... + diff --git a/stubs/sympy-stubs/assumptions/handlers/matrices.pyi b/stubs/sympy-stubs/assumptions/handlers/matrices.pyi new file mode 100644 index 00000000..d220d3b2 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/handlers/matrices.pyi @@ -0,0 +1,420 @@ +from typing import Literal +from sympy import MatrixBase +from sympy.matrices.expressions import BlockDiagMatrix, BlockMatrix, Determinant, DiagMatrix, DiagonalMatrix, HadamardProduct, Identity, Inverse, MatAdd, MatMul, MatPow, MatrixExpr, MatrixSlice, MatrixSymbol, OneMatrix, Trace, Transpose, ZeroMatrix +from sympy.matrices.expressions.factorizations import Factorization +from sympy.matrices.expressions.fourier import DFT +from sympy.assumptions.predicates.matrices import ComplexElementsPredicate, DiagonalPredicate, FullRankPredicate, IntegerElementsPredicate, InvertiblePredicate, LowerTriangularPredicate, OrthogonalPredicate, PositiveDefinitePredicate, RealElementsPredicate, SquarePredicate, SymmetricPredicate, UnitaryPredicate, UpperTriangularPredicate + +@SquarePredicate.register(MatrixExpr) +def _(expr, assumptions): + ... + +@SymmetricPredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@SymmetricPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@SymmetricPredicate.register(MatAdd) +def _(expr, assumptions) -> bool: + ... + +@SymmetricPredicate.register(MatrixSymbol) +def _(expr, assumptions) -> bool | None: + ... + +@SymmetricPredicate.register_many(OneMatrix, ZeroMatrix) +def _(expr, assumptions) -> bool | None: + ... + +@SymmetricPredicate.register_many(Inverse, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@SymmetricPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@SymmetricPredicate.register(Identity) +def _(expr, assumptions) -> Literal[True]: + ... + +@InvertiblePredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@InvertiblePredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@InvertiblePredicate.register(MatAdd) +def _(expr, assumptions) -> None: + ... + +@InvertiblePredicate.register(MatrixSymbol) +def _(expr, assumptions) -> bool | None: + ... + +@InvertiblePredicate.register_many(Identity, Inverse) +def _(expr, assumptions) -> Literal[True]: + ... + +@InvertiblePredicate.register(ZeroMatrix) +def _(expr, assumptions) -> Literal[False]: + ... + +@InvertiblePredicate.register(OneMatrix) +def _(expr, assumptions): + ... + +@InvertiblePredicate.register(Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@InvertiblePredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@InvertiblePredicate.register(MatrixBase) +def _(expr, assumptions) -> Literal[False]: + ... + +@InvertiblePredicate.register(MatrixExpr) +def _(expr, assumptions) -> Literal[False] | None: + ... + +@InvertiblePredicate.register(BlockMatrix) +def _(expr, assumptions) -> bool | None: + ... + +@InvertiblePredicate.register(BlockDiagMatrix) +def _(expr, assumptions) -> bool | None: + ... + +@OrthogonalPredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@OrthogonalPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@OrthogonalPredicate.register(MatAdd) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@OrthogonalPredicate.register(MatrixSymbol) +def _(expr, assumptions) -> bool | None: + ... + +@OrthogonalPredicate.register(Identity) +def _(expr, assumptions) -> Literal[True]: + ... + +@OrthogonalPredicate.register(ZeroMatrix) +def _(expr, assumptions) -> Literal[False]: + ... + +@OrthogonalPredicate.register_many(Inverse, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@OrthogonalPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@OrthogonalPredicate.register(Factorization) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@UnitaryPredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@UnitaryPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@UnitaryPredicate.register(MatrixSymbol) +def _(expr, assumptions) -> bool | None: + ... + +@UnitaryPredicate.register_many(Inverse, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@UnitaryPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@UnitaryPredicate.register_many(DFT, Identity) +def _(expr, assumptions) -> Literal[True]: + ... + +@UnitaryPredicate.register(ZeroMatrix) +def _(expr, assumptions) -> Literal[False]: + ... + +@UnitaryPredicate.register(Factorization) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@FullRankPredicate.register(MatMul) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@FullRankPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@FullRankPredicate.register(Identity) +def _(expr, assumptions) -> Literal[True]: + ... + +@FullRankPredicate.register(ZeroMatrix) +def _(expr, assumptions) -> Literal[False]: + ... + +@FullRankPredicate.register(OneMatrix) +def _(expr, assumptions): + ... + +@FullRankPredicate.register_many(Inverse, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@FullRankPredicate.register(MatrixSlice) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositiveDefinitePredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@PositiveDefinitePredicate.register(MatPow) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositiveDefinitePredicate.register(MatAdd) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositiveDefinitePredicate.register(MatrixSymbol) +def _(expr, assumptions) -> bool | None: + ... + +@PositiveDefinitePredicate.register(Identity) +def _(expr, assumptions) -> Literal[True]: + ... + +@PositiveDefinitePredicate.register(ZeroMatrix) +def _(expr, assumptions) -> Literal[False]: + ... + +@PositiveDefinitePredicate.register(OneMatrix) +def _(expr, assumptions): + ... + +@PositiveDefinitePredicate.register_many(Inverse, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@PositiveDefinitePredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@UpperTriangularPredicate.register(MatMul) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@UpperTriangularPredicate.register(MatAdd) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@UpperTriangularPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@UpperTriangularPredicate.register(MatrixSymbol) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@UpperTriangularPredicate.register_many(Identity, ZeroMatrix) +def _(expr, assumptions) -> Literal[True]: + ... + +@UpperTriangularPredicate.register(OneMatrix) +def _(expr, assumptions): + ... + +@UpperTriangularPredicate.register(Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@UpperTriangularPredicate.register(Inverse) +def _(expr, assumptions) -> bool | None: + ... + +@UpperTriangularPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@UpperTriangularPredicate.register(Factorization) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@LowerTriangularPredicate.register(MatMul) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@LowerTriangularPredicate.register(MatAdd) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@LowerTriangularPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@LowerTriangularPredicate.register(MatrixSymbol) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@LowerTriangularPredicate.register_many(Identity, ZeroMatrix) +def _(expr, assumptions) -> Literal[True]: + ... + +@LowerTriangularPredicate.register(OneMatrix) +def _(expr, assumptions): + ... + +@LowerTriangularPredicate.register(Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@LowerTriangularPredicate.register(Inverse) +def _(expr, assumptions) -> bool | None: + ... + +@LowerTriangularPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@LowerTriangularPredicate.register(Factorization) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@DiagonalPredicate.register(MatMul) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@DiagonalPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@DiagonalPredicate.register(MatAdd) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@DiagonalPredicate.register(MatrixSymbol) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@DiagonalPredicate.register(OneMatrix) +def _(expr, assumptions): + ... + +@DiagonalPredicate.register_many(Inverse, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@DiagonalPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@DiagonalPredicate.register_many(DiagonalMatrix, DiagMatrix, Identity, ZeroMatrix) +def _(expr, assumptions) -> Literal[True]: + ... + +@DiagonalPredicate.register(Factorization) +def _(expr, assumptions) -> Literal[True] | None: + ... + +def BM_elements(predicate, expr, assumptions) -> bool: + ... + +def MS_elements(predicate, expr, assumptions) -> bool | None: + ... + +def MatMul_elements(matrix_predicate, scalar_predicate, expr, assumptions) -> bool | None: + ... + +@IntegerElementsPredicate.register_many(Determinant, HadamardProduct, MatAdd, Trace, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@IntegerElementsPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@IntegerElementsPredicate.register_many(Identity, OneMatrix, ZeroMatrix) +def _(expr, assumptions) -> Literal[True]: + ... + +@IntegerElementsPredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@IntegerElementsPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@IntegerElementsPredicate.register(BlockMatrix) +def _(expr, assumptions) -> bool: + ... + +@RealElementsPredicate.register_many(Determinant, Factorization, HadamardProduct, MatAdd, Trace, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@RealElementsPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@RealElementsPredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@RealElementsPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@RealElementsPredicate.register(BlockMatrix) +def _(expr, assumptions) -> bool: + ... + +@ComplexElementsPredicate.register_many(Determinant, Factorization, HadamardProduct, Inverse, MatAdd, Trace, Transpose) +def _(expr, assumptions) -> bool | None: + ... + +@ComplexElementsPredicate.register(MatPow) +def _(expr, assumptions) -> bool | None: + ... + +@ComplexElementsPredicate.register(MatMul) +def _(expr, assumptions) -> bool | None: + ... + +@ComplexElementsPredicate.register(MatrixSlice) +def _(expr, assumptions) -> bool | None: + ... + +@ComplexElementsPredicate.register(BlockMatrix) +def _(expr, assumptions) -> bool: + ... + +@ComplexElementsPredicate.register(DFT) +def _(expr, assumptions) -> Literal[True]: + ... + diff --git a/stubs/sympy-stubs/assumptions/handlers/ntheory.pyi b/stubs/sympy-stubs/assumptions/handlers/ntheory.pyi new file mode 100644 index 00000000..0f2ecbbf --- /dev/null +++ b/stubs/sympy-stubs/assumptions/handlers/ntheory.pyi @@ -0,0 +1,106 @@ +from typing import Literal +from sympy.core import Add, Basic, Expr, Float, Mul, Pow +from sympy.core.numbers import ImaginaryUnit, Infinity, Integer, NaN, NegativeInfinity, NumberSymbol, Rational +from sympy.functions import Abs, im, re +from sympy.assumptions.predicates.ntheory import CompositePredicate, EvenPredicate, OddPredicate, PrimePredicate + +@PrimePredicate.register(Expr) +def _(expr, assumptions): + ... + +@PrimePredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@PrimePredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@PrimePredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@PrimePredicate.register(Integer) +def _(expr, assumptions) -> bool: + ... + +@PrimePredicate.register_many(Rational, Infinity, NegativeInfinity, ImaginaryUnit) +def _(expr, assumptions) -> Literal[False]: + ... + +@PrimePredicate.register(Float) +def _(expr, assumptions) -> bool | None: + ... + +@PrimePredicate.register(NumberSymbol) +def _(expr, assumptions) -> bool | None: + ... + +@PrimePredicate.register(NaN) +def _(expr, assumptions) -> None: + ... + +@CompositePredicate.register(Expr) +def _(expr, assumptions): + ... + +@CompositePredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@EvenPredicate.register(Expr) +def _(expr, assumptions): + ... + +@EvenPredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@EvenPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@EvenPredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@EvenPredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@EvenPredicate.register(Integer) +def _(expr, assumptions) -> bool: + ... + +@EvenPredicate.register_many(Rational, Infinity, NegativeInfinity, ImaginaryUnit) +def _(expr, assumptions) -> Literal[False]: + ... + +@EvenPredicate.register(NumberSymbol) +def _(expr, assumptions) -> bool: + ... + +@EvenPredicate.register(Abs) +def _(expr, assumptions) -> bool | None: + ... + +@EvenPredicate.register(re) +def _(expr, assumptions) -> bool | None: + ... + +@EvenPredicate.register(im) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@EvenPredicate.register(NaN) +def _(expr, assumptions) -> None: + ... + +@OddPredicate.register(Expr) +def _(expr, assumptions): + ... + +@OddPredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + diff --git a/stubs/sympy-stubs/assumptions/handlers/order.pyi b/stubs/sympy-stubs/assumptions/handlers/order.pyi new file mode 100644 index 00000000..d50f233a --- /dev/null +++ b/stubs/sympy-stubs/assumptions/handlers/order.pyi @@ -0,0 +1,184 @@ +from typing import Literal +from sympy.core import Add, Basic, Expr, Mul, Pow +from sympy.core.numbers import ImaginaryUnit, NaN +from sympy.functions import Abs, acos, acot, asin, atan, exp, factorial, log +from sympy.matrices import Determinant, Trace +from sympy.matrices.expressions.matexpr import MatrixElement +from sympy.assumptions.predicates.order import ExtendedNegativePredicate, ExtendedNonNegativePredicate, ExtendedNonPositivePredicate, ExtendedNonZeroPredicate, ExtendedPositivePredicate, NegativePredicate, NonNegativePredicate, NonPositivePredicate, NonZeroPredicate, PositivePredicate, ZeroPredicate + +@NegativePredicate.register(Basic) +def _(expr, assumptions) -> Literal[False] | None: + ... + +@NegativePredicate.register(Expr) +def _(expr, assumptions): + ... + +@NegativePredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@NegativePredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@NegativePredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@NegativePredicate.register_many(Abs, ImaginaryUnit) +def _(expr, assumptions) -> Literal[False]: + ... + +@NegativePredicate.register(exp) +def _(expr, assumptions) -> Literal[False]: + ... + +@NonNegativePredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@NonNegativePredicate.register(Expr) +def _(expr, assumptions): + ... + +@NonZeroPredicate.register(Expr) +def _(expr, assumptions): + ... + +@NonZeroPredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@NonZeroPredicate.register(Add) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@NonZeroPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@NonZeroPredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@NonZeroPredicate.register(Abs) +def _(expr, assumptions) -> bool | None: + ... + +@NonZeroPredicate.register(NaN) +def _(expr, assumptions) -> None: + ... + +@ZeroPredicate.register(Expr) +def _(expr, assumptions): + ... + +@ZeroPredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@ZeroPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@NonPositivePredicate.register(Expr) +def _(expr, assumptions): + ... + +@NonPositivePredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(Expr) +def _(expr, assumptions): + ... + +@PositivePredicate.register(Basic) +def _(expr, assumptions) -> Literal[False] | None: + ... + +@PositivePredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(exp) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(log) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(factorial) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositivePredicate.register(ImaginaryUnit) +def _(expr, assumptions) -> Literal[False]: + ... + +@PositivePredicate.register(Abs) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(Trace) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositivePredicate.register(Determinant) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositivePredicate.register(MatrixElement) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositivePredicate.register(atan) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(asin) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(acos) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@PositivePredicate.register(acot) +def _(expr, assumptions) -> bool | None: + ... + +@PositivePredicate.register(NaN) +def _(expr, assumptions) -> None: + ... + +@ExtendedNegativePredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + +@ExtendedPositivePredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + +@ExtendedNonZeroPredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + +@ExtendedNonPositivePredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + +@ExtendedNonNegativePredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + diff --git a/stubs/sympy-stubs/assumptions/handlers/sets.pyi b/stubs/sympy-stubs/assumptions/handlers/sets.pyi new file mode 100644 index 00000000..63314497 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/handlers/sets.pyi @@ -0,0 +1,284 @@ +from typing import Literal +from sympy.core import Add, Basic, Expr, Mul, Pow +from sympy.core.numbers import AlgebraicNumber, ComplexInfinity, Exp1, Float, GoldenRatio, ImaginaryUnit, Infinity, Integer, NaN, NegativeInfinity, Number, NumberSymbol, Pi, Rational, TribonacciConstant +from sympy.functions import Abs, acos, acot, asin, atan, cos, cot, exp, im, log, re, sin, tan +from sympy.matrices import Determinant, MatrixBase, Trace +from sympy.matrices.expressions.matexpr import MatrixElement +from sympy.assumptions.predicates.sets import AlgebraicPredicate, AntihermitianPredicate, ComplexPredicate, ExtendedRealPredicate, HermitianPredicate, ImaginaryPredicate, IntegerPredicate, IrrationalPredicate, RationalPredicate, RealPredicate + +@IntegerPredicate.register_many(int, Integer) +def _(expr, assumptions) -> Literal[True]: + ... + +@IntegerPredicate.register_many(Exp1, GoldenRatio, ImaginaryUnit, Infinity, NegativeInfinity, Pi, Rational, TribonacciConstant) +def _(expr, assumptions) -> Literal[False]: + ... + +@IntegerPredicate.register(Expr) +def _(expr, assumptions): + ... + +@IntegerPredicate.register_many(Add, Pow) +def _(expr, assumptions) -> bool | None: + ... + +@IntegerPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@IntegerPredicate.register(Abs) +def _(expr, assumptions) -> bool | None: + ... + +@IntegerPredicate.register_many(Determinant, MatrixElement, Trace) +def _(expr, assumptions) -> bool | None: + ... + +@RationalPredicate.register(Rational) +def _(expr, assumptions) -> Literal[True]: + ... + +@RationalPredicate.register(Float) +def _(expr, assumptions) -> None: + ... + +@RationalPredicate.register_many(Exp1, GoldenRatio, ImaginaryUnit, Infinity, NegativeInfinity, Pi, TribonacciConstant) +def _(expr, assumptions) -> Literal[False]: + ... + +@RationalPredicate.register(Expr) +def _(expr, assumptions): + ... + +@RationalPredicate.register_many(Add, Mul) +def _(expr, assumptions) -> bool | None: + ... + +@RationalPredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@RationalPredicate.register_many(asin, atan, cos, sin, tan) +def _(expr, assumptions) -> bool | None: + ... + +@RationalPredicate.register(exp) +def _(expr, assumptions) -> bool | None: + ... + +@RationalPredicate.register_many(acot, cot) +def _(expr, assumptions) -> Literal[False] | None: + ... + +@RationalPredicate.register_many(acos, log) +def _(expr, assumptions) -> bool | None: + ... + +@IrrationalPredicate.register(Expr) +def _(expr, assumptions): + ... + +@IrrationalPredicate.register(Basic) +def _(expr, assumptions) -> bool | None: + ... + +@RealPredicate.register_many(Abs, Exp1, Float, GoldenRatio, im, Pi, Rational, re, TribonacciConstant) +def _(expr, assumptions) -> Literal[True]: + ... + +@RealPredicate.register_many(ImaginaryUnit, Infinity, NegativeInfinity) +def _(expr, assumptions) -> Literal[False]: + ... + +@RealPredicate.register(Expr) +def _(expr, assumptions): + ... + +@RealPredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@RealPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@RealPredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@RealPredicate.register_many(cos, sin) +def _(expr, assumptions) -> Literal[True] | None: + ... + +@RealPredicate.register(exp) +def _(expr, assumptions) -> bool | None: + ... + +@RealPredicate.register(log) +def _(expr, assumptions) -> bool | None: + ... + +@RealPredicate.register_many(Determinant, MatrixElement, Trace) +def _(expr, assumptions) -> bool | None: + ... + +@ExtendedRealPredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + +@ExtendedRealPredicate.register_many(Infinity, NegativeInfinity) +def _(expr, assumptions) -> Literal[True]: + ... + +@ExtendedRealPredicate.register_many(Add, Mul, Pow) +def _(expr, assumptions) -> bool | None: + ... + +@HermitianPredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + +@HermitianPredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@HermitianPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@HermitianPredicate.register(Pow) +def _(expr, assumptions) -> Literal[True]: + ... + +@HermitianPredicate.register_many(cos, sin) +def _(expr, assumptions) -> Literal[True]: + ... + +@HermitianPredicate.register(exp) +def _(expr, assumptions) -> Literal[True]: + ... + +@HermitianPredicate.register(MatrixBase) +def _(mat, assumptions) -> bool: + ... + +@ComplexPredicate.register_many(Abs, cos, exp, im, ImaginaryUnit, log, Number, NumberSymbol, re, sin) +def _(expr, assumptions) -> Literal[True]: + ... + +@ComplexPredicate.register_many(Infinity, NegativeInfinity) +def _(expr, assumptions) -> Literal[False]: + ... + +@ComplexPredicate.register(Expr) +def _(expr, assumptions): + ... + +@ComplexPredicate.register_many(Add, Mul) +def _(expr, assumptions) -> bool | None: + ... + +@ComplexPredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@ComplexPredicate.register_many(Determinant, MatrixElement, Trace) +def _(expr, assumptions) -> bool | None: + ... + +@ComplexPredicate.register(NaN) +def _(expr, assumptions) -> None: + ... + +@ImaginaryPredicate.register(ImaginaryUnit) +def _(expr, assumptions) -> Literal[True]: + ... + +@ImaginaryPredicate.register(Expr) +def _(expr, assumptions): + ... + +@ImaginaryPredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@ImaginaryPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@ImaginaryPredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@ImaginaryPredicate.register(log) +def _(expr, assumptions) -> bool | None: + ... + +@ImaginaryPredicate.register(exp) +def _(expr, assumptions) -> bool | None: + ... + +@ImaginaryPredicate.register_many(Number, NumberSymbol) +def _(expr, assumptions) -> bool: + ... + +@ImaginaryPredicate.register(NaN) +def _(expr, assumptions) -> None: + ... + +@AntihermitianPredicate.register(object) +def _(expr, assumptions) -> bool | None: + ... + +@AntihermitianPredicate.register(Add) +def _(expr, assumptions) -> bool | None: + ... + +@AntihermitianPredicate.register(Mul) +def _(expr, assumptions) -> bool | None: + ... + +@AntihermitianPredicate.register(Pow) +def _(expr, assumptions) -> bool: + ... + +@AntihermitianPredicate.register(MatrixBase) +def _(mat, assumptions) -> bool: + ... + +@AlgebraicPredicate.register_many(AlgebraicNumber, Float, GoldenRatio, ImaginaryUnit, TribonacciConstant) +def _(expr, assumptions) -> Literal[True]: + ... + +@AlgebraicPredicate.register_many(ComplexInfinity, Exp1, Infinity, NegativeInfinity, Pi) +def _(expr, assumptions) -> Literal[False]: + ... + +@AlgebraicPredicate.register_many(Add, Mul) +def _(expr, assumptions) -> bool | None: + ... + +@AlgebraicPredicate.register(Pow) +def _(expr, assumptions) -> bool | None: + ... + +@AlgebraicPredicate.register(Rational) +def _(expr, assumptions): + ... + +@AlgebraicPredicate.register_many(asin, atan, cos, sin, tan) +def _(expr, assumptions) -> bool | None: + ... + +@AlgebraicPredicate.register(exp) +def _(expr, assumptions) -> bool | None: + ... + +@AlgebraicPredicate.register_many(acot, cot) +def _(expr, assumptions) -> Literal[False] | None: + ... + +@AlgebraicPredicate.register_many(acos, log) +def _(expr, assumptions) -> bool | None: + ... + diff --git a/stubs/sympy-stubs/assumptions/predicates/common.pyi b/stubs/sympy-stubs/assumptions/predicates/common.pyi new file mode 100644 index 00000000..df2c2b79 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/predicates/common.pyi @@ -0,0 +1,18 @@ +from typing import Any +from sympy.assumptions import Predicate +from sympy.assumptions.assume import AppliedPredicate + +class CommutativePredicate(Predicate): + name = ... + handler = ... + + +binrelpreds = ... +class IsTruePredicate(Predicate): + name = ... + handler = ... + def __call__(self, arg) -> AppliedPredicate | Any: + ... + + + diff --git a/stubs/sympy-stubs/assumptions/predicates/matrices.pyi b/stubs/sympy-stubs/assumptions/predicates/matrices.pyi new file mode 100644 index 00000000..8a7f55fa --- /dev/null +++ b/stubs/sympy-stubs/assumptions/predicates/matrices.pyi @@ -0,0 +1,86 @@ +from typing import LiteralString +from sympy.assumptions import Predicate +from sympy.multipledispatch import Dispatcher + +class SquarePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + + +class SymmetricPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class InvertiblePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class OrthogonalPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + +class UnitaryPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class FullRankPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class PositiveDefinitePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class UpperTriangularPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class LowerTriangularPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class DiagonalPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class IntegerElementsPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class RealElementsPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class ComplexElementsPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class SingularPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + +class NormalPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class TriangularPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class UnitTriangularPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... diff --git a/stubs/sympy-stubs/assumptions/predicates/ntheory.pyi b/stubs/sympy-stubs/assumptions/predicates/ntheory.pyi new file mode 100644 index 00000000..528d2d93 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/predicates/ntheory.pyi @@ -0,0 +1,23 @@ +from typing import LiteralString +from sympy.assumptions import Predicate +from sympy.multipledispatch import Dispatcher + + +class PrimePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class CompositePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class EvenPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class OddPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... diff --git a/stubs/sympy-stubs/assumptions/predicates/order.pyi b/stubs/sympy-stubs/assumptions/predicates/order.pyi new file mode 100644 index 00000000..79cc5cff --- /dev/null +++ b/stubs/sympy-stubs/assumptions/predicates/order.pyi @@ -0,0 +1,55 @@ +from typing import Any, LiteralString +from sympy.assumptions import Predicate +from sympy.multipledispatch import Dispatcher + + +class NegativePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class NonNegativePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class NonZeroPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class ZeroPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + +class NonPositivePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + +class PositivePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class ExtendedPositivePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class ExtendedNegativePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + +class ExtendedNonZeroPredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class ExtendedNonPositivePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... + + +class ExtendedNonNegativePredicate(Predicate): + name: LiteralString = ... + handler: Dispatcher = ... diff --git a/stubs/sympy-stubs/assumptions/refine.pyi b/stubs/sympy-stubs/assumptions/refine.pyi new file mode 100644 index 00000000..69e726a0 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/refine.pyi @@ -0,0 +1,35 @@ +from typing import Callable +from sympy.core import Expr +from sympy.core.basic import Basic +from sympy.core.function import UndefinedFunction +from sympy.logic.boolalg import Boolean +from sympy.matrices.expressions.matexpr import MatrixElement + +def refine(expr, assumptions=...) -> Basic: + ... + +def refine_abs(expr, assumptions) -> None: + ... + +def refine_Pow(expr, assumptions): + ... + +def refine_atan2(expr, assumptions) -> type[UndefinedFunction]: + ... + +def refine_re(expr, assumptions) -> Basic | None: + ... + +def refine_im(expr, assumptions) -> Basic | None: + ... + +def refine_arg(expr, assumptions) -> None: + ... + +def refine_sign(expr, assumptions): + ... + +def refine_matrixelement(expr, assumptions) -> MatrixElement | None: + ... + +handlers_dict: dict[str, Callable[[Expr, Boolean], Expr]] = ... diff --git a/stubs/sympy-stubs/assumptions/relation/__init__.pyi b/stubs/sympy-stubs/assumptions/relation/__init__.pyi new file mode 100644 index 00000000..a2d90446 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/relation/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.assumptions.relation.binrel import AppliedBinaryRelation, BinaryRelation + +__all__ = ['BinaryRelation', 'AppliedBinaryRelation'] diff --git a/stubs/sympy-stubs/assumptions/relation/binrel.pyi b/stubs/sympy-stubs/assumptions/relation/binrel.pyi new file mode 100644 index 00000000..d3471ba7 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/relation/binrel.pyi @@ -0,0 +1,51 @@ +from typing import Optional, Self +from sympy.assumptions import AppliedPredicate, Predicate +from sympy.core.basic import Basic +from sympy.core.logic import Not + +__all__ = ["BinaryRelation", "AppliedBinaryRelation"] +class BinaryRelation(Predicate): + is_reflexive: Optional[bool] = ... + is_symmetric: Optional[bool] = ... + def __call__(self, *args) -> AppliedBinaryRelation: + ... + + @property + def reversed(self) -> Self | None: + ... + + @property + def negated(self) -> None: + ... + + def eval(self, args, assumptions=...) -> bool: + ... + + + +class AppliedBinaryRelation(AppliedPredicate): + @property + def lhs(self) -> Basic: + ... + + @property + def rhs(self) -> Basic: + ... + + @property + def reversed(self) -> Self: + ... + + @property + def reversedsign(self) -> Self: + ... + + @property + def negated(self) -> Not: + ... + + def __bool__(self) -> bool: + ... + + + diff --git a/stubs/sympy-stubs/assumptions/relation/equality.pyi b/stubs/sympy-stubs/assumptions/relation/equality.pyi new file mode 100644 index 00000000..ea8ad2ee --- /dev/null +++ b/stubs/sympy-stubs/assumptions/relation/equality.pyi @@ -0,0 +1,104 @@ +from typing import Any +from sympy.assumptions.relation.binrel import BinaryRelation + +__all__ = ['EqualityPredicate', 'UnequalityPredicate', 'StrictGreaterThanPredicate', 'GreaterThanPredicate', 'StrictLessThanPredicate', 'LessThanPredicate'] +class EqualityPredicate(BinaryRelation): + is_reflexive = ... + is_symmetric = ... + name = ... + handler = ... + @property + def negated(self) -> Any: + ... + + def eval(self, args, assumptions=...): + ... + + + +class UnequalityPredicate(BinaryRelation): + is_reflexive = ... + is_symmetric = ... + name = ... + handler = ... + @property + def negated(self) -> Any: + ... + + def eval(self, args, assumptions=...): + ... + + + +class StrictGreaterThanPredicate(BinaryRelation): + is_reflexive = ... + is_symmetric = ... + name = ... + handler = ... + @property + def reversed(self) -> Any: + ... + + @property + def negated(self) -> Any: + ... + + def eval(self, args, assumptions=...): + ... + + + +class GreaterThanPredicate(BinaryRelation): + is_reflexive = ... + is_symmetric = ... + name = ... + handler = ... + @property + def reversed(self) -> Any: + ... + + @property + def negated(self) -> Any: + ... + + def eval(self, args, assumptions=...): + ... + + + +class StrictLessThanPredicate(BinaryRelation): + is_reflexive = ... + is_symmetric = ... + name = ... + handler = ... + @property + def reversed(self) -> Any: + ... + + @property + def negated(self) -> Any: + ... + + def eval(self, args, assumptions=...): + ... + + + +class LessThanPredicate(BinaryRelation): + is_reflexive = ... + is_symmetric = ... + name = ... + handler = ... + @property + def reversed(self) -> Any: + ... + + @property + def negated(self) -> Any: + ... + + def eval(self, args, assumptions=...): + ... + + + diff --git a/stubs/sympy-stubs/assumptions/satask.pyi b/stubs/sympy-stubs/assumptions/satask.pyi new file mode 100644 index 00000000..416766cd --- /dev/null +++ b/stubs/sympy-stubs/assumptions/satask.pyi @@ -0,0 +1,21 @@ +from typing import Any +from sympy.assumptions.cnf import CNF, EncodedCNF + +def satask(proposition, assumptions=..., context=..., use_known_facts=..., iterations=...) -> bool | None: + ... + +def check_satisfiability(prop, _prop, factbase) -> bool | None: + ... + +def extract_predargs(proposition, assumptions=..., context=...) -> set[Any]: + ... + +def find_symbols(pred) -> set[Any]: + ... + +def get_relevant_clsfacts(exprs, relevant_facts=...) -> tuple[Any, CNF | Any]: + ... + +def get_all_relevant_facts(proposition, assumptions, context, use_known_facts=..., iterations=...) -> EncodedCNF: + ... + diff --git a/stubs/sympy-stubs/assumptions/sathandlers.pyi b/stubs/sympy-stubs/assumptions/sathandlers.pyi new file mode 100644 index 00000000..32ba6ccc --- /dev/null +++ b/stubs/sympy-stubs/assumptions/sathandlers.pyi @@ -0,0 +1,82 @@ +from typing import Any, Callable +from sympy.core import Add, Mul, Number, NumberSymbol, Pow +from sympy.core.logic import And, Or +from sympy.core.numbers import ImaginaryUnit +from sympy.functions.elementary.complexes import Abs +from sympy.logic.boolalg import Implies +from sympy.matrices.expressions import MatMul + +def allargs(symbol, fact, expr) -> And: + ... + +def anyarg(symbol, fact, expr) -> Or: + ... + +def exactlyonearg(symbol, fact, expr) -> Or: + ... + +class ClassFactRegistry: + def __init__(self) -> None: + ... + + def register(self, cls) -> Callable[..., Any]: + ... + + def multiregister(self, *classes) -> Callable[..., Any]: + ... + + def __getitem__(self, key) -> tuple[frozenset[Any], frozenset[Any]]: + ... + + def __call__(self, expr) -> set[Any]: + ... + + + +class_fact_registry = ... +x = ... +@class_fact_registry.multiregister(Abs) +def _(expr) -> list[Any]: + ... + +@class_fact_registry.multiregister(Add) +def _(expr) -> list[Any]: + ... + +@class_fact_registry.register(Add) +def _(expr) -> Implies: + ... + +@class_fact_registry.multiregister(Mul) +def _(expr) -> list[Any]: + ... + +@class_fact_registry.register(Mul) +def _(expr) -> Implies: + ... + +@class_fact_registry.register(Mul) +def _(expr) -> Implies: + ... + +@class_fact_registry.register(Mul) +def _(expr) -> Implies: + ... + +@class_fact_registry.register(Mul) +def _(expr) -> Implies: + ... + +@class_fact_registry.register(MatMul) +def _(expr) -> Implies: + ... + +@class_fact_registry.multiregister(Pow) +def _(expr) -> list[Any]: + ... + +_old_assump_getters = ... +@class_fact_registry.multiregister(Number, NumberSymbol, ImaginaryUnit) +def _(expr) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/assumptions/wrapper.pyi b/stubs/sympy-stubs/assumptions/wrapper.pyi new file mode 100644 index 00000000..3c752965 --- /dev/null +++ b/stubs/sympy-stubs/assumptions/wrapper.pyi @@ -0,0 +1,52 @@ +from typing import Callable, Self +from sympy.core.basic import Basic + +def make_eval_method(fact) -> Callable[..., bool | None]: + ... + +class AssumptionsWrapper(Basic): + def __new__(cls, expr, assumptions=...) -> Self: + ... + + _eval_is_algebraic = ... + _eval_is_antihermitian = ... + _eval_is_commutative = ... + _eval_is_complex = ... + _eval_is_composite = ... + _eval_is_even = ... + _eval_is_extended_negative = ... + _eval_is_extended_nonnegative = ... + _eval_is_extended_nonpositive = ... + _eval_is_extended_nonzero = ... + _eval_is_extended_positive = ... + _eval_is_extended_real = ... + _eval_is_finite = ... + _eval_is_hermitian = ... + _eval_is_imaginary = ... + _eval_is_infinite = ... + _eval_is_integer = ... + _eval_is_irrational = ... + _eval_is_negative = ... + _eval_is_noninteger = ... + _eval_is_nonnegative = ... + _eval_is_nonpositive = ... + _eval_is_nonzero = ... + _eval_is_odd = ... + _eval_is_polar = ... + _eval_is_positive = ... + _eval_is_prime = ... + _eval_is_rational = ... + _eval_is_real = ... + _eval_is_transcendental = ... + _eval_is_zero = ... + + +def is_infinite(obj, assumptions=...) -> bool | None: + ... + +def is_extended_real(obj, assumptions=...) -> bool | None: + ... + +def is_extended_nonnegative(obj, assumptions=...) -> bool | None: + ... + diff --git a/stubs/sympy-stubs/calculus/__init__.pyi b/stubs/sympy-stubs/calculus/__init__.pyi new file mode 100644 index 00000000..a80c3239 --- /dev/null +++ b/stubs/sympy-stubs/calculus/__init__.pyi @@ -0,0 +1,7 @@ +from sympy.calculus.euler import euler_equations +from sympy.calculus.singularities import is_decreasing, is_increasing, is_monotonic, is_strictly_decreasing, is_strictly_increasing, singularities +from sympy.calculus.finite_diff import apply_finite_diff, differentiate_finite, finite_diff_weights +from sympy.calculus.util import is_convex, maximum, minimum, not_empty_in, periodicity, stationary_points +from sympy.calculus.accumulationbounds import AccumBounds + +__all__ = ['euler_equations', 'singularities', 'is_increasing', 'is_strictly_increasing', 'is_decreasing', 'is_strictly_decreasing', 'is_monotonic', 'finite_diff_weights', 'apply_finite_diff', 'differentiate_finite', 'periodicity', 'not_empty_in', 'is_convex', 'stationary_points', 'minimum', 'maximum', 'AccumBounds'] diff --git a/stubs/sympy-stubs/calculus/accumulationbounds.pyi b/stubs/sympy-stubs/calculus/accumulationbounds.pyi new file mode 100644 index 00000000..5c490172 --- /dev/null +++ b/stubs/sympy-stubs/calculus/accumulationbounds.pyi @@ -0,0 +1,84 @@ +from types import NotImplementedType +from typing import Self +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.logic import And +from sympy.core.numbers import _sympifyit +from sympy.core.power import Pow +from sympy.series.order import Order + +class AccumulationBounds(Expr): + is_extended_real = ... + is_number = ... + def __new__(cls, min, max) -> Self: + ... + + _op_priority = ... + @property + def min(self) -> Basic: + ... + + @property + def max(self) -> Basic: + ... + + @property + def delta(self): + ... + + @property + def mid(self): + ... + + @_sympifyit('other', NotImplemented) + def __add__(self, other) -> AccumBounds | Order | NotImplementedType: + ... + + __radd__ = ... + def __neg__(self) -> AccumBounds: + ... + + @_sympifyit('other', NotImplemented) + def __sub__(self, other) -> AccumBounds | Order | NotImplementedType: + ... + + @_sympifyit('other', NotImplemented) + def __rsub__(self, other): + ... + + @_sympifyit('other', NotImplemented) + def __mul__(self, other) -> Self | AccumBounds | Order | NotImplementedType: + ... + + __rmul__ = ... + @_sympifyit('other', NotImplemented) + def __truediv__(self, other): + ... + + @_sympifyit('other', NotImplemented) + def __rtruediv__(self, other) -> AccumBounds | Order | NotImplementedType: + ... + + @_sympifyit('other', NotImplemented) + def __pow__(self, other): + ... + + @_sympifyit('other', NotImplemented) + def __rpow__(self, other) -> Self | Pow: + ... + + def __abs__(self) -> AccumBounds | Self: + ... + + def __contains__(self, other) -> And | bool: + ... + + def intersection(self, other) -> AccumBounds | Self | None: + ... + + def union(self, other) -> AccumBounds | None: + ... + + + +AccumBounds = AccumulationBounds diff --git a/stubs/sympy-stubs/calculus/euler.pyi b/stubs/sympy-stubs/calculus/euler.pyi new file mode 100644 index 00000000..51bd9757 --- /dev/null +++ b/stubs/sympy-stubs/calculus/euler.pyi @@ -0,0 +1,7 @@ + +from typing import Any + + +def euler_equations(L, funcs=..., vars=...) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/calculus/finite_diff.pyi b/stubs/sympy-stubs/calculus/finite_diff.pyi new file mode 100644 index 00000000..fee98ec5 --- /dev/null +++ b/stubs/sympy-stubs/calculus/finite_diff.pyi @@ -0,0 +1,13 @@ + +from typing import Literal + + +def finite_diff_weights(order, x_list, x0=...) -> list[list[list[int]]]: + ... + +def apply_finite_diff(order, x_list, y_list, x0=...) -> Literal[0]: + ... + +def differentiate_finite(expr, *symbols, points=..., x0=..., wrt=..., evaluate=...): + ... + diff --git a/stubs/sympy-stubs/calculus/singularities.pyi b/stubs/sympy-stubs/calculus/singularities.pyi new file mode 100644 index 00000000..40443d60 --- /dev/null +++ b/stubs/sympy-stubs/calculus/singularities.pyi @@ -0,0 +1,22 @@ + +def singularities(expression, symbol, domain=...): + ... + +def monotonicity_helper(expression, predicate, interval=..., symbol=...): + ... + +def is_increasing(expression, interval=..., symbol=...): + ... + +def is_strictly_increasing(expression, interval=..., symbol=...): + ... + +def is_decreasing(expression, interval=..., symbol=...): + ... + +def is_strictly_decreasing(expression, interval=..., symbol=...): + ... + +def is_monotonic(expression, interval=..., symbol=...) -> bool: + ... + diff --git a/stubs/sympy-stubs/calculus/util.pyi b/stubs/sympy-stubs/calculus/util.pyi new file mode 100644 index 00000000..c9b1182d --- /dev/null +++ b/stubs/sympy-stubs/calculus/util.pyi @@ -0,0 +1,32 @@ +from typing import Any +from sympy import Union +from sympy.sets.sets import FiniteSet, Set + + +def continuous_domain(f, symbol, domain): + ... + +def function_range(f, symbol, domain) -> FiniteSet: + ... + +def not_empty_in(finset_intersection, *syms) -> FiniteSet | Union | None: + ... + +def periodicity(f, symbol, check=...): + ... + +def lcim(numbers) -> Any | None: + ... + +def is_convex(f, *syms, domain=...) -> bool: + ... + +def stationary_points(f, symbol, domain=...) -> Set: + ... + +def maximum(f, symbol, domain=...): + ... + +def minimum(f, symbol, domain=...): + ... + diff --git a/stubs/sympy-stubs/categories/__init__.pyi b/stubs/sympy-stubs/categories/__init__.pyi new file mode 100644 index 00000000..010cc500 --- /dev/null +++ b/stubs/sympy-stubs/categories/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.categories.baseclasses import Category, CompositeMorphism, Diagram, IdentityMorphism, Morphism, NamedMorphism, Object +from sympy.categories.diagram_drawing import DiagramGrid, XypicDiagramDrawer, preview_diagram, xypic_draw_diagram + +__all__ = ['Object', 'Morphism', 'IdentityMorphism', 'NamedMorphism', 'CompositeMorphism', 'Category', 'Diagram', 'DiagramGrid', 'XypicDiagramDrawer', 'xypic_draw_diagram', 'preview_diagram'] diff --git a/stubs/sympy-stubs/categories/baseclasses.pyi b/stubs/sympy-stubs/categories/baseclasses.pyi new file mode 100644 index 00000000..2ac5186a --- /dev/null +++ b/stubs/sympy-stubs/categories/baseclasses.pyi @@ -0,0 +1,124 @@ +from typing import Any, Self +from sympy.core import Basic, Symbol +from sympy.sets import Set + +class Class(Set): + is_proper = ... + + +class Object(Symbol): + ... + + +class Morphism(Basic): + def __new__(cls, domain, codomain): + ... + + @property + def domain(self) -> Basic: + ... + + @property + def codomain(self) -> Basic: + ... + + def compose(self, other) -> Morphism | CompositeMorphism: + ... + + def __mul__(self, other) -> Morphism | CompositeMorphism: + ... + + + +class IdentityMorphism(Morphism): + def __new__(cls, domain) -> Self: + ... + + @property + def codomain(self) -> Basic: + ... + + + +class NamedMorphism(Morphism): + def __new__(cls, domain, codomain, name) -> Self: + ... + + @property + def name(self): + ... + + + +class CompositeMorphism(Morphism): + def __new__(cls, *components) -> Morphism | Self: + ... + + @property + def components(self) -> Basic: + ... + + @property + def domain(self): + ... + + @property + def codomain(self): + ... + + def flatten(self, new_name) -> NamedMorphism: + ... + + + +class Category(Basic): + def __new__(cls, name, objects=..., commutative_diagrams=...) -> Self: + ... + + @property + def name(self): + ... + + @property + def objects(self) -> Basic: + ... + + @property + def commutative_diagrams(self) -> Basic: + ... + + def hom(self, A, B): + ... + + def all_morphisms(self): + ... + + + +class Diagram(Basic): + def __new__(cls, *args) -> Self: + ... + + @property + def premises(self) -> Basic: + ... + + @property + def conclusions(self) -> Basic: + ... + + @property + def objects(self) -> Basic: + ... + + def hom(self, A, B) -> tuple[Any, Any]: + ... + + def is_subdiagram(self, diagram) -> bool: + ... + + def subdiagram_from_objects(self, objects) -> Diagram: + ... + + + diff --git a/stubs/sympy-stubs/categories/diagram_drawing.pyi b/stubs/sympy-stubs/categories/diagram_drawing.pyi new file mode 100644 index 00000000..6f2561de --- /dev/null +++ b/stubs/sympy-stubs/categories/diagram_drawing.pyi @@ -0,0 +1,85 @@ +from typing import Any +from sympy.utilities.decorator import doctest_depends_on + +__doctest_requires__ = ... +class _GrowableGrid: + def __init__(self, width, height) -> None: + ... + + @property + def width(self) -> Any: + ... + + @property + def height(self) -> Any: + ... + + def __getitem__(self, i_j): + ... + + def __setitem__(self, i_j, newvalue) -> None: + ... + + def append_row(self) -> None: + ... + + def append_column(self) -> None: + ... + + def prepend_row(self) -> None: + ... + + def prepend_column(self) -> None: + ... + + + +class DiagramGrid: + def __init__(self, diagram, groups=..., **hints) -> None: + ... + + @property + def width(self): + ... + + @property + def height(self): + ... + + def __getitem__(self, i_j): + ... + + @property + def morphisms(self) -> dict[Any, Any]: + ... + + def __str__(self) -> str: + ... + + + +class ArrowStringDescription: + def __init__(self, unit, curving, curving_amount, looping_start, looping_end, horizontal_direction, vertical_direction, label_position, label) -> None: + ... + + def __str__(self) -> str: + ... + + + +class XypicDiagramDrawer: + def __init__(self) -> None: + ... + + def draw(self, diagram, grid, masked=..., diagram_format=...): + ... + + + +def xypic_draw_diagram(diagram, masked=..., diagram_format=..., groups=..., **hints): + ... + +@doctest_depends_on(exe=('latex', 'dvipng'), modules=('pyglet', )) +def preview_diagram(diagram, masked=..., diagram_format=..., groups=..., output=..., viewer=..., euler=..., **hints) -> None: + ... + diff --git a/stubs/sympy-stubs/codegen/__init__.pyi b/stubs/sympy-stubs/codegen/__init__.pyi new file mode 100644 index 00000000..5c55ae17 --- /dev/null +++ b/stubs/sympy-stubs/codegen/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.codegen.ast import Assignment, Attribute, CodeBlock, Declaration, For, FunctionCall, FunctionDefinition, FunctionPrototype, Print, Scope, Variable, While, aug_assign + +__all__ = ['Assignment', 'aug_assign', 'CodeBlock', 'For', 'Attribute', 'Variable', 'Declaration', 'While', 'Scope', 'Print', 'FunctionPrototype', 'FunctionDefinition', 'FunctionCall'] diff --git a/stubs/sympy-stubs/codegen/ast.pyi b/stubs/sympy-stubs/codegen/ast.pyi new file mode 100644 index 00000000..1f15734e --- /dev/null +++ b/stubs/sympy-stubs/codegen/ast.pyi @@ -0,0 +1,394 @@ +from typing import Any, Callable, Iterator, Literal, Self +from sympy.core.basic import Basic +from sympy.core.expr import Atom, Expr +from sympy.core.function import UndefinedFunction +from sympy.core.numbers import Float, Integer + +class CodegenAST(Basic): + __slots__ = ... + + +class Token(CodegenAST): + __slots__: tuple[str, ...] = ... + _fields = ... + defaults: dict[str, Any] = ... + not_in_args: list[str] = ... + indented_args = ... + @property + def is_Atom(self) -> bool: + ... + + def __new__(cls, *args, **kwargs) -> Self: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + _sympystr = ... + def __repr__(self): + ... + + def kwargs(self, exclude=..., apply=...) -> dict[Any, Any]: + ... + + + +class BreakToken(Token): + ... + + +break_ = ... +class ContinueToken(Token): + ... + + +continue_ = ... +class NoneToken(Token): + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +none = ... +class AssignmentBase(CodegenAST): + def __new__(cls, lhs, rhs) -> Self: + ... + + @property + def lhs(self) -> Basic: + ... + + @property + def rhs(self) -> Basic: + ... + + + +class Assignment(AssignmentBase): + op = ... + + +class AugmentedAssignment(AssignmentBase): + binop: str = ... + @property + def op(self) -> str: + ... + + + +class AddAugmentedAssignment(AugmentedAssignment): + binop = ... + + +class SubAugmentedAssignment(AugmentedAssignment): + binop = ... + + +class MulAugmentedAssignment(AugmentedAssignment): + binop = ... + + +class DivAugmentedAssignment(AugmentedAssignment): + binop = ... + + +class ModAugmentedAssignment(AugmentedAssignment): + binop = ... + + +augassign_classes = ... +def aug_assign(lhs, op, rhs): + ... + +class CodeBlock(CodegenAST): + def __new__(cls, *args) -> Self: + ... + + def __iter__(self) -> Iterator[Basic]: + ... + + _sympystr = ... + @property + def free_symbols(self) -> set[Basic]: + ... + + @classmethod + def topological_sort(cls, assignments) -> Self: + ... + + def cse(self, symbols=..., optimizations=..., postprocess=..., order=...) -> Self: + ... + + + +class For(Token): + _fields = ... + _construct_target = ... + + +class String(Atom, Token): + _fields = ... + not_in_args = ... + is_Atom = ... + def kwargs(self, exclude=..., apply=...) -> dict[Any, Any]: + ... + + @property + def func(self) -> Callable[[], Self]: + ... + + + +class QuotedString(String): + ... + + +class Comment(String): + ... + + +class Node(Token): + __slots__: tuple[str, ...] = ... + _fields = ... + defaults: dict[str, Any] = ... + _construct_attrs = ... + def attr_params(self, looking_for) -> None: + ... + + + +class Type(Token): + __slots__: tuple[str, ...] = ... + _fields = ... + _construct_name = String + @classmethod + def from_expr(cls, expr) -> FloatBaseType | IntBaseType | ComplexBaseType | Type: + ... + + def cast_check(self, value, rtol=..., atol=..., precision_targets=...): + ... + + + +class IntBaseType(Type): + __slots__ = ... + cast_nocheck = ... + + +class _SizedIntType(IntBaseType): + __slots__ = ... + _fields = ... + _construct_nbits = Integer + + +class SignedIntType(_SizedIntType): + __slots__ = ... + @property + def min(self) -> Any: + ... + + @property + def max(self) -> Any: + ... + + + +class UnsignedIntType(_SizedIntType): + __slots__ = ... + @property + def min(self) -> Literal[0]: + ... + + @property + def max(self) -> Literal[0]: + ... + + + +two = ... +class FloatBaseType(Type): + __slots__ = ... + cast_nocheck = Float + + +class FloatType(FloatBaseType): + __slots__ = ... + _fields = ... + _construct_nexp = _construct_nmant = _construct_nbits = Integer + @property + def max_exponent(self) -> Expr: + ... + + @property + def min_exponent(self): + ... + + @property + def max(self): + ... + + @property + def tiny(self): + ... + + @property + def eps(self): + ... + + @property + def dig(self) -> type[UndefinedFunction]: + ... + + @property + def decimal_dig(self) -> type[UndefinedFunction]: + ... + + def cast_nocheck(self, value) -> float | Float: + ... + + + +class ComplexBaseType(FloatBaseType): + __slots__ = ... + def cast_nocheck(self, value) -> Float: + ... + + + +class ComplexType(ComplexBaseType, FloatType): + __slots__ = ... + + +intc = ... +intp = ... +int8 = ... +int16 = ... +int32 = ... +int64 = ... +uint8 = ... +uint16 = ... +uint32 = ... +uint64 = ... +float16 = ... +float32 = ... +float64 = ... +float80 = ... +float128 = ... +float256 = ... +complex64 = ... +complex128 = ... +untyped = ... +real = ... +integer = ... +complex_ = ... +bool_ = ... +class Attribute(Token): + _fields = ... + defaults = ... + _construct_name = String + _construct_parameters = ... + + +value_const = ... +pointer_const = ... +class Variable(Node): + __slots__ = ... + _fields = ... + defaults = ... + _construct_symbol = ... + _construct_value = ... + @classmethod + def deduced(cls, symbol, value=..., attrs=..., cast_check=...) -> Variable | Self: + ... + + def as_Declaration(self, **kwargs) -> Declaration: + ... + + __lt__ = ... + __le__ = ... + __ge__ = ... + __gt__ = ... + + +class Pointer(Variable): + __slots__ = ... + def __getitem__(self, key) -> Element: + ... + + + +class Element(Token): + _fields = ... + defaults = ... + _construct_symbol = ... + _construct_indices = ... + _construct_strides = ... + _construct_offset = ... + + +class Declaration(Token): + _fields = ... + _construct_variable = Variable + + +class While(Token): + _fields = ... + _construct_condition = ... + + +class Scope(Token): + _fields = ... + + +class Stream(Token): + _fields = ... + _construct_name = String + + +stdout = ... +stderr = ... +class Print(Token): + _fields = ... + defaults = ... + _construct_print_args = ... + _construct_format_string = QuotedString + _construct_file = Stream + + +class FunctionPrototype(Node): + __slots__ = ... + _fields: tuple[str, ...] = ... + _construct_return_type = Type + _construct_name = String + @classmethod + def from_FunctionDefinition(cls, func_def) -> Self: + ... + + + +class FunctionDefinition(FunctionPrototype): + __slots__ = ... + _fields = ... + @classmethod + def from_FunctionPrototype(cls, func_proto, body) -> Self: + ... + + + +class Return(Token): + _fields = ... + _construct_return = ... + + +class FunctionCall(Token, Expr): + _fields = ... + _construct_name = String + _construct_function_args = ... + + diff --git a/stubs/sympy-stubs/codegen/cfunctions.pyi b/stubs/sympy-stubs/codegen/cfunctions.pyi new file mode 100644 index 00000000..7d8326b6 --- /dev/null +++ b/stubs/sympy-stubs/codegen/cfunctions.pyi @@ -0,0 +1,97 @@ +from sympy.core.basic import Basic +from sympy.core.function import Function, UndefinedFunction +from sympy.core.power import Pow + +class expm1(Function): + nargs = ... + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + _eval_rewrite_as_tractable = ... + @classmethod + def eval(cls, arg) -> None: + ... + + + +class log1p(Function): + nargs = ... + def fdiff(self, argindex=...): + ... + + _eval_rewrite_as_tractable = ... + @classmethod + def eval(cls, arg) -> type[UndefinedFunction] | None: + ... + + + +_Two = ... +class exp2(Function): + nargs = ... + def fdiff(self, argindex=...): + ... + + _eval_rewrite_as_tractable = ... + @classmethod + def eval(cls, arg) -> Pow | None: + ... + + + +class log2(Function): + nargs = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> None: + ... + + _eval_rewrite_as_tractable = ... + + +class fma(Function): + nargs = ... + def fdiff(self, argindex=...) -> Basic: + ... + + + +_Ten = ... +class log10(Function): + nargs = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> None: + ... + + _eval_rewrite_as_tractable = ... + + +class Sqrt(Function): + nargs = ... + def fdiff(self, argindex=...): + ... + + _eval_rewrite_as_tractable = ... + + +class Cbrt(Function): + nargs = ... + def fdiff(self, argindex=...): + ... + + _eval_rewrite_as_tractable = ... + + +class hypot(Function): + nargs = ... + def fdiff(self, argindex=...): + ... + + _eval_rewrite_as_tractable = ... + + diff --git a/stubs/sympy-stubs/codegen/cnodes.pyi b/stubs/sympy-stubs/codegen/cnodes.pyi new file mode 100644 index 00000000..6f38bd2a --- /dev/null +++ b/stubs/sympy-stubs/codegen/cnodes.pyi @@ -0,0 +1,57 @@ +from typing import Self +from sympy.codegen.ast import FunctionCall, Node, String, Token +from sympy.core.basic import Basic + +void = ... +restrict = ... +volatile = ... +static = ... +def alignof(arg) -> FunctionCall: + ... + +def sizeof(arg) -> FunctionCall: + ... + +class CommaOperator(Basic): + def __new__(cls, *args) -> Self: + ... + + + +class Label(Node): + _fields = ... + defaults = ... + _construct_name = String + + +class goto(Token): + _fields = ... + _construct_label = Label + + +class PreDecrement(Basic): + nargs = ... + + +class PostDecrement(Basic): + nargs = ... + + +class PreIncrement(Basic): + nargs = ... + + +class PostIncrement(Basic): + nargs = ... + + +class struct(Node): + _fields = ... + defaults = ... + _construct_name = String + + +class union(struct): + __slots__ = ... + + diff --git a/stubs/sympy-stubs/codegen/fnodes.pyi b/stubs/sympy-stubs/codegen/fnodes.pyi new file mode 100644 index 00000000..9aab694e --- /dev/null +++ b/stubs/sympy-stubs/codegen/fnodes.pyi @@ -0,0 +1,185 @@ +from ast import Attribute +from typing import Self +from sympy.codegen.ast import FunctionCall, Node, String, Token, Variable +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.function import Function +from sympy.core.numbers import Float + +pure = ... +elemental = ... +intent_in = ... +intent_out = ... +intent_inout = ... +allocatable = ... +class Program(Token): + _fields = ... + _construct_name = String + _construct_body = ... + + +class use_rename(Token): + _fields = ... + _construct_local = String + _construct_original = String + + +class use(Token): + _fields = ... + defaults = ... + _construct_namespace = ... + _construct_rename = ... + _construct_only = ... + + +class Module(Token): + _fields = ... + defaults = ... + _construct_name = String + _construct_definitions = ... + + +class Subroutine(Node): + __slots__ = ... + _fields = ... + _construct_name = String + _construct_parameters = ... + + +class SubroutineCall(Token): + _fields = ... + _construct_name = ... + _construct_subroutine_args = ... + + +class Do(Token): + _fields = ... + defaults = ... + _construct_body = ... + _construct_counter = ... + _construct_first = ... + _construct_last = ... + _construct_step = ... + _construct_concurrent = ... + + +class ArrayConstructor(Token): + _fields = ... + _construct_elements = ... + + +class ImpliedDoLoop(Token): + _fields = ... + defaults = ... + _construct_expr = ... + _construct_counter = ... + _construct_first = ... + _construct_last = ... + _construct_step = ... + + +class Extent(Basic): + def __new__(cls, *args) -> Self: + ... + + + +assumed_extent = ... +def dimension(*args) -> Attribute: + ... + +assumed_size = ... +def array(symbol, dim, intent=..., *, attrs=..., value=..., type=...) -> Variable: + ... + +def allocated(array) -> FunctionCall: + ... + +def lbound(array, dim=..., kind=...) -> FunctionCall: + ... + +def ubound(array, dim=..., kind=...) -> FunctionCall: + ... + +def shape(source, kind=...) -> FunctionCall: + ... + +def size(array, dim=..., kind=...) -> FunctionCall: + ... + +def reshape(source, shape, pad=..., order=...) -> FunctionCall: + ... + +def bind_C(name=...) -> Attribute: + ... + +class GoTo(Token): + _fields = ... + defaults = ... + _construct_labels = ... + _construct_expr = ... + + +class FortranReturn(Token): + _fields = ... + defaults = ... + _construct_return_value = ... + + +class FFunction(Function): + _required_standard = ... + + +class F95Function(FFunction): + _required_standard = ... + + +class isign(FFunction): + nargs = ... + + +class dsign(FFunction): + nargs = ... + + +class cmplx(FFunction): + nargs = ... + + +class kind(FFunction): + nargs = ... + + +class merge(F95Function): + nargs = ... + + +class _literal(Float): + _token: str = ... + _decimals: int = ... + + +class literal_sp(_literal): + _token = ... + _decimals = ... + + +class literal_dp(_literal): + _token = ... + _decimals = ... + + +class sum_(Token, Expr): + _fields = ... + defaults = ... + _construct_array = ... + _construct_dim = ... + + +class product_(Token, Expr): + _fields = ... + defaults = ... + _construct_array = ... + _construct_dim = ... + + diff --git a/stubs/sympy-stubs/codegen/pynodes.pyi b/stubs/sympy-stubs/codegen/pynodes.pyi new file mode 100644 index 00000000..053ada22 --- /dev/null +++ b/stubs/sympy-stubs/codegen/pynodes.pyi @@ -0,0 +1,11 @@ +from sympy.codegen.abstract_nodes import List as AbstractList +from sympy.codegen.ast import Token + +class List(AbstractList): + ... + + +class NumExprEvaluate(Token): + _fields = ... + + diff --git a/stubs/sympy-stubs/combinatorics/coset_table.pyi b/stubs/sympy-stubs/combinatorics/coset_table.pyi new file mode 100644 index 00000000..7c890913 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/coset_table.pyi @@ -0,0 +1,114 @@ +from typing import Any, Self +from sympy.printing.defaults import DefaultPrinting + +class CosetTable(DefaultPrinting): + coset_table_max_limit = ... + coset_table_limit = ... + max_stack_size = ... + def __init__(self, fp_grp, subgroup, max_cosets=...) -> None: + ... + + @property + def omega(self) -> list[int]: + ... + + def copy(self) -> Self: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + @property + def n(self) -> int: + ... + + def is_complete(self) -> bool: + ... + + def define(self, alpha, x, modified=...) -> None: + ... + + def define_c(self, alpha, x) -> None: + ... + + def scan_c(self, alpha, word) -> None: + ... + + def coincidence_c(self, alpha, beta) -> None: + ... + + def scan(self, alpha, word, y=..., fill=..., modified=...) -> None: + ... + + def scan_check(self, alpha, word) -> bool: + ... + + def merge(self, k, lamda, q, w=..., modified=...) -> None: + ... + + def rep(self, k, modified=...): + ... + + def coincidence(self, alpha, beta, w=..., modified=...) -> None: + ... + + def scan_and_fill(self, alpha, word) -> None: + ... + + def scan_and_fill_c(self, alpha, word) -> None: + ... + + def look_ahead(self) -> None: + ... + + def process_deductions(self, R_c_x, R_c_x_inv) -> None: + ... + + def process_deductions_check(self, R_c_x, R_c_x_inv) -> bool: + ... + + def switch(self, beta, gamma) -> None: + ... + + def standardize(self) -> None: + ... + + def compress(self) -> None: + ... + + def conjugates(self, R) -> list[Any]: + ... + + def coset_representative(self, coset) -> None: + ... + + def modified_define(self, alpha, x) -> None: + ... + + def modified_scan(self, alpha, w, y, fill=...) -> None: + ... + + def modified_scan_and_fill(self, alpha, w, y) -> None: + ... + + def modified_merge(self, k, lamda, w, q) -> None: + ... + + def modified_rep(self, k) -> None: + ... + + def modified_coincidence(self, alpha, beta, w) -> None: + ... + + + +def coset_enumeration_r(fp_grp, Y, max_cosets=..., draft=..., incomplete=..., modified=...) -> CosetTable: + ... + +def modified_coset_enumeration_r(fp_grp, Y, max_cosets=..., draft=..., incomplete=...) -> CosetTable: + ... + +def coset_enumeration_c(fp_grp, Y, max_cosets=..., draft=..., incomplete=...) -> CosetTable: + ... + diff --git a/stubs/sympy-stubs/combinatorics/fp_groups.pyi b/stubs/sympy-stubs/combinatorics/fp_groups.pyi new file mode 100644 index 00000000..8346c628 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/fp_groups.pyi @@ -0,0 +1,169 @@ +from typing import Any, Callable +from sympy.combinatorics.coset_table import CosetTable +from sympy.combinatorics.free_groups import FreeGroupElement +from sympy.combinatorics.homomorphisms import GroupHomomorphism +from sympy.printing.defaults import DefaultPrinting +from sympy.utilities import public + +@public +def fp_group(fr_grp, relators=...) -> tuple[FpGroup, *tuple[Any, ...]]: + ... + +@public +def xfp_group(fr_grp, relators=...) -> tuple[FpGroup, Callable[[], Any]]: + ... + +@public +def vfp_group(fr_grpm, relators) -> FpGroup: + ... + +class FpGroup(DefaultPrinting): + is_group = ... + is_FpGroup = ... + is_PermutationGroup = ... + def __init__(self, fr_grp, relators) -> None: + ... + + def make_confluent(self) -> None: + ... + + def reduce(self, word): + ... + + def equals(self, word1, word2) -> bool | None: + ... + + @property + def identity(self): + ... + + def __contains__(self, g) -> bool: + ... + + def subgroup(self, gens, C=..., homomorphism=...) -> tuple[FpGroup, GroupHomomorphism] | FpGroup: + ... + + def coset_enumeration(self, H, strategy=..., max_cosets=..., draft=..., incomplete=...) -> CosetTable: + ... + + def standardize_coset_table(self) -> None: + ... + + def coset_table(self, H, strategy=..., max_cosets=..., draft=..., incomplete=...) -> list[list[None]]: + ... + + def order(self, strategy=...) -> int | Any: + ... + + def most_frequent_generator(self): + ... + + def random(self): + ... + + def index(self, H, strategy=...) -> int: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def derived_series(self) -> list[Any]: + ... + + def lower_central_series(self) -> list[Any]: + ... + + def center(self) -> list[Any]: + ... + + def derived_subgroup(self) -> list[Any]: + ... + + def centralizer(self, other) -> list[Any]: + ... + + def normal_closure(self, other) -> list[Any]: + ... + + @property + def is_abelian(self) -> Any: + ... + + @property + def is_nilpotent(self) -> Any: + ... + + @property + def is_solvable(self) -> Any: + ... + + @property + def elements(self) -> list[Any] | None: + ... + + @property + def is_cyclic(self) -> bool: + ... + + def abelian_invariants(self) -> list[Any]: + ... + + def composition_series(self) -> list[Any]: + ... + + + +class FpSubgroup(DefaultPrinting): + def __init__(self, G, gens, normal=...) -> None: + ... + + def __contains__(self, g) -> bool: + ... + + def order(self): + ... + + def to_FpGroup(self) -> Any: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + + +def low_index_subgroups(G, N, Y=...) -> list[Any]: + ... + +def descendant_subgroups(S, C, R1_c_list, x, R2, N, Y) -> None: + ... + +def try_descendant(S, C, R1_c_list, R2, N, alpha, x, beta, Y) -> None: + ... + +def first_in_class(C, Y=...) -> bool: + ... + +def simplify_presentation(*args, change_gens=...) -> FpGroup | tuple[Any, Any] | tuple[Any | list[Any], Any | list[Any]]: + ... + +def elimination_technique_1(gens, rels, identity) -> tuple[list[Any], list[Any]]: + ... + +def define_schreier_generators(C, homomorphism=...) -> None: + ... + +def reidemeister_relators(C) -> None: + ... + +def rewrite(C, alpha, w): + ... + +def elimination_technique_2(C) -> tuple[Any, Any]: + ... + +def reidemeister_presentation(fp_grp, H, C=..., homomorphism=...) -> tuple[tuple[Any, ...], tuple[Any, ...], list[Any]] | tuple[tuple[Any, ...], tuple[Any, ...]]: + ... + +FpGroupElement = FreeGroupElement diff --git a/stubs/sympy-stubs/combinatorics/free_groups.pyi b/stubs/sympy-stubs/combinatorics/free_groups.pyi new file mode 100644 index 00000000..07fd018b --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/free_groups.pyi @@ -0,0 +1,239 @@ +from types import NotImplementedType +from typing import Any, Literal, Self +from sympy.core.expr import Expr +from sympy.core.sympify import CantSympify +from sympy.printing.defaults import DefaultPrinting +from sympy.utilities import public + +@public +def free_group(symbols) -> tuple[FreeGroup, *tuple[Any, ...]]: + ... + +@public +def xfree_group(symbols) -> tuple[FreeGroup, Any]: + ... + +@public +def vfree_group(symbols) -> FreeGroup: + ... + +_free_group_cache: dict[int, FreeGroup] = ... +class FreeGroup(DefaultPrinting): + is_associative = ... + is_group = ... + is_FreeGroup = ... + is_PermutationGroup = ... + relators: list[Expr] = ... + def __new__(cls, symbols) -> Self | FreeGroup: + ... + + def clone(self, symbols=...) -> Self: + ... + + def __contains__(self, i) -> Literal[False]: + ... + + def __hash__(self) -> int: + ... + + def __len__(self): + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __getitem__(self, index) -> Self: + ... + + def __eq__(self, other) -> bool: + ... + + def index(self, gen): + ... + + def order(self): + ... + + @property + def elements(self) -> set[Any]: + ... + + @property + def rank(self): + ... + + @property + def is_abelian(self) -> bool: + ... + + @property + def identity(self): + ... + + def contains(self, g) -> bool: + ... + + def center(self) -> set[Any]: + ... + + + +class FreeGroupElement(CantSympify, DefaultPrinting, tuple): + is_assoc_word = ... + def new(self, init) -> Self: + ... + + _hash = ... + def __hash__(self) -> int: + ... + + def copy(self) -> Self: + ... + + @property + def is_identity(self) -> bool: + ... + + @property + def array_form(self) -> tuple[Any, ...]: + ... + + @property + def letter_form(self) -> tuple[Any, ...]: + ... + + def __getitem__(self, i): + ... + + def index(self, gen) -> int: + ... + + @property + def letter_form_elm(self) -> list[Any]: + ... + + @property + def ext_rep(self) -> tuple[Any, ...]: + ... + + def __contains__(self, gen) -> bool: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __pow__(self, n) -> Self: + ... + + def __mul__(self, other) -> Self: + ... + + def __truediv__(self, other): + ... + + def __rtruediv__(self, other): + ... + + def __add__(self, other) -> NotImplementedType: + ... + + def inverse(self): + ... + + def order(self): + ... + + def commutator(self, other): + ... + + def eliminate_words(self, words, _all=..., inverse=...) -> Self: + ... + + def eliminate_word(self, gen, by=..., _all=..., inverse=...) -> Self: + ... + + def __len__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def exponent_sum(self, gen): + ... + + def generator_count(self, gen): + ... + + def subword(self, from_i, to_j, strict=...): + ... + + def subword_index(self, word, start=...) -> int: + ... + + def is_dependent(self, word) -> bool: + ... + + def is_independent(self, word) -> bool: + ... + + def contains_generators(self) -> set[Any]: + ... + + def cyclic_subword(self, from_i, to_j): + ... + + def cyclic_conjugates(self) -> set[Any]: + ... + + def is_cyclic_conjugate(self, w) -> bool: + ... + + def number_syllables(self) -> int: + ... + + def exponent_syllable(self, i): + ... + + def generator_syllable(self, i): + ... + + def sub_syllables(self, from_i, to_j): + ... + + def substituted_word(self, from_i, to_j, by): + ... + + def is_cyclically_reduced(self) -> Literal[True]: + ... + + def identity_cyclic_reduction(self) -> Self: + ... + + def cyclic_reduction(self, removed=...) -> tuple[Self | Any, Any] | Self: + ... + + def power_of(self, other) -> bool: + ... + + + +def letter_form_to_array_form(array_form, group) -> list[Any] | None: + ... + +def zero_mul_simp(l, index) -> None: + ... + diff --git a/stubs/sympy-stubs/combinatorics/galois.pyi b/stubs/sympy-stubs/combinatorics/galois.pyi new file mode 100644 index 00000000..31082cfb --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/galois.pyi @@ -0,0 +1,115 @@ +from enum import Enum +from typing import Any +from sympy.combinatorics.perm_groups import PermutationGroup + +class S1TransitiveSubgroups(Enum): + S1 = ... + def get_perm_group(self) -> PermutationGroup: + ... + + + +class S2TransitiveSubgroups(Enum): + S2 = ... + def get_perm_group(self) -> PermutationGroup: + ... + + + +class S3TransitiveSubgroups(Enum): + A3 = ... + S3 = ... + def get_perm_group(self) -> PermutationGroup | None: + ... + + + +class S4TransitiveSubgroups(Enum): + C4 = ... + V = ... + D4 = ... + A4 = ... + S4 = ... + def get_perm_group(self) -> PermutationGroup | None: + ... + + + +class S5TransitiveSubgroups(Enum): + C5 = ... + D5 = ... + M20 = ... + A5 = ... + S5 = ... + def get_perm_group(self) -> PermutationGroup | None: + ... + + + +class S6TransitiveSubgroups(Enum): + C6 = ... + S3 = ... + D6 = ... + A4 = ... + G18 = ... + A4xC2 = ... + S4m = ... + S4p = ... + G36m = ... + G36p = ... + S4xC2 = ... + PSL2F5 = ... + G72 = ... + PGL2F5 = ... + A6 = ... + S6 = ... + def get_perm_group(self) -> PermutationGroup | None: + ... + + + +def four_group() -> PermutationGroup: + ... + +def M20() -> PermutationGroup: + ... + +def S3_in_S6() -> PermutationGroup: + ... + +def A4_in_S6() -> PermutationGroup: + ... + +def S4m() -> PermutationGroup: + ... + +def S4p() -> PermutationGroup: + ... + +def A4xC2() -> PermutationGroup: + ... + +def S4xC2() -> PermutationGroup: + ... + +def G18() -> PermutationGroup: + ... + +def G36m() -> PermutationGroup: + ... + +def G36p() -> PermutationGroup: + ... + +def G72() -> PermutationGroup: + ... + +def PSL2F5() -> PermutationGroup: + ... + +def PGL2F5() -> PermutationGroup: + ... + +def find_transitive_subgroups_of_S6(*targets, print_report=...) -> dict[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/combinatorics/generators.pyi b/stubs/sympy-stubs/combinatorics/generators.pyi new file mode 100644 index 00000000..bf6f1354 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/generators.pyi @@ -0,0 +1,20 @@ +from typing import Any, Generator +from sympy.combinatorics.permutations import Permutation +def symmetric(n) -> Generator[Permutation, Any, None]: + ... + +def cyclic(n) -> Generator[Permutation, Any, None]: + ... + +def alternating(n) -> Generator[Permutation, Any, None]: + ... + +def dihedral(n) -> Generator[Permutation, Any, None]: + ... + +def rubik_cube_generators() -> list[Permutation]: + ... + +def rubik(n) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/combinatorics/graycode.pyi b/stubs/sympy-stubs/combinatorics/graycode.pyi new file mode 100644 index 00000000..2aecdefb --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/graycode.pyi @@ -0,0 +1,56 @@ +from typing import Any, Generator, LiteralString, Self +from sympy.core import Basic + +class GrayCode(Basic): + _skip = ... + _current = ... + _rank = ... + def __new__(cls, n, *args, **kw_args) -> Self: + ... + + def next(self, delta=...) -> GrayCode: + ... + + @property + def selections(self): + ... + + @property + def n(self) -> Basic: + ... + + def generate_gray(self, **hints) -> Generator[str, Any, None]: + ... + + def skip(self) -> None: + ... + + @property + def rank(self) -> int: + ... + + @property + def current(self) -> str: + ... + + @classmethod + def unrank(cls, n, rank) -> str: + ... + + + +def random_bitstring(n) -> str: + ... + +def gray_to_bin(bin_list) -> LiteralString: + ... + +def bin_to_gray(bin_list) -> LiteralString: + ... + +def get_subset_from_bitstring(super_set, bitstring) -> list[Any]: + ... + +def graycode_subsets(gray_code_set) -> Generator[list[Any], Any, None]: + ... + diff --git a/stubs/sympy-stubs/combinatorics/group_constructs.pyi b/stubs/sympy-stubs/combinatorics/group_constructs.pyi new file mode 100644 index 00000000..f08e800a --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/group_constructs.pyi @@ -0,0 +1,5 @@ +from sympy.combinatorics.perm_groups import PermutationGroup +_af_new = ... +def DirectProduct(*groups) -> PermutationGroup: + ... + diff --git a/stubs/sympy-stubs/combinatorics/homomorphisms.pyi b/stubs/sympy-stubs/combinatorics/homomorphisms.pyi new file mode 100644 index 00000000..b516c1a9 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/homomorphisms.pyi @@ -0,0 +1,57 @@ +from typing import Any, Literal +from sympy.combinatorics.fp_groups import FpSubgroup +from sympy.combinatorics.perm_groups import PermutationGroup +class GroupHomomorphism: + def __init__(self, domain, codomain, images) -> None: + ... + + def invert(self, g) -> list[Any] | None: + ... + + def kernel(self) -> PermutationGroup | FpSubgroup: + ... + + def image(self) -> PermutationGroup | FpSubgroup: + ... + + def __call__(self, elem) -> list[Any]: + ... + + def is_injective(self) -> bool: + ... + + def is_surjective(self) -> None: + ... + + def is_isomorphism(self) -> Literal[False] | None: + ... + + def is_trivial(self) -> bool: + ... + + def compose(self, other) -> GroupHomomorphism: + ... + + def restrict_to(self, H) -> GroupHomomorphism: + ... + + def invert_subgroup(self, H) -> PermutationGroup: + ... + + + +def homomorphism(domain, codomain, gens, images=..., check=...) -> GroupHomomorphism: + ... + +def orbit_homomorphism(group, omega) -> GroupHomomorphism: + ... + +def block_homomorphism(group, blocks) -> GroupHomomorphism: + ... + +def group_isomorphism(G, H, isomorphism=...) -> tuple[Literal[True], GroupHomomorphism] | tuple[Literal[False], None] | bool: + ... + +def is_isomorphic(G, H) -> tuple[Literal[True], GroupHomomorphism] | tuple[Literal[False], None] | bool: + ... + diff --git a/stubs/sympy-stubs/combinatorics/named_groups.pyi b/stubs/sympy-stubs/combinatorics/named_groups.pyi new file mode 100644 index 00000000..e2cbff2b --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/named_groups.pyi @@ -0,0 +1,26 @@ +from sympy.combinatorics.perm_groups import PermutationGroup +_af_new = ... +def AbelianGroup(*cyclic_orders) -> PermutationGroup: + ... + +def AlternatingGroup(n) -> PermutationGroup: + ... + +def set_alternating_group_properties(G, n, degree) -> None: + ... + +def CyclicGroup(n) -> PermutationGroup: + ... + +def DihedralGroup(n) -> PermutationGroup: + ... + +def SymmetricGroup(n) -> PermutationGroup: + ... + +def set_symmetric_group_properties(G, n, degree) -> None: + ... + +def RubikGroup(n) -> PermutationGroup: + ... + diff --git a/stubs/sympy-stubs/combinatorics/partitions.pyi b/stubs/sympy-stubs/combinatorics/partitions.pyi new file mode 100644 index 00000000..11bf1a7a --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/partitions.pyi @@ -0,0 +1,92 @@ +from typing import Any, Literal, LiteralString, Self +from sympy.core import Basic +from sympy.core.function import UndefinedFunction +from sympy.sets.sets import FiniteSet + +class Partition(FiniteSet): + _rank = ... + _partition = ... + def __new__(cls, *partition) -> Self: + ... + + def sort_key(self, order=...) -> tuple[tuple[tuple[Literal[5], Literal[0], str], tuple[int, tuple[Any, ...]], Any, Any] | Any | tuple[tuple[Literal[10, 0], Literal[0], str | Any], tuple[int, tuple[Any, ...]] | tuple[Literal[1], tuple[str]], Any, Any], ...]: + ... + + @property + def partition(self) -> list[Any]: + ... + + def __add__(self, other) -> Partition: + ... + + def __sub__(self, other) -> Partition: + ... + + def __le__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + @property + def rank(self) -> int: + ... + + @property + def RGS(self) -> tuple[Any, ...]: + ... + + @classmethod + def from_rgs(cls, rgs, elements) -> Partition: + ... + + + +class IntegerPartition(Basic): + _dict = ... + _keys = ... + def __new__(cls, partition, integer=...) -> Self: + ... + + def prev_lex(self) -> IntegerPartition: + ... + + def next_lex(self) -> IntegerPartition: + ... + + def as_dict(self) -> dict[str, str]: + ... + + @property + def conjugate(self): + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def as_ferrers(self, char=...) -> LiteralString: + ... + + def __str__(self) -> str: + ... + + + +def random_integer_partition(n, seed=...) -> list[Any]: + ... + +def RGS_generalized(m): + ... + +def RGS_enum(m) -> type[UndefinedFunction] | Literal[0, 1]: + ... + +def RGS_unrank(rank, m) -> list[Any]: + ... + +def RGS_rank(rgs) -> Literal[0]: + ... + diff --git a/stubs/sympy-stubs/combinatorics/pc_groups.pyi b/stubs/sympy-stubs/combinatorics/pc_groups.pyi new file mode 100644 index 00000000..e1126660 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/pc_groups.pyi @@ -0,0 +1,56 @@ +from typing import Any, Literal +from sympy.printing.defaults import DefaultPrinting + +class PolycyclicGroup(DefaultPrinting): + is_group = ... + is_solvable = ... + def __init__(self, pc_sequence, pc_series, relative_order, collector=...) -> None: + ... + + def is_prime_order(self) -> bool: + ... + + def length(self) -> int: + ... + + + +class Collector(DefaultPrinting): + def __init__(self, pcgs, pc_series, relative_order, free_group_=..., pc_presentation=...) -> None: + ... + + def minimal_uncollected_subword(self, word) -> tuple[tuple[Any, Any]] | tuple[tuple[Any, Any], tuple[Any, Literal[1, -1]]] | None: + ... + + def relations(self) -> tuple[dict[Any, Any], dict[Any, Any]]: + ... + + def subword_index(self, word, w) -> tuple[Literal[-1], Literal[-1]] | tuple[int, int]: + ... + + def map_relation(self, w): + ... + + def collected_word(self, word): + ... + + def pc_relators(self) -> dict[Any, Any]: + ... + + def exponent_vector(self, element) -> list[int]: + ... + + def depth(self, element) -> int: + ... + + def leading_exponent(self, element) -> int | None: + ... + + def induced_pcgs(self, gens) -> list[int]: + ... + + def constructive_membership_test(self, ipcgs, g) -> list[int] | Literal[False]: + ... + + + diff --git a/stubs/sympy-stubs/combinatorics/perm_groups.pyi b/stubs/sympy-stubs/combinatorics/perm_groups.pyi new file mode 100644 index 00000000..3ba15596 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/perm_groups.pyi @@ -0,0 +1,318 @@ +from typing import Any, Generator, Literal, Self +from sympy.combinatorics.fp_groups import FpGroup +from sympy.combinatorics.pc_groups import PolycyclicGroup +from sympy.combinatorics.permutations import Permutation +from sympy.core import Basic +from sympy.core.function import UndefinedFunction + +rmul = ... +_af_new = ... +class PermutationGroup(Basic): + is_group = ... + def __new__(cls, *args, dups=..., **kwargs) -> Self: + ... + + def __init__(self, *args, **kwargs) -> None: + ... + + def __getitem__(self, i): + ... + + def __contains__(self, i) -> bool: + ... + + def __len__(self) -> int: + ... + + def equals(self, other) -> bool: + ... + + def __mul__(self, other) -> Coset | PermutationGroup: + ... + + @property + def base(self) -> list[Any]: + ... + + def baseswap(self, base, strong_gens, pos, randomized=..., transversals=..., basic_orbits=..., strong_gens_distr=...) -> tuple[Any, Any]: + ... + + @property + def basic_orbits(self) -> list[list[Any]]: + ... + + @property + def basic_stabilizers(self) -> list[Any]: + ... + + @property + def basic_transversals(self) -> list[None] | None: + ... + + def composition_series(self) -> list[Any]: + ... + + def coset_transversal(self, H) -> list[Any | Basic | list[Any] | Permutation] | list[Permutation]: + ... + + def coset_table(self, H) -> list[Any] | None: + ... + + def center(self) -> Self | PermutationGroup | None: + ... + + def centralizer(self, other) -> Self | PermutationGroup | None: + ... + + def commutator(self, G, H) -> PermutationGroup | None: + ... + + def coset_factor(self, g, factor_index=...) -> list[Any]: + ... + + def generator_product(self, g, original=...) -> list[Any]: + ... + + def coset_rank(self, g) -> int | None: + ... + + def coset_unrank(self, rank, af=...) -> list[Any] | Permutation | None: + ... + + @property + def degree(self): + ... + + @property + def identity(self) -> Permutation: + ... + + @property + def elements(self) -> set[Any | Basic | list[Any] | Permutation]: + ... + + def derived_series(self) -> list[Self]: + ... + + def derived_subgroup(self) -> PermutationGroup | None: + ... + + def generate(self, method=..., af=...) -> Generator[Any | Basic | list[Any] | Permutation, Any, None] | Generator[list[int] | Permutation | list[Any], Any, None]: + ... + + def generate_dimino(self, af=...) -> Generator[list[int] | Permutation | list[Any], Any, None]: + ... + + def generate_schreier_sims(self, af=...) -> Generator[Any | Basic | list[Any] | Permutation, Any, None]: + ... + + @property + def generators(self) -> list[Basic]: + ... + + def contains(self, g, strict=...) -> bool: + ... + + @property + def is_perfect(self) -> bool: + ... + + @property + def is_abelian(self) -> bool: + ... + + def abelian_invariants(self) -> list[Any]: + ... + + def is_elementary(self, p) -> bool: + ... + + def is_alt_sym(self, eps=..., _random_prec=...) -> bool: + ... + + @property + def is_nilpotent(self) -> bool: + ... + + def is_normal(self, gr, strict=...) -> bool: + ... + + def is_primitive(self, randomized=...) -> bool: + ... + + def minimal_blocks(self, randomized=...) -> list[Any] | Literal[False]: + ... + + @property + def is_solvable(self) -> bool: + ... + + def is_subgroup(self, G, strict=...) -> bool: + ... + + @property + def is_polycyclic(self) -> bool: + ... + + def is_transitive(self, strict=...) -> bool: + ... + + @property + def is_trivial(self) -> bool: + ... + + def lower_central_series(self) -> list[Self]: + ... + + @property + def max_div(self) -> Literal[1] | None: + ... + + def minimal_block(self, points) -> list[Any] | Literal[False]: + ... + + def conjugacy_class(self, x) -> set[Any]: + ... + + def conjugacy_classes(self) -> list[set[Permutation]]: + ... + + def normal_closure(self, other, k=...) -> PermutationGroup | None: + ... + + def orbit(self, alpha, action=...) -> set[Any] | set[tuple[Any, ...]] | None: + ... + + def orbit_rep(self, alpha, beta, schreier_vector=...) -> Permutation | Literal[False]: + ... + + def orbit_transversal(self, alpha, pairs=...) -> list[tuple[Any, Permutation]] | list[tuple[Any, list[int]]] | tuple[list[tuple[Any, Permutation]] | list[tuple[Any, list[int]]], dict[Any, list[Any]]] | list[list[int]] | tuple[list[list[int]], dict[Any, list[Any]]] | list[Permutation] | tuple[list[Permutation], dict[Any, list[Any]]]: + ... + + def orbits(self, rep=...) -> list[Any]: + ... + + def order(self) -> int | type[UndefinedFunction]: + ... + + def index(self, H) -> None: + ... + + @property + def is_symmetric(self) -> bool: + ... + + @property + def is_alternating(self) -> bool: + ... + + @property + def is_cyclic(self) -> bool: + ... + + @property + def is_dihedral(self) -> bool: + ... + + def pointwise_stabilizer(self, points, incremental=...) -> PermutationGroup: + ... + + def make_perm(self, n, seed=...) -> Permutation: + ... + + def random(self, af=...) -> list[Any] | Permutation | None: + ... + + def random_pr(self, gen_count=..., iterations=..., _random_prec=...) -> Permutation: + ... + + def random_stab(self, alpha, schreier_vector=..., _random_prec=...) -> Permutation: + ... + + def schreier_sims(self) -> None: + ... + + def schreier_sims_incremental(self, base=..., gens=..., slp_dict=...) -> tuple[Any | list[Any], list[Basic] | Any, dict[Basic | Any, list[Basic | Any]]] | tuple[Any | list[Any], list[Basic] | Any] | tuple[Any | list[Any], list[Basic | Any], dict[Any, Any]] | tuple[Any | list[Any], list[Basic | Any]]: + ... + + def schreier_sims_random(self, base=..., gens=..., consec_succ=..., _random_prec=...) -> tuple[Any | list[Any], list[Any]]: + ... + + def schreier_vector(self, alpha): + ... + + def stabilizer(self, alpha) -> PermGroup: + ... + + @property + def strong_gens(self) -> list[Basic] | list[Basic | Any]: + ... + + def subgroup(self, gens) -> PermutationGroup: + ... + + def subgroup_search(self, prop, base=..., strong_gens=..., tests=..., init_subgroup=...) -> PermutationGroup: + ... + + @property + def transitivity_degree(self) -> int: + ... + + def sylow_subgroup(self, p) -> PermutationGroup | Self: + ... + + def strong_presentation(self) -> FpGroup | tuple[Any, Any] | tuple[Any | list[Any], Any | list[Any]]: + ... + + def presentation(self, eliminate_gens=...) -> FpGroup | tuple[Any, Any] | tuple[Any | list[Any], Any | list[Any]] | Any: + ... + + def polycyclic_group(self) -> PolycyclicGroup: + ... + + + +PermGroup = PermutationGroup +class SymmetricPermutationGroup(Basic): + def __new__(cls, deg) -> Self: + ... + + def __init__(self, *args, **kwargs) -> None: + ... + + def __contains__(self, i) -> bool: + ... + + def order(self) -> type[UndefinedFunction]: + ... + + @property + def degree(self) -> Basic: + ... + + @property + def identity(self) -> Permutation: + ... + + + +class Coset(Basic): + def __new__(cls, g, H, G=..., dir=...) -> Self: + ... + + def __init__(self, *args, **kwargs) -> None: + ... + + @property + def is_left_coset(self) -> bool: + ... + + @property + def is_right_coset(self) -> bool: + ... + + def as_list(self) -> list[Any]: + ... + + + diff --git a/stubs/sympy-stubs/combinatorics/permutations.pyi b/stubs/sympy-stubs/combinatorics/permutations.pyi new file mode 100644 index 00000000..de4d364c --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/permutations.pyi @@ -0,0 +1,275 @@ +from typing import Any, Generator, Literal, Self +from sympy.combinatorics.perm_groups import Coset +from sympy.core.basic import Atom +from sympy.core.expr import Expr +from sympy.core.numbers import Integer + +class Cycle(dict): + def __missing__(self, arg) -> int: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def __call__(self, *other) -> Cycle: + ... + + def list(self, size=...) -> list[Any]: + ... + + def __repr__(self) -> str: + ... + + def __str__(self) -> str: + ... + + def __init__(self, *args) -> None: + ... + + @property + def size(self) -> Literal[0]: + ... + + def copy(self) -> Cycle: + ... + + + +class Permutation(Atom): + is_Permutation = ... + _array_form = ... + _cyclic_form = ... + _cycle_structure = ... + _size = ... + _rank = ... + def __new__(cls, *args, size=..., **kwargs): + ... + + @property + def array_form(self): + ... + + def list(self, size=...): + ... + + @property + def cyclic_form(self) -> list[Any]: + ... + + @property + def full_cyclic_form(self) -> list[Any]: + ... + + @property + def size(self) -> None: + ... + + def support(self) -> list[int]: + ... + + def __add__(self, other) -> Self: + ... + + def __sub__(self, other) -> Self: + ... + + @staticmethod + def rmul(*args): + ... + + @classmethod + def rmul_with_af(cls, *args) -> Self: + ... + + def mul_inv(self, other) -> Self: + ... + + def __rmul__(self, other) -> Coset | Self: + ... + + def __mul__(self, other) -> Coset | Self: + ... + + def commutes_with(self, other) -> bool: + ... + + def __pow__(self, n) -> Self: + ... + + def __rxor__(self, i) -> list[Any] | Coset | Permutation: + ... + + def __xor__(self, h) -> Self: + ... + + def transpositions(self) -> list[Any]: + ... + + @classmethod + def from_sequence(cls, i, key=...) -> Permutation: + ... + + def __invert__(self) -> Self: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def __repr__(self): + ... + + def __call__(self, *i) -> list[Any] | Coset | Self: + ... + + def atoms(self) -> set[Any]: + ... + + def apply(self, i) -> Integer | AppliedPermutation: + ... + + def next_lex(self) -> Self | None: + ... + + @classmethod + def unrank_nonlex(cls, n, r) -> Self: + ... + + def rank_nonlex(self, inv_perm=...) -> Literal[0]: + ... + + def next_nonlex(self) -> Self | None: + ... + + def rank(self) -> int: + ... + + @property + def cardinality(self) -> int: + ... + + def parity(self) -> int: + ... + + @property + def is_even(self) -> bool: + ... + + @property + def is_odd(self) -> bool: + ... + + @property + def is_Singleton(self) -> bool: + ... + + @property + def is_Empty(self) -> bool: + ... + + @property + def is_identity(self) -> bool: + ... + + @property + def is_Identity(self) -> bool: + ... + + def ascents(self) -> list[int]: + ... + + def descents(self) -> list[int]: + ... + + def max(self) -> Literal[0]: + ... + + def min(self) -> int: + ... + + def inversions(self) -> int: + ... + + def commutator(self, x) -> Self: + ... + + def signature(self) -> Literal[1, -1]: + ... + + def order(self) -> Any: + ... + + def length(self) -> int: + ... + + @property + def cycle_structure(self) -> dict[Any, int]: + ... + + @property + def cycles(self) -> int: + ... + + def index(self) -> int: + ... + + def runs(self) -> list[Any]: + ... + + def inversion_vector(self) -> list[int]: + ... + + def rank_trotterjohnson(self) -> int: + ... + + @classmethod + def unrank_trotterjohnson(cls, size, rank) -> Self: + ... + + def next_trotterjohnson(self) -> Self | None: + ... + + def get_precedence_matrix(self): + ... + + def get_precedence_distance(self, other): + ... + + def get_adjacency_matrix(self): + ... + + def get_adjacency_distance(self, other): + ... + + def get_positional_distance(self, other) -> int: + ... + + @classmethod + def josephus(cls, m, n, s=...) -> Self: + ... + + @classmethod + def from_inversion_vector(cls, inversion) -> Self: + ... + + @classmethod + def random(cls, n) -> Self: + ... + + @classmethod + def unrank_lex(cls, size, rank) -> Self: + ... + + def resize(self, n) -> Permutation | Self: + ... + + print_cyclic = ... + + +Perm = Permutation +_af_new = ... +class AppliedPermutation(Expr): + def __new__(cls, perm, x, evaluate=...) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/combinatorics/polyhedron.pyi b/stubs/sympy-stubs/combinatorics/polyhedron.pyi new file mode 100644 index 00000000..9ea1bbe0 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/polyhedron.pyi @@ -0,0 +1,57 @@ +from typing import Any, Self +from sympy.core import Basic +from sympy.sets.sets import FiniteSet + +rmul = ... +class Polyhedron(Basic): + _edges = ... + def __new__(cls, corners, faces=..., pgroup=...) -> Self: + ... + + @property + def corners(self) -> tuple[Any, ...] | Basic: + ... + + vertices = ... + @property + def array_form(self) -> list[int]: + ... + + @property + def cyclic_form(self) -> list[Any]: + ... + + @property + def size(self) -> int: + ... + + @property + def faces(self): + ... + + @property + def pgroup(self): + ... + + @property + def edges(self) -> FiniteSet: + ... + + def rotate(self, perm) -> None: + ... + + def reset(self) -> None: + ... + + + +tetrahedron = ... +cube = ... +octahedron = ... +dodecahedron = ... +icosahedron = ... +tetrahedron_faces = ... +cube_faces = ... +octahedron_faces = ... +dodecahedron_faces = ... +icosahedron_faces = ... diff --git a/stubs/sympy-stubs/combinatorics/prufer.pyi b/stubs/sympy-stubs/combinatorics/prufer.pyi new file mode 100644 index 00000000..4907dd2c --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/prufer.pyi @@ -0,0 +1,58 @@ +from typing import Any, Literal, Self +from sympy.core import Basic + +class Prufer(Basic): + _prufer_repr = ... + _tree_repr = ... + _nodes = ... + _rank = ... + @property + def prufer_repr(self) -> list[Any]: + ... + + @property + def tree_repr(self) -> list[Any]: + ... + + @property + def nodes(self) -> None: + ... + + @property + def rank(self) -> int: + ... + + @property + def size(self) -> int: + ... + + @staticmethod + def to_prufer(tree, n) -> list[Any]: + ... + + @staticmethod + def to_tree(prufer) -> list[Any]: + ... + + @staticmethod + def edges(*runs) -> tuple[list[Any], Any]: + ... + + def prufer_rank(self) -> Literal[0]: + ... + + @classmethod + def unrank(cls, rank, n) -> Prufer: + ... + + def __new__(cls, *args, **kw_args) -> Self: + ... + + def next(self, delta=...) -> Prufer: + ... + + def prev(self, delta=...) -> Prufer: + ... + + + diff --git a/stubs/sympy-stubs/combinatorics/rewritingsystem.pyi b/stubs/sympy-stubs/combinatorics/rewritingsystem.pyi new file mode 100644 index 00000000..431686ef --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/rewritingsystem.pyi @@ -0,0 +1,29 @@ +from typing import Any +class RewritingSystem: + def __init__(self, group) -> None: + ... + + def set_max(self, n) -> None: + ... + + @property + def is_confluent(self) -> bool: + ... + + def add_rule(self, w1, w2, check=...) -> set[Any]: + ... + + def make_confluent(self, check=...) -> bool | None: + ... + + def reduce(self, word, exclude=...): + ... + + def construct_automaton(self) -> None: + ... + + def reduce_using_automaton(self, word): + ... + + + diff --git a/stubs/sympy-stubs/combinatorics/rewritingsystem_fsm.pyi b/stubs/sympy-stubs/combinatorics/rewritingsystem_fsm.pyi new file mode 100644 index 00000000..cf1c186b --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/rewritingsystem_fsm.pyi @@ -0,0 +1,22 @@ +from typing import LiteralString +class State: + def __init__(self, name, state_machine, state_type=..., rh_rule=...) -> None: + ... + + def add_transition(self, letter, state) -> None: + ... + + + +class StateMachine: + def __init__(self, name, automaton_alphabet) -> None: + ... + + def add_state(self, state_name, state_type=..., rh_rule=...) -> None: + ... + + def __repr__(self) -> LiteralString: + ... + + + diff --git a/stubs/sympy-stubs/combinatorics/subsets.pyi b/stubs/sympy-stubs/combinatorics/subsets.pyi new file mode 100644 index 00000000..69297b22 --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/subsets.pyi @@ -0,0 +1,95 @@ +from itertools import combinations +from typing import Any, Self +class Subset: + _rank_binary = ... + _rank_lex = ... + _rank_graycode = ... + _subset = ... + _superset = ... + def __new__(cls, subset, superset) -> Self: + ... + + def __eq__(self, other) -> bool: + ... + + def iterate_binary(self, k) -> Subset: + ... + + def next_binary(self) -> Subset: + ... + + def prev_binary(self) -> Subset: + ... + + def next_lexicographic(self) -> Subset: + ... + + def prev_lexicographic(self) -> Subset: + ... + + def iterate_graycode(self, k) -> Subset: + ... + + def next_gray(self) -> Subset: + ... + + def prev_gray(self) -> Subset: + ... + + @property + def rank_binary(self) -> int: + ... + + @property + def rank_lexicographic(self) -> int: + ... + + @property + def rank_gray(self) -> int: + ... + + @property + def subset(self) -> None: + ... + + @property + def size(self) -> int: + ... + + @property + def superset(self) -> None: + ... + + @property + def superset_size(self) -> int: + ... + + @property + def cardinality(self) -> Any: + ... + + @classmethod + def subset_from_bitlist(cls, super_set, bitlist) -> Subset: + ... + + @classmethod + def bitlist_from_subset(cls, subset, superset) -> str: + ... + + @classmethod + def unrank_binary(cls, rank, superset) -> Subset: + ... + + @classmethod + def unrank_gray(cls, rank, superset) -> Subset: + ... + + @classmethod + def subset_indices(cls, subset, superset) -> list[Any]: + ... + + + +def ksubsets(superset, k) -> combinations[Any]: + ... + diff --git a/stubs/sympy-stubs/combinatorics/tensor_can.pyi b/stubs/sympy-stubs/combinatorics/tensor_can.pyi new file mode 100644 index 00000000..3683f90a --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/tensor_can.pyi @@ -0,0 +1,40 @@ +from typing import Any, Literal +from sympy.combinatorics.permutations import Perm +from sympy.core.basic import Basic +def dummy_sgs(dummies, sym, n) -> list[Any]: + ... + +def transversal2coset(size, base, transversal) -> list[Any]: + ... + +def double_coset_can_rep(dummies, sym, b_S, sgens, S_transversals, g) -> Literal[0]: + ... + +def canonical_free(base, gens, g, num_free) -> list[Any]: + ... + +def canonicalize(g, dummies, msym, *v) -> list[Any] | Literal[0]: + ... + +def perm_af_direct_product(gens1, gens2, signed=...) -> list[list[Any]]: + ... + +def bsgs_direct_product(base1, gens1, base2, gens2, signed=...) -> tuple[list[Any], list[Perm]]: + ... + +def get_symmetric_group_sgs(n, antisym=...) -> tuple[list[Any], list[Perm]] | tuple[list[int], list[Perm]]: + ... + +riemann_bsgs = ... +def get_transversals(base, gens) -> list[Any] | list[dict[Any, Any]]: + ... + +def get_minimal_bsgs(base, gens) -> tuple[Any | list[Any], list[Basic] | Any | list[Basic | Any]] | None: + ... + +def tensor_gens(base, gens, list_free_indices, sym=...) -> tuple[Any, list[Any], list[Perm]] | tuple[Any, Any | list[Any], list[Perm] | list[Any | Perm]] | tuple[Any, list[Any], list[Perm] | list[Any | Perm]]: + ... + +def gens_products(*v) -> tuple[Any | None, Any | list[Any], list[list[int]] | list[Perm | Any]]: + ... + diff --git a/stubs/sympy-stubs/combinatorics/testutil.pyi b/stubs/sympy-stubs/combinatorics/testutil.pyi new file mode 100644 index 00000000..9caf385c --- /dev/null +++ b/stubs/sympy-stubs/combinatorics/testutil.pyi @@ -0,0 +1,8 @@ +from typing import Any, Literal +rmul = ... +def canonicalize_naive(g, dummies, sym, *v) -> list[Any] | Literal[0]: + ... + +def graph_certificate(gr) -> list[Any] | Literal[0]: + ... + diff --git a/stubs/sympy-stubs/concrete/__init__.pyi b/stubs/sympy-stubs/concrete/__init__.pyi new file mode 100644 index 00000000..8c7e8a84 --- /dev/null +++ b/stubs/sympy-stubs/concrete/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.concrete.products import Product, product +from sympy.concrete.summations import Sum, summation + +__all__ = ['product', 'Product', 'summation', 'Sum'] diff --git a/stubs/sympy-stubs/concrete/delta.pyi b/stubs/sympy-stubs/concrete/delta.pyi new file mode 100644 index 00000000..f0445615 --- /dev/null +++ b/stubs/sympy-stubs/concrete/delta.pyi @@ -0,0 +1,15 @@ +from typing import Any +from sympy.concrete.summations import Sum +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.relational import Equality, Ne, Relational +from sympy.functions.elementary.piecewise import Piecewise + +@cacheit +def deltaproduct(f, limit) -> Equality | Relational | Ne | Any: + ... + +@cacheit +def deltasummation(f, limit, no_piecewise=...) -> Equality | Relational | Ne | Basic | Piecewise | Sum: + ... + diff --git a/stubs/sympy-stubs/concrete/expr_with_intlimits.pyi b/stubs/sympy-stubs/concrete/expr_with_intlimits.pyi new file mode 100644 index 00000000..92300bb9 --- /dev/null +++ b/stubs/sympy-stubs/concrete/expr_with_intlimits.pyi @@ -0,0 +1,29 @@ +from typing import Self +from sympy.concrete.expr_with_limits import ExprWithLimits + +class ReorderError(NotImplementedError): + def __init__(self, expr, msg) -> None: + ... + + + +class ExprWithIntLimits(ExprWithLimits): + __slots__ = ... + def change_index(self, var, trafo, newvar=...) -> Self: + ... + + def index(self, x) -> int: + ... + + def reorder(self, *arg) -> Self: + ... + + def reorder_limit(self, x, y) -> Self: + ... + + @property + def has_empty_sequence(self) -> bool | None: + ... + + + diff --git a/stubs/sympy-stubs/concrete/expr_with_limits.pyi b/stubs/sympy-stubs/concrete/expr_with_limits.pyi new file mode 100644 index 00000000..4922e5ac --- /dev/null +++ b/stubs/sympy-stubs/concrete/expr_with_limits.pyi @@ -0,0 +1,56 @@ +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.kind import Kind +from sympy.core.relational import Equality, Ne, Relational + +class ExprWithLimits(Expr): + __slots__ = ... + def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: + ... + + @property + def function(self) -> Basic: + ... + + @property + def kind(self) -> Kind: + ... + + @property + def limits(self) -> tuple[Basic, ...]: + ... + + @property + def variables(self) -> list[Any]: + ... + + @property + def bound_symbols(self) -> list[Any]: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + @property + def is_number(self) -> bool: + ... + + @property + def has_finite_limits(self) -> bool | None: + ... + + @property + def has_reversed_limits(self) -> bool | None: + ... + + + +class AddWithLimits(ExprWithLimits): + __slots__ = ... + def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: + ... + + + diff --git a/stubs/sympy-stubs/concrete/gosper.pyi b/stubs/sympy-stubs/concrete/gosper.pyi new file mode 100644 index 00000000..ac834e98 --- /dev/null +++ b/stubs/sympy-stubs/concrete/gosper.pyi @@ -0,0 +1,11 @@ +from typing import Any + +def gosper_normal(f, g, n, polys=...) -> tuple[Any, Any, Any]: + ... + +def gosper_term(f, n) -> Any | None: + ... + +def gosper_sum(f, k) -> Any | None: + ... + diff --git a/stubs/sympy-stubs/concrete/products.pyi b/stubs/sympy-stubs/concrete/products.pyi new file mode 100644 index 00000000..e2edec49 --- /dev/null +++ b/stubs/sympy-stubs/concrete/products.pyi @@ -0,0 +1,33 @@ +from typing import Any, Self, Tuple as tTuple +from sympy.concrete.expr_with_intlimits import ExprWithIntLimits +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.relational import Equality, Ne, Relational +from sympy.core.symbol import Symbol +from sympy.series.order import Order + +class Product(ExprWithIntLimits): + __slots__ = ... + limits: tTuple[tTuple[Symbol, Expr, Expr]] + def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: + ... + + @property + def term(self) -> Basic: + ... + + function = ... + def doit(self, **hints) -> tuple[Any, ...] | Self | Basic | Equality | Order | Relational | Ne | Any: + ... + + def is_convergent(self): + ... + + def reverse_order(self, *indices) -> Product: + ... + + + +def product(*args, **kwargs) -> Equality | Relational | Ne: + ... + diff --git a/stubs/sympy-stubs/concrete/summations.pyi b/stubs/sympy-stubs/concrete/summations.pyi new file mode 100644 index 00000000..f69cf00d --- /dev/null +++ b/stubs/sympy-stubs/concrete/summations.pyi @@ -0,0 +1,60 @@ +from typing import Any, Self, Tuple as tTuple +from sympy.concrete.expr_with_intlimits import ExprWithIntLimits +from sympy.concrete.expr_with_limits import AddWithLimits +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.relational import Equality, Ne, Relational +from sympy.core.symbol import Symbol +from sympy.functions.elementary.piecewise import Piecewise +from sympy.series.order import Order + +class Sum(AddWithLimits, ExprWithIntLimits): + __slots__ = ... + limits: tTuple[tTuple[Symbol, Expr, Expr]] + def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: + ... + + def doit(self, **hints) -> tuple[Any, ...] | Self | Order | Any | Piecewise | Basic | Equality | Relational | Ne | Sum | None: + ... + + def eval_zeta_function(self, f, limits) -> Piecewise | None: + ... + + def is_convergent(self): + ... + + def is_absolutely_convergent(self): + ... + + def euler_maclaurin(self, m=..., n=..., eps=..., eval_integral=...) -> tuple[Any, Any] | tuple[Any | Basic, Any] | tuple[Any | Order | Basic, Any] | tuple[Any, int]: + ... + + def reverse_order(self, *indices) -> Sum: + ... + + + +def summation(f, *symbols, **kwargs) -> Equality | Relational | Ne: + ... + +def telescopic_direct(L, R, n, limits) -> Order: + ... + +def telescopic(L, R, limits) -> Order | None: + ... + +def eval_sum(f, limits) -> Piecewise | Equality | Relational | Ne | Basic | Sum | Order | None: + ... + +def eval_sum_direct(expr, limits) -> Order: + ... + +def eval_sum_symbolic(f, limits): + ... + +def eval_sum_hyper(f, i_a_b) -> Piecewise | None: + ... + +def eval_sum_residue(f, i_a_b): + ... + diff --git a/stubs/sympy-stubs/conftest.pyi b/stubs/sympy-stubs/conftest.pyi new file mode 100644 index 00000000..a88761f6 --- /dev/null +++ b/stubs/sympy-stubs/conftest.pyi @@ -0,0 +1,26 @@ +import pytest + +sp = ... +def process_split(config, items) -> None: + ... + +def pytest_report_header(config) -> str: + ... + +def pytest_terminal_summary(terminalreporter) -> None: + ... + +def pytest_addoption(parser) -> None: + ... + +def pytest_collection_modifyitems(config, items) -> None: + ... + +@pytest.fixture(autouse=True, scope='module') +def file_clear_cache() -> None: + ... + +@pytest.fixture(autouse=True, scope='module') +def check_disabled(request) -> None: + ... + diff --git a/stubs/sympy-stubs/core/__init__.pyi b/stubs/sympy-stubs/core/__init__.pyi new file mode 100644 index 00000000..99a9d0fc --- /dev/null +++ b/stubs/sympy-stubs/core/__init__.pyi @@ -0,0 +1,28 @@ +from sympy.core.sympify import SympifyError, sympify +from sympy.core.cache import cacheit +from sympy.core.assumptions import assumptions, check_assumptions, common_assumptions, failing_assumptions +from sympy.core.basic import Atom, Basic +from sympy.core.singleton import S +from sympy.core.expr import AtomicExpr, Expr, UnevaluatedExpr +from sympy.core.symbol import Dummy, Symbol, Wild, symbols, var +from sympy.core.numbers import AlgebraicNumber, E, Float, I, Integer, Number, NumberSymbol, Rational, RealNumber, comp, igcd, ilcm, mod_inverse, nan, oo, pi, seterr, zoo +from sympy.core.power import Pow, integer_log, integer_nthroot +from sympy.core.mul import Mul, prod +from sympy.core.add import Add +from sympy.core.mod import Mod +from sympy.core.relational import Eq, Equality, Ge, GreaterThan, Gt, Le, LessThan, Lt, Ne, Rel, StrictGreaterThan, StrictLessThan, Unequality +from sympy.core.multidimensional import vectorize +from sympy.core.function import Derivative, Function, FunctionClass, Lambda, PoleError, Subs, WildFunction, arity, count_ops, diff, expand, expand_complex, expand_func, expand_log, expand_mul, expand_multinomial, expand_power_base, expand_power_exp, expand_trig, nfloat +from sympy.core.evalf import N, PrecisionExhausted, evalf +from sympy.core.containers import Dict, Tuple +from sympy.core.exprtools import factor_nc, factor_terms, gcd_terms +from sympy.core.parameters import evaluate +from sympy.core.kind import BooleanKind, NumberKind, UndefinedKind +from sympy.core.traversal import bottom_up, postorder_traversal, preorder_traversal, use +from sympy.core.sorting import default_sort_key, ordered + +Catalan = ... +EulerGamma = ... +GoldenRatio = ... +TribonacciConstant = ... +__all__ = ['sympify', 'SympifyError', 'cacheit', 'assumptions', 'check_assumptions', 'failing_assumptions', 'common_assumptions', 'Basic', 'Atom', 'S', 'Expr', 'AtomicExpr', 'UnevaluatedExpr', 'Symbol', 'Wild', 'Dummy', 'symbols', 'var', 'Number', 'Float', 'Rational', 'Integer', 'NumberSymbol', 'RealNumber', 'igcd', 'ilcm', 'seterr', 'E', 'I', 'nan', 'oo', 'pi', 'zoo', 'AlgebraicNumber', 'comp', 'mod_inverse', 'Pow', 'integer_nthroot', 'integer_log', 'Mul', 'prod', 'Add', 'Mod', 'Rel', 'Eq', 'Ne', 'Lt', 'Le', 'Gt', 'Ge', 'Equality', 'GreaterThan', 'LessThan', 'Unequality', 'StrictGreaterThan', 'StrictLessThan', 'vectorize', 'Lambda', 'WildFunction', 'Derivative', 'diff', 'FunctionClass', 'Function', 'Subs', 'expand', 'PoleError', 'count_ops', 'expand_mul', 'expand_log', 'expand_func', 'expand_trig', 'expand_complex', 'expand_multinomial', 'nfloat', 'expand_power_base', 'expand_power_exp', 'arity', 'PrecisionExhausted', 'N', 'evalf', 'Tuple', 'Dict', 'gcd_terms', 'factor_terms', 'factor_nc', 'evaluate', 'Catalan', 'EulerGamma', 'GoldenRatio', 'TribonacciConstant', 'UndefinedKind', 'NumberKind', 'BooleanKind', 'preorder_traversal', 'bottom_up', 'use', 'postorder_traversal', 'default_sort_key', 'ordered'] diff --git a/stubs/sympy-stubs/core/add.pyi b/stubs/sympy-stubs/core/add.pyi new file mode 100644 index 00000000..5809032e --- /dev/null +++ b/stubs/sympy-stubs/core/add.pyi @@ -0,0 +1,82 @@ +from typing import Any, Literal, Self, Tuple as tTuple +from sympy.core.kind import _UndefinedKind +from sympy.core.mul import Mul +from sympy.core.numbers import Integer, Rational +from sympy.core.operations import AssocOp +from sympy.core.cache import cacheit +from sympy.core.expr import Expr +from sympy.series.order import Order + +_args_sortkey = ... +class Add(Expr, AssocOp): + __slots__ = ... + args: tTuple[Expr, ...] + is_Add = ... + _args_type = Expr + @classmethod + def flatten(cls, seq): + ... + + @classmethod + def class_key(cls) -> tuple[Literal[3], Literal[1], str]: + ... + + @property + def kind(self) -> _UndefinedKind | Any: + ... + + def could_extract_minus_sign(self) -> bool: + ... + + @cacheit + def as_coeff_add(self, *deps) -> tuple[Any | Self, tuple[Any, ...]] | tuple[Expr, tuple[Expr, ...]] | tuple[Any, tTuple[Expr, ...]]: + ... + + def as_coeff_Add(self, rational=..., deps=...) -> tuple[Expr, Any | Self] | tuple[Any, Self]: + ... + + def matches(self, expr, repl_dict=..., old=...): + ... + + @cacheit + def as_two_terms(self) -> tuple[Expr, Any | Self]: + ... + + def as_numer_denom(self) -> tuple[Order, Any] | tuple[Self, Any | Add | Order | Mul] | tuple[Any | Add | Order | Mul, Any | Add | Order | Mul]: + ... + + _eval_is_real = ... + _eval_is_extended_real = ... + _eval_is_complex = ... + _eval_is_antihermitian = ... + _eval_is_finite = ... + _eval_is_hermitian = ... + _eval_is_integer = ... + _eval_is_rational = ... + _eval_is_algebraic = ... + _eval_is_commutative = ... + def removeO(self) -> Self: + ... + + def getO(self) -> Self | None: + ... + + @cacheit + def extract_leading_order(self, symbols, point=...) -> tuple[tuple[Expr, Order], ...]: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Self, Self]: + ... + + def primitive(self) -> tuple[Any, Self] | tuple[Rational | Any | Integer, Any | Self]: + ... + + def as_content_primitive(self, radical=..., clear=...) -> tuple[Any | Integer | Rational, Any | Rational | Integer | Self]: + ... + + def __neg__(self) -> Mul | Order: + ... + + + +add = ... diff --git a/stubs/sympy-stubs/core/assumptions.pyi b/stubs/sympy-stubs/core/assumptions.pyi new file mode 100644 index 00000000..b4cda51d --- /dev/null +++ b/stubs/sympy-stubs/core/assumptions.pyi @@ -0,0 +1,43 @@ +from typing import Any, Self +from sympy.core.facts import FactKB + +_assume_rules = ... +_assume_defined = ... +_assume_defined = ... +def assumptions(expr, _check=...) -> dict[Any, Any]: + ... + +def common_assumptions(exprs, check=...) -> dict[Any, Any]: + ... + +def failing_assumptions(expr, **assumptions) -> dict[Any, Any]: + ... + +def check_assumptions(expr, against=..., **assume) -> bool | None: + ... + +class StdFactKB(FactKB): + def __init__(self, facts=...) -> None: + ... + + def copy(self) -> Self: + ... + + @property + def generator(self) -> dict[Any, Any]: + ... + + + +def as_property(fact): + ... + +def make_property(fact) -> property: + ... + +class ManagedProperties(type): + def __init__(cls, *args, **kwargs) -> None: + ... + + + diff --git a/stubs/sympy-stubs/core/basic.pyi b/stubs/sympy-stubs/core/basic.pyi new file mode 100644 index 00000000..8981964b --- /dev/null +++ b/stubs/sympy-stubs/core/basic.pyi @@ -0,0 +1,220 @@ +from typing import Any, Literal, Self +from sympy import Symbol +from sympy.core.cache import cacheit +from sympy.core.kind import Kind +from sympy.core._print_helpers import Printable + +def as_Basic(expr): + ... + +class Basic(Printable): + __slots__ = ... + _args: tuple[Basic, ...] + _mhash: int | None + @property + def __sympy__(self) -> Literal[True]: + ... + + def __init_subclass__(cls) -> None: + ... + + is_number = ... + is_Atom = ... + is_Symbol = ... + is_symbol = ... + is_Indexed = ... + is_Dummy = ... + is_Wild = ... + is_Function = ... + is_Add = ... + is_Mul = ... + is_Pow = ... + is_Number = ... + is_Float = ... + is_Rational = ... + is_Integer = ... + is_NumberSymbol = ... + is_Order = ... + is_Derivative = ... + is_Piecewise = ... + is_Poly = ... + is_AlgebraicNumber = ... + is_Relational = ... + is_Equality = ... + is_Boolean = ... + is_Not = ... + is_Matrix = ... + is_Vector = ... + is_Point = ... + is_MatAdd = ... + is_MatMul = ... + is_real: bool | None + is_extended_real: bool | None + is_zero: bool | None + is_negative: bool | None + is_commutative: bool | None + kind: Kind = ... + def __new__(cls, *args) -> Self: + ... + + def copy(self) -> Self: + ... + + def __getnewargs__(self) -> tuple[Basic, ...]: + ... + + def __getstate__(self) -> None: + ... + + def __setstate__(self, state) -> None: + ... + + def __reduce_ex__(self, protocol) -> str | tuple[Any, ...]: + ... + + def __hash__(self) -> int: + ... + + @property + def assumptions0(self) -> dict[Any, Any]: + ... + + def compare(self, other) -> int: + ... + + @classmethod + def fromiter(cls, args, **assumptions) -> Self: + ... + + @classmethod + def class_key(cls) -> tuple[Literal[5], Literal[0], str]: + ... + + @cacheit + def sort_key(self, order=...) -> tuple[tuple[Literal[5], Literal[0], str], tuple[int, tuple[Any, ...]], Any, Any]: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def dummy_eq(self, other, symbol=...): + ... + + def atoms(self, *types) -> set[Any]: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + @property + def expr_free_symbols(self) -> set[Any]: + ... + + def as_dummy(self) -> Self | tuple[Any, dict[Any, Any]]: + ... + + @property + def canonical_variables(self) -> dict[Any, Any]: + ... + + def rcall(self, *args) -> Symbol | Any: + ... + + def is_hypergeometric(self, k) -> bool | None: + ... + + @property + def is_comparable(self) -> Literal[False]: + ... + + @property + def func(self) -> type[Self]: + ... + + @property + def args(self) -> tuple[Basic, ...]: + ... + + def as_content_primitive(self, radical=..., clear=...) -> tuple[Any, Self]: + ... + + def subs(self, *args, **kwargs) -> Self | Basic: + ... + + def xreplace(self, rule) -> Self: + ... + + @cacheit + def has(self, *patterns) -> bool: + ... + + def has_xfree(self, s: set[Basic]) -> bool: + ... + + @cacheit + def has_free(self, *patterns) -> bool: + ... + + def replace(self, query, value, map=..., simultaneous=..., exact=...) -> tuple[Any, dict[Any, Any]]: + ... + + def find(self, query, group=...) -> set[Any] | dict[Any, Any]: + ... + + def count(self, query) -> int: + ... + + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + def match(self, pattern, old=...): + ... + + def count_ops(self, visual=...): + ... + + def doit(self, **hints) -> Self: + ... + + def simplify(self, **kwargs): + ... + + def refine(self, assumption=...) -> Basic: + ... + + def rewrite(self, *args, deep=..., **hints) -> Self | Any: + ... + + _constructor_postprocessor_mapping = ... + def could_extract_minus_sign(self) -> Literal[False]: + ... + + + +class Atom(Basic): + is_Atom = ... + __slots__ = ... + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + def xreplace(self, rule, hack2=...): + ... + + def doit(self, **hints) -> Self: + ... + + @classmethod + def class_key(cls) -> tuple[Literal[2], Literal[0], str]: + ... + + @cacheit + def sort_key(self, order=...) -> tuple[tuple[Literal[2], Literal[0], str], tuple[Literal[1], tuple[str]], Any, Any]: + ... + + + +preorder_traversal = ... diff --git a/stubs/sympy-stubs/core/cache.pyi b/stubs/sympy-stubs/core/cache.pyi new file mode 100644 index 00000000..f9afb695 --- /dev/null +++ b/stubs/sympy-stubs/core/cache.pyi @@ -0,0 +1,37 @@ +from typing import Callable + +class _cache(list): + def print_cache(self) -> None: + ... + + def clear_cache(self) -> None: + ... + + + +CACHE = ... +print_cache = ... +clear_cache = ... +USE_CACHE = ... +scs = ... +if scs.lower() == 'none': + SYMPY_CACHE_SIZE = ... +else: + SYMPY_CACHE_SIZE = ... +if USE_CACHE == 'no': + cacheit = ... +else: + cacheit = ... +def cached_property(func) -> property: + ... + +def lazy_function(module: str, name: str) -> Callable: + class LazyFunctionMeta(type): + ... + + + class LazyFunction(metaclass=LazyFunctionMeta): + ... + + + diff --git a/stubs/sympy-stubs/core/containers.pyi b/stubs/sympy-stubs/core/containers.pyi new file mode 100644 index 00000000..567c3ce3 --- /dev/null +++ b/stubs/sympy-stubs/core/containers.pyi @@ -0,0 +1,147 @@ +from collections.abc import MutableSet +from types import NotImplementedType +from typing import Any, Callable, Generator, Iterator, Self +from sympy.core.basic import Basic +from sympy.core.kind import Kind + +class Tuple(Basic): + def __new__(cls, *args, **kwargs) -> Self: + ... + + def __getitem__(self, i) -> Tuple: + ... + + def __len__(self) -> int: + ... + + def __contains__(self, item) -> bool: + ... + + def __iter__(self) -> Iterator[Basic]: + ... + + def __add__(self, other) -> Tuple | NotImplementedType: + ... + + def __radd__(self, other) -> Tuple | NotImplementedType: + ... + + def __mul__(self, other) -> Self: + ... + + __rmul__ = ... + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def tuple_count(self, value) -> int: + ... + + def index(self, value, start=..., stop=...) -> int: + ... + + @property + def kind(self) -> TupleKind: + ... + + + +def tuple_wrapper(method) -> Callable[..., Any]: + ... + +class Dict(Basic): + def __new__(cls, *args) -> Self: + ... + + def __getitem__(self, key): + ... + + def __setitem__(self, key, value): + ... + + def items(self): + ... + + def keys(self): + ... + + def values(self): + ... + + def __iter__(self): + ... + + def __len__(self): + ... + + def get(self, key, default=...) -> None: + ... + + def __contains__(self, key) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __eq__(self, other) -> bool: + ... + + __hash__: Callable[[Basic], Any] = ... + + +class OrderedSet(MutableSet): + def __init__(self, iterable=...) -> None: + ... + + def __len__(self) -> int: + ... + + def __contains__(self, key) -> bool: + ... + + def add(self, key) -> None: + ... + + def discard(self, key) -> None: + ... + + def pop(self, last=...): + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def __repr__(self) -> str: + ... + + def intersection(self, other) -> Self: + ... + + def difference(self, other) -> Self: + ... + + def update(self, iterable) -> None: + ... + + + +class TupleKind(Kind): + def __new__(cls, *args) -> Self: + ... + + def __repr__(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/core/core.pyi b/stubs/sympy-stubs/core/core.pyi new file mode 100644 index 00000000..713b3194 --- /dev/null +++ b/stubs/sympy-stubs/core/core.pyi @@ -0,0 +1,12 @@ + +ordering_of_classes = ... +class Registry: + __slots__ = ... + def __setattr__(self, name, obj) -> None: + ... + + def __delattr__(self, name) -> None: + ... + + + diff --git a/stubs/sympy-stubs/core/decorators.pyi b/stubs/sympy-stubs/core/decorators.pyi new file mode 100644 index 00000000..f449e02e --- /dev/null +++ b/stubs/sympy-stubs/core/decorators.pyi @@ -0,0 +1,27 @@ +from functools import _Wrapped +from typing import Any, Callable + +def call_highest_priority(method_name) -> Callable[..., _Wrapped[..., Any, ..., Any]]: + ... + +def sympify_method_args(cls): + ... + +def sympify_return(*args) -> Callable[..., _SympifyWrapper]: + ... + +def _sympifyit(arg, retval=None) -> Callable[..., _SympifyWrapper]: + ... + +def __sympifyit(func, arg, retval=None) -> Callable[..., _SympifyWrapper]: + ... + +class _SympifyWrapper: + def __init__(self, func, args) -> None: + ... + + def make_wrapped(self, cls) -> _Wrapped[..., Any, ..., Any]: + ... + + + diff --git a/stubs/sympy-stubs/core/evalf.pyi b/stubs/sympy-stubs/core/evalf.pyi new file mode 100644 index 00000000..b3a058fb --- /dev/null +++ b/stubs/sympy-stubs/core/evalf.pyi @@ -0,0 +1,174 @@ +from typing import Any, Callable, Dict as tDict, List, Optional, TYPE_CHECKING, Self, Tuple as tTuple, Type, Union as tUnion, overload +from mpmath import mpc, mpf +from sympy.core.expr import Expr +from sympy.core.add import Add +from sympy.core.mul import Mul +from sympy.core.power import Pow +from sympy.core.symbol import Symbol +from sympy.integrals.integrals import Integral +from sympy.concrete.summations import Sum +from sympy.concrete.products import Product +from sympy.functions.elementary.exponential import exp, log +from sympy.functions.elementary.complexes import Abs, im, re +from sympy.functions.elementary.integers import ceiling, floor +from sympy.functions.elementary.trigonometric import atan +from sympy.core.numbers import AlgebraicNumber, Float, Integer, Number, Rational + +if TYPE_CHECKING: + ... +LG10 = ... +rnd = ... +def bitcount(n): + ... + +INF = ... +MINUS_INF = ... +DEFAULT_MAXPREC = ... +class PrecisionExhausted(ArithmeticError): + ... + + +MPF_TUP = tTuple[int, int, int, int] +TMP_RES = Any +OPT_DICT = tDict[str, Any] +def fastlog(x: Optional[MPF_TUP]) -> tUnion[int, Any]: + ... + +def pure_complex(v: Expr, or_real=...) -> tuple[Number, Number] | None: + ... + +SCALED_ZERO_TUP = tTuple[List[int], int, int, int] +@overload +def scaled_zero(mag: SCALED_ZERO_TUP, sign=...) -> MPF_TUP: + ... + +@overload +def scaled_zero(mag: int, sign=...) -> tTuple[SCALED_ZERO_TUP, int]: + ... + +def scaled_zero(mag: tUnion[SCALED_ZERO_TUP, int], sign=...) -> tUnion[MPF_TUP, tTuple[SCALED_ZERO_TUP, int]]: + ... + +def iszero(mpf: tUnion[MPF_TUP, SCALED_ZERO_TUP, None], scaled=...) -> Optional[bool]: + ... + +def complex_accuracy(result: TMP_RES) -> tUnion[int, Any]: + ... + +def get_abs(expr: Expr, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def get_complex_part(expr: Expr, no: int, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_abs(expr: Abs, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_re(expr: re, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_im(expr: im, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def finalize_complex(re: MPF_TUP, im: MPF_TUP, prec: int) -> TMP_RES: + ... + +def chop_parts(value: TMP_RES, prec: int) -> TMP_RES: + ... + +def check_target(expr: Expr, result: TMP_RES, prec: int) -> None: + ... + +def get_integer_part(expr: Expr, no: int, options: OPT_DICT, return_ints=...) -> tUnion[TMP_RES, tTuple[int, int]]: + ... + +def evalf_ceiling(expr: ceiling, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_floor(expr: floor, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_float(expr: Float, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_rational(expr: Rational, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_integer(expr: Integer, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def add_terms(terms: list, prec: int, target_prec: int) -> tTuple[tUnion[MPF_TUP, SCALED_ZERO_TUP, None], Optional[int]]: + ... + +def evalf_add(v: Add, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_mul(v: Mul, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_pow(v: Pow, prec: int, options) -> TMP_RES: + ... + +def evalf_exp(expr: exp, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_trig(v: Expr, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_log(expr: log, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_atan(v: atan, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_subs(prec: int, subs: dict) -> dict: + ... + +def evalf_piecewise(expr: Expr, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_alg_num(a: AlgebraicNumber, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def as_mpmath(x: Any, prec: int, options: OPT_DICT) -> tUnion[mpc, mpf]: + ... + +def do_integral(expr: Integral, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_integral(expr: Integral, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def check_convergence(numer: Expr, denom: Expr, n: Symbol) -> tTuple[int, Any, Any]: + ... + +def hypsum(expr: Expr, n: Symbol, start: int, prec: int) -> mpf: + ... + +def evalf_prod(expr: Product, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_sum(expr: Sum, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def evalf_symbol(x: Expr, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +evalf_table: tDict[Type[Expr], Callable[[Expr, int, OPT_DICT], TMP_RES]] = ... +def evalf(x: Expr, prec: int, options: OPT_DICT) -> TMP_RES: + ... + +def quad_to_mpmath(q, ctx=...): + ... + +class EvalfMixin: + __slots__: tTuple[str, ...] = ... + def evalf(self, n=..., subs=..., maxn=..., chop=..., strict=..., quad=..., verbose=...) -> Self | EvalfMixin | TMP_RES | Float: + ... + + n = ... + + +def N(x, n=..., **options): + ... + diff --git a/stubs/sympy-stubs/core/expr.pyi b/stubs/sympy-stubs/core/expr.pyi new file mode 100644 index 00000000..b1dd0faf --- /dev/null +++ b/stubs/sympy-stubs/core/expr.pyi @@ -0,0 +1,409 @@ +from collections import defaultdict +from typing import TYPE_CHECKING, Any, Literal, Self +from sympy import Derivative, Equality, Integer, Mul, Order, Pow +from sympy.core.basic import Atom, Basic +from sympy.core.evalf import EvalfMixin +from sympy.core.decorators import call_highest_priority, sympify_method_args, sympify_return +from sympy.core.cache import cacheit +from sympy.core.function import UndefinedFunction +from sympy.core.numbers import Float, Number, Rational +from sympy.core.relational import Ne, Relational +from sympy.series.formal import FormalPowerSeries +from sympy.series.fourier import FiniteFourierSeries, FourierSeries +from sympy.tensor.array.array_derivatives import ArrayDerivative + +if TYPE_CHECKING: + ... +@sympify_method_args +class Expr(Basic, EvalfMixin): + __slots__: tuple[str, ...] = ... + is_scalar = ... + @cacheit + def sort_key(self, order=...) -> tuple[tuple[Literal[5], Literal[0], str] | Any, tuple[int, tuple[tuple[tuple[Literal[5], Literal[0], str], tuple[int, tuple[Any, ...]], Any, Any] | Any | tuple[tuple[Literal[10, 0], Literal[0], str | Any], tuple[int, tuple[Any, ...]] | tuple[Literal[1], tuple[str]], Any, Any], ...]], tuple[tuple[Literal[5], Literal[0], str], tuple[int, tuple[Any, ...]], Any, Any] | Any, Number]: + ... + + _op_priority = ... + def __pos__(self) -> Self: + ... + + def __neg__(self) -> Mul: + ... + + def __abs__(self) -> Expr: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__radd__') + def __add__(self, other) -> Order: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__add__') + def __radd__(self, other) -> Order: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__rsub__') + def __sub__(self, other) -> Order: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__sub__') + def __rsub__(self, other) -> Order: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__rmul__') + def __mul__(self, other) -> Order: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__mul__') + def __rmul__(self, other) -> Order: + ... + + def __pow__(self, other, mod=...) -> Expr: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__pow__') + def __rpow__(self, other) -> Pow: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__rtruediv__') + def __truediv__(self, other) -> Pow | Order: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__truediv__') + def __rtruediv__(self, other) -> Pow | Order: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__rmod__') + def __mod__(self, other) -> type[UndefinedFunction]: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__mod__') + def __rmod__(self, other) -> type[UndefinedFunction]: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__rfloordiv__') + def __floordiv__(self, other) -> type[UndefinedFunction]: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__floordiv__') + def __rfloordiv__(self, other) -> type[UndefinedFunction]: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__rdivmod__') + def __divmod__(self, other) -> tuple[type[UndefinedFunction] | Any, type[UndefinedFunction] | Any]: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + @call_highest_priority('__divmod__') + def __rdivmod__(self, other) -> tuple[type[UndefinedFunction] | Any, type[UndefinedFunction] | Any]: + ... + + def __int__(self) -> int: + ... + + def __float__(self) -> float: + ... + + def __complex__(self) -> complex: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + def __ge__(self, other) -> bool: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + def __le__(self, other) -> bool: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + def __gt__(self, other) -> bool: + ... + + @sympify_return([('other', 'Expr')], NotImplemented) + def __lt__(self, other) -> bool: + ... + + def __trunc__(self) -> Integer: + ... + + def __format__(self, format_spec: str) -> str: + ... + + @property + def is_number(self) -> bool: + ... + + def is_constant(self, *wrt, **flags): + ... + + def equals(self, other, failing_expression=...): + ... + + def conjugate(self) -> type[UndefinedFunction]: + ... + + def dir(self, x, cdir): + ... + + def transpose(self) -> type[UndefinedFunction]: + ... + + def adjoint(self) -> type[UndefinedFunction]: + ... + + def as_ordered_factors(self, order=...) -> list[Self]: + ... + + def as_poly(self, *gens, **args) -> Any | None: + ... + + def as_ordered_terms(self, order=..., data=...) -> list[Basic] | tuple[list[Any], list[Any]] | list[Any]: + ... + + def as_terms(self) -> tuple[list[Any], list[Any]]: + ... + + def removeO(self) -> Self: + ... + + def getO(self) -> None: + ... + + def getn(self) -> None: + ... + + def count_ops(self, visual=...): + ... + + def args_cnc(self, cset=..., warn=..., split_1=...) -> list[Any]: + ... + + def coeff(self, x, n=..., right=..., _first=...): + ... + + def as_expr(self, *gens) -> Self: + ... + + def as_coefficient(self, expr) -> None: + ... + + def as_independent(self, *deps, **hint) -> tuple[Expr, Expr]: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[type[UndefinedFunction] | Any, type[UndefinedFunction] | Any] | None: + ... + + def as_powers_dict(self) -> defaultdict[Any, int]: + ... + + def as_coefficients_dict(self, *syms) -> defaultdict[Any, int]: + ... + + def as_base_exp(self) -> tuple[Expr, Expr]: + ... + + def as_coeff_mul(self, *deps, **kwargs) -> tuple[Expr, tuple[Expr, ...]]: + ... + + def as_coeff_add(self, *deps) -> tuple[Expr, tuple[Expr, ...]]: + ... + + def primitive(self) -> tuple[Any, Any] | tuple[Any | Mul | Number, Any | Mul | Expr]: + ... + + def as_content_primitive(self, radical=..., clear=...) -> tuple[Any, Self]: + ... + + def as_numer_denom(self) -> tuple[Self, Any]: + ... + + def normal(self) -> Self | Mul: + ... + + def extract_multiplicatively(self, c): + ... + + def extract_additively(self, c) -> Self | Order | None: + ... + + @property + def expr_free_symbols(self) -> set[Any]: + ... + + def could_extract_minus_sign(self) -> Literal[False]: + ... + + def extract_branch_factor(self, allow_half=...) -> tuple[Any, Any]: + ... + + def is_polynomial(self, *syms) -> Literal[True] | None: + ... + + def is_rational_function(self, *syms) -> bool | None: + ... + + def is_meromorphic(self, x, a) -> Literal[True] | None: + ... + + def is_algebraic_expr(self, *syms) -> Literal[True] | None: + ... + + def series(self, x=..., x0=..., n=..., dir=..., logx=..., cdir=...): + ... + + def aseries(self, x=..., n=..., bound=..., hir=...) -> Self: + ... + + def taylor_term(self, n, x, *previous_terms): + ... + + def lseries(self, x=..., x0=..., dir=..., logx=..., cdir=...): + ... + + def nseries(self, x=..., x0=..., n=..., dir=..., logx=..., cdir=...) -> Self: + ... + + def limit(self, x, xlim, dir=...): + ... + + def compute_leading_term(self, x, logx=...) -> Self | Order | Any: + ... + + @cacheit + def as_leading_term(self, *symbols, logx=..., cdir=...) -> Self: + ... + + def as_coeff_exponent(self, x) -> tuple[Expr, Expr]: + ... + + def leadterm(self, x, logx=..., cdir=...) -> tuple[Any | Expr | Basic, Expr | Any]: + ... + + def as_coeff_Mul(self, rational: bool = ...) -> tuple[Number, Expr]: + ... + + def as_coeff_Add(self, rational=...) -> tuple[Number, Expr]: + ... + + def fps(self, x=..., x0=..., dir=..., hyper=..., order=..., rational=..., full=...) -> FormalPowerSeries: + ... + + def fourier_series(self, limits=...) -> FiniteFourierSeries | FourierSeries: + ... + + def diff(self, *symbols, **assumptions) -> ArrayDerivative | Derivative: + ... + + @cacheit + def expand(self, deep=..., modulus=..., power_base=..., power_exp=..., mul=..., log=..., multinomial=..., basic=..., **hints) -> Order | Any | Self: + ... + + def integrate(self, *args, **kwargs) -> Equality | Relational | Ne: + ... + + def nsimplify(self, constants=..., tolerance=..., full=...): + ... + + def separate(self, deep=..., force=...): + ... + + def collect(self, syms, func=..., evaluate=..., exact=..., distribute_order_term=...): + ... + + def together(self, *args, **kwargs) -> Any: + ... + + def apart(self, x=..., **args) -> Any: + ... + + def ratsimp(self) -> Any: + ... + + def trigsimp(self, **args) -> Any: + ... + + def radsimp(self, **kwargs): + ... + + def powsimp(self, *args, **kwargs): + ... + + def combsimp(self) -> Any: + ... + + def gammasimp(self) -> Self | Any: + ... + + def factor(self, *gens, **args) -> Any: + ... + + def cancel(self, *gens, **args) -> Any: + ... + + def invert(self, g, *gens, **args) -> int | Any: + ... + + def round(self, n=...) -> Self | Integer | Rational | Float: + ... + + __round__ = ... + + +class AtomicExpr(Atom, Expr): + is_number = ... + is_Atom = ... + __slots__ = ... + @property + def expr_free_symbols(self) -> set[Self]: + ... + + + +class UnevaluatedExpr(Expr): + def __new__(cls, arg, **kwargs) -> Self: + ... + + def doit(self, **hints) -> Basic: + ... + + + +def unchanged(func, *args): + ... + +class ExprBuilder: + def __init__(self, op, args=..., validator=..., check=...) -> None: + ... + + def validate(self) -> None: + ... + + def build(self, check=...): + ... + + def append_argument(self, arg, check=...) -> None: + ... + + def __getitem__(self, item) -> Any: + ... + + def __repr__(self) -> str: + ... + + def search_element(self, elem) -> tuple[int] | None: + ... + + + diff --git a/stubs/sympy-stubs/core/exprtools.pyi b/stubs/sympy-stubs/core/exprtools.pyi new file mode 100644 index 00000000..26400d18 --- /dev/null +++ b/stubs/sympy-stubs/core/exprtools.pyi @@ -0,0 +1,143 @@ +from types import NotImplementedType +from sympy import Order +from sympy.core.add import Add +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.mul import Mul +from sympy.core.numbers import Rational +from typing import Any, Dict, LiteralString, Tuple as tTuple + +_eps = ... +def decompose_power(expr: Expr) -> tTuple[Expr, int]: + ... + +def decompose_power_rat(expr: Expr) -> tTuple[Expr, Rational]: + ... + +class Factors: + __slots__ = ... + def __init__(self, factors=...) -> None: + ... + + def __hash__(self) -> int: + ... + + def __repr__(self) -> LiteralString: + ... + + @property + def is_zero(self) -> bool: + ... + + @property + def is_one(self) -> bool: + ... + + def as_expr(self) -> Order: + ... + + def mul(self, other) -> Factors: + ... + + def normal(self, other) -> tuple[Factors, Factors]: + ... + + def div(self, other) -> tuple[Factors, Factors]: + ... + + def quo(self, other) -> Factors: + ... + + def rem(self, other) -> Factors: + ... + + def pow(self, other) -> Factors: + ... + + def gcd(self, other) -> Factors: + ... + + def lcm(self, other) -> Factors: + ... + + def __mul__(self, other) -> Factors: + ... + + def __divmod__(self, other) -> tuple[Factors, Factors]: + ... + + def __truediv__(self, other) -> Factors: + ... + + def __mod__(self, other) -> Factors: + ... + + def __pow__(self, other) -> Factors: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + + +class Term: + __slots__ = ... + def __init__(self, term, numer=..., denom=...) -> None: + ... + + def __hash__(self) -> int: + ... + + def __repr__(self) -> str: + ... + + def as_expr(self): + ... + + def mul(self, other) -> Term: + ... + + def inv(self) -> Term: + ... + + def quo(self, other) -> Term: + ... + + def pow(self, other) -> Term: + ... + + def gcd(self, other) -> Term: + ... + + def lcm(self, other) -> Term: + ... + + def __mul__(self, other) -> Term | NotImplementedType: + ... + + def __truediv__(self, other) -> Term | NotImplementedType: + ... + + def __pow__(self, other) -> Term | NotImplementedType: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + + +def gcd_terms(terms, isprimitive=..., clear=..., fraction=...) -> Add | Order | Mul | Basic | Dict: + ... + +def factor_terms(expr, radical=..., clear=..., fraction=..., sign=...) -> Basic | Any | Add | Order | Mul: + ... + +def factor_nc(expr) -> Expr | Any | Add | Order | Mul: + ... + diff --git a/stubs/sympy-stubs/core/facts.pyi b/stubs/sympy-stubs/core/facts.pyi new file mode 100644 index 00000000..b73b75c9 --- /dev/null +++ b/stubs/sympy-stubs/core/facts.pyi @@ -0,0 +1,66 @@ +from collections import defaultdict +from typing import Any, Iterator + +def transitive_closure(implications) -> set[Any]: + ... + +def deduce_alpha_implications(implications) -> defaultdict[Any, set[Any]]: + ... + +def apply_beta_to_alpha_route(alpha_implications, beta_rules) -> dict[Any, Any]: + ... + +def rules_2prereq(rules) -> defaultdict[Any, set[Any]]: + ... + +class TautologyDetected(Exception): + ... + + +class Prover: + def __init__(self) -> None: + ... + + def split_alpha_beta(self) -> tuple[list[Any], list[Any]]: + ... + + @property + def rules_alpha(self) -> list[Any]: + ... + + @property + def rules_beta(self) -> list[Any]: + ... + + def process_rule(self, a, b) -> None: + ... + + + +class FactRules: + def __init__(self, rules) -> None: + ... + + def print_rules(self) -> Iterator[str]: + ... + + + +class InconsistentAssumptions(ValueError): + def __str__(self) -> str: + ... + + + +class FactKB(dict): + def __str__(self) -> str: + ... + + def __init__(self, rules) -> None: + ... + + def deduce_all_facts(self, facts) -> None: + ... + + + diff --git a/stubs/sympy-stubs/core/function.pyi b/stubs/sympy-stubs/core/function.pyi new file mode 100644 index 00000000..5e3e67fc --- /dev/null +++ b/stubs/sympy-stubs/core/function.pyi @@ -0,0 +1,304 @@ +from inspect import Signature +from types import NotImplementedType +from typing import Any, Callable, Dict, Literal, Self +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.decorators import _sympifyit +from sympy.core.expr import AtomicExpr, Expr +from sympy.core.kind import Kind +from sympy.core.logic import FuzzyBool +from sympy.core.numbers import Float +from sympy.printing.str import StrPrinter +from sympy.sets.sets import FiniteSet +from sympy.tensor.array.array_derivatives import ArrayDerivative + +class PoleError(Exception): + ... + + +class ArgumentIndexError(ValueError): + def __str__(self) -> str: + ... + + + +class BadSignatureError(TypeError): + ... + + +class BadArgumentsError(TypeError): + ... + + +def arity(cls) -> int | tuple[int, ...] | None: + ... + +class FunctionClass(type): + _new = ... + def __init__(cls, *args, **kwargs) -> None: + ... + + @property + def __signature__(self) -> Signature | None: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + @property + def xreplace(self) -> Callable[..., Any]: + ... + + @property + def nargs(self) -> FiniteSet: + ... + + def __repr__(cls) -> str: + ... + + + +class Application(Basic, metaclass=FunctionClass): + is_Function = ... + @cacheit + def __new__(cls, *args, **options) -> Self: + ... + + @classmethod + def eval(cls, *args) -> None: + ... + + @property + def func(self) -> type[Self]: + ... + + + +class Function(Application, Expr): + @cacheit + def __new__(cls, *args, **options) -> type[UndefinedFunction]: + ... + + @classmethod + def class_key(cls) -> tuple[Literal[4], int, str]: + ... + + _singularities: FuzzyBool | tuple[Expr, ...] = ... + @classmethod + def is_singular(cls, a) -> FuzzyBool: + ... + + def as_base_exp(self) -> tuple[Self, Any]: + ... + + def fdiff(self, argindex=...) -> ArrayDerivative | Derivative | Subs: + ... + + + +class AppliedUndef(Function): + is_number = ... + def __new__(cls, *args, **options) -> type[UndefinedFunction]: + ... + + + +class UndefSageHelper: + def __get__(self, ins, typ) -> Callable[[], Any]: + ... + + + +_undef_sage_helper = ... +class UndefinedFunction(FunctionClass): + def __new__(cls, name, bases=..., __dict__=..., **kwargs) -> Self: # type: ignore + ... + + def __instancecheck__(cls, instance) -> bool: + ... + + _kwargs: dict[str, bool | None] = ... + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + + +class WildFunction(Function, AtomicExpr): + include: set[Any] = ... + def __init__(self, name, **assumptions) -> None: + ... + + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + + +class Derivative(Expr): + is_Derivative = ... + def __new__(cls, expr, *variables, **kwargs): + ... + + @property + def canonical(cls) -> Self: + ... + + def doit(self, **hints) -> Self: + ... + + @_sympifyit('z0', NotImplementedError) + def doit_numerically(self, z0) -> Float: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def variables(self) -> tuple[Any, ...]: + ... + + @property + def variable_count(self) -> tuple[Basic, ...]: + ... + + @property + def derivative_count(self) -> int: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + @property + def kind(self) -> Kind: + ... + + def as_finite_difference(self, points=..., x0=..., wrt=...) -> Literal[0]: + ... + + + +class Lambda(Expr): + is_Function = ... + def __new__(cls, signature, expr) -> Self: + ... + + @property + def signature(self) -> Basic: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def variables(self) -> tuple[Any, ...]: + ... + + @property + def nargs(self) -> FiniteSet: + ... + + bound_symbols = ... + @property + def free_symbols(self) -> set[Basic]: + ... + + def __call__(self, *args) -> Basic: + ... + + @property + def is_identity(self) -> NotImplementedType | bool: + ... + + + +class Subs(Expr): + def __new__(cls, expr, variables, point, **assumptions) -> Self: + class CustomStrPrinter(StrPrinter): + ... + + + + def doit(self, **hints) -> Basic: + ... + + def evalf(self, prec=..., **options): + ... + + n = ... + @property + def variables(self) -> Basic: + ... + + bound_symbols = ... + @property + def expr(self) -> Basic: + ... + + @property + def point(self) -> Basic: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + @property + def expr_free_symbols(self) -> set[Any]: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +def diff(f, *symbols, **kwargs) -> ArrayDerivative | Derivative: + ... + +def expand(e, deep=..., modulus=..., power_base=..., power_exp=..., mul=..., log=..., multinomial=..., basic=..., **hints): + ... + +def expand_mul(expr, deep=...): + ... + +def expand_multinomial(expr, deep=...): + ... + +def expand_log(expr, deep=..., force=..., factor=...): + ... + +def expand_func(expr, deep=...): + ... + +def expand_trig(expr, deep=...): + ... + +def expand_complex(expr, deep=...): + ... + +def expand_power_base(expr, deep=..., force=...): + ... + +def expand_power_exp(expr, deep=...): + ... + +def count_ops(expr, visual=...): + ... + +def nfloat(expr, n=..., exponent=..., dkeys=...) -> dict[Any, Any] | Dict | Basic | Any | Float: + ... + diff --git a/stubs/sympy-stubs/core/kind.pyi b/stubs/sympy-stubs/core/kind.pyi new file mode 100644 index 00000000..80414dff --- /dev/null +++ b/stubs/sympy-stubs/core/kind.pyi @@ -0,0 +1,68 @@ +from typing import Callable, Literal, LiteralString, Self +from sympy.core.cache import cacheit + +class KindMeta(type): + def __new__(cls, clsname, bases, dct) -> Self: # type: ignore + ... + + + +class Kind(metaclass=KindMeta): + def __new__(cls, *args) -> Self: + ... + + + +class _UndefinedKind(Kind): + def __new__(cls) -> Self: + ... + + def __repr__(self) -> Literal['UndefinedKind']: + ... + + + +UndefinedKind = ... +class _NumberKind(Kind): + def __new__(cls) -> Self: + ... + + def __repr__(self) -> Literal['NumberKind']: + ... + + + +NumberKind = ... +class _BooleanKind(Kind): + def __new__(cls) -> Self: + ... + + def __repr__(self) -> Literal['BooleanKind']: + ... + + + +BooleanKind = ... +class KindDispatcher: + def __init__(self, name, commutative=..., doc=...) -> None: + ... + + def __repr__(self) -> LiteralString: + ... + + def register(self, *types, **kwargs) -> Callable[..., None]: + ... + + def __call__(self, *args, **kwargs) -> Kind | _UndefinedKind: + ... + + @cacheit + def dispatch_kinds(self, kinds, **kwargs) -> Kind | _UndefinedKind: + ... + + @property + def __doc__(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/core/logic.pyi b/stubs/sympy-stubs/core/logic.pyi new file mode 100644 index 00000000..452e7460 --- /dev/null +++ b/stubs/sympy-stubs/core/logic.pyi @@ -0,0 +1,85 @@ +from typing import Any, Optional, Self + +FuzzyBool = Optional[bool] +def fuzzy_bool(x) -> bool | None: + ... + +def fuzzy_and(args) -> bool | None: + ... + +def fuzzy_not(v) -> bool: + ... + +def fuzzy_or(args) -> bool | None: + ... + +def fuzzy_xor(args) -> bool | None: + ... + +def fuzzy_nand(args) -> bool | None: + ... + +class Logic: + op_2class: dict[str, type[Logic]] = ... + def __new__(cls, *args) -> Self: + ... + + def __getnewargs__(self): + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, b) -> bool: + ... + + def __ne__(self, b) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __cmp__(self, other) -> int: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + @staticmethod + def fromstring(text) -> Not | bool | Logic: + ... + + + +class AndOr_Base(Logic): + def __new__(cls, *args) -> bool | Self: + ... + + @classmethod + def flatten(cls, args) -> tuple[Any, ...]: + ... + + + +class And(AndOr_Base): + op_x_notx = ... + def expand(self) -> bool | Or | Self: + ... + + + +class Or(AndOr_Base): + op_x_notx = ... + + +class Not(Logic): + def __new__(cls, arg) -> Self | bool: + ... + + @property + def arg(self): + ... + + + diff --git a/stubs/sympy-stubs/core/mod.pyi b/stubs/sympy-stubs/core/mod.pyi new file mode 100644 index 00000000..dddfead5 --- /dev/null +++ b/stubs/sympy-stubs/core/mod.pyi @@ -0,0 +1,10 @@ +from sympy.core.function import Function + +class Mod(Function): + kind = ... + @classmethod + def eval(cls, p, q): + ... + + + diff --git a/stubs/sympy-stubs/core/mul.pyi b/stubs/sympy-stubs/core/mul.pyi new file mode 100644 index 00000000..9b4f9d73 --- /dev/null +++ b/stubs/sympy-stubs/core/mul.pyi @@ -0,0 +1,82 @@ +from collections import defaultdict +from typing import Any, Literal, Self, Tuple as tTuple +from sympy.core.kind import _UndefinedKind, Kind +from sympy.core.operations import AssocOp +from sympy.core.cache import cacheit +from sympy.core.expr import Expr + +class NC_Marker: + is_Order = ... + is_Mul = ... + is_Number = ... + is_Poly = ... + is_commutative = ... + + +_args_sortkey = ... +class Mul(Expr, AssocOp): + __slots__ = ... + args: tTuple[Expr] + is_Mul = ... + _args_type = Expr + _kind_dispatcher = ... + @property + def kind(self) -> Kind | _UndefinedKind: + ... + + def could_extract_minus_sign(self) -> Literal[False]: + ... + + def __neg__(self) -> Self: + ... + + @classmethod + def flatten(cls, seq): + ... + + @classmethod + def class_key(cls) -> tuple[Literal[3], Literal[0], str]: + ... + + @cacheit + def as_two_terms(self) -> tuple[Any, Self] | tuple[Any, Any | Self]: + ... + + @cacheit + def as_coeff_mul(self, *deps, rational=..., **kwargs) -> tuple[Any | Self, tuple[Any, ...]] | tuple[Expr, tuple[()]] | tuple[Any, tuple[Any | Mul]] | tuple[Any, tTuple[Expr]]: + ... + + def as_coeff_Mul(self, rational=...) -> tuple[Expr, Any] | tuple[Expr, Any | Self] | tuple[Any, Any | Self] | tuple[Any, Self]: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Self, Any] | tuple[Any, Any] | None: + ... + + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + def as_powers_dict(self) -> defaultdict[Any, int]: + ... + + def as_numer_denom(self) -> tuple[Self, Self]: + ... + + def as_base_exp(self) -> tuple[Self, Any] | tuple[Self, Expr | None]: + ... + + _eval_is_commutative = ... + def as_content_primitive(self, radical=..., clear=...) -> tuple[Any, Self]: + ... + + def as_ordered_factors(self, order=...): + ... + + + +mul = ... +def prod(a, start=...) -> Any: + ... + +def expand_2arg(e): + ... + diff --git a/stubs/sympy-stubs/core/multidimensional.pyi b/stubs/sympy-stubs/core/multidimensional.pyi new file mode 100644 index 00000000..cd876e9f --- /dev/null +++ b/stubs/sympy-stubs/core/multidimensional.pyi @@ -0,0 +1,21 @@ +from functools import _Wrapped +from typing import Any, Callable + +def apply_on_element(f, args, kwargs, n) -> list[list[Any] | Any]: + ... + +def iter_copy(structure) -> list[Any]: + ... + +def structure_copy(structure) -> list[Any]: + ... + +class vectorize: + def __init__(self, *mdargs) -> None: + ... + + def __call__(self, f) -> _Wrapped[..., Any, ..., list[list[Any] | Any] | Any]: + ... + + + diff --git a/stubs/sympy-stubs/core/numbers.pyi b/stubs/sympy-stubs/core/numbers.pyi new file mode 100644 index 00000000..cdc3772a --- /dev/null +++ b/stubs/sympy-stubs/core/numbers.pyi @@ -0,0 +1,1071 @@ +from functools import lru_cache +from types import NotImplementedType +from typing import Any, Literal, Self, Tuple +from sympy.core.mul import Mul +from sympy.core.singleton import Singleton +from sympy.core.basic import Basic +from sympy.core.expr import AtomicExpr, Expr +from sympy.core.cache import cacheit +from sympy.core.decorators import _sympifyit +from sympy.external.gmpy import gmpy +from sympy.series.order import Order + +_LOG2 = ... +def comp(z1, z2, tol=...) -> bool: + ... + +def mpf_norm(mpf, prec) -> tuple[Literal[0], int | Any, Literal[0], Literal[0]] | tuple[Any, Any | Literal[1], Any, Any | Literal[1]]: + ... + +_errdict = ... +def seterr(divide=...) -> None: + ... + +_floatpat = ... +@lru_cache(1024) +def igcd(*args) -> int: + ... + +igcd2 = ... +def igcd_lehmer(a, b) -> int: + ... + +def ilcm(*args) -> Literal[0]: + ... + +def igcdex(a, b) -> tuple[Literal[0], Literal[1], Literal[0]] | tuple[Literal[0], Any, Any] | tuple[Any, Literal[0], Any] | tuple[Literal[-1, 1, 0], Literal[0, -1, 1], Any]: + ... + +def mod_inverse(a, m) -> int: + ... + +class Number(AtomicExpr): + is_commutative = ... + is_number = ... + is_Number = ... + __slots__ = ... + _prec = ... + kind = ... + def __new__(cls, *obj) -> Number | Integer | Rational | Float: + ... + + def could_extract_minus_sign(self) -> bool: + ... + + def invert(self, other, *gens, **args) -> int | Any: + ... + + def __divmod__(self, other) -> tuple[Any, Any] | NotImplementedType | Tuple: + ... + + def __rdivmod__(self, other) -> NotImplementedType | tuple[Any, Any] | Tuple: + ... + + def __float__(self) -> float: + ... + + def floor(self): + ... + + def ceiling(self): + ... + + def __floor__(self): + ... + + def __ceil__(self): + ... + + @classmethod + def class_key(cls) -> tuple[Literal[1], Literal[0], Literal['Number']]: + ... + + @cacheit + def sort_key(self, order=...) -> tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[Literal[0], tuple[()]], tuple[()], Self]: + ... + + @_sympifyit('other', NotImplemented) + def __add__(self, other): + ... + + @_sympifyit('other', NotImplemented) + def __sub__(self, other): + ... + + @_sympifyit('other', NotImplemented) + def __mul__(self, other) -> NotImplementedType: + ... + + @_sympifyit('other', NotImplemented) + def __truediv__(self, other): + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def is_constant(self, *wrt, **flags) -> Literal[True]: + ... + + def as_coeff_mul(self, *deps, rational=..., **kwargs) -> tuple[Self, tuple[()]] | tuple[Any, tuple[Any | Mul]] | tuple[Any, tuple[Self]]: + ... + + def as_coeff_add(self, *deps) -> tuple[Self, tuple[()]] | tuple[Any, tuple[Self]]: + ... + + def as_coeff_Mul(self, rational=...) -> tuple[Any, Self] | tuple[Self, Any] | tuple[Any, Any]: + ... + + def as_coeff_Add(self, rational=...) -> tuple[Self, Any] | tuple[Any, Self]: + ... + + def gcd(self, other) -> Any: + ... + + def lcm(self, other) -> Any: + ... + + def cofactors(self, other) -> Any: + ... + + + +class Float(Number): + __slots__ = ... + _mpf_: tuple[int, int, int, int] + is_rational = ... + is_irrational = ... + is_number = ... + is_real = ... + is_extended_real = ... + is_Float = ... + def __new__(cls, num, dps=..., precision=...): + ... + + def __getnewargs_ex__(self) -> tuple[tuple[tuple[int, str, int, int]], dict[str, Any]]: + ... + + def floor(self) -> Integer: + ... + + def ceiling(self) -> Integer: + ... + + def __floor__(self) -> Integer: + ... + + def __ceil__(self) -> Integer: + ... + + @property + def num(self): + ... + + def __bool__(self) -> bool: + ... + + def __neg__(self) -> Self | Float: + ... + + @_sympifyit('other', NotImplemented) + def __add__(self, other) -> Float: + ... + + @_sympifyit('other', NotImplemented) + def __sub__(self, other) -> Float: + ... + + @_sympifyit('other', NotImplemented) + def __mul__(self, other) -> Float | NotImplementedType: + ... + + @_sympifyit('other', NotImplemented) + def __truediv__(self, other) -> Float: + ... + + @_sympifyit('other', NotImplemented) + def __mod__(self, other) -> Float: + ... + + @_sympifyit('other', NotImplemented) + def __rmod__(self, other) -> Float: + ... + + def __abs__(self) -> Float: + ... + + def __int__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def epsilon_eq(self, other, epsilon=...): + ... + + def __format__(self, format_spec) -> str: + ... + + + +RealNumber = Float +class Rational(Number): + is_real = ... + is_integer = ... + is_rational = ... + is_number = ... + __slots__ = ... + p: int + q: int + is_Rational = ... + @cacheit + def __new__(cls, p, q=..., gcd=...) -> Rational | Integer | Self: + ... + + def limit_denominator(self, max_denominator=...) -> Rational: + ... + + def __getnewargs__(self) -> tuple[int, int]: + ... + + def __neg__(self) -> Rational | Integer: + ... + + @_sympifyit('other', NotImplemented) + def __add__(self, other) -> Rational | Integer | Float: + ... + + __radd__ = ... + @_sympifyit('other', NotImplemented) + def __sub__(self, other) -> Rational | Integer | Float: + ... + + @_sympifyit('other', NotImplemented) + def __rsub__(self, other) -> Rational | Integer | Float | Order: + ... + + @_sympifyit('other', NotImplemented) + def __mul__(self, other) -> Rational | Integer | Float | NotImplementedType: + ... + + __rmul__ = ... + @_sympifyit('other', NotImplemented) + def __truediv__(self, other) -> Rational | Integer: + ... + + @_sympifyit('other', NotImplemented) + def __rtruediv__(self, other) -> Rational | Integer: + ... + + @_sympifyit('other', NotImplemented) + def __mod__(self, other) -> Rational | Integer | Float: + ... + + @_sympifyit('other', NotImplemented) + def __rmod__(self, other) -> Rational | Integer | Float: + ... + + def __abs__(self) -> Rational | Integer: + ... + + def __int__(self) -> int: + ... + + def floor(self) -> Integer: + ... + + def ceiling(self) -> Integer: + ... + + def __floor__(self) -> Integer: + ... + + def __ceil__(self) -> Integer: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def factors(self, limit=..., use_trial=..., use_rho=..., use_pm1=..., verbose=..., visual=...) -> Order | dict[Any, int] | list[Any]: + ... + + @property + def numerator(self) -> int: + ... + + @property + def denominator(self) -> int: + ... + + @_sympifyit('other', NotImplemented) + def gcd(self, other) -> Rational | Integer | Any: + ... + + @_sympifyit('other', NotImplemented) + def lcm(self, other) -> Rational | Integer | Any: + ... + + def as_numer_denom(self) -> tuple[Any | Integer, Any | Integer]: + ... + + def as_content_primitive(self, radical=..., clear=...) -> tuple[Self, Any] | tuple[Rational | Any | Integer, Any] | tuple[Any, Any]: + ... + + def as_coeff_Mul(self, rational=...) -> tuple[Self, Any]: + ... + + def as_coeff_Add(self, rational=...) -> tuple[Self, Any]: + ... + + + +class Integer(Rational): + q = ... + is_integer = ... + is_number = ... + is_Integer = ... + __slots__ = ... + @cacheit + def __new__(cls, i) -> Self: + ... + + def __getnewargs__(self) -> tuple[int]: + ... + + def __int__(self) -> int: + ... + + def floor(self) -> Integer: + ... + + def ceiling(self) -> Integer: + ... + + def __floor__(self) -> Integer: + ... + + def __ceil__(self) -> Integer: + ... + + def __neg__(self) -> Integer: + ... + + def __abs__(self) -> Self | Integer: + ... + + def __divmod__(self, other) -> Tuple | tuple[Any, Any] | NotImplementedType: + ... + + def __rdivmod__(self, other) -> Tuple | tuple[Any, Any] | NotImplementedType: + ... + + def __add__(self, other) -> Integer | Rational | Float | Order: + ... + + def __radd__(self, other) -> Integer | Rational: + ... + + def __sub__(self, other) -> Integer | Rational | Float: + ... + + def __rsub__(self, other) -> Integer | Rational | Float | Order: + ... + + def __mul__(self, other) -> Integer | Rational | Float | NotImplementedType: + ... + + def __rmul__(self, other) -> Integer | Rational: + ... + + def __mod__(self, other) -> Integer | Rational | Float: + ... + + def __rmod__(self, other) -> Integer | Rational | Float: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __index__(self) -> int: + ... + + def as_numer_denom(self) -> tuple[Self, Any]: + ... + + @_sympifyit('other', NotImplemented) + def __floordiv__(self, other) -> NotImplementedType | Integer | Tuple: + ... + + def __rfloordiv__(self, other) -> Integer: + ... + + def __lshift__(self, other) -> Integer | NotImplementedType: + ... + + def __rlshift__(self, other) -> Integer | NotImplementedType: + ... + + def __rshift__(self, other) -> Integer | NotImplementedType: + ... + + def __rrshift__(self, other) -> Integer | NotImplementedType: + ... + + def __and__(self, other) -> Integer | NotImplementedType: + ... + + def __rand__(self, other) -> Integer | NotImplementedType: + ... + + def __xor__(self, other) -> Integer | NotImplementedType: + ... + + def __rxor__(self, other) -> Integer | NotImplementedType: + ... + + def __or__(self, other) -> Integer | NotImplementedType: + ... + + def __ror__(self, other) -> Integer | NotImplementedType: + ... + + def __invert__(self) -> Integer: + ... + + + +class AlgebraicNumber(Expr): + __slots__ = ... + is_AlgebraicNumber = ... + is_algebraic = ... + is_number = ... + kind = ... + free_symbols: set[Basic] = ... + def __new__(cls, expr, coeffs=..., alias=..., **args) -> Self: + ... + + def __hash__(self) -> int: + ... + + @property + def is_aliased(self) -> bool: + ... + + def as_poly(self, x=...): + ... + + def as_expr(self, x=...): + ... + + def coeffs(self) -> list[Any]: + ... + + def native_coeffs(self): + ... + + def to_algebraic_integer(self) -> Self | AlgebraicNumber: + ... + + def field_element(self, coeffs) -> AlgebraicNumber: + ... + + @property + def is_primitive_element(self) -> bool: + ... + + def primitive_element(self) -> Self | AlgebraicNumber: + ... + + def to_primitive_element(self, radicals=...) -> Self | AlgebraicNumber: + ... + + def minpoly_of_element(self) -> Any: + ... + + def to_root(self, radicals=..., minpoly=...) -> Any | None: + ... + + + +class RationalConstant(Rational): + __slots__ = ... + def __new__(cls) -> Self: + ... + + + +class IntegerConstant(Integer): + __slots__ = ... + def __new__(cls) -> Self: + ... + + + +class Zero(IntegerConstant, metaclass=Singleton): + p = ... + q = ... + is_positive = ... + is_negative = ... + is_zero = ... + is_number = ... + is_comparable = ... + __slots__ = ... + def __getnewargs__(self) -> tuple[()]: + ... + + @staticmethod + def __abs__(): + ... + + @staticmethod + def __neg__(): + ... + + def __bool__(self) -> Literal[False]: + ... + + + +class One(IntegerConstant, metaclass=Singleton): + is_number = ... + is_positive = ... + p = ... + q = ... + __slots__ = ... + def __getnewargs__(self) -> tuple[()]: + ... + + @staticmethod + def __abs__(): + ... + + @staticmethod + def __neg__(): + ... + + @staticmethod + def factors(limit=..., use_trial=..., use_rho=..., use_pm1=..., verbose=..., visual=...) -> dict[Any, Any]: + ... + + + +class NegativeOne(IntegerConstant, metaclass=Singleton): + is_number = ... + p = ... + q = ... + __slots__ = ... + def __getnewargs__(self) -> tuple[()]: + ... + + @staticmethod + def __abs__(): + ... + + @staticmethod + def __neg__(): + ... + + + +class Half(RationalConstant, metaclass=Singleton): + is_number = ... + p = ... + q = ... + __slots__ = ... + def __getnewargs__(self) -> tuple[()]: + ... + + @staticmethod + def __abs__(): + ... + + + +class Infinity(Number, metaclass=Singleton): + is_commutative = ... + is_number = ... + is_complex = ... + is_extended_real = ... + is_infinite = ... + is_comparable = ... + is_extended_positive = ... + is_prime = ... + __slots__ = ... + def __new__(cls) -> Self: + ... + + def evalf(self, prec=..., **options) -> Float: + ... + + @_sympifyit('other', NotImplemented) + def __add__(self, other) -> Self: + ... + + __radd__ = ... + @_sympifyit('other', NotImplemented) + def __sub__(self, other) -> Self: + ... + + @_sympifyit('other', NotImplemented) + def __rsub__(self, other): + ... + + @_sympifyit('other', NotImplemented) + def __mul__(self, other) -> Self | NotImplementedType: + ... + + __rmul__ = ... + @_sympifyit('other', NotImplemented) + def __truediv__(self, other) -> Self: + ... + + def __abs__(self): + ... + + def __neg__(self): + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + __gt__ = ... + __ge__ = ... + __lt__ = ... + __le__ = ... + @_sympifyit('other', NotImplemented) + def __mod__(self, other) -> NotImplementedType: + ... + + __rmod__ = ... + def floor(self) -> Self: + ... + + def ceiling(self) -> Self: + ... + + + +oo = ... +class NegativeInfinity(Number, metaclass=Singleton): + is_extended_real = ... + is_complex = ... + is_commutative = ... + is_infinite = ... + is_comparable = ... + is_extended_negative = ... + is_number = ... + is_prime = ... + __slots__ = ... + def __new__(cls) -> Self: + ... + + def evalf(self, prec=..., **options) -> Float: + ... + + @_sympifyit('other', NotImplemented) + def __add__(self, other) -> Self: + ... + + __radd__ = ... + @_sympifyit('other', NotImplemented) + def __sub__(self, other) -> Self: + ... + + @_sympifyit('other', NotImplemented) + def __rsub__(self, other): + ... + + @_sympifyit('other', NotImplemented) + def __mul__(self, other) -> Self | NotImplementedType: + ... + + __rmul__ = ... + @_sympifyit('other', NotImplemented) + def __truediv__(self, other) -> Self: + ... + + def __abs__(self): + ... + + def __neg__(self): + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + __gt__ = ... + __ge__ = ... + __lt__ = ... + __le__ = ... + @_sympifyit('other', NotImplemented) + def __mod__(self, other) -> NotImplementedType: + ... + + __rmod__ = ... + def floor(self) -> Self: + ... + + def ceiling(self) -> Self: + ... + + def as_powers_dict(self) -> dict[Any, int]: + ... + + + +class NaN(Number, metaclass=Singleton): + is_commutative = ... + is_extended_real = ... + is_real = ... + is_rational = ... + is_algebraic = ... + is_transcendental = ... + is_integer = ... + is_comparable = ... + is_finite = ... + is_zero = ... + is_prime = ... + is_positive = ... + is_negative = ... + is_number = ... + __slots__ = ... + def __new__(cls) -> Self: + ... + + def __neg__(self) -> Self: + ... + + @_sympifyit('other', NotImplemented) + def __add__(self, other) -> Self: + ... + + @_sympifyit('other', NotImplemented) + def __sub__(self, other) -> Self: + ... + + @_sympifyit('other', NotImplemented) + def __mul__(self, other) -> Self: + ... + + @_sympifyit('other', NotImplemented) + def __truediv__(self, other) -> Self: + ... + + def floor(self) -> Self: + ... + + def ceiling(self) -> Self: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + __gt__ = ... + __ge__ = ... + __lt__ = ... + __le__ = ... + + +nan = ... +class ComplexInfinity(AtomicExpr, metaclass=Singleton): + is_commutative = ... + is_infinite = ... + is_number = ... + is_prime = ... + is_complex = ... + is_extended_real = ... + kind = ... + __slots__ = ... + def __new__(cls) -> Self: + ... + + @staticmethod + def __abs__(): + ... + + def floor(self) -> Self: + ... + + def ceiling(self) -> Self: + ... + + @staticmethod + def __neg__(): + ... + + + +zoo = ... +class NumberSymbol(AtomicExpr): + is_commutative = ... + is_finite = ... + is_number = ... + __slots__ = ... + is_NumberSymbol = ... + kind = ... + def __new__(cls) -> Self: + ... + + def approximation(self, number_cls) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __int__(self) -> int: + ... + + def __hash__(self) -> int: + ... + + + +class Exp1(NumberSymbol, metaclass=Singleton): + is_real = ... + is_positive = ... + is_negative = ... + is_irrational = ... + is_number = ... + is_algebraic = ... + is_transcendental = ... + __slots__ = ... + @staticmethod + def __abs__(): + ... + + def __int__(self) -> int: + ... + + def approximation_interval(self, number_cls) -> tuple[Any | Integer, Any | Integer] | None: + ... + + + +E = ... +class Pi(NumberSymbol, metaclass=Singleton): + is_real = ... + is_positive = ... + is_negative = ... + is_irrational = ... + is_number = ... + is_algebraic = ... + is_transcendental = ... + __slots__ = ... + @staticmethod + def __abs__(): + ... + + def __int__(self) -> int: + ... + + def approximation_interval(self, number_cls) -> tuple[Any | Integer, Any | Integer] | tuple[Rational | Any | Integer, Rational | Any | Integer] | None: + ... + + + +pi = ... +class GoldenRatio(NumberSymbol, metaclass=Singleton): + is_real = ... + is_positive = ... + is_negative = ... + is_irrational = ... + is_number = ... + is_algebraic = ... + is_transcendental = ... + __slots__ = ... + def __int__(self) -> int: + ... + + def approximation_interval(self, number_cls) -> tuple[Any, Rational | Any | Integer] | None: + ... + + _eval_rewrite_as_sqrt = ... + + +class TribonacciConstant(NumberSymbol, metaclass=Singleton): + is_real = ... + is_positive = ... + is_negative = ... + is_irrational = ... + is_number = ... + is_algebraic = ... + is_transcendental = ... + __slots__ = ... + def __int__(self) -> int: + ... + + def approximation_interval(self, number_cls) -> tuple[Any, Rational | Any | Integer] | None: + ... + + _eval_rewrite_as_sqrt = ... + + +class EulerGamma(NumberSymbol, metaclass=Singleton): + is_real = ... + is_positive = ... + is_negative = ... + is_irrational = ... + is_number = ... + __slots__ = ... + def __int__(self) -> int: + ... + + def approximation_interval(self, number_cls) -> tuple[Any, Any] | tuple[Any, Rational | Any | Integer] | None: + ... + + + +class Catalan(NumberSymbol, metaclass=Singleton): + is_real = ... + is_positive = ... + is_negative = ... + is_irrational = ... + is_number = ... + __slots__ = ... + def __int__(self) -> int: + ... + + def approximation_interval(self, number_cls) -> tuple[Any, Any] | tuple[Rational | Any | Integer, Any] | None: + ... + + + +class ImaginaryUnit(AtomicExpr, metaclass=Singleton): + is_commutative = ... + is_imaginary = ... + is_finite = ... + is_number = ... + is_algebraic = ... + is_transcendental = ... + kind = ... + __slots__ = ... + @staticmethod + def __abs__(): + ... + + def as_base_exp(self) -> tuple[Any, Any]: + ... + + + +I = ... +def equal_valued(x, y) -> Literal[False]: + ... + +def sympify_fractions(f) -> Rational | Integer: + ... + +def sympify_mpz(x) -> Integer: + ... + +def sympify_mpq(x) -> Rational | Integer: + ... + +def sympify_mpmath_mpq(x) -> Rational | Integer: + ... + +def sympify_mpmath(x) -> Float: + ... + +def sympify_complex(a): + ... + +_illegal = ... diff --git a/stubs/sympy-stubs/core/operations.pyi b/stubs/sympy-stubs/core/operations.pyi new file mode 100644 index 00000000..f20bd4e4 --- /dev/null +++ b/stubs/sympy-stubs/core/operations.pyi @@ -0,0 +1,64 @@ +from typing import Any, LiteralString, Self +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.series.order import Order + +class AssocOp(Basic): + __slots__: tuple[str, ...] = ... + _args_type: type[Basic] | None = ... + @cacheit + def __new__(cls, *args, evaluate=..., _sympify=...) -> Order: + ... + + @classmethod + def flatten(cls, seq) -> tuple[list[Any], list[Any], None]: + ... + + @classmethod + def make_args(cls, expr) -> tuple[Basic, ...] | tuple[Any]: + ... + + def doit(self, **hints) -> Self: + ... + + + +class ShortCircuit(Exception): + ... + + +class LatticeOp(AssocOp): + is_commutative = ... + def __new__(cls, *args, **options) -> Self: + ... + + @classmethod + def make_args(cls, expr) -> frozenset[Any]: + ... + + + +class AssocOpDispatcher: + def __init__(self, name, doc=...) -> None: + ... + + def __repr__(self) -> LiteralString: + ... + + def register_handlerclass(self, classes, typ, on_ambiguity=...) -> None: + ... + + @cacheit + def __call__(self, *args, _sympify=..., **kwargs) -> Any: + ... + + @cacheit + def dispatch(self, handlers) -> type: + ... + + @property + def __doc__(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/core/parameters.pyi b/stubs/sympy-stubs/core/parameters.pyi new file mode 100644 index 00000000..f0b2aa23 --- /dev/null +++ b/stubs/sympy-stubs/core/parameters.pyi @@ -0,0 +1,22 @@ +from contextlib import contextmanager +from threading import local +from typing import Any, Generator + +class _global_parameters(local): + def __init__(self, **kwargs) -> None: + ... + + def __setattr__(self, name, value) -> None: + ... + + + +global_parameters = ... +@contextmanager +def evaluate(x) -> Generator[None, Any, None]: + ... + +@contextmanager +def distribute(x) -> Generator[None, Any, None]: + ... + diff --git a/stubs/sympy-stubs/core/power.pyi b/stubs/sympy-stubs/core/power.pyi new file mode 100644 index 00000000..f5852378 --- /dev/null +++ b/stubs/sympy-stubs/core/power.pyi @@ -0,0 +1,72 @@ +from typing import Any, Literal, Self +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.core.kind import _UndefinedKind, Kind +from sympy.core.mul import Mul +from sympy.core.numbers import Number +from sympy.functions.elementary.exponential import log +from sympy.series.order import Order + +def isqrt(n) -> int: + ... + +def integer_nthroot(y, n) -> tuple[int, bool] | tuple[Any, Literal[True]] | tuple[Literal[1], Literal[False]] | tuple[int, Any]: + ... + +def integer_log(y, x) -> tuple[int, Any] | tuple[Any, Any | bool] | tuple[int, bool]: + ... + +class Pow(Expr): + is_Pow = ... + __slots__ = ... + args: tuple[Expr, Expr] + _args: tuple[Expr, Expr] + @cacheit + def __new__(cls, b, e, evaluate=...): + ... + + def inverse(self, argindex=...) -> type[log] | None: + ... + + @property + def base(self) -> Expr: + ... + + @property + def exp(self) -> Expr: + ... + + @property + def kind(self) -> Kind | _UndefinedKind: + ... + + @classmethod + def class_key(cls) -> tuple[Literal[3], Literal[2], str]: + ... + + def as_base_exp(self) -> tuple[Any, Any | Mul] | tuple[Expr, Expr]: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Self, Any] | tuple[Any | Order | Basic, Any] | tuple[Any, Any | Expr] | tuple[Any, Any] | tuple[type[UndefinedFunction] | Any, type[UndefinedFunction] | Any] | None: + ... + + def as_numer_denom(self) -> tuple[Self, Any] | tuple[Any | Mul | Expr, Self] | tuple[Self, Any | Mul | Expr] | tuple[Self, Self]: + ... + + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + def taylor_term(self, n, x, *previous_terms): + ... + + def as_content_primitive(self, radical=..., clear=...) -> tuple[Self, Self] | tuple[Number, Self] | tuple[Any, Self]: + ... + + def is_constant(self, *wrt, **flags) -> bool | None: + ... + + + +power = ... diff --git a/stubs/sympy-stubs/core/random.pyi b/stubs/sympy-stubs/core/random.pyi new file mode 100644 index 00000000..5b9a9708 --- /dev/null +++ b/stubs/sympy-stubs/core/random.pyi @@ -0,0 +1,23 @@ + +rng = ... +choice = ... +random = ... +randint = ... +randrange = ... +sample = ... +shuffle = ... +uniform = ... +_assumptions_rng = ... +_assumptions_shuffle = ... +def seed(a=..., version=...) -> None: + ... + +def random_complex_number(a=..., b=..., c=..., d=..., rational=..., tolerance=...): + ... + +def verify_numerically(f, g, z=..., tol=..., a=..., b=..., c=..., d=...) -> bool: + ... + +def test_derivative_numerically(f, z, tol=..., a=..., b=..., c=..., d=...) -> bool: + ... + diff --git a/stubs/sympy-stubs/core/relational.pyi b/stubs/sympy-stubs/core/relational.pyi new file mode 100644 index 00000000..fad51882 --- /dev/null +++ b/stubs/sympy-stubs/core/relational.pyi @@ -0,0 +1,187 @@ +from types import NotImplementedType +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.core.evalf import EvalfMixin +from sympy.logic.boolalg import Boolean + +__all__ = ('Rel', 'Eq', 'Ne', 'Lt', 'Le', 'Gt', 'Ge', 'Relational', 'Equality', 'Unequality', 'StrictLessThan', 'LessThan', 'StrictGreaterThan', 'GreaterThan') +class Relational(Boolean, EvalfMixin): + __slots__ = ... + ValidRelationOperator: dict[str | None, type[Relational]] = ... + is_Relational = ... + def __new__(cls, lhs, rhs, rop=..., **assumptions) -> Self | Eq | Relational | Ne: + ... + + @property + def lhs(self) -> Basic: + ... + + @property + def rhs(self) -> Basic: + ... + + @property + def reversed(self) -> Eq | Relational | Ne: + ... + + @property + def reversedsign(self) -> Eq | Relational | Ne | Self: + ... + + @property + def negated(self) -> Self | Eq | Relational | Ne: + ... + + @property + def weak(self) -> Self: + ... + + @property + def strict(self) -> Self: + ... + + @property + def canonical(self) -> Eq | Relational | Ne | Self: + ... + + def equals(self, other, failing_expression=...) -> bool | None: + ... + + def expand(self, **kwargs) -> Self: + ... + + def __bool__(self): + ... + + @property + def binary_symbols(self) -> set[Any]: + ... + + + +Rel = Relational +class Equality(Relational): + rel_op = ... + __slots__ = ... + is_Equality = ... + def __new__(cls, lhs, rhs, **options) -> Self | Eq | Relational | Ne: + ... + + @property + def binary_symbols(self) -> set[Basic] | set[Any]: + ... + + def integrate(self, *args, **kwargs) -> Equality | Relational | Ne: + ... + + def as_poly(self, *gens, **kwargs): + ... + + + +Eq = Equality +class Unequality(Relational): + rel_op = ... + __slots__ = ... + def __new__(cls, lhs, rhs, **options) -> Self: + ... + + @property + def binary_symbols(self) -> set[Basic] | set[Any]: + ... + + + +Ne = Unequality +class _Inequality(Relational): + __slots__ = ... + def __new__(cls, lhs, rhs, **options) -> NotImplementedType | Self | Eq | Relational | Ne: + ... + + + +class _Greater(_Inequality): + __slots__ = ... + @property + def gts(self) -> Basic: + ... + + @property + def lts(self) -> Basic: + ... + + + +class _Less(_Inequality): + __slots__ = ... + @property + def gts(self) -> Basic: + ... + + @property + def lts(self) -> Basic: + ... + + + +class GreaterThan(_Greater): + __slots__ = ... + rel_op = ... + @property + def strict(self) -> NotImplementedType | Gt | Eq | Relational | Ne: + ... + + + +Ge = GreaterThan +class LessThan(_Less): + __doc__ = ... + __slots__ = ... + rel_op = ... + @property + def strict(self) -> NotImplementedType | Lt | Eq | Relational | Ne: + ... + + + +Le = LessThan +class StrictGreaterThan(_Greater): + __doc__ = ... + __slots__ = ... + rel_op = ... + @property + def weak(self) -> NotImplementedType | Ge | Eq | Relational | Ne: + ... + + + +Gt = StrictGreaterThan +class StrictLessThan(_Less): + __doc__ = ... + __slots__ = ... + rel_op = ... + @property + def weak(self) -> NotImplementedType | Le | Eq | Relational | Ne: + ... + + + +Lt = StrictLessThan +def is_lt(lhs, rhs, assumptions=...) -> bool | None: + ... + +def is_gt(lhs, rhs, assumptions=...) -> bool | None: + ... + +def is_le(lhs, rhs, assumptions=...) -> bool | None: + ... + +def is_ge(lhs, rhs, assumptions=...) -> bool | None: + ... + +def is_neq(lhs, rhs, assumptions=...) -> bool: + ... + +def is_eq(lhs, rhs, assumptions=...): + ... + diff --git a/stubs/sympy-stubs/core/rules.pyi b/stubs/sympy-stubs/core/rules.pyi new file mode 100644 index 00000000..25d61016 --- /dev/null +++ b/stubs/sympy-stubs/core/rules.pyi @@ -0,0 +1,16 @@ + +class Transform: + def __init__(self, transform, filter=...) -> None: + ... + + def __contains__(self, item): + ... + + def __getitem__(self, key): + ... + + def get(self, item, default=...) -> None: + ... + + + diff --git a/stubs/sympy-stubs/core/singleton.pyi b/stubs/sympy-stubs/core/singleton.pyi new file mode 100644 index 00000000..eb88a110 --- /dev/null +++ b/stubs/sympy-stubs/core/singleton.pyi @@ -0,0 +1,27 @@ +from typing import Literal +from sympy.core.core import Registry + +class SingletonRegistry(Registry): + __slots__ = ... + __call__ = ... + def __init__(self) -> None: + ... + + def register(self, cls) -> None: + ... + + def __getattr__(self, name): + ... + + def __repr__(self) -> Literal['S']: + ... + + + +S = ... +class Singleton(type): + def __init__(cls, *args, **kwargs) -> None: + ... + + + diff --git a/stubs/sympy-stubs/core/sorting.pyi b/stubs/sympy-stubs/core/sorting.pyi new file mode 100644 index 00000000..6db0aac8 --- /dev/null +++ b/stubs/sympy-stubs/core/sorting.pyi @@ -0,0 +1,8 @@ +from typing import Any, Generator, Literal +__all__ = ['default_sort_key', 'ordered'] +def default_sort_key(item, order=...) -> tuple[tuple[Literal[5], Literal[0], str], tuple[int, tuple[Any, ...]], Any, Any] | tuple[tuple[Literal[10, 0], Literal[0], str | Any], tuple[int, tuple[Any, ...]] | tuple[Literal[1], tuple[str]], Any, Any]: + ... + +def ordered(seq, keys=..., default=..., warn=...) -> Generator[Any, Any, None]: + ... + diff --git a/stubs/sympy-stubs/core/symbol.pyi b/stubs/sympy-stubs/core/symbol.pyi new file mode 100644 index 00000000..eafa316e --- /dev/null +++ b/stubs/sympy-stubs/core/symbol.pyi @@ -0,0 +1,119 @@ +from sympy.core.basic import Atom, Basic +from sympy.core.cache import cacheit +from sympy.core.expr import AtomicExpr +from sympy.core.function import FunctionClass, UndefinedFunction +from sympy.core.kind import _NumberKind, _UndefinedKind +from sympy.logic.boolalg import Boolean +from typing import Any, Literal, Self, Tuple + +class Str(Atom): + __slots__ = ... + def __new__(cls, name, **kwargs) -> Self: + ... + + def __getnewargs__(self) -> tuple[Any]: + ... + + + +def uniquely_named_symbol(xname, exprs=..., compare=..., modify=..., **assumptions) -> Symbol: + ... + +_uniquely_named_symbol = ... +class Symbol(AtomicExpr, Boolean): + is_comparable = ... + __slots__ = ... + name: str + is_Symbol = ... + is_symbol = ... + @property + def kind(self) -> _NumberKind | _UndefinedKind: + ... + + def __new__(cls, name, **assumptions): + ... + + @staticmethod + def __xnew__(cls, name, **assumptions): + ... + + def __getnewargs_ex__(self) -> tuple[tuple[str], Any]: + ... + + def __setstate__(self, state) -> None: + ... + + @property + def assumptions0(self): + ... + + @cacheit + def sort_key(self, order=...) -> tuple[tuple[Literal[2], Literal[0], str], tuple[Literal[1], tuple[str]], Any, Any]: + ... + + def as_dummy(self) -> Dummy: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[type[UndefinedFunction] | Any, type[UndefinedFunction] | Any] | None: + ... + + def is_constant(self, *wrt, **flags) -> bool: + ... + + @property + def free_symbols(self) -> set[Self]: + ... + + binary_symbols = ... + def as_set(self): + ... + + + +class Dummy(Symbol): + _count = ... + _prng = ... + _base_dummy_index = ... + __slots__ = ... + is_Dummy = ... + def __new__(cls, name=..., dummy_index=..., **assumptions): + ... + + def __getnewargs_ex__(self) -> tuple[tuple[str, Any], Any]: + ... + + @cacheit + def sort_key(self, order=...) -> tuple[tuple[Literal[2], Literal[0], str], tuple[Literal[2], tuple[str, Any]], Any, Any]: + ... + + + +class Wild(Symbol): + is_Wild = ... + __slots__ = ... + def __new__(cls, name, exclude=..., properties=..., **assumptions): + ... + + def __getnewargs__(self) -> tuple[str, Any, Any]: + ... + + @staticmethod + @cacheit + def __xnew__(cls, name, exclude, properties, **assumptions): + ... + + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + + +_range = ... +def symbols(names, *, cls=..., **args) -> Any: + ... + +def var(names, **args) -> Basic | FunctionClass | Any: + ... + +def disambiguate(*iter) -> Tuple: + ... + diff --git a/stubs/sympy-stubs/core/sympify.pyi b/stubs/sympy-stubs/core/sympify.pyi new file mode 100644 index 00000000..20fb0045 --- /dev/null +++ b/stubs/sympy-stubs/core/sympify.pyi @@ -0,0 +1,25 @@ +from typing import Any, Callable +from sympy.core.basic import Basic + +class SympifyError(ValueError): + def __init__(self, expr, base_exc=...) -> None: + ... + + def __str__(self) -> str: + ... + + + +converter: dict[type[Any], Callable[[Any], Basic]] = ... +_sympy_converter: dict[type[Any], Callable[[Any], Basic]] = ... +_external_converter = ... +class CantSympify: + __slots__ = ... + + +def sympify(a, locals=..., convert_xor=..., strict=..., rational=..., evaluate=...): + ... + +def kernS(s) -> list[Any] | set[Any] | tuple[Any, ...]: + ... + diff --git a/stubs/sympy-stubs/core/traversal.pyi b/stubs/sympy-stubs/core/traversal.pyi new file mode 100644 index 00000000..1686e518 --- /dev/null +++ b/stubs/sympy-stubs/core/traversal.pyi @@ -0,0 +1,35 @@ +from typing import Any, Generator, Self +from sympy.core.basic import Basic +def iterargs(expr) -> Generator[Any, Any, None]: + ... + +def iterfreeargs(expr, _first=...) -> Generator[Any, Any, None]: + ... + +class preorder_traversal: + def __init__(self, node, keys=...) -> None: + ... + + def skip(self) -> None: + ... + + def __next__(self): + ... + + def __iter__(self) -> Self: + ... + + + +def use(expr, func, level=..., args=..., kwargs=...): + ... + +def walk(e, *target) -> Generator[Any, Any, None]: + ... + +def bottom_up(rv, F, atoms=..., nonbasic=...): + ... + +def postorder_traversal(node, keys=...) -> Generator[Any | Basic, Any, None]: + ... + diff --git a/stubs/sympy-stubs/crypto/crypto.pyi b/stubs/sympy-stubs/crypto/crypto.pyi new file mode 100644 index 00000000..cf23d0d9 --- /dev/null +++ b/stubs/sympy-stubs/crypto/crypto.pyi @@ -0,0 +1,191 @@ +from array import array +from typing import Any, Literal, LiteralString +from sympy.core.numbers import Integer, Rational +from sympy.matrices import Matrix +from sympy.utilities.decorator import doctest_depends_on + +class NonInvertibleCipherWarning(RuntimeWarning): + def __init__(self, msg) -> None: + ... + + def __str__(self) -> str: + ... + + def warn(self, stacklevel=...) -> None: + ... + + + +def AZ(s=...) -> LiteralString | str | list[Any | str]: + ... + +bifid5 = ... +bifid6 = ... +bifid10 = ... +def padded_key(key, symbols) -> str: + ... + +def check_and_join(phrase, symbols=..., filter=...) -> str: + ... + +def cycle_list(k, n) -> list[int]: + ... + +def encipher_shift(msg, key, symbols=...) -> str: + ... + +def decipher_shift(msg, key, symbols=...) -> str: + ... + +def encipher_rot13(msg, symbols=...) -> str: + ... + +def decipher_rot13(msg, symbols=...) -> str: + ... + +def encipher_affine(msg, key, symbols=..., _inverse=...) -> str: + ... + +def decipher_affine(msg, key, symbols=...) -> str: + ... + +def encipher_atbash(msg, symbols=...) -> str: + ... + +def decipher_atbash(msg, symbols=...) -> str: + ... + +def encipher_substitution(msg, old, new=...) -> str: + ... + +def encipher_vigenere(msg, key, symbols=...) -> LiteralString: + ... + +def decipher_vigenere(msg, key, symbols=...) -> str: + ... + +def encipher_hill(msg, key, symbols=..., pad=...) -> str: + ... + +def decipher_hill(msg, key, symbols=...) -> str: + ... + +def encipher_bifid(msg, key, symbols=...) -> str: + ... + +def decipher_bifid(msg, key, symbols=...) -> str: + ... + +def bifid_square(key) -> Matrix: + ... + +def encipher_bifid5(msg, key) -> str: + ... + +def decipher_bifid5(msg, key) -> str: + ... + +def bifid5_square(key=...) -> Matrix: + ... + +def encipher_bifid6(msg, key) -> str: + ... + +def decipher_bifid6(msg, key) -> str: + ... + +def bifid6_square(key=...) -> Matrix: + ... + +def rsa_public_key(*args, **kwargs) -> tuple[Any, Any] | tuple[Any, Any | int] | Literal[False]: + ... + +def rsa_private_key(*args, **kwargs) -> tuple[Any, Any] | tuple[Any, Any | int] | Literal[False]: + ... + +def encipher_rsa(i, key, factors=...): + ... + +def decipher_rsa(i, key, factors=...): + ... + +def kid_rsa_public_key(a, b, A, B) -> tuple[Any, Any]: + ... + +def kid_rsa_private_key(a, b, A, B) -> tuple[Any, Any]: + ... + +def encipher_kid_rsa(msg, key): + ... + +def decipher_kid_rsa(msg, key): + ... + +morse_char = ... +char_morse = ... +def encode_morse(msg, sep=..., mapping=...) -> str: + ... + +def decode_morse(msg, sep=..., mapping=...) -> LiteralString: + ... + +def lfsr_sequence(key, fill, n) -> list[Any]: + ... + +def lfsr_autocorrelation(L, P, k) -> Rational | Integer: + ... + +def lfsr_connection_polynomial(s) -> int: + ... + +def elgamal_private_key(digit=..., seed=...) -> tuple[Any | int | array[int] | None, int | Any | None, int | Any]: + ... + +def elgamal_public_key(key) -> tuple[Any, Any, Any]: + ... + +def encipher_elgamal(i, key, seed=...) -> tuple[Any, Any]: + ... + +def decipher_elgamal(msg, key): + ... + +def dh_private_key(digit=..., seed=...) -> tuple[Any | int | array[int] | None, int | Any | None, int | Any]: + ... + +def dh_public_key(key) -> tuple[Any, Any, Any]: + ... + +def dh_shared_key(key, b): + ... + +def gm_private_key(p, q, a=...) -> tuple[Any, Any]: + ... + +def gm_public_key(p, q, a=..., seed=...) -> tuple[int | Any, Any] | Literal[False]: + ... + +def encipher_gm(i, key, seed=...) -> list[Any]: + ... + +def decipher_gm(message, key) -> int: + ... + +def encipher_railfence(message, rails) -> LiteralString: + ... + +def decipher_railfence(ciphertext, rails) -> str: + ... + +def bg_private_key(p, q) -> tuple[Any, Any]: + ... + +def bg_public_key(p, q): + ... + +def encipher_bg(i, key, seed=...) -> tuple[list[Any], int]: + ... + +def decipher_bg(message, key) -> Literal[0]: + ... + diff --git a/stubs/sympy-stubs/diffgeom/__init__.pyi b/stubs/sympy-stubs/diffgeom/__init__.pyi new file mode 100644 index 00000000..ca8dd4eb --- /dev/null +++ b/stubs/sympy-stubs/diffgeom/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.diffgeom.diffgeom import BaseCovarDerivativeOp, BaseScalarField, BaseVectorField, Commutator, CoordSystem, CoordinateSymbol, CovarDerivativeOp, Differential, LieDerivative, Manifold, Patch, Point, TensorProduct, WedgeProduct, contravariant_order, covariant_order, intcurve_diffequ, intcurve_series, metric_to_Christoffel_1st, metric_to_Christoffel_2nd, metric_to_Ricci_components, metric_to_Riemann_components, twoform_to_matrix, vectors_in_basis + +__all__ = ['BaseCovarDerivativeOp', 'BaseScalarField', 'BaseVectorField', 'Commutator', 'contravariant_order', 'CoordSystem', 'CoordinateSymbol', 'CovarDerivativeOp', 'covariant_order', 'Differential', 'intcurve_diffequ', 'intcurve_series', 'LieDerivative', 'Manifold', 'metric_to_Christoffel_1st', 'metric_to_Christoffel_2nd', 'metric_to_Ricci_components', 'metric_to_Riemann_components', 'Patch', 'Point', 'TensorProduct', 'twoform_to_matrix', 'vectors_in_basis', 'WedgeProduct'] diff --git a/stubs/sympy-stubs/diffgeom/diffgeom.pyi b/stubs/sympy-stubs/diffgeom/diffgeom.pyi new file mode 100644 index 00000000..5ed8c1ad --- /dev/null +++ b/stubs/sympy-stubs/diffgeom/diffgeom.pyi @@ -0,0 +1,370 @@ +from typing import Any, Literal, Self +from sympy.core import Basic, Expr +from sympy.core.function import Lambda +from sympy.core.symbol import Symbol +from sympy.matrices.immutable import ImmutableDenseMatrix +from sympy.series.order import Order +from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray + +class Manifold(Basic): + def __new__(cls, name, dim, **kwargs) -> Self: + ... + + @property + def name(self) -> Basic: + ... + + @property + def dim(self) -> Basic: + ... + + + +class Patch(Basic): + def __new__(cls, name, manifold, **kwargs) -> Self: + ... + + @property + def name(self) -> Basic: + ... + + @property + def manifold(self) -> Basic: + ... + + @property + def dim(self): + ... + + + +class CoordSystem(Basic): + def __new__(cls, name, patch, symbols=..., relations=..., **kwargs) -> Self: + ... + + @property + def name(self) -> Basic: + ... + + @property + def patch(self) -> Basic: + ... + + @property + def manifold(self): + ... + + @property + def symbols(self) -> tuple[CoordinateSymbol, ...]: + ... + + @property + def relations(self) -> Basic: + ... + + @property + def dim(self): + ... + + def transformation(self, sys) -> Lambda: + ... + + def connect_to(self, to_sys, from_coords, to_exprs, inverse=..., fill_in_gaps=...) -> None: + ... + + def transform(self, sys, coordinates=...) -> Basic | ImmutableDenseMatrix: + ... + + def coord_tuple_transform_to(self, to_sys, coords) -> ImmutableDenseMatrix: + ... + + def jacobian(self, sys, coordinates=...): + ... + + jacobian_matrix = ... + def jacobian_determinant(self, sys, coordinates=...): + ... + + def point(self, coords) -> Point: + ... + + def point_to_coords(self, point): + ... + + def base_scalar(self, coord_index) -> BaseScalarField: + ... + + coord_function = ... + def base_scalars(self) -> list[BaseScalarField]: + ... + + coord_functions = ... + def base_vector(self, coord_index) -> BaseVectorField: + ... + + def base_vectors(self) -> list[BaseVectorField]: + ... + + def base_oneform(self, coord_index) -> Differential: + ... + + def base_oneforms(self) -> list[Any | Differential]: + ... + + + +class CoordinateSymbol(Symbol): + def __new__(cls, coord_sys, index, **assumptions): + ... + + def __getnewargs__(self) -> tuple[Any, Any]: + ... + + + +class Point(Basic): + def __new__(cls, coord_sys, coords, **kwargs) -> Self: + ... + + @property + def patch(self): + ... + + @property + def manifold(self): + ... + + @property + def dim(self): + ... + + def coords(self, sys=...): + ... + + @property + def free_symbols(self): + ... + + + +class BaseScalarField(Expr): + is_commutative = ... + def __new__(cls, coord_sys, index, **kwargs) -> Self: + ... + + @property + def coord_sys(self) -> Basic: + ... + + @property + def index(self) -> Basic: + ... + + @property + def patch(self): + ... + + @property + def manifold(self): + ... + + @property + def dim(self): + ... + + def __call__(self, *args) -> Self: + ... + + free_symbols: set[Any] = ... + + +class BaseVectorField(Expr): + is_commutative = ... + def __new__(cls, coord_sys, index, **kwargs) -> Self: + ... + + @property + def coord_sys(self) -> Basic: + ... + + @property + def index(self) -> Basic: + ... + + @property + def patch(self): + ... + + @property + def manifold(self): + ... + + @property + def dim(self): + ... + + def __call__(self, scalar_field) -> Self: + ... + + + +class Commutator(Expr): + def __new__(cls, v1, v2) -> Self | Literal[0]: + ... + + @property + def v1(self) -> Basic: + ... + + @property + def v2(self) -> Basic: + ... + + def __call__(self, scalar_field): + ... + + + +class Differential(Expr): + is_commutative = ... + def __new__(cls, form_field) -> Self: + ... + + @property + def form_field(self) -> Basic: + ... + + def __call__(self, *vector_fields) -> Self | Literal[0]: + ... + + + +class TensorProduct(Expr): + def __new__(cls, *args) -> Order: + ... + + def __call__(self, *fields) -> Order: + ... + + + +class WedgeProduct(TensorProduct): + def __call__(self, *fields): + ... + + + +class LieDerivative(Expr): + def __new__(cls, v_field, expr) -> Self | Commutator | Literal[0]: + ... + + @property + def v_field(self) -> Basic: + ... + + @property + def expr(self) -> Basic: + ... + + def __call__(self, *args): + ... + + + +class BaseCovarDerivativeOp(Expr): + def __new__(cls, coord_sys, index, christoffel) -> Self: + ... + + @property + def coord_sys(self) -> Basic: + ... + + @property + def index(self) -> Basic: + ... + + @property + def christoffel(self) -> Basic: + ... + + def __call__(self, field): + ... + + + +class CovarDerivativeOp(Expr): + def __new__(cls, wrt, christoffel) -> Self: + ... + + @property + def wrt(self) -> Basic: + ... + + @property + def christoffel(self) -> Basic: + ... + + def __call__(self, field): + ... + + + +def intcurve_series(vector_field, param, start_point, n=..., coord_sys=..., coeffs=...) -> list[ImmutableDenseMatrix] | ImmutableDenseMatrix: + ... + +def intcurve_diffequ(vector_field, param, start_point, coord_sys=...) -> tuple[list[Any], list[Any]]: + ... + +def dummyfy(args, exprs) -> tuple[ImmutableDenseMatrix, ImmutableDenseMatrix]: + ... + +def contravariant_order(expr, _strict=...) -> int: + ... + +def covariant_order(expr, _strict=...) -> int: + ... + +def vectors_in_basis(expr, to_sys): + ... + +def twoform_to_matrix(expr) -> ImmutableDenseMatrix: + ... + +def metric_to_Christoffel_1st(expr) -> ImmutableDenseNDimArray: + ... + +def metric_to_Christoffel_2nd(expr) -> ImmutableDenseNDimArray: + ... + +def metric_to_Riemann_components(expr) -> ImmutableDenseNDimArray: + ... + +def metric_to_Ricci_components(expr) -> ImmutableDenseNDimArray: + ... + +class _deprecated_container: + def __init__(self, message, data) -> None: + ... + + def warn(self) -> None: + ... + + def __iter__(self): + ... + + def __getitem__(self, key): + ... + + def __contains__(self, key): + ... + + + +class _deprecated_list(_deprecated_container, list): + ... + + +class _deprecated_dict(_deprecated_container, dict): + ... + + diff --git a/stubs/sympy-stubs/discrete/__init__.pyi b/stubs/sympy-stubs/discrete/__init__.pyi new file mode 100644 index 00000000..e7c88175 --- /dev/null +++ b/stubs/sympy-stubs/discrete/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.discrete.transforms import fft, fwht, ifft, ifwht, intt, inverse_mobius_transform, mobius_transform, ntt +from sympy.discrete.convolutions import convolution, covering_product, intersecting_product + +__all__ = ['fft', 'ifft', 'ntt', 'intt', 'fwht', 'ifwht', 'mobius_transform', 'inverse_mobius_transform', 'convolution', 'covering_product', 'intersecting_product'] diff --git a/stubs/sympy-stubs/discrete/convolutions.pyi b/stubs/sympy-stubs/discrete/convolutions.pyi new file mode 100644 index 00000000..d637128b --- /dev/null +++ b/stubs/sympy-stubs/discrete/convolutions.pyi @@ -0,0 +1,24 @@ +from typing import Any +from sympy.core.numbers import Integer, Rational + +def convolution(a, b, cycle=..., dps=..., prime=..., dyadic=..., subset=...) -> list[int] | list[Any | int] | Any | list[Any]: + ... + +def convolution_fft(a, b, dps=...) -> list[Any] | Any: + ... + +def convolution_ntt(a, b, prime) -> list[int] | list[Any | int] | Any: + ... + +def convolution_fwht(a, b) -> list[Any] | Any: + ... + +def convolution_subset(a, b) -> list[Any] | Any: + ... + +def covering_product(a, b) -> list[Any] | Any: + ... + +def intersecting_product(a, b) -> list[Any] | Any: + ... + diff --git a/stubs/sympy-stubs/discrete/recurrences.pyi b/stubs/sympy-stubs/discrete/recurrences.pyi new file mode 100644 index 00000000..11e6bb38 --- /dev/null +++ b/stubs/sympy-stubs/discrete/recurrences.pyi @@ -0,0 +1,7 @@ + +def linrec(coeffs, init, n) -> int: + ... + +def linrec_coeffs(c, n): + ... + diff --git a/stubs/sympy-stubs/discrete/transforms.pyi b/stubs/sympy-stubs/discrete/transforms.pyi new file mode 100644 index 00000000..ca1e0b6d --- /dev/null +++ b/stubs/sympy-stubs/discrete/transforms.pyi @@ -0,0 +1,26 @@ +from typing import Any + +def fft(seq, dps=...) -> list[Any] | Any: + ... + +def ifft(seq, dps=...) -> list[Any] | Any: + ... + +def ntt(seq, prime) -> list[int] | list[Any | int] | Any: + ... + +def intt(seq, prime) -> list[int] | list[Any | int] | Any: + ... + +def fwht(seq) -> list[Any] | Any: + ... + +def ifwht(seq) -> list[Any] | Any: + ... + +def mobius_transform(seq, subset=...) -> list[Any] | Any: + ... + +def inverse_mobius_transform(seq, subset=...) -> list[Any] | Any: + ... + diff --git a/stubs/sympy-stubs/external/importtools.pyi b/stubs/sympy-stubs/external/importtools.pyi new file mode 100644 index 00000000..fc141599 --- /dev/null +++ b/stubs/sympy-stubs/external/importtools.pyi @@ -0,0 +1,11 @@ +from typing import Any + +WARN_NOT_INSTALLED = ... +WARN_OLD_VERSION = ... +_component_re = ... +def version_tuple(vstring) -> tuple[Any, ...]: + ... + +def import_module(module, min_module_version=..., min_python_version=..., warn_not_installed=..., warn_old_version=..., module_version_attr=..., module_version_attr_call_args=..., import_kwargs=..., catch=...): + ... + diff --git a/stubs/sympy-stubs/external/pythonmpq.pyi b/stubs/sympy-stubs/external/pythonmpq.pyi new file mode 100644 index 00000000..193dea47 --- /dev/null +++ b/stubs/sympy-stubs/external/pythonmpq.pyi @@ -0,0 +1,85 @@ +from types import NotImplementedType +from typing import Any, Self, Tuple as tTuple, Type + +_PyHASH_MODULUS = ... +_PyHASH_INF = ... +class PythonMPQ: + __slots__ = ... + def __new__(cls, numerator, denominator=...) -> Self: + ... + + def __int__(self) -> int: + ... + + def __float__(self): + ... + + def __bool__(self) -> bool: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __reduce__(self) -> tuple[type[Self], tuple[Any, Any]]: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __abs__(self) -> Self: + ... + + def __pos__(self) -> Self: + ... + + def __neg__(self) -> Self: + ... + + def __add__(self, other) -> NotImplementedType | Self: + ... + + def __radd__(self, other) -> Self | NotImplementedType: + ... + + def __sub__(self, other) -> NotImplementedType | Self: + ... + + def __rsub__(self, other) -> Self | NotImplementedType: + ... + + def __mul__(self, other) -> NotImplementedType | Self: + ... + + def __rmul__(self, other) -> Self | NotImplementedType: + ... + + def __pow__(self, exp) -> Self: + ... + + def __truediv__(self, other) -> NotImplementedType | Self: + ... + + def __rtruediv__(self, other) -> Self | NotImplementedType: + ... + + _compatible_types: tTuple[Type, ...] = ... + + diff --git a/stubs/sympy-stubs/functions/combinatorial/factorials.pyi b/stubs/sympy-stubs/functions/combinatorial/factorials.pyi new file mode 100644 index 00000000..b510f443 --- /dev/null +++ b/stubs/sympy-stubs/functions/combinatorial/factorials.pyi @@ -0,0 +1,65 @@ +from typing import Any +from sympy.core.function import Function, UndefinedFunction +from sympy.core.numbers import Integer +from sympy.series.order import Order + +class CombinatorialFunction(Function): + ... + + +class factorial(CombinatorialFunction): + def fdiff(self, argindex=...): + ... + + _small_swing = ... + _small_factorials: list[int] = ... + @classmethod + def eval(cls, n) -> Integer | None: + ... + + + +class MultiFactorial(CombinatorialFunction): + ... + + +class subfactorial(CombinatorialFunction): + @classmethod + def eval(cls, arg) -> int | None: + ... + + + +class factorial2(CombinatorialFunction): + @classmethod + def eval(cls, arg) -> None: + ... + + + +class RisingFactorial(CombinatorialFunction): + @classmethod + def eval(cls, x, k) -> type[UndefinedFunction] | int | float | None: + ... + + + +class FallingFactorial(CombinatorialFunction): + @classmethod + def eval(cls, x, k) -> type[UndefinedFunction] | int | float | None: + ... + + + +rf = RisingFactorial +ff = FallingFactorial +class binomial(CombinatorialFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, n, k) -> Order | Any | Integer | float | None: + ... + + + diff --git a/stubs/sympy-stubs/functions/combinatorial/numbers.pyi b/stubs/sympy-stubs/functions/combinatorial/numbers.pyi new file mode 100644 index 00000000..22a0df2f --- /dev/null +++ b/stubs/sympy-stubs/functions/combinatorial/numbers.pyi @@ -0,0 +1,161 @@ +from typing import Any, Self, Tuple as tTuple +from sympy.core.function import Function, UndefinedFunction +from sympy.core.numbers import Float, Integer, Rational +from sympy.series.order import Order + +_sym = ... +class carmichael(Function): + @staticmethod + def is_perfect_square(n) -> bool: + ... + + @staticmethod + def divides(p, n): + ... + + @staticmethod + def is_prime(n) -> bool: + ... + + @staticmethod + def is_carmichael(n) -> bool: + ... + + @staticmethod + def find_carmichael_numbers_in_range(x, y) -> list[int]: + ... + + @staticmethod + def find_first_n_carmichaels(n) -> list[Any]: + ... + + + +class fibonacci(Function): + @classmethod + def eval(cls, n, sym=...) -> Integer | None: + ... + + + +class lucas(Function): + @classmethod + def eval(cls, n) -> None: + ... + + + +class tribonacci(Function): + @classmethod + def eval(cls, n, sym=...) -> Integer | None: + ... + + + +class bernoulli(Function): + args: tTuple[Integer] + _cache = ... + _highest = ... + @classmethod + def eval(cls, n, x=...) -> Self | Rational | Integer | Float | Any | None: + ... + + + +class bell(Function): + @classmethod + def eval(cls, n, k_sym=..., symbols=...) -> Integer | None: + ... + + + +class harmonic(Function): + @classmethod + def eval(cls, n, m=...) -> Self | type[UndefinedFunction] | Order | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class euler(Function): + @classmethod + def eval(cls, n, x=...) -> Integer | Any | None: + ... + + + +class catalan(Function): + @classmethod + def eval(cls, n) -> Rational | Integer | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class genocchi(Function): + @classmethod + def eval(cls, n, x=...) -> Self | Any | None: + ... + + + +class andre(Function): + @classmethod + def eval(cls, n) -> None: + ... + + + +_npartition = ... +class partition(Function): + @classmethod + def eval(cls, n) -> Integer | None: + ... + + + +class _MultisetHistogram(tuple): + ... + + +_N = ... +_ITEMS = ... +_M = ... +def nP(n, k=..., replacement=...) -> Integer: + ... + +def nC(n, k=..., replacement=...) -> int | type[UndefinedFunction]: + ... + +def stirling(n, k, d=..., kind=..., signed=...) -> type[UndefinedFunction] | Integer: + ... + +def nT(n, k=...): + ... + +class motzkin(Function): + @staticmethod + def is_motzkin(n) -> bool: + ... + + @staticmethod + def find_motzkin_numbers_in_range(x, y) -> list[Any]: + ... + + @staticmethod + def find_first_n_motzkins(n) -> list[int]: + ... + + @classmethod + def eval(cls, n) -> Integer: + ... + + + +def nD(i=..., brute=..., *, n=..., m=...): + ... + diff --git a/stubs/sympy-stubs/functions/elementary/complexes.pyi b/stubs/sympy-stubs/functions/elementary/complexes.pyi new file mode 100644 index 00000000..d3ed2355 --- /dev/null +++ b/stubs/sympy-stubs/functions/elementary/complexes.pyi @@ -0,0 +1,135 @@ +from typing import Any, Literal, Self, Tuple as tTuple +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.function import Function, UndefinedFunction +from sympy.core.relational import Equality, Ne, Relational +from sympy.core.symbol import Dummy, Symbol +from sympy.integrals.integrals import Integral +from sympy.series.order import Order + +class re(Function): + args: tTuple[Expr] + is_extended_real = ... + unbranched = ... + _singularities = ... + @classmethod + def eval(cls, arg) -> type[UndefinedFunction] | None: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Self, Any]: + ... + + + +class im(Function): + args: tTuple[Expr] + is_extended_real = ... + unbranched = ... + _singularities = ... + @classmethod + def eval(cls, arg) -> None: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Self, Any]: + ... + + + +class sign(Function): + is_complex = ... + _singularities = ... + def doit(self, **hints) -> Self: + ... + + @classmethod + def eval(cls, arg) -> sign | None: + ... + + + +class Abs(Function): + args: tTuple[Expr] + is_extended_real = ... + is_extended_negative = ... + is_extended_nonnegative = ... + unbranched = ... + _singularities = ... + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + @classmethod + def eval(cls, arg): + ... + + + +class arg(Function): + is_extended_real = ... + is_real = ... + is_finite = ... + _singularities = ... + @classmethod + def eval(cls, arg) -> type[UndefinedFunction] | Self | None: + ... + + + +class conjugate(Function): + _singularities = ... + @classmethod + def eval(cls, arg) -> None: + ... + + def inverse(self) -> type[conjugate]: + ... + + + +class transpose(Function): + @classmethod + def eval(cls, arg) -> None: + ... + + + +class adjoint(Function): + @classmethod + def eval(cls, arg) -> type[UndefinedFunction] | None: + ... + + + +class polar_lift(Function): + is_polar = ... + is_comparable = ... + @classmethod + def eval(cls, arg) -> Order | None: + ... + + + +class periodic_argument(Function): + @classmethod + def eval(cls, ar, period) -> type[UndefinedFunction] | Literal[0] | None: + ... + + + +def unbranched_argument(arg) -> type[UndefinedFunction]: + ... + +class principal_branch(Function): + is_polar = ... + is_comparable = ... + @classmethod + def eval(cls, x, period) -> type[UndefinedFunction] | None: + ... + + + +def polarify(eq, subs=..., lift=...) -> type[UndefinedFunction] | Symbol | Equality | Relational | Ne | Integral | tuple[Any | Symbol | Basic | Equality | Relational | Ne | Integral, dict[Dummy, Any | Symbol | Basic]]: + ... + +def unpolarify(eq, subs=..., exponents_only=...) -> bool | Basic: + ... + diff --git a/stubs/sympy-stubs/functions/elementary/exponential.pyi b/stubs/sympy-stubs/functions/elementary/exponential.pyi new file mode 100644 index 00000000..de19f897 --- /dev/null +++ b/stubs/sympy-stubs/functions/elementary/exponential.pyi @@ -0,0 +1,107 @@ +from typing import Any, Literal, Self, Tuple as tTuple +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.expr import Expr +from sympy.core.function import Function, FunctionClass, UndefinedFunction +from sympy.core.kind import Kind +from sympy.core.numbers import Integer +from sympy.series.order import Order + +class ExpBase(Function): + unbranched = ... + _singularities = ... + @property + def kind(self) -> Kind: + ... + + def inverse(self, argindex=...) -> type[log]: + ... + + def as_numer_denom(self) -> tuple[Any, Self] | tuple[Self, Any]: + ... + + @property + def exp(self) -> Basic: + ... + + def as_base_exp(self) -> tuple[Self, Any | Order]: + ... + + + +class exp_polar(ExpBase): + is_polar = ... + is_comparable = ... + def as_base_exp(self) -> tuple[Self, Any] | tuple[ExpBase, Any | Order]: + ... + + + +class ExpMeta(FunctionClass): + def __instancecheck__(cls, instance) -> bool: + ... + + + +class exp(ExpBase, metaclass=ExpMeta): + def fdiff(self, argindex=...) -> Self: + ... + + @classmethod + def eval(cls, arg): + ... + + @property + def base(self): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: + ... + + + +def match_real_imag(expr) -> tuple[Any, Literal[0]] | tuple[Any, Any] | tuple[None, None]: + ... + +class log(Function): + args: tTuple[Expr] + _singularities = ... + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[exp]: + ... + + @classmethod + def eval(cls, arg, base=...): + ... + + def as_base_exp(self) -> tuple[Self, Any]: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Self, Any] | tuple[Any, type[UndefinedFunction] | Any] | tuple[type[UndefinedFunction] | Any, type[UndefinedFunction] | Any]: + ... + + + +class LambertW(Function): + _singularities = ... + @classmethod + def eval(cls, x, k=...) -> Self | type[UndefinedFunction] | Integer | None: + ... + + def fdiff(self, argindex=...): + ... + + + diff --git a/stubs/sympy-stubs/functions/elementary/hyperbolic.pyi b/stubs/sympy-stubs/functions/elementary/hyperbolic.pyi new file mode 100644 index 00000000..b49e1521 --- /dev/null +++ b/stubs/sympy-stubs/functions/elementary/hyperbolic.pyi @@ -0,0 +1,252 @@ +from typing import Any, Self +from sympy.core import cacheit +from sympy.core.basic import Basic +from sympy.core.function import Function, UndefinedFunction +from sympy.core.logic import FuzzyBool +from sympy.core.mul import Mul +from sympy.core.power import Pow +from sympy.functions.elementary.exponential import log +from sympy.series.order import Order + +class HyperbolicFunction(Function): + unbranched = ... + + +class sinh(HyperbolicFunction): + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + def inverse(self, argindex=...) -> type[asinh]: + ... + + @classmethod + def eval(cls, arg) -> Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any | Order | Self, Any] | tuple[Self, Any] | tuple[Any, Any]: + ... + + + +class cosh(HyperbolicFunction): + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + @classmethod + def eval(cls, arg) -> Self | type[UndefinedFunction] | Pow | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any | Order | Self, Any] | tuple[Self, Any] | tuple[Any, Any]: + ... + + + +class tanh(HyperbolicFunction): + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[atanh]: + ... + + @classmethod + def eval(cls, arg) -> Mul | type[UndefinedFunction] | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any | Order | Self, Any] | tuple[Self, Any] | tuple[Any, Any]: + ... + + + +class coth(HyperbolicFunction): + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[acoth]: + ... + + @classmethod + def eval(cls, arg) -> Mul | type[UndefinedFunction] | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any | Order | Self, Any] | tuple[Self, Any] | tuple[Any, Any]: + ... + + + +class ReciprocalHyperbolicFunction(HyperbolicFunction): + _reciprocal_of = ... + _is_even: FuzzyBool = ... + _is_odd: FuzzyBool = ... + @classmethod + def eval(cls, arg) -> Self | Mul: + ... + + def as_real_imag(self, deep=..., **hints): + ... + + + +class csch(ReciprocalHyperbolicFunction): + _reciprocal_of = sinh + _is_odd = ... + def fdiff(self, argindex=...): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class sech(ReciprocalHyperbolicFunction): + _reciprocal_of = cosh + _is_even = ... + def fdiff(self, argindex=...): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class InverseHyperbolicFunction(Function): + ... + + +class asinh(InverseHyperbolicFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> log | Mul | Basic | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[sinh]: + ... + + + +class acosh(InverseHyperbolicFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[cosh]: + ... + + + +class atanh(InverseHyperbolicFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> Mul | Basic | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[tanh]: + ... + + + +class acoth(InverseHyperbolicFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[coth]: + ... + + + +class asech(InverseHyperbolicFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms) -> type[UndefinedFunction]: + ... + + def inverse(self, argindex=...) -> type[sech]: + ... + + _eval_rewrite_as_tractable = ... + + +class acsch(InverseHyperbolicFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> log | Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms) -> type[UndefinedFunction]: + ... + + def inverse(self, argindex=...) -> type[csch]: + ... + + _eval_rewrite_as_tractable = ... + + diff --git a/stubs/sympy-stubs/functions/elementary/miscellaneous.pyi b/stubs/sympy-stubs/functions/elementary/miscellaneous.pyi new file mode 100644 index 00000000..1151e30d --- /dev/null +++ b/stubs/sympy-stubs/functions/elementary/miscellaneous.pyi @@ -0,0 +1,99 @@ +from typing import Self, Tuple +from sympy.core import Function +from sympy.core.operations import LatticeOp +from sympy.core.function import Application, Lambda +from sympy.core.expr import Expr +from sympy.core.power import Pow +from sympy.core.singleton import Singleton +from sympy.core.symbol import Dummy +from sympy.functions.elementary.piecewise import Piecewise +from sympy.functions.special.delta_functions import Heaviside +from sympy.series.order import Order + +class IdentityFunction(Lambda, metaclass=Singleton): + _symbol = ... + @property + def signature(self) -> Tuple: + ... + + @property + def expr(self) -> Dummy: + ... + + + +Id = ... +def sqrt(arg, evaluate=...) -> Pow: + ... + +def cbrt(arg, evaluate=...) -> Pow: + ... + +def root(arg, n, k=..., evaluate=...) -> Order | Pow: + ... + +def real_root(arg, n=..., evaluate=...) -> Piecewise: + ... + +class MinMaxBase(Expr, LatticeOp): + def __new__(cls, *args, **assumptions) -> Self: + ... + + def evalf(self, n=..., **options) -> Self: + ... + + def n(self, *args, **kwargs) -> Self: + ... + + _eval_is_algebraic = ... + _eval_is_antihermitian = ... + _eval_is_commutative = ... + _eval_is_complex = ... + _eval_is_composite = ... + _eval_is_even = ... + _eval_is_finite = ... + _eval_is_hermitian = ... + _eval_is_imaginary = ... + _eval_is_infinite = ... + _eval_is_integer = ... + _eval_is_irrational = ... + _eval_is_negative = ... + _eval_is_noninteger = ... + _eval_is_nonnegative = ... + _eval_is_nonpositive = ... + _eval_is_nonzero = ... + _eval_is_odd = ... + _eval_is_polar = ... + _eval_is_positive = ... + _eval_is_prime = ... + _eval_is_rational = ... + _eval_is_real = ... + _eval_is_extended_real = ... + _eval_is_transcendental = ... + _eval_is_zero = ... + + +class Max(MinMaxBase, Application): + zero = ... + identity = ... + def fdiff(self, argindex) -> Heaviside: + ... + + + +class Min(MinMaxBase, Application): + zero = ... + identity = ... + def fdiff(self, argindex) -> Heaviside: + ... + + + +class Rem(Function): + kind = ... + @classmethod + def eval(cls, p, q) -> None: + ... + + + diff --git a/stubs/sympy-stubs/functions/elementary/piecewise.pyi b/stubs/sympy-stubs/functions/elementary/piecewise.pyi new file mode 100644 index 00000000..708af13a --- /dev/null +++ b/stubs/sympy-stubs/functions/elementary/piecewise.pyi @@ -0,0 +1,81 @@ +from typing import Any, Generator, Self +from sympy.core import Function, Tuple +from sympy.core.basic import Basic + +Undefined = ... +class ExprCondPair(Tuple): + def __new__(cls, expr, cond) -> Self: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def cond(self) -> Basic: + ... + + @property + def is_commutative(self) -> bool | None: + ... + + def __iter__(self) -> Generator[Basic, Any, None]: + ... + + + +class Piecewise(Function): + nargs = ... + is_Piecewise = ... + def __new__(cls, *args, **options) -> Self: + ... + + @classmethod + def eval(cls, *_args) -> Self | None: + ... + + def doit(self, **hints) -> Self: + ... + + def piecewise_integrate(self, x, **kwargs) -> Self: + ... + + _eval_is_finite = ... + _eval_is_complex = ... + _eval_is_even = ... + _eval_is_imaginary = ... + _eval_is_integer = ... + _eval_is_irrational = ... + _eval_is_negative = ... + _eval_is_nonnegative = ... + _eval_is_nonpositive = ... + _eval_is_nonzero = ... + _eval_is_odd = ... + _eval_is_polar = ... + _eval_is_positive = ... + _eval_is_extended_real = ... + _eval_is_extended_positive = ... + _eval_is_extended_negative = ... + _eval_is_extended_nonzero = ... + _eval_is_extended_nonpositive = ... + _eval_is_extended_nonnegative = ... + _eval_is_real = ... + _eval_is_zero = ... + def as_expr_set_pairs(self, domain=...) -> list[Any]: + ... + + + +def piecewise_fold(expr, evaluate=...) -> Basic | Piecewise: + ... + +def piecewise_simplify_arguments(expr, **kwargs): + ... + +_blessed = ... +def piecewise_simplify(expr, **kwargs) -> Piecewise: + ... + +def piecewise_exclusive(expr, *, skip_nan=..., deep=...) -> Piecewise: + ... + diff --git a/stubs/sympy-stubs/functions/elementary/trigonometric.pyi b/stubs/sympy-stubs/functions/elementary/trigonometric.pyi new file mode 100644 index 00000000..f7f3875e --- /dev/null +++ b/stubs/sympy-stubs/functions/elementary/trigonometric.pyi @@ -0,0 +1,296 @@ +from typing import Any, Self, Tuple as tTuple +from sympy.calculus.accumulationbounds import AccumBounds +from sympy.core.cache import cacheit +from sympy.core.expr import Expr +from sympy.core.function import Function, UndefinedFunction +from sympy.core.logic import FuzzyBool +from sympy.core.mul import Mul +from sympy.functions.elementary.piecewise import Piecewise + +class TrigonometricFunction(Function): + unbranched = ... + _singularities = ... + + +class sin(TrigonometricFunction): + def period(self, symbol=...): + ... + + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + @classmethod + def eval(cls, arg): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: + ... + + + +class cos(TrigonometricFunction): + def period(self, symbol=...): + ... + + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: + ... + + + +class tan(TrigonometricFunction): + def period(self, symbol=...): + ... + + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[atan]: + ... + + @classmethod + def eval(cls, arg): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any] | tuple[Self, Any]: + ... + + + +class cot(TrigonometricFunction): + def period(self, symbol=...): + ... + + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[acot]: + ... + + @classmethod + def eval(cls, arg): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any] | tuple[Self, Any]: + ... + + + +class ReciprocalTrigonometricFunction(TrigonometricFunction): + _reciprocal_of = ... + _singularities = ... + _is_even: FuzzyBool = ... + _is_odd: FuzzyBool = ... + @classmethod + def eval(cls, arg) -> Self | Mul: + ... + + def fdiff(self, argindex=...) -> Any: + ... + + def as_real_imag(self, deep=..., **hints): + ... + + + +class sec(ReciprocalTrigonometricFunction): + _reciprocal_of = cos + _is_even = ... + def period(self, symbol=...): + ... + + def fdiff(self, argindex=...): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class csc(ReciprocalTrigonometricFunction): + _reciprocal_of = sin + _is_odd = ... + def period(self, symbol=...): + ... + + def fdiff(self, argindex=...): + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class sinc(Function): + _singularities = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> Self | None: + ... + + _eval_is_finite = ... + + +class InverseTrigonometricFunction(Function): + _singularities: tTuple[Expr, ...] = ... + + +class asin(InverseTrigonometricFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[sin]: + ... + + + +class acos(InverseTrigonometricFunction): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[cos]: + ... + + + +class atan(InverseTrigonometricFunction): + args: tTuple[Expr] + _singularities = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> AccumBounds | Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[tan]: + ... + + + +class acot(InverseTrigonometricFunction): + _singularities = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + def inverse(self, argindex=...) -> type[cot]: + ... + + + +class asec(InverseTrigonometricFunction): + @classmethod + def eval(cls, arg) -> None: + ... + + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[sec]: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + + +class acsc(InverseTrigonometricFunction): + @classmethod + def eval(cls, arg) -> Mul | None: + ... + + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[csc]: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + _eval_rewrite_as_tractable = ... + + +class atan2(InverseTrigonometricFunction): + @classmethod + def eval(cls, y, x) -> atan | Piecewise | None: + ... + + def fdiff(self, argindex): + ... + + + diff --git a/stubs/sympy-stubs/functions/special/bessel.pyi b/stubs/sympy-stubs/functions/special/bessel.pyi new file mode 100644 index 00000000..4305700e --- /dev/null +++ b/stubs/sympy-stubs/functions/special/bessel.pyi @@ -0,0 +1,181 @@ +from functools import _Wrapped +from typing import Any, Callable +from numpy import floating, ndarray as NDArray +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.function import Function, UndefinedFunction +from sympy.core.numbers import Float + +class BesselBase(Function): + @property + def order(self) -> Basic: + ... + + @property + def argument(self) -> Basic: + ... + + @classmethod + def eval(cls, nu, z) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class besselj(BesselBase): + _a = ... + _b = ... + @classmethod + def eval(cls, nu, z) -> type[UndefinedFunction] | None: + ... + + + +class bessely(BesselBase): + _a = ... + _b = ... + @classmethod + def eval(cls, nu, z) -> None: + ... + + + +class besseli(BesselBase): + _a = ... + _b = ... + @classmethod + def eval(cls, nu, z) -> type[UndefinedFunction] | None: + ... + + + +class besselk(BesselBase): + _a = ... + _b = ... + @classmethod + def eval(cls, nu, z) -> type[UndefinedFunction] | None: + ... + + + +class hankel1(BesselBase): + _a = ... + _b = ... + + +class hankel2(BesselBase): + _a = ... + _b = ... + + +def assume_integer_order(fn) -> _Wrapped[..., Any, ..., Any | None]: + ... + +class SphericalBesselBase(BesselBase): + def fdiff(self, argindex=...): + ... + + + +class jn(SphericalBesselBase): + @classmethod + def eval(cls, nu, z) -> None: + ... + + + +class yn(SphericalBesselBase): + ... + + +class SphericalHankelBase(SphericalBesselBase): + ... + + +class hn1(SphericalHankelBase): + _hankel_kind_sign = ... + + +class hn2(SphericalHankelBase): + _hankel_kind_sign = ... + + +def jn_zeros(n, k, method=..., dps=...) -> list[Any | Float] | list[Any | NDArray[Any, Any] | NDArray[floating[Any], Any] | tuple[Any, Any] | Any]: + ... + +class AiryBase(Function): + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: + ... + + + +class airyai(AiryBase): + nargs = ... + unbranched = ... + @classmethod + def eval(cls, arg) -> None: + ... + + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class airybi(AiryBase): + nargs = ... + unbranched = ... + @classmethod + def eval(cls, arg) -> None: + ... + + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class airyaiprime(AiryBase): + nargs = ... + unbranched = ... + @classmethod + def eval(cls, arg) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class airybiprime(AiryBase): + nargs = ... + unbranched = ... + @classmethod + def eval(cls, arg) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class marcumq(Function): + @classmethod + def eval(cls, m, a, b) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + diff --git a/stubs/sympy-stubs/functions/special/beta_functions.pyi b/stubs/sympy-stubs/functions/special/beta_functions.pyi new file mode 100644 index 00000000..c1830f67 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/beta_functions.pyi @@ -0,0 +1,39 @@ +from typing import Self +from sympy.core.function import Function, UndefinedFunction + +def betainc_mpmath_fix(a, b, x1, x2, reg=...): + ... + +class beta(Function): + unbranched = ... + def fdiff(self, argindex): + ... + + @classmethod + def eval(cls, x, y=...) -> type[UndefinedFunction] | None: + ... + + def doit(self, **hints) -> Self | type[UndefinedFunction]: + ... + + + +class betainc(Function): + nargs = ... + unbranched = ... + def fdiff(self, argindex): + ... + + + +class betainc_regularized(Function): + nargs = ... + unbranched = ... + def __new__(cls, a, b, x1, x2) -> type[UndefinedFunction]: + ... + + def fdiff(self, argindex): + ... + + + diff --git a/stubs/sympy-stubs/functions/special/bsplines.pyi b/stubs/sympy-stubs/functions/special/bsplines.pyi new file mode 100644 index 00000000..f2a69491 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/bsplines.pyi @@ -0,0 +1,15 @@ +from functools import lru_cache +from typing import Any +from sympy.functions.elementary.piecewise import Piecewise +from sympy.series.order import Order + +@lru_cache(maxsize=128) +def bspline_basis(d, knots, n, x) -> Piecewise | Order | Any: + ... + +def bspline_basis_set(d, knots, x) -> list[Any | Piecewise | Order]: + ... + +def interpolating_spline(d, x, X, Y) -> Piecewise: + ... + diff --git a/stubs/sympy-stubs/functions/special/delta_functions.pyi b/stubs/sympy-stubs/functions/special/delta_functions.pyi new file mode 100644 index 00000000..0c2a507b --- /dev/null +++ b/stubs/sympy-stubs/functions/special/delta_functions.pyi @@ -0,0 +1,37 @@ +from typing import Literal, Self +from sympy.core.basic import Basic +from sympy.core.function import Function, UndefinedFunction +from sympy.core.mul import Mul + +class DiracDelta(Function): + is_real = ... + def fdiff(self, argindex=...) -> Self: + ... + + @classmethod + def eval(cls, arg, k=...) -> Mul | Self | None: + ... + + def is_simple(self, x) -> Literal[False]: + ... + + + +class Heaviside(Function): + is_real = ... + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + def __new__(cls, arg, H0=..., **options): + ... + + @property + def pargs(self) -> tuple[Basic, ...]: + ... + + @classmethod + def eval(cls, arg, H0=...) -> None: + ... + + + diff --git a/stubs/sympy-stubs/functions/special/elliptic_integrals.pyi b/stubs/sympy-stubs/functions/special/elliptic_integrals.pyi new file mode 100644 index 00000000..76beb857 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/elliptic_integrals.pyi @@ -0,0 +1,43 @@ +from sympy.core.function import Function +from sympy.core.power import Pow + +class elliptic_k(Function): + @classmethod + def eval(cls, m) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class elliptic_f(Function): + @classmethod + def eval(cls, z, m) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class elliptic_e(Function): + @classmethod + def eval(cls, m, z=...) -> None: + ... + + def fdiff(self, argindex=...) -> Pow: + ... + + + +class elliptic_pi(Function): + @classmethod + def eval(cls, n, m, z=...): + ... + + def fdiff(self, argindex=...): + ... + + + diff --git a/stubs/sympy-stubs/functions/special/error_functions.pyi b/stubs/sympy-stubs/functions/special/error_functions.pyi new file mode 100644 index 00000000..9cfc5ba1 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/error_functions.pyi @@ -0,0 +1,244 @@ +from typing import Any +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.function import Function, UndefinedFunction +from sympy.core.mul import Mul +from sympy.functions.elementary.hyperbolic import cosh, sinh +from sympy.functions.elementary.trigonometric import cos, sin + +def real_to_real_as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: + ... + +class erf(Function): + unbranched = ... + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[erfinv]: + ... + + @classmethod + def eval(cls, arg) -> Basic | erf2inv | Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + as_real_imag = ... + + +class erfc(Function): + unbranched = ... + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[erfcinv]: + ... + + @classmethod + def eval(cls, arg) -> Basic | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + as_real_imag = ... + + +class erfi(Function): + unbranched = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, z) -> Mul | None: + ... + + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + as_real_imag = ... + + +class erf2(Function): + def fdiff(self, argindex): + ... + + @classmethod + def eval(cls, x, y) -> Basic | Mul | None: + ... + + + +class erfinv(Function): + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[erf]: + ... + + @classmethod + def eval(cls, z) -> Basic | None: + ... + + + +class erfcinv(Function): + def fdiff(self, argindex=...): + ... + + def inverse(self, argindex=...) -> type[erfc]: + ... + + @classmethod + def eval(cls, z) -> None: + ... + + + +class erf2inv(Function): + def fdiff(self, argindex) -> type[UndefinedFunction]: + ... + + @classmethod + def eval(cls, x, y) -> type[UndefinedFunction] | None: + ... + + + +class Ei(Function): + @classmethod + def eval(cls, z) -> None: + ... + + def fdiff(self, argindex=...): + ... + + _eval_rewrite_as_Ci = ... + _eval_rewrite_as_Chi = ... + _eval_rewrite_as_Shi = ... + + +class expint(Function): + @classmethod + def eval(cls, nu, z) -> type[UndefinedFunction] | bool | Basic | None: + ... + + def fdiff(self, argindex) -> Mul: + ... + + _eval_rewrite_as_Ci = ... + _eval_rewrite_as_Chi = ... + _eval_rewrite_as_Shi = ... + + +def E1(z) -> type[UndefinedFunction]: + ... + +class li(Function): + @classmethod + def eval(cls, z) -> None: + ... + + def fdiff(self, argindex=...): + ... + + _eval_rewrite_as_Ci = ... + _eval_rewrite_as_Chi = ... + + +class Li(Function): + @classmethod + def eval(cls, z) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class TrigonometricIntegral(Function): + @classmethod + def eval(cls, z) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class Si(TrigonometricIntegral): + _trigfunc = sin + _atzero = ... + + +class Ci(TrigonometricIntegral): + _trigfunc = cos + _atzero = ... + + +class Shi(TrigonometricIntegral): + _trigfunc = sinh + _atzero = ... + + +class Chi(TrigonometricIntegral): + _trigfunc = cosh + _atzero = ... + + +class FresnelIntegral(Function): + unbranched = ... + @classmethod + def eval(cls, z) -> None: + ... + + def fdiff(self, argindex=...): + ... + + _eval_is_finite = ... + as_real_imag = ... + + +class fresnels(FresnelIntegral): + _trigfunc = sin + _sign = ... + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class fresnelc(FresnelIntegral): + _trigfunc = cos + _sign = ... + @staticmethod + @cacheit + def taylor_term(n, x, *previous_terms): + ... + + + +class _erfs(Function): + @classmethod + def eval(cls, arg) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class _eis(Function): + def fdiff(self, argindex=...): + ... + + + diff --git a/stubs/sympy-stubs/functions/special/gamma_functions.pyi b/stubs/sympy-stubs/functions/special/gamma_functions.pyi new file mode 100644 index 00000000..2e20e266 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/gamma_functions.pyi @@ -0,0 +1,88 @@ +from sympy.core.function import Function, UndefinedFunction + +def intlike(n) -> bool: + ... + +class gamma(Function): + unbranched = ... + _singularities = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, arg) -> type[UndefinedFunction] | None: + ... + + + +class lowergamma(Function): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, a, x) -> type[UndefinedFunction] | None: + ... + + + +class uppergamma(Function): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, a, z): + ... + + + +class polygamma(Function): + @classmethod + def eval(cls, n, z) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...) -> polygamma: + ... + + + +class loggamma(Function): + @classmethod + def eval(cls, z) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + + +class digamma(Function): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, z) -> type[UndefinedFunction]: + ... + + + +class trigamma(Function): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, z) -> type[UndefinedFunction]: + ... + + + +class multigamma(Function): + unbranched = ... + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, x, p): + ... + + + diff --git a/stubs/sympy-stubs/functions/special/hyper.pyi b/stubs/sympy-stubs/functions/special/hyper.pyi new file mode 100644 index 00000000..459dcdc9 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/hyper.pyi @@ -0,0 +1,169 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.core.function import Derivative, Function, UndefinedFunction +from sympy.core.containers import Tuple +from sympy.core.logic import Or + +class TupleArg(Tuple): + def limit(self, x, xlim, dir=...) -> TupleArg: + ... + + + +class TupleParametersBase(Function): + is_commutative = ... + + +class hyper(TupleParametersBase): + def __new__(cls, ap, bq, z, **kwargs) -> type[UndefinedFunction]: + ... + + @classmethod + def eval(cls, ap, bq, z) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...): + ... + + @property + def argument(self) -> Basic: + ... + + @property + def ap(self) -> Tuple: + ... + + @property + def bq(self) -> Tuple: + ... + + @property + def eta(self): + ... + + @property + def radius_of_convergence(self): + ... + + @property + def convergence_statement(self) -> Or | bool: + ... + + + +class meijerg(TupleParametersBase): + def __new__(cls, *args, **kwargs) -> type[UndefinedFunction]: + ... + + def fdiff(self, argindex=...): + ... + + def get_period(self): + ... + + def integrand(self, s): + ... + + @property + def argument(self) -> Basic: + ... + + @property + def an(self) -> Tuple: + ... + + @property + def ap(self) -> Tuple: + ... + + @property + def aother(self) -> Tuple: + ... + + @property + def bm(self) -> Tuple: + ... + + @property + def bq(self) -> Tuple: + ... + + @property + def bother(self) -> Tuple: + ... + + @property + def nu(self): + ... + + @property + def delta(self): + ... + + @property + def is_number(self) -> bool: + ... + + + +class HyperRep(Function): + @classmethod + def eval(cls, *args) -> Self | None: + ... + + + +class HyperRep_power1(HyperRep): + ... + + +class HyperRep_power2(HyperRep): + ... + + +class HyperRep_log1(HyperRep): + ... + + +class HyperRep_atanh(HyperRep): + ... + + +class HyperRep_asin1(HyperRep): + ... + + +class HyperRep_asin2(HyperRep): + ... + + +class HyperRep_sqrts1(HyperRep): + ... + + +class HyperRep_sqrts2(HyperRep): + ... + + +class HyperRep_log2(HyperRep): + ... + + +class HyperRep_cosasin(HyperRep): + ... + + +class HyperRep_sinasin(HyperRep): + ... + + +class appellf1(Function): + @classmethod + def eval(cls, a, b1, b2, c, x, y) -> Self | None: + ... + + def fdiff(self, argindex=...) -> Derivative: + ... + + + diff --git a/stubs/sympy-stubs/functions/special/mathieu_functions.pyi b/stubs/sympy-stubs/functions/special/mathieu_functions.pyi new file mode 100644 index 00000000..7c258252 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/mathieu_functions.pyi @@ -0,0 +1,48 @@ +from typing import Self +from sympy.core.function import Function, UndefinedFunction +from sympy.core.mul import Mul + +class MathieuBase(Function): + unbranched = ... + + +class mathieus(MathieuBase): + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + @classmethod + def eval(cls, a, q, z) -> type[UndefinedFunction] | Mul | None: + ... + + + +class mathieuc(MathieuBase): + def fdiff(self, argindex=...) -> type[UndefinedFunction]: + ... + + @classmethod + def eval(cls, a, q, z) -> type[UndefinedFunction] | Self | None: + ... + + + +class mathieusprime(MathieuBase): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, a, q, z) -> Self | None: + ... + + + +class mathieucprime(MathieuBase): + def fdiff(self, argindex=...): + ... + + @classmethod + def eval(cls, a, q, z) -> Mul | None: + ... + + + diff --git a/stubs/sympy-stubs/functions/special/polynomials.pyi b/stubs/sympy-stubs/functions/special/polynomials.pyi new file mode 100644 index 00000000..2f7f82de --- /dev/null +++ b/stubs/sympy-stubs/functions/special/polynomials.pyi @@ -0,0 +1,134 @@ +from typing import Any +from sympy.concrete.summations import Sum +from sympy.core.function import Function, UndefinedFunction +from sympy.core.mul import Mul +from sympy.core.relational import Equality, Ne, Relational + +_x = ... +class OrthogonalPolynomial(Function): + ... + + +class jacobi(OrthogonalPolynomial): + @classmethod + def eval(cls, n, a, b, x) -> type[UndefinedFunction] | Any | None: + ... + + def fdiff(self, argindex=...) -> Equality | Relational | Ne | Sum: + ... + + + +def jacobi_normalized(n, a, b, x): + ... + +class gegenbauer(OrthogonalPolynomial): + @classmethod + def eval(cls, n, a, x) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...) -> Equality | Relational | Ne | Sum: + ... + + + +class chebyshevt(OrthogonalPolynomial): + _ortho_poly = ... + @classmethod + def eval(cls, n, x) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class chebyshevu(OrthogonalPolynomial): + _ortho_poly = ... + @classmethod + def eval(cls, n, x) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class chebyshevt_root(Function): + @classmethod + def eval(cls, n, k) -> type[UndefinedFunction]: + ... + + + +class chebyshevu_root(Function): + @classmethod + def eval(cls, n, k) -> type[UndefinedFunction]: + ... + + + +class legendre(OrthogonalPolynomial): + _ortho_poly = ... + @classmethod + def eval(cls, n, x) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class assoc_legendre(Function): + @classmethod + def eval(cls, n, m, x) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class hermite(OrthogonalPolynomial): + _ortho_poly = ... + @classmethod + def eval(cls, n, x) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class hermite_prob(OrthogonalPolynomial): + _ortho_poly = ... + @classmethod + def eval(cls, n, x) -> None: + ... + + def fdiff(self, argindex=...): + ... + + + +class laguerre(OrthogonalPolynomial): + _ortho_poly = ... + @classmethod + def eval(cls, n, x) -> None: + ... + + def fdiff(self, argindex=...) -> Mul: + ... + + + +class assoc_laguerre(OrthogonalPolynomial): + @classmethod + def eval(cls, n, alpha, x) -> type[UndefinedFunction] | Any | None: + ... + + def fdiff(self, argindex=...) -> Equality | Relational | Ne | Sum | Mul: + ... + + + diff --git a/stubs/sympy-stubs/functions/special/singularity_functions.pyi b/stubs/sympy-stubs/functions/special/singularity_functions.pyi new file mode 100644 index 00000000..dbee3d18 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/singularity_functions.pyi @@ -0,0 +1,16 @@ +from typing import Self +from sympy.core.function import Function + +class SingularityFunction(Function): + is_real = ... + def fdiff(self, argindex=...) -> Self | None: + ... + + @classmethod + def eval(cls, variable, offset, exponent) -> None: + ... + + _eval_rewrite_as_DiracDelta = ... + _eval_rewrite_as_HeavisideDiracDelta = ... + + diff --git a/stubs/sympy-stubs/functions/special/spherical_harmonics.pyi b/stubs/sympy-stubs/functions/special/spherical_harmonics.pyi new file mode 100644 index 00000000..fe83b7b5 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/spherical_harmonics.pyi @@ -0,0 +1,27 @@ +from typing import Any +from sympy.core.function import Function, UndefinedFunction + +_x = ... +class Ynm(Function): + @classmethod + def eval(cls, n, m, theta, phi) -> type[UndefinedFunction] | None: + ... + + def fdiff(self, argindex=...): + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: + ... + + + +def Ynm_c(n, m, theta, phi) -> type[UndefinedFunction]: + ... + +class Znm(Function): + @classmethod + def eval(cls, n, m, theta, phi) -> type[UndefinedFunction] | None: + ... + + + diff --git a/stubs/sympy-stubs/functions/special/tensor_functions.pyi b/stubs/sympy-stubs/functions/special/tensor_functions.pyi new file mode 100644 index 00000000..b3c09f67 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/tensor_functions.pyi @@ -0,0 +1,65 @@ +from typing import Literal, Self +from sympy.core.basic import Basic +from sympy.core.function import Function, UndefinedFunction + +def Eijk(*args, **kwargs) -> type[UndefinedFunction]: + ... + +def eval_levicivita(*args): + ... + +class LeviCivita(Function): + is_integer = ... + @classmethod + def eval(cls, *args) -> None: + ... + + def doit(self, **hints): + ... + + + +class KroneckerDelta(Function): + is_integer = ... + @classmethod + def eval(cls, i, j, delta_range=...) -> Self | None: + ... + + @property + def delta_range(self) -> Basic | None: + ... + + @property + def is_above_fermi(self) -> bool: + ... + + @property + def is_below_fermi(self) -> bool: + ... + + @property + def is_only_above_fermi(self) -> Literal[False]: + ... + + @property + def is_only_below_fermi(self) -> Literal[False]: + ... + + @property + def indices_contain_equal_information(self) -> bool: + ... + + @property + def preferred_index(self) -> Basic: + ... + + @property + def killable_index(self) -> Basic: + ... + + @property + def indices(self) -> tuple[Basic, ...]: + ... + + + diff --git a/stubs/sympy-stubs/functions/special/zeta_functions.pyi b/stubs/sympy-stubs/functions/special/zeta_functions.pyi new file mode 100644 index 00000000..ce2196f9 --- /dev/null +++ b/stubs/sympy-stubs/functions/special/zeta_functions.pyi @@ -0,0 +1,50 @@ +from typing import Self +from sympy.core.function import Function, UndefinedFunction + +class lerchphi(Function): + def fdiff(self, argindex=...): + ... + + + +class polylog(Function): + @classmethod + def eval(cls, s, z) -> type[UndefinedFunction] | Self | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class zeta(Function): + @classmethod + def eval(cls, s, a=...) -> Self | None: + ... + + def fdiff(self, argindex=...): + ... + + + +class dirichlet_eta(Function): + @classmethod + def eval(cls, s, a=...) -> Self | type[UndefinedFunction] | None: + ... + + + +class riemann_xi(Function): + @classmethod + def eval(cls, s) -> None: + ... + + + +class stieltjes(Function): + @classmethod + def eval(cls, n, a=...) -> None: + ... + + + diff --git a/stubs/sympy-stubs/geometry/curve.pyi b/stubs/sympy-stubs/geometry/curve.pyi new file mode 100644 index 00000000..10dffcb5 --- /dev/null +++ b/stubs/sympy-stubs/geometry/curve.pyi @@ -0,0 +1,55 @@ +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.core.relational import Equality, Ne, Relational +from sympy.core.symbol import Symbol +from sympy.geometry.entity import GeometrySet +from sympy.geometry.point import Point, Point2D, Point3D + +class Curve(GeometrySet): + def __new__(cls, function, limits) -> Self: + ... + + def __call__(self, f) -> Self | Basic: + ... + + def arbitrary_point(self, parameter=...) -> Point | Point2D | Point3D: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + @property + def ambient_dimension(self) -> int: + ... + + @property + def functions(self) -> Basic: + ... + + @property + def limits(self) -> Basic: + ... + + @property + def parameter(self): + ... + + @property + def length(self) -> Equality | Relational | Ne: + ... + + def plot_interval(self, parameter=...) -> list[Any | Symbol]: + ... + + def rotate(self, angle=..., pt=...) -> Self: + ... + + def scale(self, x=..., y=..., pt=...) -> Self: + ... + + def translate(self, x=..., y=...) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/geometry/ellipse.pyi b/stubs/sympy-stubs/geometry/ellipse.pyi new file mode 100644 index 00000000..b9d0b6a6 --- /dev/null +++ b/stubs/sympy-stubs/geometry/ellipse.pyi @@ -0,0 +1,167 @@ +from types import NotImplementedType +from typing import Any, Literal, Self +from sympy.core.basic import Basic +from sympy.core.power import Pow +from sympy.geometry.entity import GeometrySet +from sympy.geometry.line import Line, Line2D, Line3D, Segment, Segment2D, Segment3D +from sympy.geometry.point import Point, Point2D, Point3D + +class Ellipse(GeometrySet): + def __contains__(self, o) -> bool | NotImplementedType: + ... + + def __eq__(self, o) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __new__(cls, center=..., hradius=..., vradius=..., eccentricity=..., **kwargs) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | Self | None: + ... + + @property + def ambient_dimension(self) -> Literal[2]: + ... + + @property + def apoapsis(self): + ... + + def arbitrary_point(self, parameter=...) -> Point | Point2D | Point3D: + ... + + @property + def area(self): + ... + + @property + def bounds(self) -> tuple[Any, Any, Any, Any]: + ... + + @property + def center(self) -> Basic: + ... + + @property + def circumference(self): + ... + + @property + def eccentricity(self): + ... + + def encloses_point(self, p) -> bool | None: + ... + + def equation(self, x=..., y=..., _slope=...): + ... + + def evolute(self, x=..., y=...): + ... + + @property + def foci(self) -> tuple[Basic, Basic] | tuple[Any, Any] | None: + ... + + @property + def focus_distance(self) -> Pow | Any: + ... + + @property + def hradius(self) -> Basic: + ... + + def intersection(self, o) -> list[Point] | list[Any] | Self: + ... + + def is_tangent(self, o) -> bool: + ... + + @property + def major(self) -> Basic: + ... + + @property + def minor(self) -> Basic: + ... + + def normal_lines(self, p, prec=...) -> list[Any] | list[Line | Line2D | Line3D | None]: + ... + + @property + def periapsis(self): + ... + + @property + def semilatus_rectum(self): + ... + + def auxiliary_circle(self) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + def director_circle(self) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + def plot_interval(self, parameter=...) -> list[Any]: + ... + + def random_point(self, seed=...) -> Point | Point2D | Point3D: + ... + + def reflect(self, line) -> Self: + ... + + def rotate(self, angle=..., pt=...) -> Self: + ... + + def scale(self, x=..., y=..., pt=...) -> Self: + ... + + def tangent_lines(self, p) -> list[Any] | list[Line | Line2D | Line3D | None]: + ... + + @property + def vradius(self) -> Basic: + ... + + def second_moment_of_area(self, point=...) -> tuple[Any, Any, Literal[0]] | tuple[Any, Any, Any]: + ... + + def polar_second_moment_of_area(self): + ... + + def section_modulus(self, point=...) -> tuple[Any, Any]: + ... + + + +class Circle(Ellipse): + def __new__(cls, *args, **kwargs) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | Self | None: + ... + + @property + def circumference(self): + ... + + def equation(self, x=..., y=...): + ... + + def intersection(self, o) -> list[Point] | list[Any] | Ellipse: + ... + + @property + def radius(self) -> Basic: + ... + + def reflect(self, line) -> Self: + ... + + def scale(self, x=..., y=..., pt=...) -> Self | Ellipse: + ... + + @property + def vradius(self): + ... + + + diff --git a/stubs/sympy-stubs/geometry/entity.pyi b/stubs/sympy-stubs/geometry/entity.pyi new file mode 100644 index 00000000..df47a731 --- /dev/null +++ b/stubs/sympy-stubs/geometry/entity.pyi @@ -0,0 +1,102 @@ +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.core.evalf import EvalfMixin +from sympy.multipledispatch import dispatch +from sympy.sets import Set +from sympy.sets.sets import FiniteSet, Union + +ordering_of_classes = ... +T = ... +class GeometryEntity(Basic, EvalfMixin): + __slots__: tuple[str, ...] = ... + def __cmp__(self, other) -> int: + ... + + def __contains__(self, other): + ... + + def __getnewargs__(self) -> tuple[Basic, ...]: + ... + + def __ne__(self, o) -> bool: + ... + + def __new__(cls, *args, **kwargs) -> Self: + ... + + def __radd__(self, a): + ... + + def __rtruediv__(self, a): + ... + + def __repr__(self) -> str: + ... + + def __rmul__(self, a): + ... + + def __rsub__(self, a): + ... + + def __str__(self) -> str: + ... + + @property + def ambient_dimension(self): + ... + + @property + def bounds(self): + ... + + def encloses(self, o) -> bool: + ... + + def equals(self, o): + ... + + def intersection(self, o): + ... + + def is_similar(self, other): + ... + + def reflect(self, line) -> Self: + ... + + def rotate(self, angle, pt=...) -> Self: + ... + + def scale(self, x=..., y=..., pt=...) -> Self: + ... + + def translate(self, x=..., y=...) -> Self: + ... + + def parameter_value(self, other, t) -> dict[Any, Any]: + ... + + + +class GeometrySet(GeometryEntity, Set): + __slots__ = ... + + +@dispatch(GeometrySet, Set) +def union_sets(self, o) -> FiniteSet | Union | None: + ... + +@dispatch(GeometrySet, Set) +def intersection_sets(self, o) -> FiniteSet | Union | None: + ... + +def translate(x, y): + ... + +def scale(x, y, pt=...): + ... + +def rotate(th): + ... + diff --git a/stubs/sympy-stubs/geometry/line.pyi b/stubs/sympy-stubs/geometry/line.pyi new file mode 100644 index 00000000..29a06013 --- /dev/null +++ b/stubs/sympy-stubs/geometry/line.pyi @@ -0,0 +1,257 @@ +from types import NotImplementedType +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.core.containers import Tuple +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.core.power import Pow +from sympy.geometry.entity import GeometrySet +from sympy.geometry.point import Point, Point2D, Point3D +from sympy.sets.sets import Complement, FiniteSet, Intersection, Union + +class LinearEntity(GeometrySet): + def __new__(cls, p1, p2=..., **kwargs) -> Self: + ... + + def __contains__(self, other): + ... + + @property + def ambient_dimension(self) -> int: + ... + + def angle_between(self, l2) -> type[UndefinedFunction]: + ... + + def smallest_angle_between(self, l2) -> type[UndefinedFunction]: + ... + + def arbitrary_point(self, parameter=...): + ... + + @staticmethod + def are_concurrent(*lines) -> bool: + ... + + def contains(self, other): + ... + + @property + def direction(self): + ... + + def intersection(self, other): + ... + + def is_parallel(self, l2): + ... + + def is_perpendicular(self, l2): + ... + + def is_similar(self, other) -> bool: + ... + + @property + def length(self): + ... + + @property + def p1(self) -> Basic: + ... + + @property + def p2(self) -> Basic: + ... + + def parallel_line(self, p) -> Line | Line2D | Line3D | None: + ... + + def perpendicular_line(self, p) -> Line | Line2D | Line3D | None: + ... + + def perpendicular_segment(self, p) -> Point | Point2D | Point3D | Segment2D | Segment3D | Segment: + ... + + @property + def points(self) -> tuple[Basic, Basic]: + ... + + def projection(self, other) -> FiniteSet | Intersection | Union | Complement | Basic: + ... + + def random_point(self, seed=...): + ... + + def bisectors(self, other) -> list[Self] | list[Line | Line2D | Line3D | None]: + ... + + + +class Line(LinearEntity): + def __new__(cls, *args, **kwargs) -> Line | Line2D | Line3D | Self | None: + ... + + def contains(self, other) -> bool: + ... + + def distance(self, other) -> Pow | Any: + ... + + def equals(self, other) -> bool: + ... + + def plot_interval(self, parameter=...) -> list[Any]: + ... + + + +class Ray(LinearEntity): + def __new__(cls, p1, p2=..., **kwargs) -> Ray2D | Ray3D | Self: + ... + + def contains(self, other) -> bool: + ... + + def distance(self, other): + ... + + def equals(self, other) -> bool | NotImplementedType: + ... + + def plot_interval(self, parameter=...) -> list[Any]: + ... + + @property + def source(self) -> Basic: + ... + + + +class Segment(LinearEntity): + def __new__(cls, p1, p2, **kwargs) -> Point | Point2D | Point3D | Segment2D | Segment3D | Self: + ... + + def contains(self, other) -> bool: + ... + + def equals(self, other) -> bool: + ... + + def distance(self, other) -> Pow | Any: + ... + + @property + def length(self) -> Pow | Any: + ... + + @property + def midpoint(self) -> Point | Point2D | Point3D: + ... + + def perpendicular_bisector(self, p=...) -> Point | Point2D | Point3D | Segment2D | Segment3D | Segment | Line | Line2D | Line3D | None: + ... + + def plot_interval(self, parameter=...) -> list[Any]: + ... + + + +class LinearEntity2D(LinearEntity): + @property + def bounds(self) -> tuple[Any, Any, Any, Any]: + ... + + def perpendicular_line(self, p) -> Line | Line2D | Line3D | None: + ... + + @property + def slope(self): + ... + + + +class Line2D(LinearEntity2D, Line): + def __new__(cls, p1, pt=..., slope=..., **kwargs) -> Self: + ... + + @property + def coefficients(self) -> tuple[Any, Any, Any] | tuple[Any, ...]: + ... + + def equation(self, x=..., y=...): + ... + + + +class Ray2D(LinearEntity2D, Ray): + def __new__(cls, p1, pt=..., angle=..., **kwargs) -> Self: + ... + + @property + def xdirection(self): + ... + + @property + def ydirection(self): + ... + + def closing_angle(self, r2): + ... + + + +class Segment2D(LinearEntity2D, Segment): + def __new__(cls, p1, p2, **kwargs) -> Point | Point2D | Point3D | Self: + ... + + + +class LinearEntity3D(LinearEntity): + def __new__(cls, p1, p2, **kwargs) -> Self: + ... + + ambient_dimension = ... + @property + def direction_ratio(self): + ... + + @property + def direction_cosine(self): + ... + + + +class Line3D(LinearEntity3D, Line): + def __new__(cls, p1, pt=..., direction_ratio=..., **kwargs) -> Self: + ... + + def equation(self, x=..., y=..., z=...) -> Tuple: + ... + + + +class Ray3D(LinearEntity3D, Ray): + def __new__(cls, p1, pt=..., direction_ratio=..., **kwargs) -> Self: + ... + + @property + def xdirection(self): + ... + + @property + def ydirection(self): + ... + + @property + def zdirection(self): + ... + + + +class Segment3D(LinearEntity3D, Segment): + def __new__(cls, p1, p2, **kwargs) -> Point | Point2D | Point3D | Self: + ... + + + diff --git a/stubs/sympy-stubs/geometry/parabola.pyi b/stubs/sympy-stubs/geometry/parabola.pyi new file mode 100644 index 00000000..bb63a849 --- /dev/null +++ b/stubs/sympy-stubs/geometry/parabola.pyi @@ -0,0 +1,49 @@ +from typing import Any, Literal, Self +from sympy.core.basic import Basic +from sympy.geometry.entity import GeometrySet +from sympy.geometry.point import Point, Point2D, Point3D + +class Parabola(GeometrySet): + def __new__(cls, focus=..., directrix=..., **kwargs) -> Self: + ... + + @property + def ambient_dimension(self) -> Literal[2]: + ... + + @property + def axis_of_symmetry(self): + ... + + @property + def directrix(self) -> Basic: + ... + + @property + def eccentricity(self): + ... + + def equation(self, x=..., y=...): + ... + + @property + def focal_length(self): + ... + + @property + def focus(self) -> Basic: + ... + + def intersection(self, o) -> list[Parabola] | list[Any] | list[Point2D]: + ... + + @property + def p_parameter(self): + ... + + @property + def vertex(self) -> Point | Point2D | Point3D: + ... + + + diff --git a/stubs/sympy-stubs/geometry/plane.pyi b/stubs/sympy-stubs/geometry/plane.pyi new file mode 100644 index 00000000..3815c9da --- /dev/null +++ b/stubs/sympy-stubs/geometry/plane.pyi @@ -0,0 +1,81 @@ +from typing import Any, Literal, Self +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.geometry.entity import GeometryEntity +from sympy.geometry.line import Line3D, Ray3D, Segment3D +from sympy.geometry.point import Point, Point2D, Point3D + +class Plane(GeometryEntity): + def __new__(cls, p1, a=..., b=..., **kwargs) -> Self: + ... + + def __contains__(self, o) -> Literal[False]: + ... + + def angle_between(self, o) -> type[UndefinedFunction] | None: + ... + + def arbitrary_point(self, u=..., v=...) -> Point3D: + ... + + @staticmethod + def are_concurrent(*planes) -> bool: + ... + + def distance(self, o) -> Expr: + ... + + def equals(self, o) -> Any | Literal[False]: + ... + + def equation(self, x=..., y=..., z=...) -> int: + ... + + def intersection(self, o) -> list[Point | Point2D | Point3D] | list[Any] | list[Point | Point2D | Point3D | Segment3D | Ray3D | Line3D] | list[Any | Point3D | Basic] | list[Self] | list[Line3D] | None: + ... + + def is_coplanar(self, o) -> bool | None: + ... + + def is_parallel(self, l) -> bool | None: + ... + + def is_perpendicular(self, l) -> bool: + ... + + @property + def normal_vector(self) -> Basic: + ... + + @property + def p1(self) -> Basic: + ... + + def parallel_plane(self, pt) -> Plane: + ... + + def perpendicular_line(self, pt) -> Line3D: + ... + + def perpendicular_plane(self, *pts) -> Plane: + ... + + def projection_line(self, line) -> Point | Point2D | Point3D | Segment3D | Ray3D | Line3D | Basic | Self | None: + ... + + def projection(self, pt) -> Point | Point2D | Point3D | Segment3D | Ray3D | Line3D | Basic | Self: + ... + + def random_point(self, seed=...) -> Point3D | Basic: + ... + + def parameter_value(self, other, u, v=...) -> Point | Point2D | Point3D: + ... + + @property + def ambient_dimension(self): + ... + + + diff --git a/stubs/sympy-stubs/geometry/point.pyi b/stubs/sympy-stubs/geometry/point.pyi new file mode 100644 index 00000000..888b7847 --- /dev/null +++ b/stubs/sympy-stubs/geometry/point.pyi @@ -0,0 +1,208 @@ +from typing import Any, Iterator, Self +from sympy.core.basic import Basic +from sympy.core.power import Pow +from sympy.geometry.entity import GeometryEntity +from sympy.series.order import Order + +class Point(GeometryEntity): + is_Point = ... + def __new__(cls, *args, **kwargs) -> Point | Point2D | Point3D | Self: + ... + + def __abs__(self) -> Pow | Any: + ... + + def __add__(self, other) -> Point | Point2D | Point3D: + ... + + def __contains__(self, item) -> bool: + ... + + def __truediv__(self, divisor) -> Point | Point2D | Point3D: + ... + + def __eq__(self, other) -> bool: + ... + + def __getitem__(self, key): + ... + + def __hash__(self) -> int: + ... + + def __iter__(self) -> Iterator[Basic]: + ... + + def __len__(self) -> int: + ... + + def __mul__(self, factor) -> Point | Point2D | Point3D: + ... + + def __rmul__(self, factor) -> Point | Point2D | Point3D: + ... + + def __neg__(self) -> Point | Point2D | Point3D: + ... + + def __sub__(self, other) -> Point | Point2D | Point3D: + ... + + @staticmethod + def affine_rank(*args) -> int: + ... + + @property + def ambient_dimension(self) -> Any | int: + ... + + @classmethod + def are_coplanar(cls, *points) -> bool: + ... + + def distance(self, other) -> Pow | Any: + ... + + def dot(self, p) -> Order: + ... + + def equals(self, other) -> bool: + ... + + def intersection(self, other) -> list[Self] | list[Any]: + ... + + def is_collinear(self, *args) -> bool: + ... + + def is_concyclic(self, *args) -> bool: + ... + + @property + def is_nonzero(self) -> bool | None: + ... + + def is_scalar_multiple(self, p) -> bool: + ... + + @property + def is_zero(self) -> bool | None: + ... + + @property + def length(self): + ... + + def midpoint(self, p) -> Point | Point2D | Point3D: + ... + + @property + def origin(self) -> Point | Point2D | Point3D: + ... + + @property + def orthogonal_direction(self) -> Point | Point2D | Point3D: + ... + + @staticmethod + def project(a, b): + ... + + def taxicab_distance(self, p) -> Order: + ... + + def canberra_distance(self, p) -> Order: + ... + + @property + def unit(self) -> Point | Point2D | Point3D | Any: + ... + + + +class Point2D(Point): + _ambient_dimension = ... + def __new__(cls, *args, _nocheck=..., **kwargs) -> Self: + ... + + def __contains__(self, item): + ... + + @property + def bounds(self) -> tuple[Basic, Basic, Basic, Basic]: + ... + + def rotate(self, angle, pt=...) -> Point | Point2D | Point3D: + ... + + def scale(self, x=..., y=..., pt=...) -> Point: + ... + + def transform(self, matrix) -> Point | Point2D | Point3D: + ... + + def translate(self, x=..., y=...) -> Point: + ... + + @property + def coordinates(self) -> tuple[Basic, ...]: + ... + + @property + def x(self) -> Basic: + ... + + @property + def y(self) -> Basic: + ... + + + +class Point3D(Point): + _ambient_dimension = ... + def __new__(cls, *args, _nocheck=..., **kwargs) -> Self: + ... + + def __contains__(self, item): + ... + + @staticmethod + def are_collinear(*points) -> bool: + ... + + def direction_cosine(self, point) -> list[Any]: + ... + + def direction_ratio(self, point) -> list[Any]: + ... + + def intersection(self, other) -> list[Self] | list[Any] | list[Point] | list[Point2D]: + ... + + def scale(self, x=..., y=..., z=..., pt=...) -> Point3D: + ... + + def transform(self, matrix) -> Point3D: + ... + + def translate(self, x=..., y=..., z=...) -> Point3D: + ... + + @property + def coordinates(self) -> tuple[Basic, ...]: + ... + + @property + def x(self) -> Basic: + ... + + @property + def y(self) -> Basic: + ... + + @property + def z(self) -> Basic: + ... + + + diff --git a/stubs/sympy-stubs/geometry/polygon.pyi b/stubs/sympy-stubs/geometry/polygon.pyi new file mode 100644 index 00000000..9ea48767 --- /dev/null +++ b/stubs/sympy-stubs/geometry/polygon.pyi @@ -0,0 +1,280 @@ +from types import NotImplementedType +from typing import Any, LiteralString, Self +from sympy.core.basic import Basic +from sympy.core.power import Pow +from sympy.functions.elementary.piecewise import Piecewise +from sympy.geometry.ellipse import Circle +from sympy.geometry.entity import GeometryEntity, GeometrySet +from sympy.geometry.line import Line, Line2D, Line3D, Segment, Segment2D, Segment3D +from sympy.geometry.point import Point, Point2D, Point3D + +class Polygon(GeometrySet): + __slots__ = ... + def __new__(cls, *args, n=..., **kwargs) -> RegularPolygon | Self | Triangle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + @property + def area(self): + ... + + @property + def angles(self) -> dict[Any, Any]: + ... + + @property + def ambient_dimension(self): + ... + + @property + def perimeter(self): + ... + + @property + def vertices(self) -> list[Basic]: + ... + + @property + def centroid(self) -> Point | Point2D | Point3D: + ... + + def second_moment_of_area(self, point=...) -> tuple[Any, Any, Any]: + ... + + def first_moment_of_area(self, point=...) -> tuple[Any, Any]: + ... + + def polar_second_moment_of_area(self): + ... + + def section_modulus(self, point=...) -> tuple[Any, Any]: + ... + + @property + def sides(self) -> list[Any]: + ... + + @property + def bounds(self) -> tuple[Any, Any, Any, Any]: + ... + + def is_convex(self) -> bool: + ... + + def encloses_point(self, p) -> bool | None: + ... + + def arbitrary_point(self, parameter=...) -> Piecewise: + ... + + def parameter_value(self, other, t) -> dict[Any, Any]: + ... + + def plot_interval(self, parameter=...) -> list[Any]: + ... + + def intersection(self, o) -> list[Any]: + ... + + def cut_section(self, line) -> tuple[RegularPolygon | Polygon | Triangle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None, RegularPolygon | Polygon | Triangle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None]: + ... + + def distance(self, o): + ... + + def __contains__(self, o) -> NotImplementedType | bool: + ... + + def bisectors(self, prec=...) -> dict[Any, Any]: + ... + + + +class RegularPolygon(Polygon): + __slots__ = ... + def __new__(cls, c, r, n, rot=..., **kwargs) -> Self: + ... + + @property + def args(self) -> tuple[Any, Any, Any, Any]: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> LiteralString: + ... + + @property + def area(self): + ... + + @property + def length(self): + ... + + @property + def center(self): + ... + + centroid = ... + @property + def circumcenter(self): + ... + + @property + def radius(self): + ... + + @property + def circumradius(self): + ... + + @property + def rotation(self): + ... + + @property + def apothem(self): + ... + + @property + def inradius(self): + ... + + @property + def interior_angle(self): + ... + + @property + def exterior_angle(self): + ... + + @property + def circumcircle(self) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + @property + def incircle(self) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + @property + def angles(self) -> dict[Any, Any]: + ... + + def encloses_point(self, p) -> bool | None: + ... + + def spin(self, angle) -> None: + ... + + def rotate(self, angle, pt=...) -> GeometryEntity: + ... + + def scale(self, x=..., y=..., pt=...) -> Point3D | Polygon | Triangle | Point | Segment2D | Segment3D | Segment | Self: + ... + + def reflect(self, line) -> Self: + ... + + @property + def vertices(self) -> list[Point | Point2D | Point3D]: + ... + + def __eq__(self, o) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +class Triangle(Polygon): + def __new__(cls, *args, **kwargs) -> Triangle | Self | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + @property + def vertices(self) -> tuple[Basic, ...]: + ... + + def is_similar(self, t2) -> bool: + ... + + def is_equilateral(self) -> bool: + ... + + def is_isosceles(self) -> bool: + ... + + def is_scalene(self) -> bool: + ... + + def is_right(self): + ... + + @property + def altitudes(self) -> dict[Basic, Any]: + ... + + @property + def orthocenter(self): + ... + + @property + def circumcenter(self): + ... + + @property + def circumradius(self) -> Pow | Any: + ... + + @property + def circumcircle(self) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + def bisectors(self) -> dict[Basic, Point | Point2D | Point3D | Segment2D | Segment3D | Segment]: + ... + + @property + def incenter(self) -> Point | Point2D | Point3D: + ... + + @property + def inradius(self): + ... + + @property + def incircle(self) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + @property + def exradii(self) -> dict[Any, Any]: + ... + + @property + def excenters(self) -> dict[Any, Point | Point2D | Point3D]: + ... + + @property + def medians(self) -> dict[Basic, Point | Point2D | Point3D | Segment2D | Segment3D | Segment]: + ... + + @property + def medial(self) -> Triangle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + @property + def nine_point_circle(self) -> Circle | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | None: + ... + + @property + def eulerline(self) -> Line | Line2D | Line3D | None: + ... + + + +def rad(d): + ... + +def deg(r): + ... + diff --git a/stubs/sympy-stubs/geometry/util.pyi b/stubs/sympy-stubs/geometry/util.pyi new file mode 100644 index 00000000..c02dc2c7 --- /dev/null +++ b/stubs/sympy-stubs/geometry/util.pyi @@ -0,0 +1,36 @@ +from ast import Add +from typing import Any, Literal +from sympy.core.basic import Basic +from sympy.core.mul import Mul +from sympy.geometry.line import Segment, Segment2D, Segment3D +from sympy.geometry.point import Point, Point2D, Point3D +from sympy.geometry.polygon import Polygon, RegularPolygon, Triangle +from sympy.series.order import Order + +def find(x, equation): + ... + +def are_coplanar(*e) -> bool: + ... + +def are_similar(e1, e2) -> Any | Literal[True]: + ... + +def centroid(*args) -> None: + ... + +def closest_points(*args) -> set[tuple[Point2D, ...]]: + ... + +def convex_hull(*args, polygon=...) -> tuple[Any, None] | Point | Point2D | Point3D | Segment2D | Segment3D | Segment | tuple[Point | Point2D | Point3D | Segment2D | Segment3D | Segment, None] | RegularPolygon | Polygon | Triangle | tuple[list[Any], list[Any]] | None: + ... + +def farthest_points(*args) -> set[tuple[Any, Any]]: + ... + +def idiff(eq, y, x, n=...) -> Basic | Add | Order | Mul | Any | None: + ... + +def intersection(*entities, pairwise=..., **kwargs) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/holonomic/__init__.pyi b/stubs/sympy-stubs/holonomic/__init__.pyi new file mode 100644 index 00000000..5faaf084 --- /dev/null +++ b/stubs/sympy-stubs/holonomic/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.holonomic.holonomic import DifferentialOperator, DifferentialOperators, HolonomicFunction, expr_to_holonomic, from_hyper, from_meijerg +from sympy.holonomic.recurrence import HolonomicSequence, RecurrenceOperator, RecurrenceOperators + +__all__ = ['DifferentialOperator', 'HolonomicFunction', 'DifferentialOperators', 'from_hyper', 'from_meijerg', 'expr_to_holonomic', 'RecurrenceOperators', 'RecurrenceOperator', 'HolonomicSequence'] diff --git a/stubs/sympy-stubs/holonomic/holonomic.pyi b/stubs/sympy-stubs/holonomic/holonomic.pyi new file mode 100644 index 00000000..e78104cc --- /dev/null +++ b/stubs/sympy-stubs/holonomic/holonomic.pyi @@ -0,0 +1,160 @@ +from typing import Any, Self +from sympy.holonomic.recurrence import HolonomicSequence + +def DifferentialOperators(base, generator) -> tuple[DifferentialOperatorAlgebra, DifferentialOperator]: + ... + +class DifferentialOperatorAlgebra: + def __init__(self, base, generator) -> None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __eq__(self, other) -> bool: + ... + + + +class DifferentialOperator: + _op_priority = ... + def __init__(self, list_of_poly, parent) -> None: + ... + + def __mul__(self, other) -> DifferentialOperator: + ... + + def __rmul__(self, other) -> DifferentialOperator | None: + ... + + def __add__(self, other) -> DifferentialOperator: + ... + + __radd__ = ... + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + def __neg__(self) -> DifferentialOperator | None: + ... + + def __truediv__(self, other): + ... + + def __pow__(self, n) -> Self | DifferentialOperator | None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __eq__(self, other) -> bool: + ... + + def is_singular(self, x0) -> bool: + ... + + + +class HolonomicFunction: + _op_priority = ... + def __init__(self, annihilator, x, x0=..., y0=...) -> None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def unify(self, other) -> tuple[Self, Any] | tuple[HolonomicFunction, HolonomicFunction]: + ... + + def is_singularics(self) -> bool | None: + ... + + def __add__(self, other): + ... + + def integrate(self, limits, initcond=...): + ... + + def diff(self, *args, **kwargs) -> Self | HolonomicFunction: + ... + + def __eq__(self, other) -> bool: + ... + + def __mul__(self, other): + ... + + __rmul__ = ... + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + def __neg__(self): + ... + + def __truediv__(self, other): + ... + + def __pow__(self, n) -> HolonomicFunction | Self | None: + ... + + def degree(self): + ... + + def composition(self, expr, *args, **kwargs) -> HolonomicFunction: + ... + + def to_sequence(self, lb=...) -> list[tuple[HolonomicSequence, Any]] | list[HolonomicSequence]: + ... + + def series(self, n=..., coefficient=..., order=..., _recur=...) -> list[Any]: + ... + + def evalf(self, points, method=..., h=..., derivatives=...) -> list[Any]: + ... + + def change_x(self, z) -> HolonomicFunction: + ... + + def shift_x(self, a) -> HolonomicFunction: + ... + + def to_hyper(self, as_list=..., _recur=...): + ... + + def to_expr(self): + ... + + def change_ics(self, b, lenics=...) -> HolonomicFunction: + ... + + def to_meijerg(self): + ... + + + +def from_hyper(func, x0=..., evalf=...) -> HolonomicFunction: + ... + +def from_meijerg(func, x0=..., evalf=..., initcond=..., domain=...) -> HolonomicFunction: + ... + +x_1 = ... +_lookup_table = ... +domain_for_table = ... +def expr_to_holonomic(func, x=..., x0=..., y0=..., lenics=..., domain=..., initcond=...): + ... + +def DMFdiff(frac): + ... + +def DMFsubs(frac, x0, mpm=...): + ... + diff --git a/stubs/sympy-stubs/holonomic/recurrence.pyi b/stubs/sympy-stubs/holonomic/recurrence.pyi new file mode 100644 index 00000000..8b2f2cae --- /dev/null +++ b/stubs/sympy-stubs/holonomic/recurrence.pyi @@ -0,0 +1,64 @@ +from typing import LiteralString, Self + +def RecurrenceOperators(base, generator) -> tuple[RecurrenceOperatorAlgebra, RecurrenceOperator]: + ... + +class RecurrenceOperatorAlgebra: + def __init__(self, base, generator) -> None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __eq__(self, other) -> bool: + ... + + + +class RecurrenceOperator: + _op_priority = ... + def __init__(self, list_of_poly, parent) -> None: + ... + + def __mul__(self, other) -> RecurrenceOperator: + ... + + def __rmul__(self, other) -> RecurrenceOperator | None: + ... + + def __add__(self, other) -> RecurrenceOperator: + ... + + __radd__ = ... + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + def __pow__(self, n) -> Self | RecurrenceOperator | None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __eq__(self, other) -> bool: + ... + + + +class HolonomicSequence: + def __init__(self, recurrence, u0=...) -> None: + ... + + def __repr__(self) -> LiteralString: + ... + + __str__ = ... + def __eq__(self, other) -> bool: + ... + + + diff --git a/stubs/sympy-stubs/integrals/__init__.pyi b/stubs/sympy-stubs/integrals/__init__.pyi new file mode 100644 index 00000000..033baa78 --- /dev/null +++ b/stubs/sympy-stubs/integrals/__init__.pyi @@ -0,0 +1,5 @@ +from sympy.integrals.integrals import Integral, integrate, line_integrate +from sympy.integrals.transforms import CosineTransform, FourierTransform, HankelTransform, InverseCosineTransform, InverseFourierTransform, InverseHankelTransform, InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform, LaplaceTransform, MellinTransform, SineTransform, cosine_transform, fourier_transform, hankel_transform, inverse_cosine_transform, inverse_fourier_transform, inverse_hankel_transform, inverse_laplace_transform, inverse_mellin_transform, inverse_sine_transform, laplace_transform, mellin_transform, sine_transform +from sympy.integrals.singularityfunctions import singularityintegrate + +__all__ = ['integrate', 'Integral', 'line_integrate', 'mellin_transform', 'inverse_mellin_transform', 'MellinTransform', 'InverseMellinTransform', 'laplace_transform', 'inverse_laplace_transform', 'LaplaceTransform', 'InverseLaplaceTransform', 'fourier_transform', 'inverse_fourier_transform', 'FourierTransform', 'InverseFourierTransform', 'sine_transform', 'inverse_sine_transform', 'SineTransform', 'InverseSineTransform', 'cosine_transform', 'inverse_cosine_transform', 'CosineTransform', 'InverseCosineTransform', 'hankel_transform', 'inverse_hankel_transform', 'HankelTransform', 'InverseHankelTransform', 'singularityintegrate'] diff --git a/stubs/sympy-stubs/integrals/deltafunctions.pyi b/stubs/sympy-stubs/integrals/deltafunctions.pyi new file mode 100644 index 00000000..a3592d0f --- /dev/null +++ b/stubs/sympy-stubs/integrals/deltafunctions.pyi @@ -0,0 +1,10 @@ +from typing import Any +from sympy.core.relational import Equality, Ne, Relational +from sympy.functions.special.delta_functions import DiracDelta, Heaviside +from sympy.series.order import Order +def change_mul(node, x) -> tuple[None, Any | Order | None] | tuple[DiracDelta, Any | Order]: + ... + +def deltaintegrate(f, x) -> Heaviside | Equality | Relational | Ne | None: + ... + diff --git a/stubs/sympy-stubs/integrals/heurisch.pyi b/stubs/sympy-stubs/integrals/heurisch.pyi new file mode 100644 index 00000000..fdce991d --- /dev/null +++ b/stubs/sympy-stubs/integrals/heurisch.pyi @@ -0,0 +1,37 @@ +from typing import Any +from sympy.core.basic import Basic +from sympy.core.symbol import Dummy +from sympy.functions.elementary.piecewise import Piecewise + +def components(f, x) -> set[Any]: + ... + +_symbols_cache: dict[str, list[Dummy]] = ... +def heurisch_wrapper(f, x, rewrite=..., hints=..., mappings=..., retries=..., degree_offset=..., unnecessary_permutations=..., _try_heurisch=...) -> Basic | Piecewise: + ... + +class BesselTable: + def __init__(self) -> None: + ... + + def diffs(self, f, n, z) -> tuple[Any, Any] | None: + ... + + def has(self, f) -> bool: + ... + + + +_bessel_table = ... +class DiffCache: + def __init__(self, x) -> None: + ... + + def get_diff(self, f): + ... + + + +def heurisch(f, x, rewrite=..., hints=..., mappings=..., retries=..., degree_offset=..., unnecessary_permutations=..., _try_heurisch=...): + ... + diff --git a/stubs/sympy-stubs/integrals/integrals.pyi b/stubs/sympy-stubs/integrals/integrals.pyi new file mode 100644 index 00000000..3163dfc9 --- /dev/null +++ b/stubs/sympy-stubs/integrals/integrals.pyi @@ -0,0 +1,45 @@ +from typing import Any, Self, Tuple as tTuple +from sympy.concrete.expr_with_limits import AddWithLimits +from sympy.core.basic import Basic +from sympy.core.containers import Tuple +from sympy.core.expr import Expr +from sympy.core.relational import Equality, Ne, Relational +from sympy.tensor.functions import shape + +class Integral(AddWithLimits): + __slots__ = ... + args: tTuple[Expr, Tuple] + def __new__(cls, function, *symbols, **assumptions) -> Equality | Relational | Ne | Self: + ... + + def __getnewargs__(self) -> tuple[Basic, *tuple[tuple[Any], ...]]: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + def transform(self, x, u) -> Self: + ... + + def doit(self, **hints): + ... + + def as_sum(self, n=..., method=..., evaluate=...): + ... + + def principal_value(self, **kwargs) -> Self: + ... + + + +def integrate(*args, meijerg=..., conds=..., risch=..., heurisch=..., manual=..., **kwargs) -> Equality | Relational | Ne: + ... + +def line_integrate(field, curve, vars) -> Equality | Relational | Ne: + ... + +@shape.register(Integral) +def _(expr): + ... + diff --git a/stubs/sympy-stubs/integrals/laplace.pyi b/stubs/sympy-stubs/integrals/laplace.pyi new file mode 100644 index 00000000..6b575298 --- /dev/null +++ b/stubs/sympy-stubs/integrals/laplace.pyi @@ -0,0 +1,43 @@ +from typing import Any, Callable +from sympy import MatrixBase +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.core.logic import And +from sympy.core.mul import Mul +from sympy.functions.elementary.miscellaneous import Max +from sympy.integrals.transforms import IntegralTransform +from sympy.series.order import Order + +def expand_dirac_delta(expr) -> tuple[Any, dict[Any, Any]] | tuple[Any | Order, dict[Any, Any | Order]] | tuple[Any | Mul, dict[Any, Any]]: + ... + +class LaplaceTransform(IntegralTransform): + _name = ... + def doit(self, **hints) -> Order | tuple[Any | Order, Any | Max, Any | And]: + ... + + + +def laplace_transform(f, t, s, legacy_matrix=..., **hints) -> tuple[MatrixBase, Any | Max, Any | And] | MatrixBase: + ... + +class InverseLaplaceTransform(IntegralTransform): + _name = ... + _none_sentinel = ... + _c = ... + def __new__(cls, F, s, x, plane, **opts) -> type[UndefinedFunction]: + ... + + @property + def fundamental_plane(self) -> Basic | None: + ... + + def doit(self, **hints) -> Order | tuple[Any | Order, Any | And]: + ... + + + +def inverse_laplace_transform(F, s, t, plane=..., **hints): + ... + diff --git a/stubs/sympy-stubs/integrals/manualintegrate.pyi b/stubs/sympy-stubs/integrals/manualintegrate.pyi new file mode 100644 index 00000000..cb8861e9 --- /dev/null +++ b/stubs/sympy-stubs/integrals/manualintegrate.pyi @@ -0,0 +1,707 @@ +from typing import Any, Callable, NamedTuple, Sequence, Type +from abc import ABC, abstractmethod +from dataclasses import dataclass +from sympy.core.cache import cacheit +from sympy.core.expr import Expr +from sympy.core.function import Derivative, UndefinedFunction +from sympy.core.relational import Boolean +from sympy.core.symbol import Symbol, Wild +from sympy.functions.elementary.exponential import exp +from sympy.functions.elementary.piecewise import Piecewise +from sympy.tensor.array.array_derivatives import ArrayDerivative + +@dataclass +class Rule(ABC): + integrand: Expr + variable: Symbol + @abstractmethod + def eval(self) -> Expr: + ... + + @abstractmethod + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class AtomicRule(Rule, ABC): + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class ConstantRule(AtomicRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class ConstantTimesRule(Rule): + constant: Expr + other: Expr + substep: Rule + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class PowerRule(AtomicRule): + base: Expr + exp: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class NestedPowRule(AtomicRule): + base: Expr + exp: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class AddRule(Rule): + substeps: list[Rule] + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class URule(Rule): + u_var: Symbol + u_func: Expr + substep: Rule + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class PartsRule(Rule): + u: Symbol + dv: Expr + v_step: Rule + second_step: Rule | None + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class CyclicPartsRule(Rule): + parts_rules: list[PartsRule] + coefficient: Expr + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class TrigRule(AtomicRule, ABC): + ... + + +@dataclass +class SinRule(TrigRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class CosRule(TrigRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class SecTanRule(TrigRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class CscCotRule(TrigRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class Sec2Rule(TrigRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class Csc2Rule(TrigRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class HyperbolicRule(AtomicRule, ABC): + ... + + +@dataclass +class SinhRule(HyperbolicRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class CoshRule(HyperbolicRule): + def eval(self) -> type[UndefinedFunction]: + ... + + + +@dataclass +class ExpRule(AtomicRule): + base: Expr + exp: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class ReciprocalRule(AtomicRule): + base: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class ArcsinRule(AtomicRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class ArcsinhRule(AtomicRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class ReciprocalSqrtQuadraticRule(AtomicRule): + a: Expr + b: Expr + c: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class SqrtQuadraticDenomRule(AtomicRule): + a: Expr + b: Expr + c: Expr + coeffs: list[Expr] + def eval(self) -> Expr: + ... + + + +@dataclass +class SqrtQuadraticRule(AtomicRule): + a: Expr + b: Expr + c: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class AlternativeRule(Rule): + alternatives: list[Rule] + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class DontKnowRule(Rule): + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class DerivativeRule(AtomicRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class RewriteRule(Rule): + rewritten: Expr + substep: Rule + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class CompleteSquareRule(RewriteRule): + ... + + +@dataclass +class PiecewiseRule(Rule): + subfunctions: Sequence[tuple[Rule, bool | Boolean]] + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class HeavisideRule(Rule): + harg: Expr + ibnd: Expr + substep: Rule + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class DiracDeltaRule(AtomicRule): + n: Expr + a: Expr + b: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class TrigSubstitutionRule(Rule): + theta: Expr + func: Expr + rewritten: Expr + substep: Rule + restriction: bool | Boolean + def eval(self) -> Expr: + ... + + def contains_dont_know(self) -> bool: + ... + + + +@dataclass +class ArctanRule(AtomicRule): + a: Expr + b: Expr + c: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class OrthogonalPolyRule(AtomicRule, ABC): + n: Expr + ... + + +@dataclass +class JacobiRule(OrthogonalPolyRule): + a: Expr + b: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class GegenbauerRule(OrthogonalPolyRule): + a: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class ChebyshevTRule(OrthogonalPolyRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class ChebyshevURule(OrthogonalPolyRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class LegendreRule(OrthogonalPolyRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class HermiteRule(OrthogonalPolyRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class LaguerreRule(OrthogonalPolyRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class AssocLaguerreRule(OrthogonalPolyRule): + a: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class IRule(AtomicRule, ABC): + a: Expr + b: Expr + ... + + +@dataclass +class CiRule(IRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class ChiRule(IRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class EiRule(IRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class SiRule(IRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class ShiRule(IRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class LiRule(IRule): + def eval(self) -> Expr: + ... + + + +@dataclass +class ErfRule(AtomicRule): + a: Expr + b: Expr + c: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class FresnelCRule(AtomicRule): + a: Expr + b: Expr + c: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class FresnelSRule(AtomicRule): + a: Expr + b: Expr + c: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class PolylogRule(AtomicRule): + a: Expr + b: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class UpperGammaRule(AtomicRule): + a: Expr + e: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class EllipticFRule(AtomicRule): + a: Expr + d: Expr + def eval(self) -> Expr: + ... + + + +@dataclass +class EllipticERule(AtomicRule): + a: Expr + d: Expr + def eval(self) -> Expr: + ... + + + +class IntegralInfo(NamedTuple): + integrand: Expr + symbol: Symbol + ... + + +def manual_diff(f, symbol) -> int | ArrayDerivative | Derivative: + ... + +def manual_subs(expr, *args): + ... + +inverse_trig_functions = ... +def find_substitutions(integrand, symbol, u_var) -> list[Any]: + ... + +def rewriter(condition, rewrite) -> Callable[..., RewriteRule | None]: + ... + +def proxy_rewriter(condition, rewrite) -> Callable[..., RewriteRule | None]: + ... + +def multiplexer(conditions) -> Callable[..., Any | None]: + ... + +def alternatives(*rules) -> Callable[..., Any | AlternativeRule | None]: + ... + +def constant_rule(integral) -> ConstantRule: + ... + +def power_rule(integral) -> ReciprocalRule | PowerRule | ExpRule | ConstantRule | PiecewiseRule | None: + ... + +def exp_rule(integral) -> ExpRule | None: + ... + +def orthogonal_poly_rule(integral) -> None: + ... + +_special_function_patterns: list[tuple[Type, Expr, Callable | None, tuple]] = ... +_wilds = ... +_symbol = ... +def special_function_rule(integral) -> None: + ... + +def nested_pow_rule(integral: IntegralInfo) -> Rule | None: + class NoMatch(Exception): + ... + + + +def inverse_trig_rule(integral: IntegralInfo, degenerate=...) -> NestedPowRule | Rule | None: + ... + +def add_rule(integral) -> AddRule | None: + ... + +def mul_rule(integral: IntegralInfo) -> ConstantTimesRule | None: + ... + +def parts_rule(integral) -> ConstantTimesRule | CyclicPartsRule | PartsRule | None: + ... + +def trig_rule(integral) -> SinRule | CosRule | Sec2Rule | Csc2Rule | RewriteRule | None: + ... + +def trig_product_rule(integral: IntegralInfo) -> SecTanRule | CscCotRule | None: + ... + +def quadratic_denom_rule(integral) -> ArctanRule | RewriteRule | PiecewiseRule | URule | ConstantTimesRule | None: + ... + +def sqrt_linear_rule(integral: IntegralInfo) -> PiecewiseRule | URule | None: + ... + +def sqrt_quadratic_rule(integral: IntegralInfo, degenerate=...) -> Rule | None: + ... + +def hyperbolic_rule(integral: tuple[Expr, Symbol]) -> SinhRule | CoshRule | RewriteRule | None: + ... + +@cacheit +def make_wilds(symbol) -> tuple[Wild, Wild, Wild, Wild]: + ... + +@cacheit +def sincos_pattern(symbol) -> tuple[Any, Wild, Wild, Wild, Wild]: + ... + +@cacheit +def tansec_pattern(symbol) -> tuple[Any, Wild, Wild, Wild, Wild]: + ... + +@cacheit +def cotcsc_pattern(symbol) -> tuple[Any, Wild, Wild, Wild, Wild]: + ... + +@cacheit +def heaviside_pattern(symbol) -> tuple[Any, Wild, Wild, Wild]: + ... + +def uncurry(func) -> Callable[..., Any]: + ... + +def trig_rewriter(rewrite) -> Callable[..., RewriteRule | None]: + ... + +sincos_botheven_condition = ... +sincos_botheven = ... +sincos_sinodd_condition = ... +sincos_sinodd = ... +sincos_cosodd_condition = ... +sincos_cosodd = ... +tansec_seceven_condition = ... +tansec_seceven = ... +tansec_tanodd_condition = ... +tansec_tanodd = ... +tan_tansquared_condition = ... +tan_tansquared = ... +cotcsc_csceven_condition = ... +cotcsc_csceven = ... +cotcsc_cotodd_condition = ... +cotcsc_cotodd = ... +def trig_sincos_rule(integral) -> None: + ... + +def trig_tansec_rule(integral) -> None: + ... + +def trig_cotcsc_rule(integral) -> None: + ... + +def trig_sindouble_rule(integral) -> DontKnowRule | tuple[Any, Any] | Rule | None: + ... + +def trig_powers_products_rule(integral) -> DontKnowRule | Rule | tuple[Any, Any]: + ... + +def trig_substitution_rule(integral) -> TrigSubstitutionRule | None: + ... + +def heaviside_rule(integral) -> HeavisideRule | None: + ... + +def dirac_delta_rule(integral: IntegralInfo) -> Rule | None: + ... + +def substitution_rule(integral) -> AlternativeRule | None: + ... + +partial_fractions_rule = ... +cancel_rule = ... +distribute_expand_rule = ... +trig_expand_rule = ... +def derivative_rule(integral) -> DerivativeRule | DontKnowRule | ConstantRule: + ... + +def rewrites_rule(integral) -> RewriteRule | None: + ... + +def fallback_rule(integral) -> DontKnowRule: + ... + +_integral_cache: dict[Expr, Expr | None] = ... +_parts_u_cache: dict[Expr, int] = ... +_cache_dummy = ... +def integral_steps(integrand, symbol, **options) -> DontKnowRule | tuple[Any, Any] | Rule: + ... + +def manualintegrate(f, var) -> Piecewise | Expr: + ... + diff --git a/stubs/sympy-stubs/integrals/meijerint.pyi b/stubs/sympy-stubs/integrals/meijerint.pyi new file mode 100644 index 00000000..a2ca1743 --- /dev/null +++ b/stubs/sympy-stubs/integrals/meijerint.pyi @@ -0,0 +1,22 @@ +from sympy.core.basic import Basic +from sympy.core.symbol import Dummy +from sympy.functions.elementary.piecewise import Piecewise + +z = ... +timeit = ... +class _CoeffExpValueError(ValueError): + ... + + +_dummies: dict[tuple[str, str], Dummy] = ... +_lookup_table = ... +def meijerint_indefinite(f, x) -> Piecewise | Basic | None: + ... + +@timeit +def meijerint_definite(f, x, a, b): + ... + +def meijerint_inversion(f, x, t) -> Piecewise | None: + ... + diff --git a/stubs/sympy-stubs/integrals/prde.pyi b/stubs/sympy-stubs/integrals/prde.pyi new file mode 100644 index 00000000..9ef519dd --- /dev/null +++ b/stubs/sympy-stubs/integrals/prde.pyi @@ -0,0 +1,63 @@ +from typing import Any, Literal +from sympy.polys.polymatrix import PolyMatrix +from sympy.series.order import Order + +zeros = ... +eye = ... +def prde_normal_denom(fa, fd, G, DE) -> tuple[Any, tuple[Any, Any], list[Any], Any]: + ... + +def real_imag(ba, bd, gen) -> tuple[Any, Any, Any]: + ... + +def prde_special_denom(a, ba, bd, G, DE, case=...) -> tuple[Any, Any, Any, Any] | tuple[Any, Any, list[Any], Any]: + ... + +def prde_linear_constraints(a, b, G, DE) -> tuple[Any, PolyMatrix]: + ... + +def poly_linear_constraints(p, d) -> tuple[Any, PolyMatrix]: + ... + +def constant_system(A, u, DE) -> tuple[Any, Any]: + ... + +def prde_spde(a, b, Q, n, DE) -> tuple[Any, Any, list[Any], list[Any], Any]: + ... + +def prde_no_cancel_b_large(b, Q, n, DE) -> tuple[list[Any], Any]: + ... + +def prde_no_cancel_b_small(b, Q, n, DE) -> tuple[list[Any], Any] | tuple[list[Any], PolyMatrix | Any]: + ... + +def prde_cancel_liouvillian(b, Q, n, DE) -> tuple[list[Any], Any]: + ... + +def param_poly_rischDE(a, b, q, n, DE) -> tuple[list[Any], PolyMatrix] | tuple[list[Any], Any] | tuple[list[Any], PolyMatrix | Any]: + ... + +def param_rischDE(fa, fd, G, DE) -> tuple[list[Any], PolyMatrix]: + ... + +def limited_integrate_reduce(fa, fd, G, DE) -> tuple[Any, Any, Any, Any, Any, list[Any]]: + ... + +def limited_integrate(fa, fd, G, DE) -> tuple[tuple[Any, Any], list[Any]] | None: + ... + +def parametric_log_deriv_heu(fa, fd, wa, wd, DE, c1=...) -> tuple[Any, Any, Any | Order] | None: + ... + +def parametric_log_deriv(fa, fd, wa, wd, DE) -> tuple[Any, Any, Any | Order] | None: + ... + +def is_deriv_k(fa, fd, DE) -> tuple[list[tuple[Any, Any]], Any | Order, Any] | None: + ... + +def is_log_deriv_k_t_radical(fa, fd, DE, Df=...) -> tuple[list[tuple[Any, Any]], Any | Order, Any | Literal[0], Any] | None: + ... + +def is_log_deriv_k_t_radical_in_field(fa, fd, DE, case=..., z=...) -> tuple[Any | int, Any | Order] | tuple[Any | int, Any] | None: + ... + diff --git a/stubs/sympy-stubs/integrals/rationaltools.pyi b/stubs/sympy-stubs/integrals/rationaltools.pyi new file mode 100644 index 00000000..e71fc3e8 --- /dev/null +++ b/stubs/sympy-stubs/integrals/rationaltools.pyi @@ -0,0 +1,17 @@ +from typing import Any + +def ratint(f, x, **flags) -> Any: + ... + +def ratint_ratpart(f, g, x) -> tuple[Any, Any]: + ... + +def ratint_logpart(f, g, x, t=...) -> list[Any]: + ... + +def log_to_atan(f, g): + ... + +def log_to_real(h, q, x, t) -> None: + ... + diff --git a/stubs/sympy-stubs/integrals/rde.pyi b/stubs/sympy-stubs/integrals/rde.pyi new file mode 100644 index 00000000..6db5b041 --- /dev/null +++ b/stubs/sympy-stubs/integrals/rde.pyi @@ -0,0 +1,45 @@ +from typing import Any, Literal +from sympy.polys.polymatrix import PolyMatrix + +def order_at(a, p, t) -> Literal[0]: + ... + +def order_at_oo(a, d, t): + ... + +def weak_normalizer(a, d, DE, z=...) -> tuple[Any, tuple[Any, Any]]: + ... + +def normal_denom(fa, fd, ga, gd, DE) -> tuple[Any, tuple[Any, Any], tuple[Any, Any], Any]: + ... + +def special_denom(a, ba, bd, ca, cd, DE, case=...) -> tuple[Any, Any, Any, Any]: + ... + +def bound_degree(a, b, cQ, DE, case=..., parametric=...): + ... + +def spde(a, b, c, n, DE) -> tuple[Any, Any, Literal[0], Any, Any] | tuple[Any, Any, Any, Any, Any]: + ... + +def no_cancel_b_large(b, c, n, DE) -> Any: + ... + +def no_cancel_b_small(b, c, n, DE) -> tuple[Any, Any, Any] | Any: + ... + +def no_cancel_equal(b, c, n, DE) -> tuple[Any, Any | int, Any] | Any: + ... + +def cancel_primitive(b, c, n, DE) -> Any: + ... + +def cancel_exp(b, c, n, DE) -> Any: + ... + +def solve_poly_rde(b, cQ, n, DE, parametric=...) -> tuple[list[Any], Any] | Any | tuple[list[Any], PolyMatrix | Any] | tuple[Any, Any, Any] | tuple[Any, Any | int, Any]: + ... + +def rischDE(fa, fd, ga, gd, DE) -> tuple[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/integrals/risch.pyi b/stubs/sympy-stubs/integrals/risch.pyi new file mode 100644 index 00000000..3a6ac20f --- /dev/null +++ b/stubs/sympy-stubs/integrals/risch.pyi @@ -0,0 +1,131 @@ +from typing import Any, Literal +from sympy.core.relational import Equality, Ne, Relational +from sympy.integrals.integrals import Integral + +def integer_powers(exprs) -> list[tuple[Any, Any]]: + ... + +class DifferentialExtension: + __slots__ = ... + def __init__(self, f=..., x=..., handle_first=..., dummy=..., extension=..., rewrite_complex=...) -> None: + ... + + def __getattr__(self, attr) -> None: + ... + + def __repr__(self) -> str: + ... + + def __str__(self) -> str: + ... + + def __eq__(self, other) -> bool: + ... + + def reset(self) -> None: + ... + + def indices(self, extension) -> list[int]: + ... + + def increment_level(self) -> None: + ... + + def decrement_level(self) -> None: + ... + + + +def update_sets(seq, atoms, func) -> list[Any]: + ... + +class DecrementLevel: + __slots__ = ... + def __init__(self, DE) -> None: + ... + + def __enter__(self) -> None: + ... + + def __exit__(self, exc_type, exc_value, traceback) -> None: + ... + + + +class NonElementaryIntegralException(Exception): + ... + + +def gcdex_diophantine(a, b, c) -> tuple[Any, Any]: + ... + +def frac_in(f, t, *, cancel=..., **kwargs) -> tuple[Any, Any]: + ... + +def as_poly_1t(p, t, z): + ... + +def derivation(p, DE, coefficientD=..., basic=...) -> Any | Literal[0]: + ... + +def get_case(d, t) -> Literal['base', 'primitive', 'exp', 'tan', 'other_nonlinear', 'other_linear']: + ... + +def splitfactor(p, DE, coefficientD=..., z=...) -> tuple[Any, Any]: + ... + +def splitfactor_sqf(p, DE, coefficientD=..., z=..., basic=...) -> tuple[tuple[tuple[Any, Literal[1]]], tuple[()]] | tuple[tuple[Any, ...], tuple[Any, ...]]: + ... + +def canonical_representation(a, d, DE) -> tuple[Any, tuple[Any, Any], tuple[Any, Any]]: + ... + +def hermite_reduce(a, d, DE) -> tuple[tuple[Any, Any], tuple[Any, Any], tuple[Any, Any]]: + ... + +def polynomial_reduce(p, DE) -> tuple[Any, Any]: + ... + +def laurent_series(a, d, F, n, DE) -> tuple[Any, Any, list[Any]] | Literal[0]: + ... + +def recognize_derivative(a, d, DE, z=...) -> bool: + ... + +def recognize_log_derivative(a, d, DE, z=...) -> bool: + ... + +def residue_reduce(a, d, DE, z=..., invert=...) -> tuple[list[Any], Literal[True]] | tuple[list[Any], bool]: + ... + +def residue_reduce_to_basic(H, DE, z) -> int: + ... + +def residue_reduce_derivation(H, DE, z): + ... + +def integrate_primitive_polynomial(p, DE) -> tuple[Any, Any, Literal[True]] | tuple[Any, Any, Literal[False]]: + ... + +def integrate_primitive(a, d, DE, z=...) -> tuple[Any, Any | Equality | Relational | Ne | NonElementaryIntegral, Literal[False]] | tuple[Any, Any | Equality | Relational | Ne | NonElementaryIntegral, bool]: + ... + +def integrate_hyperexponential_polynomial(p, DE, z) -> tuple[Any, Any, Literal[True]] | tuple[Any, Any, bool]: + ... + +def integrate_hyperexponential(a, d, DE, z=..., conds=...) -> tuple[Any, Any | Equality | Relational | Ne | NonElementaryIntegral, Literal[False]] | tuple[Any, Any | Equality | Relational | Ne | NonElementaryIntegral, bool]: + ... + +def integrate_hypertangent_polynomial(p, DE) -> tuple[Any, Any]: + ... + +def integrate_nonlinear_no_specials(a, d, DE, z=...) -> tuple[Any, Literal[False]] | tuple[Any, bool]: + ... + +class NonElementaryIntegral(Integral): + ... + + +def risch_integrate(f, x, extension=..., handle_first=..., separate_integral=..., rewrite_complex=..., conds=...) -> tuple[Any, NonElementaryIntegral] | tuple[Any, Literal[0]] | None: + ... + diff --git a/stubs/sympy-stubs/integrals/singularityfunctions.pyi b/stubs/sympy-stubs/integrals/singularityfunctions.pyi new file mode 100644 index 00000000..89434f0a --- /dev/null +++ b/stubs/sympy-stubs/integrals/singularityfunctions.pyi @@ -0,0 +1,6 @@ +from typing import Any +from sympy.core.function import UndefinedFunction +from sympy.core.relational import Equality, Ne, Relational +def singularityintegrate(f, x) -> type[UndefinedFunction] | Equality | Any | Relational | Ne | None: + ... + diff --git a/stubs/sympy-stubs/integrals/transforms.pyi b/stubs/sympy-stubs/integrals/transforms.pyi new file mode 100644 index 00000000..c2330b87 --- /dev/null +++ b/stubs/sympy-stubs/integrals/transforms.pyi @@ -0,0 +1,199 @@ +from typing import Any, Literal +from sympy.core.basic import Basic +from sympy.core.logic import And +from sympy.core.relational import Equality, Ne, Relational +from sympy.integrals.integrals import Integral +import sympy.integrals.laplace as _laplace +from sympy.core.function import Function, UndefinedFunction +from sympy.functions.elementary.trigonometric import cos, sin +from sympy.series.order import Order + +class IntegralTransformError(NotImplementedError): + def __init__(self, transform, function, msg) -> None: + ... + + + +class IntegralTransform(Function): + @property + def function(self) -> Basic: + ... + + @property + def function_variable(self) -> Basic: + ... + + @property + def transform_variable(self) -> Basic: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + def doit(self, **hints) -> Order | tuple[Any | Order, *tuple[Any, ...]] | tuple[Any | Order, Any | And]: + ... + + @property + def as_integral(self): + ... + + + +_noconds = ... +class MellinTransform(IntegralTransform): + _name = ... + + +def mellin_transform(f, x, s, **hints): + ... + +class MellinTransformStripError(ValueError): + ... + + +_allowed = ... +class InverseMellinTransform(IntegralTransform): + _name = ... + _none_sentinel = ... + _c = ... + def __new__(cls, F, s, x, a, b, **opts) -> type[UndefinedFunction]: + ... + + @property + def fundamental_strip(self) -> tuple[Basic | None, Basic | None]: + ... + + + +def inverse_mellin_transform(F, s, x, strip, **hints): + ... + +class FourierTypeTransform(IntegralTransform): + def a(self): + ... + + def b(self): + ... + + + +class FourierTransform(FourierTypeTransform): + _name = ... + def a(self) -> Literal[1]: + ... + + def b(self): + ... + + + +def fourier_transform(f, x, k, **hints): + ... + +class InverseFourierTransform(FourierTypeTransform): + _name = ... + def a(self) -> Literal[1]: + ... + + def b(self): + ... + + + +def inverse_fourier_transform(F, k, x, **hints): + ... + +class SineCosineTypeTransform(IntegralTransform): + def a(self): + ... + + def b(self): + ... + + + +class SineTransform(SineCosineTypeTransform): + _name = ... + _kern = sin + def a(self): + ... + + def b(self): + ... + + + +def sine_transform(f, x, k, **hints): + ... + +class InverseSineTransform(SineCosineTypeTransform): + _name = ... + _kern = sin + def a(self): + ... + + def b(self): + ... + + + +def inverse_sine_transform(F, k, x, **hints): + ... + +class CosineTransform(SineCosineTypeTransform): + _name = ... + _kern = cos + def a(self): + ... + + def b(self): + ... + + + +def cosine_transform(f, x, k, **hints): + ... + +class InverseCosineTransform(SineCosineTypeTransform): + _name = ... + _kern = cos + def a(self): + ... + + def b(self): + ... + + + +def inverse_cosine_transform(F, k, x, **hints): + ... + +class HankelTypeTransform(IntegralTransform): + def doit(self, **hints) -> tuple[Any | Equality | Relational | Ne, Any] | tuple[Any, Any]: + ... + + @property + def as_integral(self) -> Equality | Relational | Ne | Integral: + ... + + + +class HankelTransform(HankelTypeTransform): + _name = ... + + +def hankel_transform(f, r, k, nu, **hints): + ... + +class InverseHankelTransform(HankelTypeTransform): + _name = ... + + +def inverse_hankel_transform(F, k, r, nu, **hints): + ... + +LaplaceTransform = _laplace.LaplaceTransform +laplace_transform = ... +InverseLaplaceTransform = _laplace.InverseLaplaceTransform +inverse_laplace_transform = ... diff --git a/stubs/sympy-stubs/interactive/__init__.pyi b/stubs/sympy-stubs/interactive/__init__.pyi new file mode 100644 index 00000000..af3a784c --- /dev/null +++ b/stubs/sympy-stubs/interactive/__init__.pyi @@ -0,0 +1,5 @@ +from sympy.interactive.printing import init_printing +from sympy.interactive.session import init_session +from sympy.interactive.traversal import interactive_traversal + +__all__ = ['init_printing', 'init_session', 'interactive_traversal'] diff --git a/stubs/sympy-stubs/interactive/printing.pyi b/stubs/sympy-stubs/interactive/printing.pyi new file mode 100644 index 00000000..8ce8350c --- /dev/null +++ b/stubs/sympy-stubs/interactive/printing.pyi @@ -0,0 +1,5 @@ + +NO_GLOBAL = ... +def init_printing(pretty_print=..., order=..., use_unicode=..., use_latex=..., wrap_line=..., num_columns=..., no_global=..., ip=..., euler=..., forecolor=..., backcolor=..., fontsize=..., latex_mode=..., print_builtin=..., str_printer=..., pretty_printer=..., latex_printer=..., scale=..., **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/interactive/session.pyi b/stubs/sympy-stubs/interactive/session.pyi new file mode 100644 index 00000000..72ec2dee --- /dev/null +++ b/stubs/sympy-stubs/interactive/session.pyi @@ -0,0 +1,27 @@ +from code import InteractiveConsole +from typing import Any + +preexec_source = ... +verbose_message = ... +no_ipython = ... +def int_to_Integer(s) -> Any: + ... + +def enable_automatic_int_sympification(shell) -> None: + ... + +def enable_automatic_symbols(shell) -> None: + ... + +def init_ipython_session(shell=..., argv=..., auto_symbols=..., auto_int_to_Integer=...) -> Any: + ... + +def init_python_session() -> InteractiveConsole: + class SymPyConsole(InteractiveConsole): + ... + + + +def init_session(ipython=..., pretty_print=..., order=..., use_unicode=..., use_latex=..., quiet=..., auto_symbols=..., auto_int_to_Integer=..., str_printer=..., pretty_printer=..., latex_printer=..., argv=...) -> None: + ... + diff --git a/stubs/sympy-stubs/interactive/traversal.pyi b/stubs/sympy-stubs/interactive/traversal.pyi new file mode 100644 index 00000000..a0f547af --- /dev/null +++ b/stubs/sympy-stubs/interactive/traversal.pyi @@ -0,0 +1,4 @@ +from sympy.core.basic import Basic +def interactive_traversal(expr) -> Basic: + ... + diff --git a/stubs/sympy-stubs/liealgebras/cartan_type.pyi b/stubs/sympy-stubs/liealgebras/cartan_type.pyi new file mode 100644 index 00000000..ecf0e988 --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/cartan_type.pyi @@ -0,0 +1,29 @@ +from typing import Any, Callable, Self +from sympy.core import Atom +from sympy.liealgebras.type_a import TypeA +from sympy.liealgebras.type_b import TypeB +from sympy.liealgebras.type_c import TypeC +from sympy.liealgebras.type_d import TypeD +from sympy.liealgebras.type_e import TypeE +from sympy.liealgebras.type_f import TypeF +from sympy.liealgebras.type_g import TypeG + +class CartanType_generator: + def __call__(self, *args) -> TypeA | TypeB | TypeC | TypeD | TypeE | TypeF | TypeG | None: + ... + + + +CartanType = ... +class Standard_Cartan(Atom): + def __new__(cls, series, n) -> Self: + ... + + def rank(self): + ... + + def series(self) -> Callable[[], Any]: + ... + + + diff --git a/stubs/sympy-stubs/liealgebras/type_a.pyi b/stubs/sympy-stubs/liealgebras/type_a.pyi new file mode 100644 index 00000000..4f1b0a6f --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/type_a.pyi @@ -0,0 +1,39 @@ +from typing import Any, Self +from sympy.liealgebras.cartan_type import Standard_Cartan + +class TypeA(Standard_Cartan): + def __new__(cls, n) -> Self: + ... + + def dimension(self): + ... + + def basic_root(self, i, j): + ... + + def simple_root(self, i): + ... + + def positive_roots(self) -> dict[Any, Any]: + ... + + def highest_root(self): + ... + + def roots(self): + ... + + def cartan_matrix(self): + ... + + def basis(self): + ... + + def lie_algebra(self) -> str: + ... + + def dynkin_diagram(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/liealgebras/type_b.pyi b/stubs/sympy-stubs/liealgebras/type_b.pyi new file mode 100644 index 00000000..f7e7ad9a --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/type_b.pyi @@ -0,0 +1,36 @@ +from typing import Any, Self +from sympy.liealgebras.cartan_type import Standard_Cartan + +class TypeB(Standard_Cartan): + def __new__(cls, n) -> Self: + ... + + def dimension(self): + ... + + def basic_root(self, i, j): + ... + + def simple_root(self, i): + ... + + def positive_roots(self) -> dict[Any, Any]: + ... + + def roots(self): + ... + + def cartan_matrix(self): + ... + + def basis(self): + ... + + def lie_algebra(self) -> str: + ... + + def dynkin_diagram(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/liealgebras/type_c.pyi b/stubs/sympy-stubs/liealgebras/type_c.pyi new file mode 100644 index 00000000..4a8f635b --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/type_c.pyi @@ -0,0 +1,36 @@ +from typing import Any, Self +from sympy.liealgebras.cartan_type import Standard_Cartan + +class TypeC(Standard_Cartan): + def __new__(cls, n) -> Self: + ... + + def dimension(self): + ... + + def basic_root(self, i, j): + ... + + def simple_root(self, i): + ... + + def positive_roots(self) -> dict[Any, Any]: + ... + + def roots(self): + ... + + def cartan_matrix(self): + ... + + def basis(self): + ... + + def lie_algebra(self) -> str: + ... + + def dynkin_diagram(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/liealgebras/type_d.pyi b/stubs/sympy-stubs/liealgebras/type_d.pyi new file mode 100644 index 00000000..ab70af03 --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/type_d.pyi @@ -0,0 +1,36 @@ +from typing import Any, Self +from sympy.liealgebras.cartan_type import Standard_Cartan + +class TypeD(Standard_Cartan): + def __new__(cls, n) -> Self: + ... + + def dimension(self): + ... + + def basic_root(self, i, j): + ... + + def simple_root(self, i): + ... + + def positive_roots(self) -> dict[Any, Any]: + ... + + def roots(self): + ... + + def cartan_matrix(self): + ... + + def basis(self): + ... + + def lie_algebra(self) -> str: + ... + + def dynkin_diagram(self): + ... + + + diff --git a/stubs/sympy-stubs/liealgebras/type_e.pyi b/stubs/sympy-stubs/liealgebras/type_e.pyi new file mode 100644 index 00000000..cc81e1cc --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/type_e.pyi @@ -0,0 +1,33 @@ +from typing import Any, Literal, Self +from sympy.liealgebras.cartan_type import Standard_Cartan + +class TypeE(Standard_Cartan): + def __new__(cls, n) -> Self: + ... + + def dimension(self) -> Literal[8]: + ... + + def basic_root(self, i, j) -> list[int]: + ... + + def simple_root(self, i) -> list[float] | list[int]: + ... + + def positive_roots(self) -> dict[Any, Any] | None: + ... + + def roots(self) -> Literal[72, 126, 240] | None: + ... + + def cartan_matrix(self): + ... + + def basis(self) -> Literal[78, 133, 248] | None: + ... + + def dynkin_diagram(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/liealgebras/type_f.pyi b/stubs/sympy-stubs/liealgebras/type_f.pyi new file mode 100644 index 00000000..888445fe --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/type_f.pyi @@ -0,0 +1,35 @@ +from typing import Any, Literal, Self +from sympy.core.numbers import Integer, Rational +from sympy.liealgebras.cartan_type import Standard_Cartan +from sympy.matrices import Matrix + +class TypeF(Standard_Cartan): + def __new__(cls, n) -> Self: + ... + + def dimension(self) -> Literal[4]: + ... + + def basic_root(self, i, j): + ... + + def simple_root(self, i) -> list[int] | list[Rational | Any | Integer] | None: + ... + + def positive_roots(self) -> dict[Any, Any]: + ... + + def roots(self) -> Literal[48]: + ... + + def cartan_matrix(self) -> Matrix: + ... + + def basis(self) -> Literal[52]: + ... + + def dynkin_diagram(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/liealgebras/type_g.pyi b/stubs/sympy-stubs/liealgebras/type_g.pyi new file mode 100644 index 00000000..41f96065 --- /dev/null +++ b/stubs/sympy-stubs/liealgebras/type_g.pyi @@ -0,0 +1,31 @@ +from typing import Literal, Self +from sympy.liealgebras.cartan_type import Standard_Cartan +from sympy.matrices import Matrix + +class TypeG(Standard_Cartan): + def __new__(cls, n) -> Self: + ... + + def dimension(self) -> Literal[3]: + ... + + def simple_root(self, i) -> list[int]: + ... + + def positive_roots(self) -> dict[int, list[int]]: + ... + + def roots(self) -> Literal[12]: + ... + + def cartan_matrix(self) -> Matrix: + ... + + def basis(self) -> Literal[14]: + ... + + def dynkin_diagram(self) -> Literal['0≡<≡0\n1 2']: + ... + + + diff --git a/stubs/sympy-stubs/logic/__init__.pyi b/stubs/sympy-stubs/logic/__init__.pyi new file mode 100644 index 00000000..439bcaa0 --- /dev/null +++ b/stubs/sympy-stubs/logic/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.logic.boolalg import And, Equivalent, ITE, Implies, Nand, Nor, Not, Or, POSform, SOPform, Xor, bool_map, false, gateinputcount, simplify_logic, to_cnf, to_dnf, to_nnf, true +from sympy.logic.inference import satisfiable + +__all__ = ['to_cnf', 'to_dnf', 'to_nnf', 'And', 'Or', 'Not', 'Xor', 'Nand', 'Nor', 'Implies', 'Equivalent', 'ITE', 'POSform', 'SOPform', 'simplify_logic', 'bool_map', 'true', 'false', 'gateinputcount', 'satisfiable'] diff --git a/stubs/sympy-stubs/logic/algorithms/dpll.pyi b/stubs/sympy-stubs/logic/algorithms/dpll.pyi new file mode 100644 index 00000000..b70edf32 --- /dev/null +++ b/stubs/sympy-stubs/logic/algorithms/dpll.pyi @@ -0,0 +1,32 @@ +from typing import Any, Literal + +def dpll_satisfiable(expr) -> dict[Any, Any] | Literal[False]: + ... + +def dpll(clauses, symbols, model) -> Literal[False]: + ... + +def dpll_int_repr(clauses, symbols, model) -> Literal[False]: + ... + +def pl_true_int_repr(clause, model=...) -> bool | None: + ... + +def unit_propagate(clauses, symbol) -> list[Any]: + ... + +def unit_propagate_int_repr(clauses, s) -> list[Any]: + ... + +def find_pure_symbol(symbols, unknown_clauses) -> tuple[Any, bool] | tuple[None, None]: + ... + +def find_pure_symbol_int_repr(symbols, unknown_clauses) -> tuple[Any, Literal[True]] | tuple[Any, Literal[False]] | tuple[None, None]: + ... + +def find_unit_clause(clauses, model) -> tuple[Any | bool, Any | bool] | tuple[None, None]: + ... + +def find_unit_clause_int_repr(clauses, model) -> tuple[Any, Literal[False]] | tuple[Any, Literal[True]] | tuple[None, None]: + ... + diff --git a/stubs/sympy-stubs/logic/algorithms/dpll2.pyi b/stubs/sympy-stubs/logic/algorithms/dpll2.pyi new file mode 100644 index 00000000..cd80e7fa --- /dev/null +++ b/stubs/sympy-stubs/logic/algorithms/dpll2.pyi @@ -0,0 +1,17 @@ +from typing import Any, Generator, Literal + +def dpll_satisfiable(expr, all_models=...) -> Generator[bool, None, None] | Generator[Any | Literal[False], Any, None] | dict[Any, Any] | Literal[False]: + ... + +class SATSolver: + def __init__(self, clauses, variables, var_settings, symbols=..., heuristic=..., clause_learning=..., INTERVAL=...) -> None: + ... + + + +class Level: + def __init__(self, decision, flipped=...) -> None: + ... + + + diff --git a/stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi b/stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi new file mode 100644 index 00000000..39929718 --- /dev/null +++ b/stubs/sympy-stubs/logic/algorithms/minisat22_wrapper.pyi @@ -0,0 +1,4 @@ +from typing import Any, Generator, Literal, NoReturn +def minisat22_satisfiable(expr, all_models=..., minimal=...) -> Generator[bool, None, None] | dict[Any, Any] | Generator[dict[Any, Any] | Literal[False], Any, NoReturn] | Literal[False]: + ... + diff --git a/stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi b/stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi new file mode 100644 index 00000000..a389ca0e --- /dev/null +++ b/stubs/sympy-stubs/logic/algorithms/pycosat_wrapper.pyi @@ -0,0 +1,4 @@ +from typing import Any, Generator, Literal +def pycosat_satisfiable(expr, all_models=...) -> Generator[bool, None, None] | dict[Any, Any] | Generator[dict[Any, Any] | Literal[False], Any, None] | Literal[False]: + ... + diff --git a/stubs/sympy-stubs/logic/boolalg.pyi b/stubs/sympy-stubs/logic/boolalg.pyi new file mode 100644 index 00000000..abc68df0 --- /dev/null +++ b/stubs/sympy-stubs/logic/boolalg.pyi @@ -0,0 +1,366 @@ +from typing import Any, Generator, Literal, Self +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.decorators import sympify_method_args, sympify_return +from sympy.core.function import Application, Derivative +from sympy.core.operations import LatticeOp +from sympy.core.relational import Eq, Ne +from sympy.core.singleton import Singleton +from sympy.core.symbol import Symbol + +def as_Boolean(e) -> BooleanTrue | BooleanFalse | Symbol | Boolean: + ... + +@sympify_method_args +class Boolean(Basic): + __slots__ = ... + kind = ... + @sympify_return([('other', 'Boolean')], NotImplemented) + def __and__(self, other) -> And: + ... + + __rand__ = ... + @sympify_return([('other', 'Boolean')], NotImplemented) + def __or__(self, other) -> Or: + ... + + __ror__ = ... + def __invert__(self) -> Not: + ... + + @sympify_return([('other', 'Boolean')], NotImplemented) + def __rshift__(self, other) -> Implies: + ... + + @sympify_return([('other', 'Boolean')], NotImplemented) + def __lshift__(self, other) -> Implies: + ... + + __rrshift__ = ... + __rlshift__ = ... + @sympify_return([('other', 'Boolean')], NotImplemented) + def __xor__(self, other) -> BooleanFalse | Not | Xor: + ... + + __rxor__ = ... + def equals(self, other) -> bool: + ... + + def to_nnf(self, simplify=...) -> Self: + ... + + def as_set(self): + ... + + @property + def binary_symbols(self) -> set[Any | Basic]: + ... + + + +class BooleanAtom(Boolean): + is_Boolean = ... + is_Atom = ... + _op_priority = ... + def simplify(self, *a, **kw) -> Self: + ... + + def expand(self, *a, **kw) -> Self: + ... + + @property + def canonical(self) -> Self: + ... + + __add__ = ... + __radd__ = ... + __sub__ = ... + __rsub__ = ... + __mul__ = ... + __rmul__ = ... + __pow__ = ... + __rpow__ = ... + __truediv__ = ... + __rtruediv__ = ... + __mod__ = ... + __rmod__ = ... + _eval_power = ... + def __lt__(self, other) -> bool: + ... + + __le__ = ... + __gt__ = ... + __ge__ = ... + + +class BooleanTrue(BooleanAtom, metaclass=Singleton): + def __bool__(self) -> Literal[True]: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + @property + def negated(self) -> BooleanFalse: + ... + + def as_set(self): + ... + + + +class BooleanFalse(BooleanAtom, metaclass=Singleton): + def __bool__(self) -> Literal[False]: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + @property + def negated(self) -> BooleanTrue: + ... + + def as_set(self): + ... + + + +true = ... +false = ... +class BooleanFunction(Application, Boolean): + is_Boolean = ... + def simplify(self, **kwargs): + ... + + def __lt__(self, other) -> bool: + ... + + __le__ = ... + __ge__ = ... + __gt__ = ... + @classmethod + def binary_check_and_simplify(cls, *args) -> list[Any | BooleanTrue | Basic | BooleanFalse | Symbol | Boolean]: + ... + + def to_nnf(self, simplify=...) -> Self: + ... + + def to_anf(self, deep=...) -> Self: + ... + + def diff(self, *symbols, **assumptions) -> Derivative: + ... + + + +class And(LatticeOp, BooleanFunction): + zero = ... + identity = ... + nargs = ... + def to_anf(self, deep=...) -> Self: + ... + + + +class Or(LatticeOp, BooleanFunction): + zero = ... + identity = ... + def to_anf(self, deep=...) -> BooleanFalse | Not | Xor: + ... + + + +class Not(BooleanFunction): + is_Not = ... + @classmethod + def eval(cls, arg) -> BooleanFalse | BooleanTrue | None: + ... + + def to_nnf(self, simplify=...) -> Self | Or | And: + ... + + def to_anf(self, deep=...) -> Xor: + ... + + + +class Xor(BooleanFunction): + def __new__(cls, *args, remove_true=..., **kwargs) -> BooleanFalse | Not | Self: + ... + + @property + @cacheit + def args(self) -> tuple[Any, ...]: + ... + + def to_nnf(self, simplify=...) -> And: + ... + + + +class Nand(BooleanFunction): + @classmethod + def eval(cls, *args) -> Not: + ... + + + +class Nor(BooleanFunction): + @classmethod + def eval(cls, *args) -> Not: + ... + + + +class Xnor(BooleanFunction): + @classmethod + def eval(cls, *args) -> Not: + ... + + + +class Implies(BooleanFunction): + @classmethod + def eval(cls, *args) -> Or | BooleanTrue | Self | None: + ... + + def to_nnf(self, simplify=...) -> Or: + ... + + def to_anf(self, deep=...) -> Xor: + ... + + + +class Equivalent(BooleanFunction): + def __new__(cls, *args, **options) -> BooleanFalse | BooleanTrue | And | Self: + ... + + @property + @cacheit + def args(self) -> tuple[Any, ...]: + ... + + def to_nnf(self, simplify=...) -> And: + ... + + def to_anf(self, deep=...) -> Xor: + ... + + + +class ITE(BooleanFunction): + def __new__(cls, *args, **kwargs) -> Self | Not | Basic | Ne | Eq: + ... + + @classmethod + def eval(cls, *args) -> Not | Basic | Ne | Eq | Self | None: + ... + + def to_nnf(self, simplify=...) -> And: + ... + + + +class Exclusive(BooleanFunction): + @classmethod + def eval(cls, *args) -> And: + ... + + + +def conjuncts(expr) -> frozenset[Any]: + ... + +def disjuncts(expr) -> frozenset[Any]: + ... + +def distribute_and_over_or(expr): + ... + +def distribute_or_over_and(expr): + ... + +def distribute_xor_over_and(expr): + ... + +def to_anf(expr, deep=...): + ... + +def to_nnf(expr, simplify=...): + ... + +def to_cnf(expr, simplify=..., force=...) -> BooleanFunction: + ... + +def to_dnf(expr, simplify=..., force=...) -> BooleanFunction: + ... + +def is_anf(expr) -> bool: + ... + +def is_nnf(expr, simplified=...) -> bool: + ... + +def is_cnf(expr) -> bool: + ... + +def is_dnf(expr) -> bool: + ... + +def eliminate_implications(expr): + ... + +def is_literal(expr) -> bool: + ... + +def to_int_repr(clauses, symbols) -> list[set[Any]]: + ... + +def term_to_integer(term) -> int: + ... + +integer_to_term = ... +def truth_table(expr, variables, input=...) -> Generator[tuple[list[Literal[0, 1]], Any | BooleanFunction] | Any | BooleanFunction, Any, None]: + ... + +def SOPform(variables, minterms, dontcares=...) -> BooleanFalse | Or: + ... + +def POSform(variables, minterms, dontcares=...) -> BooleanFalse | And: + ... + +def ANFform(variables, truthvalues) -> BooleanFalse | Not | Xor: + ... + +def anf_coeffs(truthvalues) -> list[Any]: + ... + +def bool_minterm(k, variables) -> And: + ... + +def bool_maxterm(k, variables) -> Or: + ... + +def bool_monomial(k, variables) -> BooleanTrue | And: + ... + +def simplify_logic(expr, form=..., deep=..., force=..., dontcare=...): + ... + +def bool_map(bool1, bool2) -> tuple[Any, dict[Any, Any]] | dict[Any, Any] | Literal[False] | None: + ... + +def simplify_univariate(expr) -> BooleanFunction | BooleanFalse | Or: + ... + +BooleanGates = ... +def gateinputcount(expr) -> int: + ... + diff --git a/stubs/sympy-stubs/logic/inference.pyi b/stubs/sympy-stubs/logic/inference.pyi new file mode 100644 index 00000000..789c7c65 --- /dev/null +++ b/stubs/sympy-stubs/logic/inference.pyi @@ -0,0 +1,48 @@ +from typing import Any, Generator, Literal, NoReturn + +def literal_symbol(literal) -> bool: + ... + +def satisfiable(expr, algorithm=..., all_models=..., minimal=...) -> dict[Any, Any] | Generator[bool, None, None] | Generator[Any | Literal[False], Any, None] | Generator[dict[Any, Any] | Literal[False], Any, None] | Generator[dict[Any, Any] | Literal[False], Any, NoReturn] | Literal[False]: + ... + +def valid(expr) -> bool: + ... + +def pl_true(expr, model=..., deep=...) -> bool | None: + ... + +def entails(expr, formula_set=...) -> bool: + ... + +class KB: + def __init__(self, sentence=...) -> None: + ... + + def tell(self, sentence): + ... + + def ask(self, query): + ... + + def retract(self, sentence): + ... + + @property + def clauses(self) -> list[Any]: + ... + + + +class PropKB(KB): + def tell(self, sentence) -> None: + ... + + def ask(self, query) -> bool: + ... + + def retract(self, sentence) -> None: + ... + + + diff --git a/stubs/sympy-stubs/matrices/__init__.pyi b/stubs/sympy-stubs/matrices/__init__.pyi new file mode 100644 index 00000000..a6870d0d --- /dev/null +++ b/stubs/sympy-stubs/matrices/__init__.pyi @@ -0,0 +1,14 @@ +from sympy.matrices.common import MatrixKind, NonSquareMatrixError, ShapeError +from sympy.matrices.dense import GramSchmidt, MutableDenseMatrix, casoratian, diag, eye, hessian, jordan_cell, list2numpy, matrix2numpy, matrix_multiply_elementwise, ones, randMatrix, rot_axis1, rot_axis2, rot_axis3, rot_ccw_axis1, rot_ccw_axis2, rot_ccw_axis3, rot_givens, symarray, wronskian, zeros +from sympy.matrices.matrices import DeferredVector, MatrixBase +from sympy.matrices.sparse import MutableSparseMatrix +from sympy.matrices.sparsetools import banded +from sympy.matrices.immutable import ImmutableDenseMatrix, ImmutableSparseMatrix +from sympy.matrices.expressions import Adjoint, BlockDiagMatrix, BlockMatrix, Determinant, DiagMatrix, DiagonalMatrix, DiagonalOf, DotProduct, FunctionMatrix, HadamardPower, HadamardProduct, Identity, Inverse, KroneckerProduct, MatAdd, MatMul, MatPow, MatrixExpr, MatrixPermute, MatrixSet, MatrixSlice, MatrixSymbol, OneMatrix, Permanent, PermutationMatrix, Trace, Transpose, ZeroMatrix, block_collapse, blockcut, det, diagonalize_vector, hadamard_product, kronecker_product, matrix_symbols, per, trace +from sympy.matrices.utilities import dotprodsimp + +MutableMatrix = MutableDenseMatrix +Matrix = MutableMatrix +ImmutableMatrix = ImmutableDenseMatrix +SparseMatrix = MutableSparseMatrix +__all__ = ['ShapeError', 'NonSquareMatrixError', 'MatrixKind', 'GramSchmidt', 'casoratian', 'diag', 'eye', 'hessian', 'jordan_cell', 'list2numpy', 'matrix2numpy', 'matrix_multiply_elementwise', 'ones', 'randMatrix', 'rot_axis1', 'rot_axis2', 'rot_axis3', 'symarray', 'wronskian', 'zeros', 'rot_ccw_axis1', 'rot_ccw_axis2', 'rot_ccw_axis3', 'rot_givens', 'MutableDenseMatrix', 'DeferredVector', 'MatrixBase', 'Matrix', 'MutableMatrix', 'MutableSparseMatrix', 'banded', 'ImmutableDenseMatrix', 'ImmutableSparseMatrix', 'ImmutableMatrix', 'SparseMatrix', 'MatrixSlice', 'BlockDiagMatrix', 'BlockMatrix', 'FunctionMatrix', 'Identity', 'Inverse', 'MatAdd', 'MatMul', 'MatPow', 'MatrixExpr', 'MatrixSymbol', 'Trace', 'Transpose', 'ZeroMatrix', 'OneMatrix', 'blockcut', 'block_collapse', 'matrix_symbols', 'Adjoint', 'hadamard_product', 'HadamardProduct', 'HadamardPower', 'Determinant', 'det', 'diagonalize_vector', 'DiagMatrix', 'DiagonalMatrix', 'DiagonalOf', 'trace', 'DotProduct', 'kronecker_product', 'KroneckerProduct', 'PermutationMatrix', 'MatrixPermute', 'MatrixSet', 'Permanent', 'per', 'dotprodsimp'] diff --git a/stubs/sympy-stubs/matrices/dense.pyi b/stubs/sympy-stubs/matrices/dense.pyi new file mode 100644 index 00000000..fa427cfa --- /dev/null +++ b/stubs/sympy-stubs/matrices/dense.pyi @@ -0,0 +1,103 @@ +from typing import Any +from sympy.core.basic import Basic +from sympy.matrices.immutable import ImmutableDenseMatrix +from sympy.series.order import Order +from sympy.utilities.decorator import doctest_depends_on +from sympy.matrices.repmatrix import MutableRepMatrix, RepMatrix +from numpy import ndarray as NDArray + +class DenseMatrix(RepMatrix): + is_MatrixExpr: bool = ... + _op_priority = ... + _class_priority = ... + def as_immutable(self) -> ImmutableDenseMatrix: + ... + + def as_mutable(self) -> Matrix: + ... + + def cholesky(self, hermitian=...): + ... + + def LDLdecomposition(self, hermitian=...) -> tuple[Any, Any]: + ... + + def lower_triangular_solve(self, rhs): + ... + + def upper_triangular_solve(self, rhs): + ... + + + +class MutableDenseMatrix(DenseMatrix, MutableRepMatrix): + def simplify(self, **kwargs) -> None: + ... + + + +Matrix = MutableMatrix = MutableDenseMatrix +def list2numpy(l, dtype=...) -> NDArray[Any, Any]: + ... + +def matrix2numpy(m, dtype=...) -> NDArray[Any, Any]: + ... + +def rot_givens(i, j, theta, dim=...): + ... + +def rot_axis3(theta): + ... + +def rot_axis2(theta): + ... + +def rot_axis1(theta): + ... + +def rot_ccw_axis3(theta): + ... + +def rot_ccw_axis2(theta): + ... + +def rot_ccw_axis1(theta): + ... + +@doctest_depends_on(modules=('numpy', )) +def symarray(prefix, shape, **kwargs) -> NDArray[Any, Any]: + ... + +def casoratian(seqs, n, zero=...) -> tuple[Any | Basic, bool] | Any | Basic | Order: + ... + +def eye(*args, **kwargs): + ... + +def diag(*values, strict=..., unpack=..., **kwargs): + ... + +def GramSchmidt(vlist, orthonormal=...) -> list[Any]: + ... + +def hessian(f, varlist, constraints=...): + ... + +def jordan_cell(eigenval, n): + ... + +def matrix_multiply_elementwise(A, B): + ... + +def ones(*args, **kwargs): + ... + +def randMatrix(r, c=..., min=..., max=..., seed=..., symmetric=..., percent=..., prng=...): + ... + +def wronskian(functions, var, method=...) -> tuple[Any | Basic, bool] | Any | Basic | Order: + ... + +def zeros(*args, **kwargs): + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/__init__.pyi b/stubs/sympy-stubs/matrices/expressions/__init__.pyi new file mode 100644 index 00000000..93dc1167 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/__init__.pyi @@ -0,0 +1,22 @@ +from sympy.matrices.expressions.slice import MatrixSlice +from sympy.matrices.expressions.blockmatrix import BlockDiagMatrix, BlockMatrix, block_collapse, blockcut +from sympy.matrices.expressions.companion import CompanionMatrix +from sympy.matrices.expressions.funcmatrix import FunctionMatrix +from sympy.matrices.expressions.inverse import Inverse +from sympy.matrices.expressions.matadd import MatAdd +from sympy.matrices.expressions.matexpr import MatrixExpr, MatrixSymbol, matrix_symbols +from sympy.matrices.expressions.matmul import MatMul +from sympy.matrices.expressions.matpow import MatPow +from sympy.matrices.expressions.trace import Trace, trace +from sympy.matrices.expressions.determinant import Determinant, Permanent, det, per +from sympy.matrices.expressions.transpose import Transpose +from sympy.matrices.expressions.adjoint import Adjoint +from sympy.matrices.expressions.hadamard import HadamardPower, HadamardProduct, hadamard_power, hadamard_product +from sympy.matrices.expressions.diagonal import DiagMatrix, DiagonalMatrix, DiagonalOf, diagonalize_vector +from sympy.matrices.expressions.dotproduct import DotProduct +from sympy.matrices.expressions.kronecker import KroneckerProduct, combine_kronecker, kronecker_product +from sympy.matrices.expressions.permutation import MatrixPermute, PermutationMatrix +from sympy.matrices.expressions.sets import MatrixSet +from sympy.matrices.expressions.special import Identity, OneMatrix, ZeroMatrix + +__all__ = ['MatrixSlice', 'BlockMatrix', 'BlockDiagMatrix', 'block_collapse', 'blockcut', 'FunctionMatrix', 'CompanionMatrix', 'Inverse', 'MatAdd', 'Identity', 'MatrixExpr', 'MatrixSymbol', 'ZeroMatrix', 'OneMatrix', 'matrix_symbols', 'MatrixSet', 'MatMul', 'MatPow', 'Trace', 'trace', 'Determinant', 'det', 'Transpose', 'Adjoint', 'hadamard_product', 'HadamardProduct', 'hadamard_power', 'HadamardPower', 'DiagonalMatrix', 'DiagonalOf', 'DiagMatrix', 'diagonalize_vector', 'DotProduct', 'kronecker_product', 'KroneckerProduct', 'combine_kronecker', 'PermutationMatrix', 'MatrixPermute', 'Permanent', 'per'] diff --git a/stubs/sympy-stubs/matrices/expressions/adjoint.pyi b/stubs/sympy-stubs/matrices/expressions/adjoint.pyi new file mode 100644 index 00000000..4fc903ea --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/adjoint.pyi @@ -0,0 +1,19 @@ +from sympy.core.basic import Basic +from sympy.core.function import UndefinedFunction +from sympy.matrices.expressions.matexpr import MatrixExpr + +class Adjoint(MatrixExpr): + is_Adjoint = ... + def doit(self, **hints) -> type[UndefinedFunction]: + ... + + @property + def arg(self) -> Basic: + ... + + @property + def shape(self): + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/applyfunc.pyi b/stubs/sympy-stubs/matrices/expressions/applyfunc.pyi new file mode 100644 index 00000000..b924cd40 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/applyfunc.pyi @@ -0,0 +1,25 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.matrices.expressions import MatrixExpr + +class ElementwiseApplyFunction(MatrixExpr): + def __new__(cls, function, expr) -> MatrixExpr | Self: + ... + + @property + def function(self) -> Basic: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def shape(self): + ... + + def doit(self, **hints) -> Basic | Self: + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/blockmatrix.pyi b/stubs/sympy-stubs/matrices/expressions/blockmatrix.pyi new file mode 100644 index 00000000..86f0ad8e --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/blockmatrix.pyi @@ -0,0 +1,139 @@ +from typing import Any, Literal, Self +from sympy.core.basic import Basic +from sympy.matrices.expressions.matadd import MatAdd +from sympy.matrices.expressions.matexpr import MatrixExpr +from sympy.matrices.expressions.matpow import MatPow +from sympy.matrices.expressions.special import GenericIdentity, GenericZeroMatrix +from sympy.matrices.immutable import ImmutableDenseMatrix +from sympy.series.order import Order + +class BlockMatrix(MatrixExpr): + def __new__(cls, *args, **kwargs) -> Self: + ... + + @property + def shape(self) -> tuple[Any | Literal[0], Any | Literal[0]]: + ... + + @property + def blockshape(self): + ... + + @property + def blocks(self) -> Basic: + ... + + @property + def rowblocksizes(self) -> list[Any]: + ... + + @property + def colblocksizes(self) -> list[Any]: + ... + + def structurally_equal(self, other) -> bool: + ... + + def transpose(self) -> BlockMatrix: + ... + + def schur(self, mat=..., generalized=...) -> Self: + ... + + def LDUdecomposition(self) -> tuple[BlockMatrix, BlockDiagMatrix, BlockMatrix]: + ... + + def UDLdecomposition(self) -> tuple[BlockMatrix, BlockDiagMatrix, BlockMatrix]: + ... + + def LUdecomposition(self) -> tuple[BlockMatrix, BlockMatrix]: + ... + + @property + def is_Identity(self) -> bool: + ... + + @property + def is_structurally_symmetric(self) -> bool: + ... + + def equals(self, other) -> bool: + ... + + + +class BlockDiagMatrix(BlockMatrix): + def __new__(cls, *mats) -> BlockDiagMatrix: + ... + + @property + def diag(self) -> tuple[Basic, ...]: + ... + + @property + def blocks(self) -> ImmutableDenseMatrix: + ... + + @property + def shape(self) -> tuple[int, int]: + ... + + @property + def blockshape(self) -> tuple[int, int]: + ... + + @property + def rowblocksizes(self) -> list[Any]: + ... + + @property + def colblocksizes(self) -> list[Any]: + ... + + def get_diag_blocks(self) -> tuple[Basic, ...]: + ... + + + +def block_collapse(expr) -> Any: + ... + +def bc_unpack(expr): + ... + +def bc_matadd(expr): + ... + +def bc_block_plus_ident(expr) -> MatAdd | GenericZeroMatrix: + ... + +def bc_dist(expr) -> BlockDiagMatrix | BlockMatrix: + ... + +def bc_matmul(expr) -> MatPow | GenericIdentity | Order | object: + ... + +def bc_transpose(expr) -> Any: + ... + +def bc_inverse(expr) -> BlockMatrix: + ... + +def blockinverse_1x1(expr) -> BlockMatrix: + ... + +def blockinverse_2x2(expr) -> BlockMatrix: + ... + +def deblock(B) -> BlockMatrix: + ... + +def reblock_2x2(expr) -> BlockMatrix: + ... + +def bounds(sizes) -> list[Any]: + ... + +def blockcut(expr, rowsizes, colsizes) -> BlockMatrix: + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/companion.pyi b/stubs/sympy-stubs/matrices/expressions/companion.pyi new file mode 100644 index 00000000..f5bfb475 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/companion.pyi @@ -0,0 +1,16 @@ +from typing import Any, Self +from sympy.matrices.expressions.matexpr import MatrixExpr + +class CompanionMatrix(MatrixExpr): + def __new__(cls, poly) -> Self: + ... + + @property + def shape(self) -> tuple[Any, Any]: + ... + + def as_explicit(self): + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/determinant.pyi b/stubs/sympy-stubs/matrices/expressions/determinant.pyi new file mode 100644 index 00000000..e56d67c3 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/determinant.pyi @@ -0,0 +1,44 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.core.expr import Expr + +class Determinant(Expr): + is_commutative = ... + def __new__(cls, mat) -> Self: + ... + + @property + def arg(self) -> Basic: + ... + + @property + def kind(self): + ... + + def doit(self, expand=..., **hints) -> Self: + ... + + + +def det(matexpr) -> Determinant: + ... + +class Permanent(Expr): + def __new__(cls, mat) -> Self: + ... + + @property + def arg(self) -> Basic: + ... + + def doit(self, expand=..., **hints) -> Self: + ... + + + +def per(matexpr) -> Permanent: + ... + +def refine_Determinant(expr, assumptions): + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/diagonal.pyi b/stubs/sympy-stubs/matrices/expressions/diagonal.pyi new file mode 100644 index 00000000..58835441 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/diagonal.pyi @@ -0,0 +1,45 @@ +from typing import Any, Self +from sympy import MatrixBase +from sympy.core.expr import Expr +from sympy.matrices.expressions import MatrixExpr + +class DiagonalMatrix(MatrixExpr): + arg = ... + shape = ... + @property + def diagonal_length(self) -> Expr | None: + ... + + + +class DiagonalOf(MatrixExpr): + arg = ... + @property + def shape(self) -> tuple[Any | None, Any]: + ... + + @property + def diagonal_length(self) -> Any | None: + ... + + + +class DiagMatrix(MatrixExpr): + def __new__(cls, vector) -> Self: + ... + + @property + def shape(self): + ... + + def as_explicit(self): + ... + + def doit(self, **hints) -> MatrixBase | DiagMatrix: + ... + + + +def diagonalize_vector(vector) -> MatrixBase | DiagMatrix: + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/dotproduct.pyi b/stubs/sympy-stubs/matrices/expressions/dotproduct.pyi new file mode 100644 index 00000000..fc2c1f04 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/dotproduct.pyi @@ -0,0 +1,13 @@ +from typing import Any, Self +from sympy.core import Expr +from sympy.matrices.expressions.slice import MatrixSlice + +class DotProduct(Expr): + def __new__(cls, arg1, arg2) -> Self: + ... + + def doit(self, expand=..., **hints) -> Any | MatrixSlice: + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/factorizations.pyi b/stubs/sympy-stubs/matrices/expressions/factorizations.pyi new file mode 100644 index 00000000..64d38ff7 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/factorizations.pyi @@ -0,0 +1,91 @@ +from typing import Any +from sympy.matrices.expressions import MatrixExpr + +class Factorization(MatrixExpr): + arg = ... + shape = ... + + +class LofLU(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class UofLU(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class LofCholesky(LofLU): + ... + + +class UofCholesky(UofLU): + ... + + +class QofQR(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class RofQR(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class EigenVectors(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class EigenValues(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class UofSVD(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class SofSVD(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +class VofSVD(Factorization): + @property + def predicates(self) -> tuple[Any]: + ... + + + +def lu(expr) -> tuple[LofLU, UofLU]: + ... + +def qr(expr) -> tuple[QofQR, RofQR]: + ... + +def eig(expr) -> tuple[EigenValues, EigenVectors]: + ... + +def svd(expr) -> tuple[UofSVD, SofSVD, VofSVD]: + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/fourier.pyi b/stubs/sympy-stubs/matrices/expressions/fourier.pyi new file mode 100644 index 00000000..ad355cda --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/fourier.pyi @@ -0,0 +1,15 @@ +from typing import Self +from sympy.matrices.expressions import MatrixExpr + +class DFT(MatrixExpr): + def __new__(cls, n) -> Self: + ... + + n = ... + shape = ... + + +class IDFT(DFT): + ... + + diff --git a/stubs/sympy-stubs/matrices/expressions/funcmatrix.pyi b/stubs/sympy-stubs/matrices/expressions/funcmatrix.pyi new file mode 100644 index 00000000..f1fb9f30 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/funcmatrix.pyi @@ -0,0 +1,18 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.matrices.expressions.matexpr import MatrixExpr + +class FunctionMatrix(MatrixExpr): + def __new__(cls, rows, cols, lamda) -> Self: + ... + + @property + def shape(self) -> tuple[Basic, ...]: + ... + + @property + def lamda(self) -> Basic: + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/hadamard.pyi b/stubs/sympy-stubs/matrices/expressions/hadamard.pyi new file mode 100644 index 00000000..813a824e --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/hadamard.pyi @@ -0,0 +1,45 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.matrices.expressions.matexpr import MatrixExpr + +def hadamard_product(*matrices): + ... + +class HadamardProduct(MatrixExpr): + is_HadamardProduct = ... + def __new__(cls, *args, evaluate=..., check=...) -> Self: + ... + + @property + def shape(self): + ... + + def doit(self, **hints): + ... + + + +def canonicalize(x): + ... + +def hadamard_power(base, exp) -> HadamardPower: + ... + +class HadamardPower(MatrixExpr): + def __new__(cls, base, exp) -> Self: + ... + + @property + def base(self) -> Basic: + ... + + @property + def exp(self) -> Basic: + ... + + @property + def shape(self): + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/inverse.pyi b/stubs/sympy-stubs/matrices/expressions/inverse.pyi new file mode 100644 index 00000000..4e786f8b --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/inverse.pyi @@ -0,0 +1,26 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.matrices.expressions.matpow import MatPow + +class Inverse(MatPow): + is_Inverse = ... + exp = ... + def __new__(cls, mat, exp=...) -> Self: + ... + + @property + def arg(self) -> Basic: + ... + + @property + def shape(self): + ... + + def doit(self, **hints) -> Self: + ... + + + +def refine_Inverse(expr, assumptions): + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/kronecker.pyi b/stubs/sympy-stubs/matrices/expressions/kronecker.pyi new file mode 100644 index 00000000..cd0242c1 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/kronecker.pyi @@ -0,0 +1,57 @@ +from types import NotImplementedType +from typing import Any, Self +from sympy.matrices.expressions.matadd import MatAdd +from sympy.matrices.expressions.matexpr import MatrixExpr +from sympy.matrices.expressions.special import GenericIdentity, GenericZeroMatrix, Identity +from sympy.matrices.immutable import ImmutableDenseMatrix +from sympy.series.order import Order + +def kronecker_product(*matrices) -> NotImplementedType | GenericIdentity | Order | object | Identity: + ... + +class KroneckerProduct(MatrixExpr): + is_KroneckerProduct = ... + def __new__(cls, *args, check=...) -> ImmutableDenseMatrix | Identity | Self: + ... + + @property + def shape(self) -> tuple[Any, Any]: + ... + + def structurally_equal(self, other) -> bool: + ... + + def has_matching_shape(self, other) -> bool | NotImplementedType: + ... + + def doit(self, **hints) -> NotImplementedType | GenericIdentity | Order | object: + ... + + + +def validate(*args) -> None: + ... + +def extract_commutative(kron) -> NotImplementedType | GenericIdentity | Order | object: + ... + +def matrix_kronecker_product(*matrices): + ... + +def explicit_kronecker_product(kron): + ... + +rules = ... +canonicalize = ... +def kronecker_mat_add(expr) -> GenericZeroMatrix | MatAdd: + ... + +def kronecker_mat_mul(expr): + ... + +def kronecker_mat_pow(expr) -> ImmutableDenseMatrix | Identity | KroneckerProduct: + ... + +def combine_kronecker(expr) -> Any: + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/matadd.pyi b/stubs/sympy-stubs/matrices/expressions/matadd.pyi new file mode 100644 index 00000000..54c92614 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/matadd.pyi @@ -0,0 +1,36 @@ +from typing import Self +from sympy.core.add import Add +from sympy.matrices.expressions.matexpr import MatrixExpr +from sympy.matrices.expressions.special import GenericZeroMatrix + +class MatAdd(MatrixExpr, Add): + is_MatAdd = ... + identity = ... + def __new__(cls, *args, evaluate=..., check=..., _sympify=...) -> GenericZeroMatrix | MatAdd | Self: + ... + + @property + def shape(self): + ... + + def could_extract_minus_sign(self) -> bool: + ... + + def expand(self, **kwargs) -> MatAdd: + ... + + def doit(self, **hints) -> MatAdd: + ... + + + +factor_of = ... +matrix_of = ... +def combine(cnt, mat): + ... + +def merge_explicit(matadd) -> MatAdd: + ... + +rules = ... +canonicalize = ... diff --git a/stubs/sympy-stubs/matrices/expressions/matexpr.pyi b/stubs/sympy-stubs/matrices/expressions/matexpr.pyi new file mode 100644 index 00000000..933d3c43 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/matexpr.pyi @@ -0,0 +1,280 @@ +from typing import Any, Callable, Literal, Self +from sympy.core.basic import Basic +from sympy.core.decorators import _sympifyit, call_highest_priority +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.core.logic import FuzzyBool +from sympy.matrices import Matrix +from sympy.matrices.common import MatrixKind +from sympy.matrices.expressions.applyfunc import ElementwiseApplyFunction +from sympy.matrices.expressions.determinant import Determinant +from sympy.matrices.expressions.inverse import Inverse +from sympy.matrices.expressions.matadd import MatAdd +from sympy.matrices.expressions.matmul import MatMul +from sympy.matrices.expressions.matpow import MatPow +from sympy.matrices.expressions.slice import MatrixSlice +from sympy.matrices.expressions.special import GenericIdentity, GenericZeroMatrix, Identity +from sympy.matrices.expressions.transpose import Transpose +from sympy.matrices.immutable import ImmutableDenseMatrix +from sympy.series.order import Order + +class MatrixExpr(Expr): + __slots__: tuple[str, ...] = ... + _iterable = ... + _op_priority = ... + is_Matrix: bool = ... + is_MatrixExpr: bool = ... + is_Identity: FuzzyBool = ... + is_Inverse = ... + is_Transpose = ... + is_ZeroMatrix = ... + is_MatAdd = ... + is_MatMul = ... + is_commutative = ... + is_number = ... + is_symbol = ... + is_scalar = ... + kind: MatrixKind = ... + def __new__(cls, *args, **kwargs) -> Self: + ... + + @property + def shape(self) -> tuple[Expr, Expr]: + ... + + def __neg__(self) -> GenericIdentity | Order | object: + ... + + def __abs__(self): + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__radd__') + def __add__(self, other) -> MatAdd | GenericZeroMatrix: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__add__') + def __radd__(self, other) -> MatAdd | GenericZeroMatrix: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rsub__') + def __sub__(self, other) -> MatAdd | GenericZeroMatrix: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__sub__') + def __rsub__(self, other) -> MatAdd | GenericZeroMatrix: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rmul__') + def __mul__(self, other) -> GenericIdentity | Order | object: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rmul__') + def __matmul__(self, other) -> GenericIdentity | Order | object: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__mul__') + def __rmul__(self, other) -> GenericIdentity | Order | object: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__mul__') + def __rmatmul__(self, other) -> GenericIdentity | Order | object: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rpow__') + def __pow__(self, other) -> Inverse | Basic | Identity | Any | MatPow: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__pow__') + def __rpow__(self, other): + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rtruediv__') + def __truediv__(self, other): + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__truediv__') + def __rtruediv__(self, other): + ... + + @property + def rows(self) -> Expr: + ... + + @property + def cols(self) -> Expr: + ... + + @property + def is_square(self) -> bool | None: + ... + + def as_real_imag(self, deep=..., **hints) -> tuple[Any, Any]: + ... + + def adjoint(self) -> type[UndefinedFunction]: + ... + + def as_coeff_Mul(self, rational=...) -> tuple[Any, Self]: + ... + + def conjugate(self) -> type[UndefinedFunction]: + ... + + def transpose(self) -> Any | Transpose: + ... + + @property + def T(self) -> Any | Transpose: + ... + + def inverse(self) -> Inverse: + ... + + def inv(self) -> Inverse: + ... + + def det(self) -> Determinant: + ... + + @property + def I(self) -> Inverse: + ... + + def valid_index(self, i, j) -> Literal[False]: + ... + + def __getitem__(self, key) -> MatrixSlice: + ... + + def as_explicit(self) -> ImmutableDenseMatrix: + ... + + def as_mutable(self) -> Matrix: + ... + + def __array__(self): + ... + + def equals(self, other) -> bool: + ... + + def canonicalize(self) -> Self: + ... + + def as_coeff_mmul(self) -> tuple[Any, GenericIdentity | Any | Order | object | MatMul]: + ... + + @staticmethod + def from_index_summation(expr, first_index=..., last_index=..., dimensions=...): + ... + + def applyfunc(self, func) -> MatrixExpr | ElementwiseApplyFunction: + ... + + + +def get_postprocessor(cls) -> Callable[..., Any]: + ... + +class MatrixElement(Expr): + parent = ... + i = ... + j = ... + _diff_wrt = ... + is_symbol = ... + is_commutative = ... + def __new__(cls, name, n, m) -> Self: + ... + + @property + def symbol(self) -> Basic: + ... + + def doit(self, **hints): + ... + + @property + def indices(self) -> tuple[Basic, ...]: + ... + + + +class MatrixSymbol(MatrixExpr): + is_commutative = ... + is_symbol = ... + _diff_wrt = ... + def __new__(cls, name, n, m) -> Self: + ... + + @property + def shape(self) -> tuple[Basic, Basic]: + ... + + @property + def name(self): + ... + + @property + def free_symbols(self) -> set[Self]: + ... + + + +def matrix_symbols(expr) -> list[Any]: + ... + +class _LeftRightArgs: + def __init__(self, lines, higher=...) -> None: + ... + + @property + def first_pointer(self): + ... + + @first_pointer.setter + def first_pointer(self, value) -> None: + ... + + @property + def second_pointer(self): + ... + + @second_pointer.setter + def second_pointer(self, value) -> None: + ... + + def __repr__(self) -> str: + ... + + def transpose(self) -> Self: + ... + + def build(self) -> list[Any]: + ... + + def matrix_form(self) -> Literal[1]: + ... + + def rank(self) -> int: + ... + + def append_first(self, other) -> None: + ... + + def append_second(self, other) -> None: + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/matmul.pyi b/stubs/sympy-stubs/matrices/expressions/matmul.pyi new file mode 100644 index 00000000..c728a425 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/matmul.pyi @@ -0,0 +1,70 @@ +from typing import Any, Self +from sympy.core.expr import Expr +from sympy.core.mul import Mul +from sympy.matrices.expressions.matadd import MatAdd +from sympy.matrices.expressions.matexpr import MatrixExpr +from sympy.matrices.expressions.special import GenericIdentity, GenericZeroMatrix, ZeroMatrix +from sympy.series.order import Order + +class MatMul(MatrixExpr, Mul): + is_MatMul = ... + identity = ... + def __new__(cls, *args, evaluate=..., check=..., _sympify=...) -> GenericIdentity | Order | object | Self: + ... + + @property + def shape(self) -> tuple[Any, Any]: + ... + + def as_coeff_matrices(self) -> tuple[Any | Order, list[Expr]]: + ... + + def as_coeff_mmul(self) -> tuple[Any | Order, GenericIdentity | Any | Order | object | MatMul]: + ... + + def expand(self, **kwargs) -> object: + ... + + def doit(self, **hints) -> object: + ... + + def args_cnc(self, cset=..., warn=..., **kwargs) -> list[Any]: + ... + + + +def newmul(*args) -> MatMul: + ... + +def any_zeros(mul) -> ZeroMatrix: + ... + +def merge_explicit(matmul) -> MatMul: + ... + +def remove_ids(mul) -> MatMul: + ... + +def factor_in_front(mul) -> MatMul: + ... + +def combine_powers(mul) -> MatMul: + ... + +def combine_permutations(mul) -> MatMul: + ... + +def combine_one_matrices(mul) -> MatMul: + ... + +def distribute_monom(mul) -> GenericZeroMatrix | MatAdd: + ... + +rules = ... +canonicalize = ... +def only_squares(*matrices) -> list[Any]: + ... + +def refine_MatMul(expr, assumptions) -> GenericIdentity | Order | object | MatMul: + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/matpow.pyi b/stubs/sympy-stubs/matrices/expressions/matpow.pyi new file mode 100644 index 00000000..f6ac3edf --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/matpow.pyi @@ -0,0 +1,27 @@ +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.matrices.expressions.inverse import Inverse +from sympy.matrices.expressions.matexpr import MatrixExpr +from sympy.matrices.expressions.special import Identity + +class MatPow(MatrixExpr): + def __new__(cls, base, exp, evaluate=..., **options) -> Basic | Identity | Inverse | Any | MatPow | Self: + ... + + @property + def base(self) -> Basic: + ... + + @property + def exp(self) -> Basic: + ... + + @property + def shape(self): + ... + + def doit(self, **hints) -> Basic | Identity | Inverse | Any | MatPow: + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/permutation.pyi b/stubs/sympy-stubs/matrices/expressions/permutation.pyi new file mode 100644 index 00000000..80a15ea1 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/permutation.pyi @@ -0,0 +1,36 @@ +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.matrices.expressions.matexpr import MatrixExpr +from sympy.matrices.expressions.special import Identity, OneMatrix, ZeroMatrix + +class PermutationMatrix(MatrixExpr): + def __new__(cls, perm) -> Self: + ... + + @property + def shape(self) -> tuple[Any, Any]: + ... + + @property + def is_Identity(self): + ... + + def doit(self, **hints) -> Identity | Self: + ... + + _eval_adjoint = ... + + +class MatrixPermute(MatrixExpr): + def __new__(cls, mat, perm, axis=...) -> Self: + ... + + def doit(self, deep=..., **hints) -> Basic | PermutationMatrix | ZeroMatrix | OneMatrix | MatrixPermute | Self: + ... + + @property + def shape(self): + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/sets.pyi b/stubs/sympy-stubs/matrices/expressions/sets.pyi new file mode 100644 index 00000000..7dcd0c0c --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/sets.pyi @@ -0,0 +1,19 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.sets.sets import Set + +class MatrixSet(Set): + is_empty = ... + def __new__(cls, n, m, set) -> Self: + ... + + @property + def shape(self) -> tuple[Basic, ...]: + ... + + @property + def set(self) -> Basic: + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/slice.pyi b/stubs/sympy-stubs/matrices/expressions/slice.pyi new file mode 100644 index 00000000..557c8d5f --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/slice.pyi @@ -0,0 +1,30 @@ +from typing import Any, Literal, Self +from sympy.core.function import UndefinedFunction +from sympy.matrices.expressions.matexpr import MatrixExpr + +def normalize(i, parentsize) -> tuple[Any | Literal[0], Any, Any | Literal[1]]: + ... + +class MatrixSlice(MatrixExpr): + parent = ... + rowslice = ... + colslice = ... + def __new__(cls, parent, rowslice, colslice) -> MatrixSlice | Self: + ... + + @property + def shape(self) -> tuple[Any | type[UndefinedFunction], Any | type[UndefinedFunction]]: + ... + + @property + def on_diag(self) -> Any: + ... + + + +def slice_of_slice(s, t) -> tuple[Any, Any, Any]: + ... + +def mat_slice_of_slice(parent, rowslice, colslice) -> MatrixSlice: + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/special.pyi b/stubs/sympy-stubs/matrices/expressions/special.pyi new file mode 100644 index 00000000..cbf33fca --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/special.pyi @@ -0,0 +1,116 @@ +from typing import Literal, Self +from sympy.core.basic import Basic +from sympy.matrices.expressions.matexpr import MatrixExpr + +class ZeroMatrix(MatrixExpr): + is_ZeroMatrix = ... + def __new__(cls, m, n) -> Self: + ... + + @property + def shape(self) -> tuple[Basic, Basic]: + ... + + + +class GenericZeroMatrix(ZeroMatrix): + def __new__(cls) -> Self: + ... + + @property + def rows(self): + ... + + @property + def cols(self): + ... + + @property + def shape(self): + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +class Identity(MatrixExpr): + is_Identity = ... + def __new__(cls, n) -> Self: + ... + + @property + def rows(self) -> Basic: + ... + + @property + def cols(self) -> Basic: + ... + + @property + def shape(self) -> tuple[Basic, Basic]: + ... + + @property + def is_square(self) -> Literal[True]: + ... + + + +class GenericIdentity(Identity): + def __new__(cls) -> Self: + ... + + @property + def rows(self): + ... + + @property + def cols(self): + ... + + @property + def shape(self): + ... + + @property + def is_square(self) -> Literal[True]: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +class OneMatrix(MatrixExpr): + def __new__(cls, m, n, evaluate=...) -> Identity | Self: + ... + + @property + def shape(self) -> tuple[Basic, ...]: + ... + + @property + def is_Identity(self): + ... + + def as_explicit(self): + ... + + def doit(self, **hints) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/matrices/expressions/trace.pyi b/stubs/sympy-stubs/matrices/expressions/trace.pyi new file mode 100644 index 00000000..04ba4598 --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/trace.pyi @@ -0,0 +1,25 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.core.expr import Expr + +class Trace(Expr): + is_Trace = ... + is_commutative = ... + def __new__(cls, mat) -> Self: + ... + + @property + def arg(self) -> Basic: + ... + + def doit(self, **hints) -> Trace: + ... + + def as_explicit(self) -> Trace: + ... + + + +def trace(expr): + ... + diff --git a/stubs/sympy-stubs/matrices/expressions/transpose.pyi b/stubs/sympy-stubs/matrices/expressions/transpose.pyi new file mode 100644 index 00000000..e5261b9f --- /dev/null +++ b/stubs/sympy-stubs/matrices/expressions/transpose.pyi @@ -0,0 +1,25 @@ +from typing import Any +from sympy.core.basic import Basic +from sympy.matrices.expressions.matexpr import MatrixExpr + +class Transpose(MatrixExpr): + is_Transpose = ... + def doit(self, **hints) -> Any | Transpose: + ... + + @property + def arg(self) -> Basic: + ... + + @property + def shape(self): + ... + + + +def transpose(expr) -> Any | Transpose: + ... + +def refine_Transpose(expr, assumptions): + ... + diff --git a/stubs/sympy-stubs/matrices/immutable.pyi b/stubs/sympy-stubs/matrices/immutable.pyi new file mode 100644 index 00000000..c47c434f --- /dev/null +++ b/stubs/sympy-stubs/matrices/immutable.pyi @@ -0,0 +1,56 @@ +from typing import Any, Self +from sympy.matrices.dense import DenseMatrix +from sympy.matrices.expressions import MatrixExpr +from sympy.matrices.repmatrix import RepMatrix +from sympy.matrices.sparse import SparseRepMatrix + +def sympify_matrix(arg): + ... + +def sympify_mpmath_matrix(arg) -> ImmutableDenseMatrix: + ... + +class ImmutableRepMatrix(RepMatrix, MatrixExpr): + def __new__(cls, *args, **kwargs): + ... + + __hash__ = ... + def copy(self) -> Self: + ... + + @property + def cols(self): + ... + + @property + def rows(self): + ... + + @property + def shape(self) -> tuple[Any, Any]: + ... + + def as_immutable(self) -> Self: + ... + + def __setitem__(self, *args): + ... + + def is_diagonalizable(self, reals_only=..., **kwargs) -> bool: + ... + + is_diagonalizable = ... + + +class ImmutableDenseMatrix(DenseMatrix, ImmutableRepMatrix): + _iterable = ... + _class_priority = ... + _op_priority = ... + + +ImmutableMatrix = ImmutableDenseMatrix +class ImmutableSparseMatrix(SparseRepMatrix, ImmutableRepMatrix): + is_Matrix = ... + _class_priority = ... + + diff --git a/stubs/sympy-stubs/matrices/normalforms.pyi b/stubs/sympy-stubs/matrices/normalforms.pyi new file mode 100644 index 00000000..c3386d11 --- /dev/null +++ b/stubs/sympy-stubs/matrices/normalforms.pyi @@ -0,0 +1,11 @@ +from typing import Any +from sympy.matrices.dense import MutableDenseMatrix +def smith_normal_form(m, domain=...) -> MutableDenseMatrix: + ... + +def invariant_factors(m, domain=...) -> tuple[Any, ...]: + ... + +def hermite_normal_form(A, *, D=..., check_rank=...) -> MutableDenseMatrix: + ... + diff --git a/stubs/sympy-stubs/matrices/repmatrix.pyi b/stubs/sympy-stubs/matrices/repmatrix.pyi new file mode 100644 index 00000000..91332573 --- /dev/null +++ b/stubs/sympy-stubs/matrices/repmatrix.pyi @@ -0,0 +1,70 @@ +from typing import Any, Self +from sympy.matrices.dense import MutableDenseMatrix +from sympy.matrices.expressions.matexpr import MatrixElement +from sympy.polys.matrices import DomainMatrix +from sympy import MatrixBase +from sympy.matrices.common import MatrixKind + +class RepMatrix(MatrixBase): + _rep: DomainMatrix + def __eq__(self, other) -> bool: + ... + + def flat(self) -> list[Any]: + ... + + def copy(self): + ... + + @property + def kind(self) -> MatrixKind: + ... + + def __getitem__(self, key) -> MatrixElement | list[Any]: + ... + + def equals(self, other, failing_expression=...) -> bool: + ... + + + +class MutableRepMatrix(RepMatrix): + is_zero = ... + def __new__(cls, *args, **kwargs) -> Self: + ... + + def copy(self) -> Self: + ... + + def as_mutable(self) -> Self: + ... + + def __setitem__(self, key, value) -> None: + ... + + def col_op(self, j, f) -> None: + ... + + def col_swap(self, i, j) -> None: + ... + + def row_op(self, i, f) -> None: + ... + + def row_swap(self, i, j) -> None: + ... + + def zip_row_op(self, i, k, f) -> None: + ... + + def copyin_list(self, key, value) -> None: + ... + + def copyin_matrix(self, key, value) -> None: + ... + + def fill(self, value) -> None: + ... + + + diff --git a/stubs/sympy-stubs/matrices/sparse.pyi b/stubs/sympy-stubs/matrices/sparse.pyi new file mode 100644 index 00000000..93492ba0 --- /dev/null +++ b/stubs/sympy-stubs/matrices/sparse.pyi @@ -0,0 +1,61 @@ +from types import NotImplementedType +from typing import Any +from sympy.matrices.immutable import ImmutableSparseMatrix +from sympy.matrices.repmatrix import MutableRepMatrix, RepMatrix + +class SparseRepMatrix(RepMatrix): + def applyfunc(self, f): + ... + + def as_immutable(self) -> ImmutableSparseMatrix: + ... + + def as_mutable(self) -> MutableSparseMatrix: + ... + + def col_list(self) -> list[tuple[Any, ...]]: + ... + + def nnz(self) -> int: + ... + + def row_list(self) -> list[tuple[Any, ...]]: + ... + + def scalar_multiply(self, scalar): + "Scalar element-wise multiplication" + ... + + def solve_least_squares(self, rhs, method=...): + ... + + def solve(self, rhs, method=...) -> NotImplementedType | None: + ... + + RL = ... + CL = ... + def liupc(self) -> tuple[list[list[Any]], Any]: + ... + + def row_structure_symbolic_cholesky(self): + ... + + def cholesky(self, hermitian=...): + ... + + def LDLdecomposition(self, hermitian=...) -> tuple[Any, Any]: + ... + + def lower_triangular_solve(self, rhs): + ... + + def upper_triangular_solve(self, rhs): + ... + + + +class MutableSparseMatrix(SparseRepMatrix, MutableRepMatrix): + ... + + +SparseMatrix = MutableSparseMatrix diff --git a/stubs/sympy-stubs/matrices/utilities.pyi b/stubs/sympy-stubs/matrices/utilities.pyi new file mode 100644 index 00000000..f99e42ec --- /dev/null +++ b/stubs/sympy-stubs/matrices/utilities.pyi @@ -0,0 +1,15 @@ +from contextlib import contextmanager +from threading import local +from typing import Any, Generator + +class DotProdSimpState(local): + def __init__(self) -> None: + ... + + + +_dotprodsimp_state = ... +@contextmanager +def dotprodsimp(x) -> Generator[None, Any, None]: + ... + diff --git a/stubs/sympy-stubs/multipledispatch/__init__.pyi b/stubs/sympy-stubs/multipledispatch/__init__.pyi new file mode 100644 index 00000000..e1e31cc9 --- /dev/null +++ b/stubs/sympy-stubs/multipledispatch/__init__.pyi @@ -0,0 +1,5 @@ +from sympy.multipledispatch.core import dispatch +from sympy.multipledispatch.dispatcher import Dispatcher, MDNotImplementedError, halt_ordering, restart_ordering + +__version__ = ... +__all__ = ['dispatch', 'Dispatcher', 'halt_ordering', 'restart_ordering', 'MDNotImplementedError'] diff --git a/stubs/sympy-stubs/multipledispatch/conflict.pyi b/stubs/sympy-stubs/multipledispatch/conflict.pyi new file mode 100644 index 00000000..26e0815e --- /dev/null +++ b/stubs/sympy-stubs/multipledispatch/conflict.pyi @@ -0,0 +1,26 @@ +from typing import _T_co, Any +class AmbiguityWarning(Warning): + ... + + +def supercedes(a, b) -> bool: + ... + +def consistent(a, b) -> bool: + ... + +def ambiguous(a, b) -> bool: + ... + +def ambiguities(signatures) -> set[tuple[tuple[_T_co, ...], tuple[_T_co, ...]]]: + ... + +def super_signature(signatures) -> list[type]: + ... + +def edge(a, b, tie_breaker=...) -> bool: + ... + +def ordering(signatures): + ... + diff --git a/stubs/sympy-stubs/multipledispatch/core.pyi b/stubs/sympy-stubs/multipledispatch/core.pyi new file mode 100644 index 00000000..9bd03dee --- /dev/null +++ b/stubs/sympy-stubs/multipledispatch/core.pyi @@ -0,0 +1,9 @@ +from typing import Any, Callable + +global_namespace: dict[str, Any] = ... +def dispatch(*types, namespace=..., on_ambiguity=...) -> Callable[..., Any]: + ... + +def ismethod(func) -> bool: + ... + diff --git a/stubs/sympy-stubs/multipledispatch/dispatcher.pyi b/stubs/sympy-stubs/multipledispatch/dispatcher.pyi new file mode 100644 index 00000000..d3814fa3 --- /dev/null +++ b/stubs/sympy-stubs/multipledispatch/dispatcher.pyi @@ -0,0 +1,108 @@ +from inspect import Parameter +from itertools import islice +from typing import Any, Callable, Generator, LiteralString, Self, ValuesView +class MDNotImplementedError(NotImplementedError): + ... + + +def ambiguity_warn(dispatcher, ambiguities) -> None: + ... + +class RaiseNotImplementedError: + def __init__(self, dispatcher) -> None: + ... + + def __call__(self, *args, **kwargs): + ... + + + +def ambiguity_register_error_ignore_dup(dispatcher, ambiguities) -> None: + ... + +_unresolved_dispatchers: set[Dispatcher] = ... +_resolve = ... +def halt_ordering() -> None: + ... + +def restart_ordering(on_ambiguity=...) -> None: + ... + +class Dispatcher: + __slots__ = ... + def __init__(self, name, doc=...) -> None: + ... + + def register(self, *types, **kwargs) -> Callable[..., Any]: + ... + + @classmethod + def get_func_params(cls, func) -> ValuesView[Parameter] | None: + ... + + @classmethod + def get_func_annotations(cls, func) -> tuple[Any, ...] | None: + ... + + def add(self, signature, func, on_ambiguity=...) -> None: + ... + + def reorder(self, on_ambiguity=...) -> None: + ... + + def __call__(self, *args, **kwargs): + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def dispatch(self, *types) -> None: + ... + + def dispatch_iter(self, *types) -> Generator[Any, Any, None]: + ... + + def resolve(self, types) -> None: + ... + + def __getstate__(self) -> dict[str, Any]: + ... + + def __setstate__(self, d) -> None: + ... + + @property + def __doc__(self) -> str: + ... + + def help(self, *args, **kwargs) -> None: + ... + + def source(self, *args, **kwargs) -> None: + ... + + + +def source(func) -> str: + ... + +class MethodDispatcher(Dispatcher): + @classmethod + def get_func_params(cls, func) -> islice[Parameter] | None: + ... + + def __get__(self, instance, owner) -> Self: + ... + + def __call__(self, *args, **kwargs): + ... + + + +def str_signature(sig) -> LiteralString: + ... + +def warning_text(name, amb): + ... + diff --git a/stubs/sympy-stubs/multipledispatch/utils.pyi b/stubs/sympy-stubs/multipledispatch/utils.pyi new file mode 100644 index 00000000..ded8236c --- /dev/null +++ b/stubs/sympy-stubs/multipledispatch/utils.pyi @@ -0,0 +1,10 @@ +from typing import Any +def expand_tuples(L) -> list[tuple[()]] | list[Any]: + ... + +def reverse_dict(d) -> dict[Any, Any]: + ... + +def groupby(func, seq) -> dict[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/ntheory/__init__.pyi b/stubs/sympy-stubs/ntheory/__init__.pyi new file mode 100644 index 00000000..7820df1b --- /dev/null +++ b/stubs/sympy-stubs/ntheory/__init__.pyi @@ -0,0 +1,13 @@ +from sympy.ntheory.generate import Sieve, composite, compositepi, cycle_length, nextprime, prevprime, prime, primepi, primerange, primorial, randprime, sieve +from sympy.ntheory.primetest import is_gaussian_prime, isprime +from sympy.ntheory.factor_ import abundance, divisor_count, divisor_sigma, divisors, dra, drm, factorint, factorrat, is_abundant, is_amicable, is_deficient, is_perfect, mersenne_prime_exponent, multiplicity, multiplicity_in_factorial, perfect_power, pollard_pm1, pollard_rho, primefactors, primenu, primeomega, proper_divisor_count, proper_divisors, reduced_totient, totient, is_mersenne_prime, trailing +from sympy.ntheory.partitions_ import npartitions +from sympy.ntheory.residue_ntheory import discrete_log, is_nthpow_residue, is_primitive_root, is_quad_residue, jacobi_symbol, legendre_symbol, mobius, n_order, nthroot_mod, polynomial_congruence, primitive_root, quadratic_congruence, quadratic_residues, sqrt_mod, sqrt_mod_iter +from sympy.ntheory.multinomial import binomial_coefficients, binomial_coefficients_list, multinomial_coefficients +from sympy.ntheory.continued_fraction import continued_fraction, continued_fraction_convergents, continued_fraction_iterator, continued_fraction_periodic, continued_fraction_reduce +from sympy.ntheory.digits import count_digits, digits, is_palindromic +from sympy.ntheory.egyptian_fraction import egyptian_fraction +from sympy.ntheory.ecm import ecm +from sympy.ntheory.qs import qs + +__all__ = ['nextprime', 'prevprime', 'prime', 'primepi', 'primerange', 'randprime', 'Sieve', 'sieve', 'primorial', 'cycle_length', 'composite', 'compositepi', 'isprime', 'is_gaussian_prime', 'divisors', 'proper_divisors', 'factorint', 'multiplicity', 'perfect_power', 'pollard_pm1', 'pollard_rho', 'primefactors', 'totient', 'trailing', 'divisor_count', 'proper_divisor_count', 'divisor_sigma', 'factorrat', 'reduced_totient', 'primenu', 'primeomega', 'mersenne_prime_exponent', 'is_perfect', 'is_mersenne_prime', 'is_abundant', 'is_deficient', 'is_amicable', 'abundance', 'dra', 'drm', 'multiplicity_in_factorial', 'npartitions', 'is_primitive_root', 'is_quad_residue', 'legendre_symbol', 'jacobi_symbol', 'n_order', 'sqrt_mod', 'quadratic_residues', 'primitive_root', 'nthroot_mod', 'is_nthpow_residue', 'sqrt_mod_iter', 'mobius', 'discrete_log', 'quadratic_congruence', 'polynomial_congruence', 'binomial_coefficients', 'binomial_coefficients_list', 'multinomial_coefficients', 'continued_fraction_periodic', 'continued_fraction_iterator', 'continued_fraction_reduce', 'continued_fraction_convergents', 'continued_fraction', 'digits', 'count_digits', 'is_palindromic', 'egyptian_fraction', 'ecm', 'qs'] diff --git a/stubs/sympy-stubs/ntheory/continued_fraction.pyi b/stubs/sympy-stubs/ntheory/continued_fraction.pyi new file mode 100644 index 00000000..792a8a56 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/continued_fraction.pyi @@ -0,0 +1,21 @@ +from typing import Any, Generator +from sympy.core.add import Add +from sympy.core.basic import Basic +from sympy.core.function import UndefinedFunction +from sympy.core.mul import Mul +from sympy.series.order import Order +def continued_fraction(a) -> list: + ... + +def continued_fraction_periodic(p, q, d=..., s=...) -> list: + ... + +def continued_fraction_reduce(cf) -> Order | Basic | Any | Add | Mul: + ... + +def continued_fraction_iterator(x) -> Generator[type[UndefinedFunction] | Any, Any, None]: + ... + +def continued_fraction_convergents(cf) -> Generator[Any, Any, None]: + ... + diff --git a/stubs/sympy-stubs/ntheory/digits.pyi b/stubs/sympy-stubs/ntheory/digits.pyi new file mode 100644 index 00000000..1c630b39 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/digits.pyi @@ -0,0 +1,11 @@ +from collections import defaultdict +from typing import Any +def digits(n, b=..., digits=...) -> list[Any]: + ... + +def count_digits(n, b=...) -> defaultdict[Any, int]: + ... + +def is_palindromic(n, b=...) -> bool: + ... + diff --git a/stubs/sympy-stubs/ntheory/ecm.pyi b/stubs/sympy-stubs/ntheory/ecm.pyi new file mode 100644 index 00000000..df928f0b --- /dev/null +++ b/stubs/sympy-stubs/ntheory/ecm.pyi @@ -0,0 +1,23 @@ +from typing import Any, Self +rgen = ... +class Point: + def __init__(self, x_cord, z_cord, a_24, mod) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def add(self, Q, diff) -> Point: + ... + + def double(self) -> Point: + ... + + def mont_ladder(self, k) -> Self | Point: + ... + + + +def ecm(n, B1=..., B2=..., max_curve=..., seed=...) -> set[Any]: + ... + diff --git a/stubs/sympy-stubs/ntheory/egyptian_fraction.pyi b/stubs/sympy-stubs/ntheory/egyptian_fraction.pyi new file mode 100644 index 00000000..4aa21143 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/egyptian_fraction.pyi @@ -0,0 +1,20 @@ +from typing import Any +from sympy.core.numbers import Integer +def egyptian_fraction(r, algorithm=...) -> list[Any | Integer] | list[Any]: + ... + +def egypt_greedy(x, y) -> list[Any]: + ... + +def egypt_graham_jewett(x, y) -> list[Any]: + ... + +def egypt_takenouchi(x, y) -> list[Any]: + ... + +def egypt_golomb(x, y) -> list[Any]: + ... + +def egypt_harmonic(r) -> tuple[list[Any], Any]: + ... + diff --git a/stubs/sympy-stubs/ntheory/factor_.pyi b/stubs/sympy-stubs/ntheory/factor_.pyi new file mode 100644 index 00000000..d3421146 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/factor_.pyi @@ -0,0 +1,148 @@ +from typing import Any, Generator, Literal, LiteralString +from sympy import Function +from sympy.core.function import UndefinedFunction +from sympy.core.numbers import Integer +from sympy.series.order import Order +from sympy.utilities.decorator import deprecated + +MERSENNE_PRIME_EXPONENTS = ... +PERFECT = ... +MERSENNES = ... +small_trailing = ... +def smoothness(n) -> tuple[Literal[1], Literal[1]] | tuple[Any, Any]: + ... + +def smoothness_p(n, m=..., power=..., visual=...) -> str | dict[Any, Any] | tuple[Any, ...] | tuple[int, list[tuple[Any, tuple[Any, ...]]]] | LiteralString: + ... + +def trailing(n) -> int: + ... + +def multiplicity(p, n) -> int: + ... + +def multiplicity_in_factorial(p, n): + ... + +def perfect_power(n, candidates=..., big=..., factor=...): + ... + +def pollard_rho(n, s=..., a=..., retries=..., seed=..., max_steps=..., F=...) -> int | None: + ... + +def pollard_pm1(n, B=..., a=..., retries=..., seed=...) -> int | None: + ... + +trial_int_msg = ... +trial_msg = ... +rho_msg = ... +pm1_msg = ... +ecm_msg = ... +factor_msg = ... +fermat_msg = ... +complete_msg = ... +def factorint(n, limit=..., use_trial=..., use_rho=..., use_pm1=..., use_ecm=..., verbose=..., visual=..., multiple=...): + ... + +def factorrat(rat, limit=..., use_trial=..., use_rho=..., use_pm1=..., verbose=..., visual=..., multiple=...) -> list[Any] | dict[Any, int] | Order: + ... + +def primefactors(n, limit=..., verbose=...) -> list[Any]: + ... + +def divisors(n, generator=..., proper=...) -> list[int] | list[Any] | list[Any | Literal[1]] | Generator[Any | Literal[1], Any, None]: + ... + +def divisor_count(n, modulus=..., proper=...) -> Order | Literal[0]: + ... + +def proper_divisors(n, generator=...) -> list[int] | list[Any] | list[Any | Literal[1]] | Generator[Any | Literal[1], Any, None]: + ... + +def proper_divisor_count(n, modulus=...) -> Order | Literal[0]: + ... + +def udivisors(n, generator=...) -> list[int] | list[Any] | list[Any | Literal[1]] | Generator[Any | Literal[1], Any, None]: + ... + +def udivisor_count(n) -> Any | Literal[0]: + ... + +def antidivisors(n, generator=...) -> list[Any] | list[Any | int] | Generator[Any | int, Any, None]: + ... + +def antidivisor_count(n) -> Literal[0]: + ... + +class totient(Function): + @classmethod + def eval(cls, n) -> Literal[1] | None: + ... + + + +class reduced_totient(Function): + @classmethod + def eval(cls, n) -> Literal[1, 0] | None: + ... + + + +class divisor_sigma(Function): + @classmethod + def eval(cls, n, k=...) -> Integer | Order | None: + ... + + + +def core(n, t=...) -> Literal[1]: + ... + +class udivisor_sigma(Function): + @classmethod + def eval(cls, n, k=...) -> Order | None: + ... + + + +class primenu(Function): + @classmethod + def eval(cls, n) -> int | None: + ... + + + +class primeomega(Function): + @classmethod + def eval(cls, n) -> int | None: + ... + + + +def mersenne_prime_exponent(nth) -> Literal[2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933]: + ... + +def is_perfect(n) -> bool | None: + ... + +def is_mersenne_prime(n) -> bool: + ... + +def abundance(n): + ... + +def is_abundant(n) -> bool: + ... + +def is_deficient(n) -> bool: + ... + +def is_amicable(m, n) -> bool: + ... + +def dra(n, b) -> int: + ... + +def drm(n, b) -> int: + ... + diff --git a/stubs/sympy-stubs/ntheory/generate.pyi b/stubs/sympy-stubs/ntheory/generate.pyi new file mode 100644 index 00000000..1f01c139 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/generate.pyi @@ -0,0 +1,77 @@ +from array import array +from typing import Any, Generator, Literal +from sympy import Function +from sympy.core.function import UndefinedFunction +from sympy.utilities.decorator import deprecated + +class Sieve: + def __init__(self) -> None: + ... + + def __repr__(self) -> str: + ... + + def extend(self, n) -> None: + ... + + def extend_to_no(self, i) -> None: + ... + + def primerange(self, a, b=...) -> Generator[Any, Any, None]: + ... + + def totientrange(self, a, b) -> Generator[int, Any, None]: + ... + + def mobiusrange(self, a, b) -> Generator[int, Any, None]: + ... + + def search(self, n) -> tuple[int, int]: + ... + + def __contains__(self, n) -> bool: + ... + + def __iter__(self) -> Generator[array[int] | int, Any, None]: + ... + + def __getitem__(self, n) -> array[int] | int: + ... + + + +sieve = ... +def prime(nth) -> array[int] | int: + ... + +class primepi(Function): + @classmethod + def eval(cls, n) -> None: + ... + + + +def nextprime(n, ith=...) -> int | array[int] | None: + ... + +def prevprime(n) -> int | array[int] | None: + ... + +def primerange(a, b=...) -> Generator[Any | int | array[int] | None, Any, None]: + ... + +def randprime(a, b) -> int | array[int] | None: + ... + +def primorial(n, nth=...) -> array[int] | int: + ... + +def cycle_length(f, x0, nmax=..., values=...) -> Generator[Any | tuple[int, None] | tuple[int, int], Any, None]: + ... + +def composite(nth) -> int: + ... + +def compositepi(n) -> Literal[0]: + ... + diff --git a/stubs/sympy-stubs/ntheory/modular.pyi b/stubs/sympy-stubs/ntheory/modular.pyi new file mode 100644 index 00000000..5e7f799c --- /dev/null +++ b/stubs/sympy-stubs/ntheory/modular.pyi @@ -0,0 +1,16 @@ +from typing import Any +def symmetric_residue(a, m): + ... + +def crt(m, v, symmetric=..., check=...) -> tuple[Any, Any | int] | None: + ... + +def crt1(m) -> tuple[float, list[Any], list[Any]]: + ... + +def crt2(m, v, mm, e, s, symmetric=...) -> tuple[Any, Any]: + ... + +def solve_congruence(*remainder_modulus_pairs, **hint) -> tuple[Any, Any | int] | None: + ... + diff --git a/stubs/sympy-stubs/ntheory/multinomial.pyi b/stubs/sympy-stubs/ntheory/multinomial.pyi new file mode 100644 index 00000000..d4bddc67 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/multinomial.pyi @@ -0,0 +1,13 @@ +from typing import Any, Generator, Literal +def binomial_coefficients(n) -> dict[tuple[Literal[0], int] | tuple[int, Literal[0]], int]: + ... + +def binomial_coefficients_list(n) -> list[int]: + ... + +def multinomial_coefficients(m, n) -> dict[Any, Any] | dict[tuple[()], int] | dict[tuple[Literal[0], int] | tuple[int, Literal[0]], int] | dict[tuple[Any, ...], Any] | dict[tuple[int, ...], int]: + ... + +def multinomial_coefficients_iterator(m, n, _tuple=...) -> Generator[Any | tuple[tuple[Any, ...], Any], Any, None]: + ... + diff --git a/stubs/sympy-stubs/ntheory/partitions_.pyi b/stubs/sympy-stubs/ntheory/partitions_.pyi new file mode 100644 index 00000000..c9ea46fe --- /dev/null +++ b/stubs/sympy-stubs/ntheory/partitions_.pyi @@ -0,0 +1,6 @@ +from sympy.core.function import UndefinedFunction +from sympy.utilities.decorator import deprecated +def npartitions(n, verbose=...) -> int: + ... + +__all__ = ['npartitions'] diff --git a/stubs/sympy-stubs/ntheory/primetest.pyi b/stubs/sympy-stubs/ntheory/primetest.pyi new file mode 100644 index 00000000..1a770554 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/primetest.pyi @@ -0,0 +1,25 @@ + +def is_euler_pseudoprime(n, b) -> bool: + ... + +def is_square(n, prep=...) -> bool: + ... + +def mr(n, bases) -> bool: + ... + +def is_lucas_prp(n) -> bool: + ... + +def is_strong_lucas_prp(n) -> bool: + ... + +def is_extra_strong_lucas_prp(n) -> bool: + ... + +def isprime(n) -> bool: + ... + +def is_gaussian_prime(num) -> bool: + ... + diff --git a/stubs/sympy-stubs/ntheory/qs.pyi b/stubs/sympy-stubs/ntheory/qs.pyi new file mode 100644 index 00000000..53d68e37 --- /dev/null +++ b/stubs/sympy-stubs/ntheory/qs.pyi @@ -0,0 +1,20 @@ +from typing import Any, Literal +rgen = ... +class SievePolynomial: + def __init__(self, modified_coeff=..., a=..., b=...) -> None: + ... + + def eval(self, x) -> Literal[0]: + ... + + + +class FactorBaseElem: + def __init__(self, prime, tmem_p, log_p) -> None: + ... + + + +def qs(N, prime_bound, M, ERROR_TERM=..., seed=...) -> set[Any]: + ... + diff --git a/stubs/sympy-stubs/ntheory/residue_ntheory.pyi b/stubs/sympy-stubs/ntheory/residue_ntheory.pyi new file mode 100644 index 00000000..41220fea --- /dev/null +++ b/stubs/sympy-stubs/ntheory/residue_ntheory.pyi @@ -0,0 +1,54 @@ +from typing import Any, Generator, Literal +from sympy import Function +from sympy.core.function import UndefinedFunction +from sympy.utilities.decorator import deprecated + +def n_order(a, n) -> Literal[1]: + ... + +def primitive_root(p) -> int | None: + ... + +def is_primitive_root(a, p) -> bool: + ... + +def sqrt_mod(a, p, all_roots=...) -> list[Any | int] | Any | int | None: + ... + +def sqrt_mod_iter(a, p, domain=...) -> Generator[Any | int, Any, None]: + ... + +def is_quad_residue(a, p) -> bool: + ... + +def is_nthpow_residue(a, n, m) -> bool: + ... + +def nthroot_mod(a, n, p, all_roots=...) -> list[Any | int] | Any | int | list[Any] | list[int] | list[int | Any] | None: + ... + +def quadratic_residues(p) -> list[int]: + ... + +def legendre_symbol(a, p) -> Literal[0, 1, -1]: + ... + +def jacobi_symbol(m, n) -> int: + ... + +class mobius(Function): + @classmethod + def eval(cls, n) -> None: + ... + + + +def discrete_log(n, a, b, order=..., prime_order=...) -> int: + ... + +def quadratic_congruence(a, b, c, p) -> list[int] | list[Any]: + ... + +def polynomial_congruence(expr, m) -> list[Any | int] | Any | int | list[Any] | list[int] | list[int | Any] | None: + ... + diff --git a/stubs/sympy-stubs/parsing/__init__.pyi b/stubs/sympy-stubs/parsing/__init__.pyi new file mode 100644 index 00000000..9ae0931a --- /dev/null +++ b/stubs/sympy-stubs/parsing/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.parsing.sympy_parser import parse_expr + +__all__ = ['parse_expr'] diff --git a/stubs/sympy-stubs/parsing/sympy_parser.pyi b/stubs/sympy-stubs/parsing/sympy_parser.pyi new file mode 100644 index 00000000..da8e4146 --- /dev/null +++ b/stubs/sympy-stubs/parsing/sympy_parser.pyi @@ -0,0 +1,112 @@ +import ast +from typing import Any, Callable, Dict as tDict, List, Optional, Tuple as tTuple, Union as tUnion + +null = ... +TOKEN = tTuple[int, str] +DICT = tDict[str, Any] +TRANS = Callable[[List[TOKEN], DICT, DICT], List[TOKEN]] +class ParenthesisGroup(List[TOKEN]): + ... + + +class AppliedFunction: + def __init__(self, function: TOKEN, args: ParenthesisGroup, exponent=...) -> None: + ... + + def expand(self) -> List[TOKEN]: + ... + + def __getitem__(self, index) -> Any: + ... + + def __repr__(self) -> str: + ... + + + +def function_exponentiation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def split_symbols_custom(predicate: Callable[[str], bool]) -> Callable[..., list[TOKEN]]: + ... + +split_symbols = ... +def implicit_multiplication(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: + ... + +def implicit_application(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: + ... + +def implicit_multiplication_application(result: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: + ... + +def auto_symbol(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def lambda_notation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def factorial_notation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def convert_xor(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def repeated_decimals(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def auto_number(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def rationalize(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> list[TOKEN]: + ... + +def convert_equals_signs(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT) -> List[TOKEN]: + ... + +standard_transformations: tTuple[TRANS, ...] = ... +def stringify_expr(s: str, local_dict: DICT, global_dict: DICT, transformations: tTuple[TRANS, ...]) -> str: + ... + +def eval_expr(code, local_dict: DICT, global_dict: DICT) -> Any: + ... + +def parse_expr(s: str, local_dict: Optional[DICT] = ..., transformations: tUnion[tTuple[TRANS, ...], str] = ..., global_dict: Optional[DICT] = ..., evaluate=...) -> Any: + ... + +def evaluateFalse(s: str) -> ast.Expression: + ... + +class EvaluateFalseTransformer(ast.NodeTransformer): + operators = ... + functions = ... + relational_operators = ... + def visit_Compare(self, node) -> ast.Call | ast.Compare: + ... + + def flatten(self, args, func) -> list[Any]: + ... + + def visit_BinOp(self, node) -> ast.Call | ast.BinOp: + ... + + def visit_Call(self, node) -> ast.AST: + ... + + + +_transformation = ... +transformations = ... +class _T: + def __init__(self) -> None: + ... + + def __str__(self) -> str: + ... + + def __getitem__(self, t) -> tuple[Any, ...]: + ... + + + +T = ... diff --git a/stubs/sympy-stubs/physics/__init__.pyi b/stubs/sympy-stubs/physics/__init__.pyi new file mode 100644 index 00000000..12b8fe8a --- /dev/null +++ b/stubs/sympy-stubs/physics/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.physics import units +from sympy.physics.matrices import mdft, mgamma, minkowski_tensor, msigma + +__all__ = ['units', 'mgamma', 'msigma', 'minkowski_tensor', 'mdft'] diff --git a/stubs/sympy-stubs/physics/control/__init__.pyi b/stubs/sympy-stubs/physics/control/__init__.pyi new file mode 100644 index 00000000..70f8b44c --- /dev/null +++ b/stubs/sympy-stubs/physics/control/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.physics.control.lti import Feedback, MIMOFeedback, MIMOParallel, MIMOSeries, Parallel, Series, TransferFunction, TransferFunctionMatrix, backward_diff, bilinear +from sympy.physics.control.control_plots import bode_magnitude_numerical_data, bode_magnitude_plot, bode_phase_numerical_data, bode_phase_plot, bode_plot, impulse_response_numerical_data, impulse_response_plot, pole_zero_numerical_data, pole_zero_plot, ramp_response_numerical_data, ramp_response_plot, step_response_numerical_data, step_response_plot + +__all__ = ['TransferFunction', 'Series', 'MIMOSeries', 'Parallel', 'MIMOParallel', 'Feedback', 'MIMOFeedback', 'TransferFunctionMatrix', 'bilinear', 'backward_diff', 'pole_zero_numerical_data', 'pole_zero_plot', 'step_response_numerical_data', 'step_response_plot', 'impulse_response_numerical_data', 'impulse_response_plot', 'ramp_response_numerical_data', 'ramp_response_plot', 'bode_magnitude_numerical_data', 'bode_phase_numerical_data', 'bode_magnitude_plot', 'bode_phase_plot', 'bode_plot'] diff --git a/stubs/sympy-stubs/physics/control/control_plots.pyi b/stubs/sympy-stubs/physics/control/control_plots.pyi new file mode 100644 index 00000000..8bbf6029 --- /dev/null +++ b/stubs/sympy-stubs/physics/control/control_plots.pyi @@ -0,0 +1,47 @@ +from typing import Any +__all__ = ['pole_zero_numerical_data', 'pole_zero_plot', 'step_response_numerical_data', 'step_response_plot', 'impulse_response_numerical_data', 'impulse_response_plot', 'ramp_response_numerical_data', 'ramp_response_plot', 'bode_magnitude_numerical_data', 'bode_phase_numerical_data', 'bode_magnitude_plot', 'bode_phase_plot', 'bode_plot'] +matplotlib = ... +numpy = ... +if matplotlib: + plt = ... +if numpy: + np = ... +def pole_zero_numerical_data(system) -> tuple[Any, Any]: + ... + +def pole_zero_plot(system, pole_color=..., pole_markersize=..., zero_color=..., zero_markersize=..., grid=..., show_axes=..., show=..., **kwargs) -> None: + ... + +def step_response_numerical_data(system, prec=..., lower_limit=..., upper_limit=..., **kwargs) -> tuple[Any, Any] | tuple[list[Any], list[Any]]: + ... + +def step_response_plot(system, color=..., prec=..., lower_limit=..., upper_limit=..., show_axes=..., grid=..., show=..., **kwargs) -> None: + ... + +def impulse_response_numerical_data(system, prec=..., lower_limit=..., upper_limit=..., **kwargs) -> tuple[Any, Any] | tuple[list[Any], list[Any]]: + ... + +def impulse_response_plot(system, color=..., prec=..., lower_limit=..., upper_limit=..., show_axes=..., grid=..., show=..., **kwargs) -> None: + ... + +def ramp_response_numerical_data(system, slope=..., prec=..., lower_limit=..., upper_limit=..., **kwargs) -> tuple[Any, Any] | tuple[list[Any], list[Any]]: + ... + +def ramp_response_plot(system, slope=..., color=..., prec=..., lower_limit=..., upper_limit=..., show_axes=..., grid=..., show=..., **kwargs) -> None: + ... + +def bode_magnitude_numerical_data(system, initial_exp=..., final_exp=..., freq_unit=..., **kwargs) -> tuple[Any | list[Any], Any | list[Any]]: + ... + +def bode_magnitude_plot(system, initial_exp=..., final_exp=..., color=..., show_axes=..., grid=..., show=..., freq_unit=..., **kwargs) -> None: + ... + +def bode_phase_numerical_data(system, initial_exp=..., final_exp=..., freq_unit=..., phase_unit=..., **kwargs) -> tuple[Any | list[Any], Any | list[Any]]: + ... + +def bode_phase_plot(system, initial_exp=..., final_exp=..., color=..., show_axes=..., grid=..., show=..., freq_unit=..., phase_unit=..., **kwargs) -> None: + ... + +def bode_plot(system, initial_exp=..., final_exp=..., grid=..., show_axes=..., show=..., freq_unit=..., phase_unit=..., **kwargs) -> None: + ... + diff --git a/stubs/sympy-stubs/physics/control/lti.pyi b/stubs/sympy-stubs/physics/control/lti.pyi new file mode 100644 index 00000000..a33376f3 --- /dev/null +++ b/stubs/sympy-stubs/physics/control/lti.pyi @@ -0,0 +1,421 @@ +from types import NotImplementedType +from typing import Any, Callable, Self, Type +from sympy.core.basic import Basic +from sympy.core.evalf import EvalfMixin +from sympy.core.power import Pow +from sympy.series.order import Order + +__all__ = ['TransferFunction', 'Series', 'MIMOSeries', 'Parallel', 'MIMOParallel', 'Feedback', 'MIMOFeedback', 'TransferFunctionMatrix', 'bilinear', 'backward_diff'] +def bilinear(tf, sample_per) -> tuple[Any, Any]: + ... + +def backward_diff(tf, sample_per) -> tuple[Any, Any]: + ... + +class LinearTimeInvariant(Basic, EvalfMixin): + _clstype: Type + def __new__(cls, *system, **kwargs) -> Self: + ... + + @property + def is_SISO(self): + ... + + + +class SISOLinearTimeInvariant(LinearTimeInvariant): + _is_SISO = ... + + +class MIMOLinearTimeInvariant(LinearTimeInvariant): + _is_SISO = ... + +def _check_other_SISO(func) -> Callable[..., NotImplementedType | Any]: + ... + +def _check_other_MIMO(func) -> Callable[..., NotImplementedType | Any]: + ... + +class TransferFunction(SISOLinearTimeInvariant): + def __new__(cls, num, den, var) -> Self: + ... + + @classmethod + def from_rational_expression(cls, expr, var=...) -> Self: + ... + + @property + def num(self): + ... + + @property + def den(self): + ... + + @property + def var(self): + ... + + def expand(self) -> TransferFunction: + ... + + def dc_gain(self): + ... + + def poles(self) -> list[Any] | Any: + ... + + def zeros(self) -> list[Any] | Any: + ... + + def is_stable(self) -> bool | None: + ... + + def __add__(self, other) -> TransferFunction | Parallel: + ... + + def __radd__(self, other): + ... + + def __sub__(self, other) -> TransferFunction | Parallel: + ... + + def __rsub__(self, other): + ... + + def __mul__(self, other) -> TransferFunction | Series: + ... + + __rmul__ = ... + def __truediv__(self, other) -> Feedback: + ... + + __rtruediv__ = ... + def __pow__(self, p) -> TransferFunction: + ... + + def __neg__(self) -> TransferFunction: + ... + + @property + def is_proper(self) -> Any: + ... + + @property + def is_strictly_proper(self) -> Any: + ... + + @property + def is_biproper(self) -> Any: + ... + + def to_expr(self) -> Order | Pow: + ... + + + +class Series(SISOLinearTimeInvariant): + def __new__(cls, *args, evaluate=...) -> TransferFunction | Self: + ... + + @property + def var(self): + ... + + def doit(self, **hints) -> TransferFunction: + ... + + @_check_other_SISO + def __add__(self, other) -> TransferFunction | Parallel: + ... + + __radd__ = ... + @_check_other_SISO + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + @_check_other_SISO + def __mul__(self, other) -> TransferFunction | Series: + ... + + def __truediv__(self, other) -> Feedback: + ... + + def __neg__(self) -> TransferFunction | Series: + ... + + def to_expr(self) -> Order: + ... + + @property + def is_proper(self) -> Any: + ... + + @property + def is_strictly_proper(self) -> Any: + ... + + @property + def is_biproper(self) -> Any: + ... + + + +class MIMOSeries(MIMOLinearTimeInvariant): + def __new__(cls, *args, evaluate=...) -> TransferFunctionMatrix | Basic | Self: + ... + + @property + def var(self): + ... + + @property + def num_inputs(self): + ... + + @property + def num_outputs(self): + ... + + @property + def shape(self) -> tuple[Any, Any]: + ... + + def doit(self, cancel=..., **kwargs) -> TransferFunctionMatrix | Basic: + ... + + @_check_other_MIMO + def __add__(self, other) -> TransferFunctionMatrix | MIMOParallel: + ... + + __radd__ = ... + @_check_other_MIMO + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + @_check_other_MIMO + def __mul__(self, other) -> TransferFunctionMatrix | Basic | MIMOSeries: + ... + + def __neg__(self) -> TransferFunctionMatrix | Basic | MIMOSeries: + ... + + + +class Parallel(SISOLinearTimeInvariant): + def __new__(cls, *args, evaluate=...) -> TransferFunction | Self: + ... + + @property + def var(self): + ... + + def doit(self, **hints) -> TransferFunction: + ... + + @_check_other_SISO + def __add__(self, other) -> TransferFunction | Parallel: + ... + + __radd__ = ... + @_check_other_SISO + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + @_check_other_SISO + def __mul__(self, other) -> TransferFunction | Series: + ... + + def __neg__(self) -> TransferFunction | Series: + ... + + def to_expr(self) -> Order: + ... + + @property + def is_proper(self) -> Any: + ... + + @property + def is_strictly_proper(self) -> Any: + ... + + @property + def is_biproper(self) -> Any: + ... + + + +class MIMOParallel(MIMOLinearTimeInvariant): + def __new__(cls, *args, evaluate=...) -> TransferFunctionMatrix | Self: + ... + + @property + def var(self): + ... + + @property + def num_inputs(self): + ... + + @property + def num_outputs(self): + ... + + @property + def shape(self) -> tuple[Any, Any]: + ... + + def doit(self, **hints) -> TransferFunctionMatrix: + ... + + @_check_other_MIMO + def __add__(self, other) -> TransferFunctionMatrix | MIMOParallel: + ... + + __radd__ = ... + @_check_other_MIMO + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + @_check_other_MIMO + def __mul__(self, other) -> TransferFunctionMatrix | Basic | MIMOSeries: + ... + + def __neg__(self) -> TransferFunctionMatrix | MIMOParallel: + ... + + + +class Feedback(SISOLinearTimeInvariant): + def __new__(cls, sys1, sys2=..., sign=...) -> Self: + ... + + @property + def sys1(self) -> Basic: + ... + + @property + def sys2(self) -> Basic: + ... + + @property + def var(self): + ... + + @property + def sign(self) -> Basic: + ... + + @property + def sensitivity(self): + ... + + def doit(self, cancel=..., expand=..., **hints) -> TransferFunction: + ... + + def __neg__(self) -> Feedback: + ... + + + +class MIMOFeedback(MIMOLinearTimeInvariant): + def __new__(cls, sys1, sys2, sign=...) -> Self: + ... + + @property + def sys1(self) -> Basic: + ... + + @property + def sys2(self) -> Basic: + ... + + @property + def var(self): + ... + + @property + def sign(self) -> Basic: + ... + + @property + def sensitivity(self): + ... + + def doit(self, cancel=..., expand=..., **hints) -> TransferFunctionMatrix: + ... + + def __neg__(self) -> MIMOFeedback: + ... + + + +class TransferFunctionMatrix(MIMOLinearTimeInvariant): + def __new__(cls, arg) -> Self: + ... + + @classmethod + def from_Matrix(cls, matrix, var) -> TransferFunctionMatrix: + ... + + @property + def var(self): + ... + + @property + def num_inputs(self): + ... + + @property + def num_outputs(self): + ... + + @property + def shape(self): + ... + + def __neg__(self) -> TransferFunctionMatrix: + ... + + @_check_other_MIMO + def __add__(self, other) -> TransferFunctionMatrix | MIMOParallel: + ... + + @_check_other_MIMO + def __sub__(self, other): + ... + + @_check_other_MIMO + def __mul__(self, other) -> TransferFunctionMatrix | Basic | MIMOSeries: + ... + + def __getitem__(self, key) -> TransferFunctionMatrix | TransferFunction: + ... + + def transpose(self) -> TransferFunctionMatrix: + ... + + def elem_poles(self) -> list[list[Any]]: + ... + + def elem_zeros(self) -> list[list[Any]]: + ... + + def expand(self, **hints) -> TransferFunctionMatrix: + ... + + + diff --git a/stubs/sympy-stubs/physics/matrices.pyi b/stubs/sympy-stubs/physics/matrices.pyi new file mode 100644 index 00000000..ab68b7e9 --- /dev/null +++ b/stubs/sympy-stubs/physics/matrices.pyi @@ -0,0 +1,17 @@ +from sympy.matrices import Matrix +from sympy.matrices.dense import MutableDenseMatrix +from sympy.utilities.decorator import deprecated + +def msigma(i) -> MutableDenseMatrix: + ... + +def pat_matrix(m, dx, dy, dz): + ... + +def mgamma(mu, lower=...) -> MutableDenseMatrix: + ... + +minkowski_tensor = ... +def mdft(n) -> Matrix: + ... + diff --git a/stubs/sympy-stubs/physics/units/__init__.pyi b/stubs/sympy-stubs/physics/units/__init__.pyi new file mode 100644 index 00000000..fa1e9888 --- /dev/null +++ b/stubs/sympy-stubs/physics/units/__init__.pyi @@ -0,0 +1,18 @@ +from sympy.physics.units.dimensions import Dimension, DimensionSystem +from sympy.physics.units.unitsystem import UnitSystem +from sympy.physics.units.util import convert_to +from sympy.physics.units.quantities import Quantity +from sympy.physics.units.definitions.dimension_definitions import acceleration, action, amount_of_substance, area, capacitance, charge, conductance, current, energy, force, frequency, impedance, inductance, length, luminous_intensity, magnetic_density, magnetic_flux, mass, momentum, power, pressure, temperature, time, velocity, voltage, volume +from sympy.physics.units.prefixes import atto, centi, deca, deci, exa, exbi, femto, gibi, giga, hecto, kibi, kilo, mebi, mega, micro, milli, nano, pebi, peta, pico, tebi, tera, yocto, yotta, zepto, zetta +from sympy.physics.units.definitions import A, Bq, C, D, Da, F, G, Gy, H, Hz, J, K, L, N, Pa, R, S, T, V, W, Wb, Z0, acceleration_due_to_gravity, ampere, amperes, amu, amus, angstrom, angstroms, angular_mil, angular_mils, anomalistic_year, anomalistic_years, astronomical_unit, astronomical_units, atm, atmosphere, atmospheres, atomic_mass_constant, atomic_mass_unit, au, avogadro, avogadro_constant, avogadro_number, bar, bars, becquerel, bit, bits, boltzmann, boltzmann_constant, byte, c, cL, candela, candelas, cd, centiliter, centiliters, centimeter, centimeters, cl, cm, common_year, common_years, coulomb, coulomb_constant, coulombs, dHg0, dL, dalton, day, days, deciliter, deciliters, decimeter, decimeters, deg, degree, degrees, dioptre, dl, dm, draconic_year, draconic_years, e0, eV, electric_constant, electric_force_constant, electron_rest_mass, electronvolt, electronvolts, elementary_charge, exbibyte, exbibytes, farad, faraday_constant, farads, feet, foot, ft, full_moon_cycle, full_moon_cycles, g, gaussian_year, gaussian_years, gee, gees, gibibyte, gibibytes, gram, grams, gravitational_constant, gray, h, ha, hbar, hectare, henry, henrys, hertz, hour, hours, hz, inch, inches, josephson_constant, joule, joules, julian_year, julian_years, kPa, kat, katal, kelvin, kelvins, kg, kibibyte, kibibytes, kilogram, kilograms, kilometer, kilometers, km, l, lightyear, lightyears, liter, liters, lux, lx, ly, m, mL, magnetic_constant, me, mebibyte, mebibytes, meter, meters, metric_ton, mg, mho, mhos, mi, microgram, micrograms, micrometer, micrometers, micron, microns, microsecond, microseconds, mil, mile, miles, milli_mass_unit, milligram, milligrams, milliliter, milliliters, millimeter, millimeters, millisecond, milliseconds, minute, minutes, ml, mm, mmHg, mmu, mmus, mol, molar_gas_constant, mole, moles, ms, nanometer, nanometers, nanosecond, nanoseconds, nautical_mile, nautical_miles, newton, newtons, nm, nmi, ns, ohm, ohms, optical_power, pa, pascal, pascals, pebibyte, pebibytes, percent, percents, permille, picometer, picometers, picosecond, picoseconds, planck, planck_acceleration, planck_angular_frequency, planck_area, planck_charge, planck_current, planck_density, planck_energy, planck_energy_density, planck_force, planck_impedance, planck_intensity, planck_length, planck_mass, planck_momentum, planck_power, planck_pressure, planck_temperature, planck_time, planck_voltage, planck_volume, pm, pound, pounds, ps, psi, quart, quarts, rad, radian, radians, s, second, seconds, sidereal_year, sidereal_years, siemens, speed_of_light, sr, stefan, stefan_boltzmann_constant, steradian, steradians, t, tebibyte, tebibytes, tesla, teslas, tonne, torr, tropical_year, tropical_years, u0, ug, um, us, v, vacuum_impedance, vacuum_permeability, vacuum_permittivity, volt, volts, von_klitzing_constant, watt, watts, wb, weber, webers, yard, yards, yd, year, years +from sympy.physics.units.systems import mks, mksa, si + +Unit = Quantity +speed = ... +luminosity = ... +magnetic_flux_density = ... +amount = ... +def find_unit(quantity, unit_system=...) -> list[str]: + ... + +__all__ = ['Dimension', 'DimensionSystem', 'UnitSystem', 'convert_to', 'Quantity', 'amount_of_substance', 'acceleration', 'action', 'area', 'capacitance', 'charge', 'conductance', 'current', 'energy', 'force', 'frequency', 'impedance', 'inductance', 'length', 'luminous_intensity', 'magnetic_density', 'magnetic_flux', 'mass', 'momentum', 'power', 'pressure', 'temperature', 'time', 'velocity', 'voltage', 'volume', 'Unit', 'speed', 'luminosity', 'magnetic_flux_density', 'amount', 'yotta', 'zetta', 'exa', 'peta', 'tera', 'giga', 'mega', 'kilo', 'hecto', 'deca', 'deci', 'centi', 'milli', 'micro', 'nano', 'pico', 'femto', 'atto', 'zepto', 'yocto', 'kibi', 'mebi', 'gibi', 'tebi', 'pebi', 'exbi', 'percent', 'percents', 'permille', 'rad', 'radian', 'radians', 'deg', 'degree', 'degrees', 'sr', 'steradian', 'steradians', 'mil', 'angular_mil', 'angular_mils', 'm', 'meter', 'meters', 'kg', 'kilogram', 'kilograms', 's', 'second', 'seconds', 'A', 'ampere', 'amperes', 'K', 'kelvin', 'kelvins', 'mol', 'mole', 'moles', 'cd', 'candela', 'candelas', 'g', 'gram', 'grams', 'mg', 'milligram', 'milligrams', 'ug', 'microgram', 'micrograms', 't', 'tonne', 'metric_ton', 'newton', 'newtons', 'N', 'joule', 'joules', 'J', 'watt', 'watts', 'W', 'pascal', 'pascals', 'Pa', 'pa', 'hertz', 'hz', 'Hz', 'coulomb', 'coulombs', 'C', 'volt', 'volts', 'v', 'V', 'ohm', 'ohms', 'siemens', 'S', 'mho', 'mhos', 'farad', 'farads', 'F', 'henry', 'henrys', 'H', 'tesla', 'teslas', 'T', 'weber', 'webers', 'Wb', 'wb', 'optical_power', 'dioptre', 'D', 'lux', 'lx', 'katal', 'kat', 'gray', 'Gy', 'becquerel', 'Bq', 'km', 'kilometer', 'kilometers', 'dm', 'decimeter', 'decimeters', 'cm', 'centimeter', 'centimeters', 'mm', 'millimeter', 'millimeters', 'um', 'micrometer', 'micrometers', 'micron', 'microns', 'nm', 'nanometer', 'nanometers', 'pm', 'picometer', 'picometers', 'ft', 'foot', 'feet', 'inch', 'inches', 'yd', 'yard', 'yards', 'mi', 'mile', 'miles', 'nmi', 'nautical_mile', 'nautical_miles', 'angstrom', 'angstroms', 'ha', 'hectare', 'l', 'L', 'liter', 'liters', 'dl', 'dL', 'deciliter', 'deciliters', 'cl', 'cL', 'centiliter', 'centiliters', 'ml', 'mL', 'milliliter', 'milliliters', 'ms', 'millisecond', 'milliseconds', 'us', 'microsecond', 'microseconds', 'ns', 'nanosecond', 'nanoseconds', 'ps', 'picosecond', 'picoseconds', 'minute', 'minutes', 'h', 'hour', 'hours', 'day', 'days', 'anomalistic_year', 'anomalistic_years', 'sidereal_year', 'sidereal_years', 'tropical_year', 'tropical_years', 'common_year', 'common_years', 'julian_year', 'julian_years', 'draconic_year', 'draconic_years', 'gaussian_year', 'gaussian_years', 'full_moon_cycle', 'full_moon_cycles', 'year', 'years', 'G', 'gravitational_constant', 'c', 'speed_of_light', 'elementary_charge', 'hbar', 'planck', 'eV', 'electronvolt', 'electronvolts', 'avogadro_number', 'avogadro', 'avogadro_constant', 'boltzmann', 'boltzmann_constant', 'stefan', 'stefan_boltzmann_constant', 'R', 'molar_gas_constant', 'faraday_constant', 'josephson_constant', 'von_klitzing_constant', 'Da', 'dalton', 'amu', 'amus', 'atomic_mass_unit', 'atomic_mass_constant', 'me', 'electron_rest_mass', 'gee', 'gees', 'acceleration_due_to_gravity', 'u0', 'magnetic_constant', 'vacuum_permeability', 'e0', 'electric_constant', 'vacuum_permittivity', 'Z0', 'vacuum_impedance', 'coulomb_constant', 'electric_force_constant', 'atmosphere', 'atmospheres', 'atm', 'kPa', 'bar', 'bars', 'pound', 'pounds', 'psi', 'dHg0', 'mmHg', 'torr', 'mmu', 'mmus', 'milli_mass_unit', 'quart', 'quarts', 'ly', 'lightyear', 'lightyears', 'au', 'astronomical_unit', 'astronomical_units', 'planck_mass', 'planck_time', 'planck_temperature', 'planck_length', 'planck_charge', 'planck_area', 'planck_volume', 'planck_momentum', 'planck_energy', 'planck_force', 'planck_power', 'planck_density', 'planck_energy_density', 'planck_intensity', 'planck_angular_frequency', 'planck_pressure', 'planck_current', 'planck_voltage', 'planck_impedance', 'planck_acceleration', 'bit', 'bits', 'byte', 'kibibyte', 'kibibytes', 'mebibyte', 'mebibytes', 'gibibyte', 'gibibytes', 'tebibyte', 'tebibytes', 'pebibyte', 'pebibytes', 'exbibyte', 'exbibytes', 'mks', 'mksa', 'si'] diff --git a/stubs/sympy-stubs/physics/units/definitions/__init__.pyi b/stubs/sympy-stubs/physics/units/definitions/__init__.pyi new file mode 100644 index 00000000..f2fe2418 --- /dev/null +++ b/stubs/sympy-stubs/physics/units/definitions/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.physics.units.definitions.unit_definitions import A, Bq, C, D, Da, F, G, Gy, H, Hz, J, K, L, N, Pa, R, S, T, V, W, Wb, Z0, acceleration_due_to_gravity, ampere, amperes, amu, amus, angstrom, angstroms, angular_mil, angular_mils, anomalistic_year, anomalistic_years, astronomical_unit, astronomical_units, atm, atmosphere, atmospheres, atomic_mass_constant, atomic_mass_unit, au, avogadro, avogadro_constant, avogadro_number, bar, bars, becquerel, bit, bits, boltzmann, boltzmann_constant, byte, c, cL, candela, candelas, cd, centiliter, centiliters, centimeter, centimeters, cl, cm, common_year, common_years, coulomb, coulomb_constant, coulombs, coulombs_constant, curie, dHg0, dL, dalton, day, days, deciliter, deciliters, decimeter, decimeters, deg, degree, degrees, dioptre, dl, dm, draconic_year, draconic_years, e0, eV, electric_constant, electric_force_constant, electron_rest_mass, electronvolt, electronvolts, elementary_charge, exbibyte, exbibytes, farad, faraday_constant, farads, feet, foot, ft, full_moon_cycle, full_moon_cycles, g, gaussian_year, gaussian_years, gee, gees, gibibyte, gibibytes, gram, grams, gravitational_constant, gray, h, ha, hbar, hectare, henry, henrys, hertz, hour, hours, hz, inch, inches, josephson_constant, joule, joules, julian_year, julian_years, kPa, kat, katal, kelvin, kelvins, kg, kibibyte, kibibytes, kilogram, kilograms, kilometer, kilometers, kilopascal, km, l, lightyear, lightyears, liter, liters, lux, lx, ly, m, mL, magnetic_constant, me, mebibyte, mebibytes, meter, meters, metric_ton, mg, mho, mhos, mi, microgram, micrograms, micrometer, micrometers, micron, microns, microsecond, microseconds, mil, mile, miles, milli_mass_unit, milligram, milligrams, milliliter, milliliters, millimeter, millimeters, millisecond, milliseconds, minute, minutes, ml, mm, mmHg, mmu, mmus, mol, molar_gas_constant, mole, moles, ms, nanometer, nanometers, nanosecond, nanoseconds, nautical_mile, nautical_miles, newton, newtons, nm, nmi, ns, ohm, ohms, optical_power, pa, pascal, pascals, pebibyte, pebibytes, percent, percents, permille, picometer, picometers, picosecond, picoseconds, planck, planck_acceleration, planck_angular_frequency, planck_area, planck_charge, planck_current, planck_density, planck_energy, planck_energy_density, planck_force, planck_impedance, planck_intensity, planck_length, planck_mass, planck_momentum, planck_power, planck_pressure, planck_temperature, planck_time, planck_voltage, planck_volume, pm, pound, pounds, ps, psi, quart, quarts, rad, radian, radians, rutherford, s, second, seconds, sidereal_year, sidereal_years, siemens, speed_of_light, sr, stefan, stefan_boltzmann_constant, steradian, steradians, t, tebibyte, tebibytes, tesla, teslas, tonne, torr, tropical_year, tropical_years, u0, ug, um, us, v, vacuum_impedance, vacuum_permeability, vacuum_permittivity, volt, volts, von_klitzing_constant, watt, watts, wb, weber, webers, yard, yards, yd, year, years + +__all__ = ['percent', 'percents', 'permille', 'rad', 'radian', 'radians', 'deg', 'degree', 'degrees', 'sr', 'steradian', 'steradians', 'mil', 'angular_mil', 'angular_mils', 'm', 'meter', 'meters', 'kg', 'kilogram', 'kilograms', 's', 'second', 'seconds', 'A', 'ampere', 'amperes', 'K', 'kelvin', 'kelvins', 'mol', 'mole', 'moles', 'cd', 'candela', 'candelas', 'g', 'gram', 'grams', 'mg', 'milligram', 'milligrams', 'ug', 'microgram', 'micrograms', 't', 'tonne', 'metric_ton', 'newton', 'newtons', 'N', 'joule', 'joules', 'J', 'watt', 'watts', 'W', 'pascal', 'pascals', 'Pa', 'pa', 'hertz', 'hz', 'Hz', 'coulomb', 'coulombs', 'C', 'volt', 'volts', 'v', 'V', 'ohm', 'ohms', 'siemens', 'S', 'mho', 'mhos', 'farad', 'farads', 'F', 'henry', 'henrys', 'H', 'tesla', 'teslas', 'T', 'weber', 'webers', 'Wb', 'wb', 'optical_power', 'dioptre', 'D', 'lux', 'lx', 'katal', 'kat', 'gray', 'Gy', 'becquerel', 'Bq', 'km', 'kilometer', 'kilometers', 'dm', 'decimeter', 'decimeters', 'cm', 'centimeter', 'centimeters', 'mm', 'millimeter', 'millimeters', 'um', 'micrometer', 'micrometers', 'micron', 'microns', 'nm', 'nanometer', 'nanometers', 'pm', 'picometer', 'picometers', 'ft', 'foot', 'feet', 'inch', 'inches', 'yd', 'yard', 'yards', 'mi', 'mile', 'miles', 'nmi', 'nautical_mile', 'nautical_miles', 'ha', 'hectare', 'l', 'L', 'liter', 'liters', 'dl', 'dL', 'deciliter', 'deciliters', 'cl', 'cL', 'centiliter', 'centiliters', 'ml', 'mL', 'milliliter', 'milliliters', 'ms', 'millisecond', 'milliseconds', 'us', 'microsecond', 'microseconds', 'ns', 'nanosecond', 'nanoseconds', 'ps', 'picosecond', 'picoseconds', 'minute', 'minutes', 'h', 'hour', 'hours', 'day', 'days', 'anomalistic_year', 'anomalistic_years', 'sidereal_year', 'sidereal_years', 'tropical_year', 'tropical_years', 'common_year', 'common_years', 'julian_year', 'julian_years', 'draconic_year', 'draconic_years', 'gaussian_year', 'gaussian_years', 'full_moon_cycle', 'full_moon_cycles', 'year', 'years', 'G', 'gravitational_constant', 'c', 'speed_of_light', 'elementary_charge', 'hbar', 'planck', 'eV', 'electronvolt', 'electronvolts', 'avogadro_number', 'avogadro', 'avogadro_constant', 'boltzmann', 'boltzmann_constant', 'stefan', 'stefan_boltzmann_constant', 'R', 'molar_gas_constant', 'faraday_constant', 'josephson_constant', 'von_klitzing_constant', 'Da', 'dalton', 'amu', 'amus', 'atomic_mass_unit', 'atomic_mass_constant', 'me', 'electron_rest_mass', 'gee', 'gees', 'acceleration_due_to_gravity', 'u0', 'magnetic_constant', 'vacuum_permeability', 'e0', 'electric_constant', 'vacuum_permittivity', 'Z0', 'vacuum_impedance', 'coulomb_constant', 'coulombs_constant', 'electric_force_constant', 'atmosphere', 'atmospheres', 'atm', 'kPa', 'kilopascal', 'bar', 'bars', 'pound', 'pounds', 'psi', 'dHg0', 'mmHg', 'torr', 'mmu', 'mmus', 'milli_mass_unit', 'quart', 'quarts', 'angstrom', 'angstroms', 'ly', 'lightyear', 'lightyears', 'au', 'astronomical_unit', 'astronomical_units', 'planck_mass', 'planck_time', 'planck_temperature', 'planck_length', 'planck_charge', 'planck_area', 'planck_volume', 'planck_momentum', 'planck_energy', 'planck_force', 'planck_power', 'planck_density', 'planck_energy_density', 'planck_intensity', 'planck_angular_frequency', 'planck_pressure', 'planck_current', 'planck_voltage', 'planck_impedance', 'planck_acceleration', 'bit', 'bits', 'byte', 'kibibyte', 'kibibytes', 'mebibyte', 'mebibytes', 'gibibyte', 'gibibytes', 'tebibyte', 'tebibytes', 'pebibyte', 'pebibytes', 'exbibyte', 'exbibytes', 'curie', 'rutherford'] diff --git a/stubs/sympy-stubs/physics/units/dimensions.pyi b/stubs/sympy-stubs/physics/units/dimensions.pyi new file mode 100644 index 00000000..a8aca62c --- /dev/null +++ b/stubs/sympy-stubs/physics/units/dimensions.pyi @@ -0,0 +1,144 @@ +from typing import Any, LiteralString, Self +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.matrices import Matrix + +class _QuantityMapper: + _quantity_scale_factors_global: dict[Expr, Expr] = ... + _quantity_dimensional_equivalence_map_global: dict[Expr, Expr] = ... + _quantity_dimension_global: dict[Expr, Expr] = ... + def __init__(self, *args, **kwargs) -> None: + ... + + def set_quantity_dimension(self, quantity, dimension) -> None: + ... + + def set_quantity_scale_factor(self, quantity, scale_factor) -> None: + ... + + def get_quantity_dimension(self, unit) -> Expr | Dimension: + ... + + def get_quantity_scale_factor(self, unit): + ... + + + +class Dimension(Expr): + _op_priority = ... + _dimensional_dependencies = ... + is_commutative = ... + is_number = ... + is_positive = ... + is_real = ... + def __new__(cls, name, symbol=...) -> Self: + ... + + @property + def name(self): + ... + + @property + def symbol(self): + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> LiteralString: + ... + + def __neg__(self) -> Self: + ... + + def __add__(self, other) -> Self: + ... + + def __radd__(self, other) -> Self: + ... + + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + def __pow__(self, other) -> Dimension: + ... + + def __mul__(self, other) -> Dimension | Self: + ... + + def __rmul__(self, other) -> Dimension | Self: + ... + + def __truediv__(self, other) -> Dimension | Self: + ... + + def __rtruediv__(self, other): + ... + + def has_integer_powers(self, dim_sys) -> bool: + ... + + + +class DimensionSystem(Basic, _QuantityMapper): + def __new__(cls, base_dims, derived_dims=..., dimensional_dependencies=...) -> Self: + ... + + @property + def base_dims(self) -> Basic: + ... + + @property + def derived_dims(self) -> Basic: + ... + + @property + def dimensional_dependencies(self) -> Basic: + ... + + def get_dimensional_dependencies(self, name, mark_dimensionless=...) -> dict[Dimension, int] | dict[Any, int | Any]: + ... + + def equivalent_dims(self, dim1, dim2) -> bool: + ... + + def extend(self, new_base_dims, new_derived_dims=..., new_dim_deps=...) -> DimensionSystem: + ... + + def is_dimensionless(self, dimension) -> bool: + ... + + @property + def list_can_dims(self) -> tuple[Any, ...]: + ... + + @property + def inv_can_transf_matrix(self): + ... + + @property + def can_transf_matrix(self): + ... + + def dim_can_vector(self, dim) -> Matrix: + ... + + def dim_vector(self, dim): + ... + + def print_dim_base(self, dim): + ... + + @property + def dim(self) -> int: + ... + + @property + def is_consistent(self): + ... + + + diff --git a/stubs/sympy-stubs/physics/units/prefixes.pyi b/stubs/sympy-stubs/physics/units/prefixes.pyi new file mode 100644 index 00000000..d898fda7 --- /dev/null +++ b/stubs/sympy-stubs/physics/units/prefixes.pyi @@ -0,0 +1,73 @@ +from typing import Any, Literal, Self +from sympy.core.expr import Expr + +class Prefix(Expr): + _op_priority = ... + is_commutative = ... + def __new__(cls, name, abbrev, exponent, base=..., latex_repr=...) -> Self: + ... + + @property + def name(self): + ... + + @property + def abbrev(self): + ... + + @property + def scale_factor(self): + ... + + @property + def base(self): + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + def __mul__(self, other) -> Prefix | Literal[1]: + ... + + def __truediv__(self, other) -> Prefix | Literal[1]: + ... + + def __rtruediv__(self, other) -> Prefix: + ... + + + +def prefix_unit(unit, prefixes) -> list[Any]: + ... + +yotta = ... +zetta = ... +exa = ... +peta = ... +tera = ... +giga = ... +mega = ... +kilo = ... +hecto = ... +deca = ... +deci = ... +centi = ... +milli = ... +micro = ... +nano = ... +pico = ... +femto = ... +atto = ... +zepto = ... +yocto = ... +PREFIXES = ... +kibi = ... +mebi = ... +gibi = ... +tebi = ... +pebi = ... +exbi = ... +BIN_PREFIXES = ... diff --git a/stubs/sympy-stubs/physics/units/quantities.pyi b/stubs/sympy-stubs/physics/units/quantities.pyi new file mode 100644 index 00000000..93c14370 --- /dev/null +++ b/stubs/sympy-stubs/physics/units/quantities.pyi @@ -0,0 +1,54 @@ +from typing import Any, Self +from sympy.core.add import Add +from sympy.core.expr import AtomicExpr, Expr +from sympy.physics.units.dimensions import Dimension + +class Quantity(AtomicExpr): + is_commutative = ... + is_real = ... + is_number = ... + is_nonzero = ... + is_physical_constant = ... + _diff_wrt = ... + def __new__(cls, name, abbrev=..., latex_repr=..., pretty_unicode_repr=..., pretty_ascii_repr=..., mathml_presentation_repr=..., is_prefixed=..., **assumptions) -> Self: + ... + + def set_global_dimension(self, dimension) -> None: + ... + + def set_global_relative_scale_factor(self, scale_factor, reference_quantity) -> None: + ... + + @property + def name(self): + ... + + @property + def dimension(self) -> Expr | Dimension: + ... + + @property + def abbrev(self): + ... + + @property + def scale_factor(self): + ... + + def convert_to(self, other, unit_system=...) -> Add | Quantity: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + @property + def is_prefixed(self) -> bool: + ... + + + +class PhysicalConstant(Quantity): + is_physical_constant = ... + + diff --git a/stubs/sympy-stubs/physics/units/unitsystem.pyi b/stubs/sympy-stubs/physics/units/unitsystem.pyi new file mode 100644 index 00000000..39a33618 --- /dev/null +++ b/stubs/sympy-stubs/physics/units/unitsystem.pyi @@ -0,0 +1,59 @@ +from typing import Dict as tDict, Set as tSet +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.physics.units.dimensions import _QuantityMapper +from sympy.physics.units.quantities import Quantity +from sympy.physics.units.dimensions import Dimension +from sympy.series.order import Order + +class UnitSystem(_QuantityMapper): + _unit_systems: tDict[str, UnitSystem] = ... + def __init__(self, base_units, units=..., name=..., descr=..., dimension_system=..., derived_units: tDict[Dimension, Quantity] = ...) -> None: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + def extend(self, base, units=..., name=..., description=..., dimension_system=..., derived_units: tDict[Dimension, Quantity] = ...) -> UnitSystem: + ... + + def get_dimension_system(self) -> None: + ... + + def get_quantity_dimension(self, unit) -> Expr | Dimension: + ... + + def get_quantity_scale_factor(self, unit): + ... + + @staticmethod + def get_unit_system(unit_system) -> UnitSystem: + ... + + @staticmethod + def get_default_unit_system() -> UnitSystem: + ... + + @property + def dim(self) -> int: + ... + + @property + def is_consistent(self): + ... + + @property + def derived_units(self) -> tDict[Dimension, Quantity]: + ... + + def get_dimensional_expr(self, expr) -> Order | type[UndefinedFunction]: + ... + + def get_units_non_prefixed(self) -> tSet[Quantity]: + ... + + + diff --git a/stubs/sympy-stubs/physics/units/util.pyi b/stubs/sympy-stubs/physics/units/util.pyi new file mode 100644 index 00000000..749b0f89 --- /dev/null +++ b/stubs/sympy-stubs/physics/units/util.pyi @@ -0,0 +1,12 @@ +from sympy.core.add import Add +from sympy.physics.units.quantities import Quantity + +def convert_to(expr, target_units, unit_system=...) -> Add | Quantity: + ... + +def quantity_simplify(expr, across_dimensions: bool = ..., unit_system=...) -> Add | Quantity: + ... + +def check_dimensions(expr, unit_system=...): + ... + diff --git a/stubs/sympy-stubs/plotting/__init__.pyi b/stubs/sympy-stubs/plotting/__init__.pyi new file mode 100644 index 00000000..ad65ca51 --- /dev/null +++ b/stubs/sympy-stubs/plotting/__init__.pyi @@ -0,0 +1,7 @@ +from sympy.plotting.plot import plot, plot3d, plot3d_parametric_line, plot3d_parametric_surface, plot_backends, plot_contour, plot_parametric +from sympy.plotting import PlotGrid +from sympy.plotting.plot_implicit import plot_implicit +from sympy.plotting.textplot import textplot +from sympy.plotting.pygletplot import PygletPlot + +__all__ = ['plot_backends', 'plot_implicit', 'textplot', 'PygletPlot', 'PlotGrid', 'plot', 'plot_parametric', 'plot3d', 'plot3d_parametric_surface', 'plot3d_parametric_line', 'plot_contour'] diff --git a/stubs/sympy-stubs/plotting/intervalmath/__init__.pyi b/stubs/sympy-stubs/plotting/intervalmath/__init__.pyi new file mode 100644 index 00000000..18b65cee --- /dev/null +++ b/stubs/sympy-stubs/plotting/intervalmath/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.plotting.intervalmath.interval_arithmetic import interval +from sympy.plotting.intervalmath.lib_interval import Abs, And, Or, acos, acosh, asin, asinh, atan, atanh, ceil, cos, cosh, exp, floor, imax, imin, log, log10, sin, sinh, sqrt, tan, tanh + +__all__ = ['interval', 'Abs', 'exp', 'log', 'log10', 'sin', 'cos', 'tan', 'sqrt', 'imin', 'imax', 'sinh', 'cosh', 'tanh', 'acosh', 'asinh', 'atanh', 'asin', 'acos', 'atan', 'ceil', 'floor', 'And', 'Or'] diff --git a/stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi b/stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi new file mode 100644 index 00000000..619fbd60 --- /dev/null +++ b/stubs/sympy-stubs/plotting/intervalmath/interval_arithmetic.pyi @@ -0,0 +1,76 @@ +from types import NotImplementedType +from typing import Self + +class interval: + def __init__(self, *args, is_valid=..., **kwargs) -> None: + ... + + @property + def mid(self) -> float: + ... + + @property + def width(self) -> float: + ... + + def __repr__(self) -> str: + ... + + def __str__(self) -> str: + ... + + def __lt__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __add__(self, other) -> interval | NotImplementedType: + ... + + __radd__ = ... + def __sub__(self, other) -> interval | NotImplementedType: + ... + + def __rsub__(self, other) -> interval | NotImplementedType: + ... + + def __neg__(self) -> interval: + ... + + def __mul__(self, other) -> interval | NotImplementedType: + ... + + __rmul__ = ... + def __contains__(self, other) -> bool: + ... + + def __rtruediv__(self, other) -> interval | NotImplementedType: + ... + + def __truediv__(self, other) -> interval | NotImplementedType: + ... + + def __pow__(self, other) -> Self | interval | NotImplementedType: + ... + + def __rpow__(self, other) -> Self | interval | NotImplementedType: + ... + + def __hash__(self) -> int: + ... + + + diff --git a/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi b/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi new file mode 100644 index 00000000..07c72603 --- /dev/null +++ b/stubs/sympy-stubs/plotting/intervalmath/interval_membership.pyi @@ -0,0 +1,38 @@ +from typing import Any, Iterator, Literal +class intervalMembership: + def __init__(self, a, b) -> None: + ... + + def __getitem__(self, i) -> Any: + ... + + def __len__(self) -> Literal[2]: + ... + + def __iter__(self) -> Iterator[Any]: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __and__(self, other) -> intervalMembership: + ... + + def __or__(self, other) -> intervalMembership: + ... + + def __invert__(self) -> intervalMembership: + ... + + def __xor__(self, other) -> intervalMembership: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + + diff --git a/stubs/sympy-stubs/plotting/intervalmath/lib_interval.pyi b/stubs/sympy-stubs/plotting/intervalmath/lib_interval.pyi new file mode 100644 index 00000000..dc3c7d35 --- /dev/null +++ b/stubs/sympy-stubs/plotting/intervalmath/lib_interval.pyi @@ -0,0 +1,72 @@ +from types import NotImplementedType +from sympy.plotting.intervalmath.interval_arithmetic import interval + +def Abs(x) -> interval: + ... + +def exp(x) -> interval: + ... + +def log(x) -> interval: + ... + +def log10(x) -> interval: + ... + +def atan(x) -> interval: + ... + +def sin(x) -> interval: + ... + +def cos(x) -> interval: + ... + +def tan(x) -> interval | NotImplementedType: + ... + +def sqrt(x) -> interval: + ... + +def imin(*args) -> type[NotImplementedError] | interval: + ... + +def imax(*args) -> type[NotImplementedError] | interval: + ... + +def sinh(x) -> interval: + ... + +def cosh(x) -> interval: + ... + +def tanh(x) -> interval: + ... + +def asin(x) -> interval | None: + ... + +def acos(x) -> interval | None: + ... + +def ceil(x) -> interval | type[NotImplementedError]: + ... + +def floor(x) -> interval | type[NotImplementedError]: + ... + +def acosh(x) -> interval | type[NotImplementedError]: + ... + +def asinh(x) -> interval | type[NotImplementedError]: + ... + +def atanh(x) -> interval | type[NotImplementedError]: + ... + +def And(*args) -> tuple[bool | None, bool | None]: + ... + +def Or(*args) -> tuple[bool | None, bool | None]: + ... + diff --git a/stubs/sympy-stubs/plotting/plot.pyi b/stubs/sympy-stubs/plotting/plot.pyi new file mode 100644 index 00000000..3ed07340 --- /dev/null +++ b/stubs/sympy-stubs/plotting/plot.pyi @@ -0,0 +1,291 @@ +from types import NotImplementedType +from typing import Any, Tuple + +_show = ... +def unset_show() -> None: + ... + +class Plot: + def __init__(self, *args, title=..., xlabel=..., ylabel=..., zlabel=..., aspect_ratio=..., xlim=..., ylim=..., axis_center=..., axis=..., xscale=..., yscale=..., legend=..., autoscale=..., margin=..., annotations=..., markers=..., rectangles=..., fill=..., backend=..., size=..., **kwargs) -> None: + ... + + def show(self) -> None: + ... + + def save(self, path) -> None: + ... + + def __str__(self) -> str: + ... + + def __getitem__(self, index): + ... + + def __setitem__(self, index, *args) -> None: + ... + + def __delitem__(self, index) -> None: + ... + + def append(self, arg) -> None: + ... + + def extend(self, arg) -> None: + ... + + + +class PlotGrid: + def __init__(self, nrows, ncolumns, *args, show=..., size=..., **kwargs) -> None: + ... + + def show(self) -> None: + ... + + def save(self, path) -> None: + ... + + def __str__(self) -> str: + ... + + + +class BaseSeries: + is_2Dline = ... + is_3Dline = ... + is_3Dsurface = ... + is_contour = ... + is_implicit = ... + is_parametric = ... + def __init__(self) -> None: + ... + + @property + def is_3D(self) -> bool: + ... + + @property + def is_line(self) -> bool: + ... + + + +class Line2DBaseSeries(BaseSeries): + is_2Dline = ... + _dim = ... + def __init__(self) -> None: + ... + + def get_data(self) -> tuple[Any, Any] | tuple[Any, Any, Any]: + ... + + def get_segments(self): + ... + + def get_color_array(self): + ... + + + +class List2DSeries(Line2DBaseSeries): + def __init__(self, list_x, list_y) -> None: + ... + + def __str__(self) -> str: + ... + + def get_points(self) -> tuple[Any, Any]: + ... + + + +class LineOver1DRangeSeries(Line2DBaseSeries): + def __init__(self, expr, var_start_end, **kwargs) -> None: + ... + + def __str__(self) -> str: + ... + + def get_points(self) -> tuple[Any, Any] | tuple[list[Any], list[Any]]: + ... + + + +class Parametric2DLineSeries(Line2DBaseSeries): + is_parametric = ... + def __init__(self, expr_x, expr_y, var_start_end, **kwargs) -> None: + ... + + def __str__(self) -> str: + ... + + def get_parameter_points(self): + ... + + def get_points(self) -> tuple[Any, Any] | tuple[list[Any], list[Any]]: + ... + + + +class Line3DBaseSeries(Line2DBaseSeries): + is_2Dline = ... + is_3Dline = ... + _dim = ... + def __init__(self) -> None: + ... + + + +class Parametric3DLineSeries(Line3DBaseSeries): + is_parametric = ... + def __init__(self, expr_x, expr_y, expr_z, var_start_end, **kwargs) -> None: + ... + + def __str__(self) -> str: + ... + + def get_parameter_points(self): + ... + + def get_points(self) -> tuple[Any, Any, Any]: + ... + + + +class SurfaceBaseSeries(BaseSeries): + is_3Dsurface = ... + def __init__(self) -> None: + ... + + def get_color_array(self): + ... + + + +class SurfaceOver2DRangeSeries(SurfaceBaseSeries): + def __init__(self, expr, var_start_end_x, var_start_end_y, **kwargs) -> None: + ... + + def __str__(self) -> str: + ... + + def get_meshes(self) -> tuple[Any, Any, Any]: + ... + + + +class ParametricSurfaceSeries(SurfaceBaseSeries): + is_parametric = ... + def __init__(self, expr_x, expr_y, expr_z, var_start_end_u, var_start_end_v, **kwargs) -> None: + ... + + def __str__(self) -> str: + ... + + def get_parameter_meshes(self): + ... + + def get_meshes(self) -> tuple[Any, Any, Any]: + ... + + + +class ContourSeries(BaseSeries): + is_contour = ... + def __init__(self, expr, var_start_end_x, var_start_end_y) -> None: + ... + + def __str__(self) -> str: + ... + + def get_meshes(self) -> tuple[Any, Any, Any]: + ... + + + +class BaseBackend: + def __init__(self, parent) -> None: + ... + + def show(self): + ... + + def save(self, path): + ... + + def close(self): + ... + + + +class MatplotlibBackend(BaseBackend): + def __init__(self, parent) -> None: + ... + + @staticmethod + def get_segments(x, y, z=...): + ... + + def process_series(self) -> None: + ... + + def show(self) -> None: + ... + + def save(self, path) -> None: + ... + + def close(self) -> None: + ... + + + +class TextBackend(BaseBackend): + def __init__(self, parent) -> None: + ... + + def show(self) -> None: + ... + + def close(self) -> None: + ... + + + +class DefaultBackend(BaseBackend): + def __new__(cls, parent) -> MatplotlibBackend | TextBackend: + ... + + + +plot_backends = ... +def centers_of_segments(array): + ... + +def centers_of_faces(array): + ... + +def flat(x, y, z, eps=...): + ... + +def plot(*args, show=..., **kwargs) -> Plot: + ... + +def plot_parametric(*args, show=..., **kwargs) -> Plot: + ... + +def plot3d_parametric_line(*args, show=..., **kwargs) -> Plot: + ... + +def plot3d(*args, show=..., **kwargs) -> Plot: + ... + +def plot3d_parametric_surface(*args, show=..., **kwargs) -> Plot: + ... + +def plot_contour(*args, show=..., **kwargs) -> Plot: + ... + +def check_arguments(args, expr_len, nb_of_free_symbols) -> list[Any] | list[Tuple | NotImplementedType] | None: + ... + diff --git a/stubs/sympy-stubs/plotting/plot_implicit.pyi b/stubs/sympy-stubs/plotting/plot_implicit.pyi new file mode 100644 index 00000000..7f1ca998 --- /dev/null +++ b/stubs/sympy-stubs/plotting/plot_implicit.pyi @@ -0,0 +1,21 @@ +from typing import Any, Literal +from sympy.plotting.plot import BaseSeries, Plot +from sympy.utilities.decorator import doctest_depends_on + +class ImplicitSeries(BaseSeries): + is_implicit = ... + def __init__(self, expr, var_start_end_x, var_start_end_y, has_equality, use_interval_math, depth, nb_of_points, line_color) -> None: + ... + + def __str__(self) -> str: + ... + + def get_raster(self) -> tuple[list[Any], Literal['fill']] | tuple[Any, Any, Any, Literal['contour']] | tuple[Any, Any, Any, Literal['contourf']]: + ... + + + +@doctest_depends_on(modules=('matplotlib', )) +def plot_implicit(expr, x_var=..., y_var=..., adaptive=..., depth=..., points=..., line_color=..., show=..., **kwargs) -> Plot: + ... + diff --git a/stubs/sympy-stubs/plotting/pygletplot/__init__.pyi b/stubs/sympy-stubs/plotting/pygletplot/__init__.pyi new file mode 100644 index 00000000..9232403c --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/__init__.pyi @@ -0,0 +1,7 @@ +from sympy.utilities.decorator import doctest_depends_on +from sympy.plotting.pygletplot.plot import PygletPlot as Plot + +@doctest_depends_on(modules=('pyglet', )) +def PygletPlot(*args, **kwargs) -> PygletPlot: + ... + diff --git a/stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi b/stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi new file mode 100644 index 00000000..42b7e599 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/color_scheme.pyi @@ -0,0 +1,37 @@ +from typing import Any +class ColorGradient: + colors = ... + intervals = ... + def __init__(self, *args) -> None: + ... + + def copy(self) -> ColorGradient: + ... + + def __call__(self, r, g, b) -> tuple[Any, Any, Any]: + ... + + + +default_color_schemes = ... +class ColorScheme: + def __init__(self, *args, **kwargs) -> None: + ... + + def __call__(self, x, y, z, u, v) -> None: + ... + + def apply_to_curve(self, verts, u_set, set_len=..., inc_pos=...) -> list[Any]: + ... + + def apply_to_surface(self, verts, u_set, v_set, set_len=..., inc_pos=...) -> list[Any]: + ... + + def str_base(self) -> str: + ... + + def __repr__(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/managed_window.pyi b/stubs/sympy-stubs/plotting/pygletplot/managed_window.pyi new file mode 100644 index 00000000..4f6b5d25 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/managed_window.pyi @@ -0,0 +1,26 @@ +gl_lock = ... +class ManagedWindow(): + fps_limit = ... + default_win_args = ... + def __init__(self, **win_args) -> None: + ... + + def __event_loop__(self, **win_args) -> None: + ... + + def close(self) -> None: + ... + + def setup(self) -> None: + ... + + def update(self, dt) -> None: + ... + + def draw(self) -> None: + ... + + + +if __name__ == '__main__': + ... diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot.pyi new file mode 100644 index 00000000..813e7144 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot.pyi @@ -0,0 +1,67 @@ +from sympy.utilities.decorator import doctest_depends_on + +@doctest_depends_on(modules=('pyglet', )) +class PygletPlot: + @doctest_depends_on(modules=('pyglet', )) + def __init__(self, *fargs, **win_args) -> None: + ... + + def show(self) -> None: + ... + + def close(self) -> None: + ... + + def saveimage(self, outfile=..., format=..., size=...) -> None: + ... + + def clear(self) -> None: + ... + + def __getitem__(self, i): + ... + + def __setitem__(self, i, args) -> None: + ... + + def __delitem__(self, i) -> None: + ... + + def firstavailableindex(self) -> int: + ... + + def append(self, *args) -> None: + ... + + def __len__(self) -> int: + ... + + def __iter__(self): + ... + + def __repr__(self) -> str: + ... + + def __str__(self) -> str: + ... + + def adjust_all_bounds(self) -> None: + ... + + def wait_for_calculations(self) -> None: + ... + + + +class ScreenShot: + def __init__(self, plot) -> None: + ... + + def __bool__(self) -> bool: + ... + + def save(self, outfile=..., format=..., size=...) -> None: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_axes.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_axes.pyi new file mode 100644 index 00000000..dfd8db01 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_axes.pyi @@ -0,0 +1,80 @@ +from sympy.plotting.pygletplot.plot_object import PlotObject + +class PlotAxes(PlotObject): + def __init__(self, *args, style=..., none=..., frame=..., box=..., ordinate=..., stride=..., visible=..., overlay=..., colored=..., label_axes=..., label_ticks=..., tick_length=..., font_face=..., font_size=..., **kwargs) -> None: + ... + + def reset_resources(self) -> None: + ... + + def reset_bounding_box(self) -> None: + ... + + def draw(self) -> None: + ... + + def adjust_bounds(self, child_bounds) -> None: + ... + + def toggle_visible(self) -> None: + ... + + def toggle_colors(self) -> None: + ... + + + +class PlotAxesBase(PlotObject): + def __init__(self, parent_axes) -> None: + ... + + def draw(self) -> None: + ... + + def draw_background(self, color) -> None: + ... + + def draw_axis(self, axis, color): + ... + + def draw_text(self, text, position, color, scale=...) -> None: + ... + + def draw_line(self, v, color) -> None: + ... + + + +class PlotAxesOrdinate(PlotAxesBase): + def __init__(self, parent_axes) -> None: + ... + + def draw_axis(self, axis, color) -> None: + ... + + def draw_axis_line(self, axis, color, a_min, a_max, labels_visible) -> None: + ... + + def draw_axis_line_labels(self, axis, color, axis_line) -> None: + ... + + def draw_tick_line(self, axis, color, radius, tick, labels_visible) -> None: + ... + + def draw_tick_line_label(self, axis, color, radius, tick) -> None: + ... + + + +class PlotAxesFrame(PlotAxesBase): + def __init__(self, parent_axes) -> None: + ... + + def draw_background(self, color) -> None: + ... + + def draw_axis(self, axis, color): + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_camera.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_camera.pyi new file mode 100644 index 00000000..00c5d4b4 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_camera.pyi @@ -0,0 +1,43 @@ +class PlotCamera: + min_dist = ... + max_dist = ... + min_ortho_dist = ... + max_ortho_dist = ... + _default_dist = ... + _default_ortho_dist = ... + rot_presets = ... + def __init__(self, window, ortho=...) -> None: + ... + + def init_rot_matrix(self) -> None: + ... + + def set_rot_preset(self, preset_name) -> None: + ... + + def reset(self) -> None: + ... + + def mult_rot_matrix(self, rot) -> None: + ... + + def setup_projection(self) -> None: + ... + + def apply_transformation(self) -> None: + ... + + def spherical_rotate(self, p1, p2, sensitivity=...) -> None: + ... + + def euler_rotate(self, angle, x, y, z) -> None: + ... + + def zoom_relative(self, clicks, sensitivity) -> None: + ... + + def mouse_translate(self, x, y, dx, dy) -> None: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_controller.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_controller.pyi new file mode 100644 index 00000000..7b4ecbce --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_controller.pyi @@ -0,0 +1,35 @@ +class PlotController: + normal_mouse_sensitivity = ... + modified_mouse_sensitivity = ... + normal_key_sensitivity = ... + modified_key_sensitivity = ... + keymap = ... + def __init__(self, window, *, invert_mouse_zoom=..., **kwargs) -> None: + ... + + def update(self, dt): + ... + + def get_mouse_sensitivity(self) -> float: + ... + + def get_key_sensitivity(self) -> float: + ... + + def on_key_press(self, symbol, modifiers) -> None: + ... + + def on_key_release(self, symbol, modifiers) -> None: + ... + + def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers) -> None: + ... + + def on_mouse_scroll(self, x, y, dx, dy) -> None: + ... + + def is_2D(self) -> bool: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_curve.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_curve.pyi new file mode 100644 index 00000000..38b27a97 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_curve.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable +from sympy.plotting.pygletplot.plot_mode_base import PlotModeBase + +class PlotCurve(PlotModeBase): + style_override = ... + def calculate_one_cvert(self, t) -> Any: + ... + + def draw_verts(self, use_cverts) -> Callable[[], None]: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi new file mode 100644 index 00000000..4f9204d6 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_interval.pyi @@ -0,0 +1,74 @@ +from typing import Any, Callable, Generator +from sympy.core.numbers import Integer +from sympy.core.symbol import Symbol +class PlotInterval: + @staticmethod + def require_all_args(f) -> Callable[..., Any]: + ... + + def __init__(self, *args) -> None: + ... + + def get_v(self) -> Symbol | None: + ... + + def set_v(self, v) -> None: + ... + + def get_v_min(self) -> None: + ... + + def set_v_min(self, v_min) -> None: + ... + + def get_v_max(self) -> None: + ... + + def set_v_max(self, v_max) -> None: + ... + + def get_v_steps(self) -> Integer | None: + ... + + def set_v_steps(self, v_steps) -> None: + ... + + @require_all_args + def get_v_len(self) -> Any: + ... + + v = ... + v_min = ... + v_max = ... + v_steps = ... + v_len = ... + def fill_from(self, b) -> None: + ... + + @staticmethod + def try_parse(*args) -> PlotInterval | None: + ... + + def __repr__(self) -> str: + ... + + def __str__(self) -> str: + ... + + @require_all_args + def assert_complete(self) -> None: + ... + + @require_all_args + def vrange(self) -> Generator[Any, Any, None]: + ... + + @require_all_args + def vrange2(self) -> Generator[tuple[Any, Any], Any, None]: + ... + + def frange(self) -> Generator[float, Any, None]: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_mode.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_mode.pyi new file mode 100644 index 00000000..4afc92d7 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_mode.pyi @@ -0,0 +1,21 @@ +from sympy.plotting.pygletplot.plot_object import PlotObject + +class PlotMode(PlotObject): + intervals = ... + aliases = ... + is_default = ... + def draw(self): + ... + + _mode_alias_list = ... + _mode_map = ... + _mode_default_map = ... + def __new__(cls, *args, **kwargs) -> PlotMode: + ... + + _was_initialized = ... + + +def var_count_error(is_independent, is_plotting) -> str: + ... + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi new file mode 100644 index 00000000..4d79f0fc --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_mode_base.pyi @@ -0,0 +1,47 @@ +from typing import Any, Callable +from sympy.plotting.pygletplot.plot_mode import PlotMode + +class PlotModeBase(PlotMode): + intervals = ... + aliases = ... + is_default = ... + styles = ... + style_override = ... + default_wireframe_color = ... + default_solid_color = ... + default_rot_preset = ... + def __init__(self, *args, bounds_callback=..., **kwargs) -> None: + ... + + @staticmethod + def synchronized(f) -> Callable[..., Any]: + ... + + @synchronized + def push_wireframe(self, function) -> None: + ... + + @synchronized + def push_solid(self, function) -> None: + ... + + @synchronized + def draw(self) -> None: + ... + + style = ... + color = ... + calculating_verts = ... + calculating_verts_pos = ... + calculating_verts_len = ... + calculating_cverts = ... + calculating_cverts_pos = ... + calculating_cverts_len = ... + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_modes.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_modes.pyi new file mode 100644 index 00000000..7b8a7b8e --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_modes.pyi @@ -0,0 +1,55 @@ +from typing import Callable +from sympy.plotting.pygletplot.plot_curve import PlotCurve +from sympy.plotting.pygletplot.plot_surface import PlotSurface + +def float_vec3(f) -> Callable[..., tuple[float, float, float]]: + ... + +class Cartesian2D(PlotCurve): + intervals = ... + aliases = ... + is_default = ... + + +class Cartesian3D(PlotSurface): + intervals = ... + aliases = ... + is_default = ... + + +class ParametricCurve2D(PlotCurve): + intervals = ... + aliases = ... + is_default = ... + + +class ParametricCurve3D(PlotCurve): + intervals = ... + aliases = ... + is_default = ... + + +class ParametricSurface(PlotSurface): + intervals = ... + aliases = ... + is_default = ... + + +class Polar(PlotCurve): + intervals = ... + aliases = ... + is_default = ... + + +class Cylindrical(PlotSurface): + intervals = ... + aliases = ... + is_default = ... + + +class Spherical(PlotSurface): + intervals = ... + aliases = ... + is_default = ... + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_object.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_object.pyi new file mode 100644 index 00000000..7dd56820 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_object.pyi @@ -0,0 +1,7 @@ +class PlotObject: + visible = ... + def draw(self) -> None: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_rotation.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_rotation.pyi new file mode 100644 index 00000000..7300c536 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_rotation.pyi @@ -0,0 +1,21 @@ +from ctypes import Array, c_float +from typing import Any +def cross(a, b) -> tuple[Any, Any, Any]: + ... + +def dot(a, b): + ... + +def mag(a) -> float: + ... + +def norm(a) -> tuple[Any, Any, Any]: + ... + +def get_sphere_mapping(x, y, width, height) -> tuple[Any, Any, float] | tuple[Any, Any, Any]: + ... + +rad2deg = ... +def get_spherical_rotatation(p1, p2, width, height, theta_multiplier) -> Array[c_float] | None: + ... + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_surface.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_surface.pyi new file mode 100644 index 00000000..13fbe93d --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_surface.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable +from sympy.plotting.pygletplot.plot_mode_base import PlotModeBase + +class PlotSurface(PlotModeBase): + default_rot_preset = ... + def calculate_one_cvert(self, u, v) -> Any: + ... + + def draw_verts(self, use_cverts, use_solid_color) -> Callable[[], None]: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/plot_window.pyi b/stubs/sympy-stubs/plotting/pygletplot/plot_window.pyi new file mode 100644 index 00000000..11a3e685 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/plot_window.pyi @@ -0,0 +1,23 @@ +from sympy.plotting.pygletplot.managed_window import ManagedWindow + +class PlotWindow(ManagedWindow): + def __init__(self, plot, antialiasing=..., ortho=..., invert_mouse_zoom=..., linewidth=..., caption=..., **kwargs) -> None: + ... + + def setup(self) -> None: + ... + + def on_resize(self, w, h) -> None: + ... + + def update(self, dt) -> None: + ... + + def draw(self) -> None: + ... + + def update_caption(self, calc_verts_pos, calc_verts_len, calc_cverts_pos, calc_cverts_len) -> None: + ... + + + diff --git a/stubs/sympy-stubs/plotting/pygletplot/util.pyi b/stubs/sympy-stubs/plotting/pygletplot/util.pyi new file mode 100644 index 00000000..f5b0af59 --- /dev/null +++ b/stubs/sympy-stubs/plotting/pygletplot/util.pyi @@ -0,0 +1,68 @@ +from ctypes import Array, c_float, c_int +from typing import Any, Literal +def get_model_matrix(array_type=..., glGetMethod=...) -> Array[c_float]: + ... + +def get_projection_matrix(array_type=..., glGetMethod=...) -> Array[c_float]: + ... + +def get_viewport() -> Array[c_int]: + ... + +def get_direction_vectors() -> tuple[tuple[Any, Any, Any], tuple[Any, Any, Any], tuple[Any, Any, Any]]: + ... + +def get_view_direction_vectors() -> tuple[tuple[Any, Any, Any], tuple[Any, Any, Any], tuple[Any, Any, Any]]: + ... + +def get_basis_vectors() -> tuple[tuple[Literal[1], Literal[0], Literal[0]], tuple[Literal[0], Literal[1], Literal[0]], tuple[Literal[0], Literal[0], Literal[1]]]: + ... + +def screen_to_model(x, y, z) -> tuple[float, float, float]: + ... + +def model_to_screen(x, y, z) -> tuple[float, float, float]: + ... + +def vec_subs(a, b) -> tuple[Any, ...]: + ... + +def billboard_matrix() -> None: + ... + +def create_bounds() -> list[list[Any]]: + ... + +def update_bounds(b, v) -> None: + ... + +def interpolate(a_min, a_max, a_ratio): + ... + +def rinterpolate(a_min, a_max, a_value): + ... + +def interpolate_color(color1, color2, ratio) -> tuple[Any, ...]: + ... + +def scale_value(v, v_min, v_len): + ... + +def scale_value_list(flist) -> list[Any]: + ... + +def strided_range(r_min, r_max, stride, max_steps=...) -> list[Any]: + ... + +def parse_option_string(s) -> dict[Any, Any] | None: + ... + +def dot_product(v1, v2) -> int: + ... + +def vec_sub(v1, v2) -> tuple[Any, ...]: + ... + +def vec_mag(v) -> Any: + ... + diff --git a/stubs/sympy-stubs/plotting/textplot.pyi b/stubs/sympy-stubs/plotting/textplot.pyi new file mode 100644 index 00000000..9ee1d96a --- /dev/null +++ b/stubs/sympy-stubs/plotting/textplot.pyi @@ -0,0 +1,16 @@ +from typing import Any, Generator +def is_valid(x) -> bool: + ... + +def rescale(y, W, H, mi, ma) -> list[Any]: + ... + +def linspace(start, stop, num) -> list[Any]: + ... + +def textplot_str(expr, a, b, W=..., H=...) -> Generator[str, Any, None]: + ... + +def textplot(expr, a, b, W=..., H=...) -> None: + ... + diff --git a/stubs/sympy-stubs/polys/__init__.pyi b/stubs/sympy-stubs/polys/__init__.pyi new file mode 100644 index 00000000..a6585cf3 --- /dev/null +++ b/stubs/sympy-stubs/polys/__init__.pyi @@ -0,0 +1,20 @@ +from sympy.polys.polytools import GroebnerBasis, LC, LM, LT, Poly, PurePoly, cancel, cofactors, compose, content, count_roots, decompose, degree, degree_list, discriminant, div, exquo, factor, factor_list, gcd, gcd_list, gcdex, gff, gff_list, groebner, ground_roots, half_gcdex, intervals, invert, is_zero_dimensional, lcm, lcm_list, monic, nroots, nth_power_roots_poly, parallel_poly_from_expr, pdiv, pexquo, poly, poly_from_expr, pquo, prem, primitive, quo, real_roots, reduced, refine_root, rem, resultant, sqf, sqf_list, sqf_norm, sqf_part, sturm, subresultants, terms_gcd, total_degree, trunc +from sympy.polys.polyfuncs import horner, interpolate, rational_interpolate, symmetrize, viete +from sympy.polys.rationaltools import together +from sympy.polys.polyerrors import BasePolynomialError, CoercionFailed, ComputationFailed, DomainError, EvaluationFailed, ExactQuotientFailed, ExtraneousFactors, FlagError, GeneratorsError, GeneratorsNeeded, HeuristicGCDFailed, HomomorphismFailed, IsomorphismFailed, MultivariatePolynomialError, NotAlgebraic, NotInvertible, NotReversible, OperationNotSupported, OptionError, PolificationFailed, PolynomialDivisionFailed, PolynomialError, RefinementFailed, UnificationFailed, UnivariatePolynomialError +from sympy.polys.numberfields import field_isomorphism, galois_group, isolate, minimal_polynomial, minpoly, prime_decomp, prime_valuation, primitive_element, round_two, to_number_field +from sympy.polys.monomials import Monomial, itermonomials +from sympy.polys.orderings import grevlex, grlex, igrevlex, igrlex, ilex, lex +from sympy.polys.rootoftools import CRootOf, ComplexRootOf, RootOf, RootSum, rootof +from sympy.polys.polyroots import roots +from sympy.polys.domains import AlgebraicField, CC, ComplexField, Domain, EX, EXRAW, ExpressionDomain, FF, FF_gmpy, FF_python, FiniteField, FractionField, GF, GMPYFiniteField, GMPYIntegerRing, GMPYRationalField, IntegerRing, PolynomialRing, PythonFiniteField, PythonIntegerRing, PythonRational, QQ, QQ_I, QQ_gmpy, QQ_python, RR, RationalField, RealField, ZZ, ZZ_I, ZZ_gmpy, ZZ_python +from sympy.polys.constructor import construct_domain +from sympy.polys.specialpolys import cyclotomic_poly, interpolating_poly, random_poly, swinnerton_dyer_poly, symmetric_poly +from sympy.polys.orthopolys import chebyshevt_poly, chebyshevu_poly, hermite_poly, hermite_prob_poly, jacobi_poly, laguerre_poly, legendre_poly +from sympy.polys.appellseqs import andre_poly, bernoulli_c_poly, bernoulli_poly, euler_poly, genocchi_poly +from sympy.polys.partfrac import apart, apart_list, assemble_partfrac_list +from sympy.polys.polyoptions import Options +from sympy.polys.rings import ring, sring, vring, xring +from sympy.polys.fields import field, sfield, vfield, xfield + +__all__ = ['Poly', 'PurePoly', 'poly_from_expr', 'parallel_poly_from_expr', 'degree', 'total_degree', 'degree_list', 'LC', 'LM', 'LT', 'pdiv', 'prem', 'pquo', 'pexquo', 'div', 'rem', 'quo', 'exquo', 'half_gcdex', 'gcdex', 'invert', 'subresultants', 'resultant', 'discriminant', 'cofactors', 'gcd_list', 'gcd', 'lcm_list', 'lcm', 'terms_gcd', 'trunc', 'monic', 'content', 'primitive', 'compose', 'decompose', 'sturm', 'gff_list', 'gff', 'sqf_norm', 'sqf_part', 'sqf_list', 'sqf', 'factor_list', 'factor', 'intervals', 'refine_root', 'count_roots', 'real_roots', 'nroots', 'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced', 'groebner', 'is_zero_dimensional', 'GroebnerBasis', 'poly', 'symmetrize', 'horner', 'interpolate', 'rational_interpolate', 'viete', 'together', 'BasePolynomialError', 'ExactQuotientFailed', 'PolynomialDivisionFailed', 'OperationNotSupported', 'HeuristicGCDFailed', 'HomomorphismFailed', 'IsomorphismFailed', 'ExtraneousFactors', 'EvaluationFailed', 'RefinementFailed', 'CoercionFailed', 'NotInvertible', 'NotReversible', 'NotAlgebraic', 'DomainError', 'PolynomialError', 'UnificationFailed', 'GeneratorsError', 'GeneratorsNeeded', 'ComputationFailed', 'UnivariatePolynomialError', 'MultivariatePolynomialError', 'PolificationFailed', 'OptionError', 'FlagError', 'minpoly', 'minimal_polynomial', 'primitive_element', 'field_isomorphism', 'to_number_field', 'isolate', 'round_two', 'prime_decomp', 'prime_valuation', 'galois_group', 'itermonomials', 'Monomial', 'lex', 'grlex', 'grevlex', 'ilex', 'igrlex', 'igrevlex', 'CRootOf', 'rootof', 'RootOf', 'ComplexRootOf', 'RootSum', 'roots', 'Domain', 'FiniteField', 'IntegerRing', 'RationalField', 'RealField', 'ComplexField', 'PythonFiniteField', 'GMPYFiniteField', 'PythonIntegerRing', 'GMPYIntegerRing', 'PythonRational', 'GMPYRationalField', 'AlgebraicField', 'PolynomialRing', 'FractionField', 'ExpressionDomain', 'FF_python', 'FF_gmpy', 'ZZ_python', 'ZZ_gmpy', 'QQ_python', 'QQ_gmpy', 'GF', 'FF', 'ZZ', 'QQ', 'ZZ_I', 'QQ_I', 'RR', 'CC', 'EX', 'EXRAW', 'construct_domain', 'swinnerton_dyer_poly', 'cyclotomic_poly', 'symmetric_poly', 'random_poly', 'interpolating_poly', 'jacobi_poly', 'chebyshevt_poly', 'chebyshevu_poly', 'hermite_poly', 'hermite_prob_poly', 'legendre_poly', 'laguerre_poly', 'bernoulli_poly', 'bernoulli_c_poly', 'genocchi_poly', 'euler_poly', 'andre_poly', 'apart', 'apart_list', 'assemble_partfrac_list', 'Options', 'ring', 'xring', 'vring', 'sring', 'field', 'xfield', 'vfield', 'sfield'] diff --git a/stubs/sympy-stubs/polys/agca/extensions.pyi b/stubs/sympy-stubs/polys/agca/extensions.pyi new file mode 100644 index 00000000..9dcb4dad --- /dev/null +++ b/stubs/sympy-stubs/polys/agca/extensions.pyi @@ -0,0 +1,132 @@ +from types import NotImplementedType +from typing import Any, Literal, Self +from sympy.polys.domains.domain import Domain +from sympy.polys.domains.domainelement import DomainElement +from sympy.printing.defaults import DefaultPrinting + +class ExtensionElement(DomainElement, DefaultPrinting): # type: ignore + __slots__ = ... + def __init__(self, rep, ext) -> None: + ... + + def parent(self) -> Any: + ... + + def __bool__(self) -> bool: + ... + + def __pos__(self) -> Self: + ... + + def __neg__(self) -> ExtElem: + ... + + def __add__(self, g) -> ExtElem | NotImplementedType: + ... + + __radd__ = ... + def __sub__(self, g) -> ExtElem | NotImplementedType: + ... + + def __rsub__(self, g) -> ExtElem | NotImplementedType: + ... + + def __mul__(self, g) -> ExtElem | NotImplementedType: + ... + + __rmul__ = ... + def inverse(self) -> ExtElem: + ... + + def __truediv__(self, g) -> NotImplementedType | ExtElem: + ... + + __floordiv__ = ... + def __rtruediv__(self, g) -> NotImplementedType: + ... + + __rfloordiv__ = ... + def __mod__(self, g) -> NotImplementedType: + ... + + def __rmod__(self, g) -> NotImplementedType: + ... + + def __pow__(self, n) -> ExtElem: + ... + + def __eq__(self, g) -> bool: + ... + + def __ne__(self, g) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + @property + def is_ground(f): + ... + + def to_ground(self): + ... + + + +ExtElem = ExtensionElement +class MonogenicFiniteExtension(Domain): # type: ignore + is_FiniteExtension = ... + dtype = ExtensionElement + def __init__(self, mod) -> None: + ... + + def new(self, arg) -> ExtElem: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def convert(self, f, base=...) -> ExtElem: + ... + + def convert_from(self, f, base) -> ExtElem: + ... + + def to_sympy(self, f): + ... + + def from_sympy(self, f) -> ExtElem: + ... + + def set_domain(self, K) -> Self: + ... + + def drop(self, *symbols) -> Self: + ... + + def quo(self, f, g) -> ExtElem: + ... + + def exquo(self, f, g) -> ExtElem: + ... + + def is_negative(self, a) -> Literal[False]: + ... + + def is_unit(self, a) -> bool | None: + ... + + + +FiniteExtension = MonogenicFiniteExtension diff --git a/stubs/sympy-stubs/polys/agca/homomorphisms.pyi b/stubs/sympy-stubs/polys/agca/homomorphisms.pyi new file mode 100644 index 00000000..eb2fe686 --- /dev/null +++ b/stubs/sympy-stubs/polys/agca/homomorphisms.pyi @@ -0,0 +1,81 @@ +from types import NotImplementedType +from typing import Self + +class ModuleHomomorphism: + def __init__(self, domain, codomain) -> None: + ... + + def kernel(self): + ... + + def image(self): + ... + + def restrict_domain(self, sm) -> Self: + ... + + def restrict_codomain(self, sm) -> Self: + ... + + def quotient_domain(self, sm) -> Self: + ... + + def quotient_codomain(self, sm) -> Self: + ... + + def __call__(self, elem): + ... + + def __mul__(self, oth) -> NotImplementedType: + ... + + __rmul__ = ... + def __truediv__(self, oth) -> NotImplementedType: + ... + + def __add__(self, oth) -> NotImplementedType: + ... + + def __sub__(self, oth) -> NotImplementedType: + ... + + def is_injective(self): + ... + + def is_surjective(self): + ... + + def is_isomorphism(self): + ... + + def is_zero(self): + ... + + def __eq__(self, oth) -> bool: + ... + + def __ne__(self, oth) -> bool: + ... + + + +class MatrixHomomorphism(ModuleHomomorphism): + def __init__(self, domain, codomain, matrix) -> None: + ... + + def __repr__(self) -> str: + ... + + + +class FreeModuleHomomorphism(MatrixHomomorphism): + ... + + +class SubModuleHomomorphism(MatrixHomomorphism): + ... + + +def homomorphism(domain, codomain, matrix) -> FreeModuleHomomorphism: + ... + diff --git a/stubs/sympy-stubs/polys/agca/ideals.pyi b/stubs/sympy-stubs/polys/agca/ideals.pyi new file mode 100644 index 00000000..e2e7bf43 --- /dev/null +++ b/stubs/sympy-stubs/polys/agca/ideals.pyi @@ -0,0 +1,103 @@ +from types import NotImplementedType +from typing import Any, Generator, LiteralString +from sympy.polys.polyutils import IntegerPowerable + +class Ideal(IntegerPowerable): + def is_whole_ring(self): + ... + + def is_zero(self): + ... + + def is_prime(self): + ... + + def is_maximal(self): + ... + + def is_radical(self): + ... + + def is_primary(self): + ... + + def is_principal(self): + ... + + def radical(self): + ... + + def depth(self): + ... + + def height(self): + ... + + def __init__(self, ring) -> None: + ... + + def contains(self, elem): + ... + + def subset(self, other) -> bool: + ... + + def quotient(self, J, **opts): + ... + + def intersect(self, J): + ... + + def saturate(self, J): + ... + + def union(self, J): + ... + + def product(self, J): + ... + + def reduce_element(self, x): + ... + + def __add__(self, e): + ... + + __radd__ = ... + def __mul__(self, e) -> NotImplementedType: + ... + + __rmul__ = ... + def __eq__(self, e) -> bool: + ... + + def __ne__(self, e) -> bool: + ... + + + +class ModuleImplementedIdeal(Ideal): + def __init__(self, ring, module) -> None: + ... + + @property + def gens(self) -> Generator[Any, None, None]: + ... + + def is_zero(self): + ... + + def is_whole_ring(self): + ... + + def __repr__(self) -> LiteralString: + ... + + def in_terms_of_generators(self, e): + ... + + def reduce_element(self, x, **options): + ... + + + diff --git a/stubs/sympy-stubs/polys/agca/modules.pyi b/stubs/sympy-stubs/polys/agca/modules.pyi new file mode 100644 index 00000000..6b7c6044 --- /dev/null +++ b/stubs/sympy-stubs/polys/agca/modules.pyi @@ -0,0 +1,310 @@ +from types import NotImplementedType +from typing import Any, Literal, LiteralString, Self +from sympy.polys.agca.homomorphisms import FreeModuleHomomorphism +from sympy.polys.orderings import ProductOrder + +class Module: + def __init__(self, ring) -> None: + ... + + def convert(self, elem, M=...): + ... + + def submodule(self, *gens): + ... + + def quotient_module(self, other): + ... + + def __truediv__(self, e): + ... + + def contains(self, elem) -> bool: + ... + + def __contains__(self, elem) -> bool: + ... + + def subset(self, other) -> bool: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def is_zero(self): + ... + + def is_submodule(self, other): + ... + + def multiply_ideal(self, other): + ... + + def __mul__(self, e) -> NotImplementedType: + ... + + __rmul__ = ... + def identity_hom(self): + ... + + + +class ModuleElement: + def __init__(self, module, data) -> None: + ... + + def add(self, d1, d2): + ... + + def mul(self, m, d): + ... + + def div(self, m, d): + ... + + def eq(self, d1, d2): + ... + + def __add__(self, om) -> NotImplementedType | Self: + ... + + __radd__ = ... + def __neg__(self) -> Self: + ... + + def __sub__(self, om) -> NotImplementedType | Self: + ... + + def __rsub__(self, om) -> NotImplementedType | ModuleElement: + ... + + def __mul__(self, o) -> NotImplementedType | Self: + ... + + __rmul__ = ... + def __truediv__(self, o) -> NotImplementedType | Self: + ... + + def __eq__(self, om) -> bool: + ... + + def __ne__(self, om) -> bool: + ... + + + +class FreeModuleElement(ModuleElement): + def add(self, d1, d2) -> tuple[Any, ...]: + ... + + def mul(self, d, p) -> tuple[Any, ...]: + ... + + def div(self, d, p) -> tuple[Any, ...]: + ... + + def __repr__(self) -> LiteralString: + ... + + def __iter__(self): + ... + + def __getitem__(self, idx): + ... + + + +class FreeModule(Module): + dtype = FreeModuleElement + def __init__(self, ring, rank) -> None: + ... + + def __repr__(self) -> str: + ... + + def is_submodule(self, other) -> Literal[False]: + ... + + def convert(self, elem, M=...) -> FreeModuleElement: + ... + + def is_zero(self): + ... + + def basis(self) -> tuple[FreeModuleElement, ...]: + ... + + def quotient_module(self, submodule) -> QuotientModule: + ... + + def multiply_ideal(self, other): + ... + + def identity_hom(self) -> FreeModuleHomomorphism: + ... + + + +class FreeModulePolyRing(FreeModule): + def __init__(self, ring, rank) -> None: + ... + + def submodule(self, *gens, **opts) -> SubModulePolyRing: + ... + + + +class FreeModuleQuotientRing(FreeModule): + def __init__(self, ring, rank) -> None: + ... + + def __repr__(self) -> str: + ... + + def submodule(self, *gens, **opts) -> SubModuleQuotientRing: + ... + + def lift(self, elem): + ... + + def unlift(self, elem) -> FreeModuleElement: + ... + + + +class SubModule(Module): + def __init__(self, gens, container) -> None: + ... + + def __repr__(self) -> str: + ... + + def convert(self, elem, M=...): + ... + + def intersect(self, other, **options): + ... + + def module_quotient(self, other, **options): + ... + + def union(self, other) -> Self: + ... + + def is_zero(self) -> bool: + ... + + def submodule(self, *gens) -> Self: + ... + + def is_full_module(self) -> bool: + ... + + def is_submodule(self, other) -> bool: + ... + + def syzygy_module(self, **opts): + ... + + def in_terms_of_generators(self, e): + ... + + def reduce_element(self, x): + ... + + def quotient_module(self, other, **opts) -> SubQuotientModule: + ... + + def __add__(self, oth): + ... + + __radd__ = ... + def multiply_ideal(self, I) -> Self: + ... + + def inclusion_hom(self): + ... + + def identity_hom(self): + ... + + + +class SubQuotientModule(SubModule): + def __init__(self, gens, container, **opts) -> None: + ... + + def is_full_module(self): + ... + + def quotient_hom(self): + ... + + + +_subs0 = ... +_subs1 = ... +class ModuleOrder(ProductOrder): + def __init__(self, o1, o2, TOP) -> None: + ... + + + +class SubModulePolyRing(SubModule): + def __init__(self, gens, container, order=..., TOP=...) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def reduce_element(self, x, NF=...): + ... + + + +class SubModuleQuotientRing(SubModule): + def __init__(self, gens, container) -> None: + ... + + + +class QuotientModuleElement(ModuleElement): + def eq(self, d1, d2): + ... + + def __repr__(self) -> str: + ... + + + +class QuotientModule(Module): + dtype = QuotientModuleElement + def __init__(self, ring, base, submodule) -> None: + ... + + def __repr__(self) -> str: + ... + + def is_zero(self): + ... + + def is_submodule(self, other) -> Literal[False]: + ... + + def submodule(self, *gens, **opts) -> SubQuotientModule: + ... + + def convert(self, elem, M=...) -> QuotientModuleElement: + ... + + def identity_hom(self): + ... + + def quotient_hom(self): + ... + + + diff --git a/stubs/sympy-stubs/polys/appellseqs.pyi b/stubs/sympy-stubs/polys/appellseqs.pyi new file mode 100644 index 00000000..8f54ad4a --- /dev/null +++ b/stubs/sympy-stubs/polys/appellseqs.pyi @@ -0,0 +1,38 @@ +from typing import Any +from sympy.utilities import public + +def dup_bernoulli(n, K) -> list[Any]: + ... + +@public +def bernoulli_poly(n, x=..., polys=...): + ... + +def dup_bernoulli_c(n, K) -> list[Any]: + ... + +@public +def bernoulli_c_poly(n, x=..., polys=...): + ... + +def dup_genocchi(n, K) -> list[Any]: + ... + +@public +def genocchi_poly(n, x=..., polys=...): + ... + +def dup_euler(n, K) -> list[Any]: + ... + +@public +def euler_poly(n, x=..., polys=...): + ... + +def dup_andre(n, K) -> list[Any]: + ... + +@public +def andre_poly(n, x=..., polys=...): + ... + diff --git a/stubs/sympy-stubs/polys/compatibility.pyi b/stubs/sympy-stubs/polys/compatibility.pyi new file mode 100644 index 00000000..5e5a3856 --- /dev/null +++ b/stubs/sympy-stubs/polys/compatibility.pyi @@ -0,0 +1,896 @@ +from typing import Any, Literal +from sympy.polys.rings import PolyElement +from sympy.polys.rootisolation import RealInterval +from sympy.utilities import public + +@public +class IPolys: + symbols = ... + ngens = ... + domain = ... + order = ... + gens = ... + def drop(self, gen) -> None: + ... + + def clone(self, symbols=..., domain=..., order=...) -> None: + ... + + def to_ground(self) -> None: + ... + + def ground_new(self, element) -> None: + ... + + def domain_new(self, element) -> None: + ... + + def from_dict(self, d) -> None: + ... + + def wrap(self, element) -> PolyElement | None: + ... + + def to_dense(self, element) -> list[Any] | list[list[Any]]: + ... + + def from_dense(self, element) -> None: + ... + + def dup_add_term(self, f, c, i) -> None: + ... + + def dmp_add_term(self, f, c, i) -> None: + ... + + def dup_sub_term(self, f, c, i) -> None: + ... + + def dmp_sub_term(self, f, c, i) -> None: + ... + + def dup_mul_term(self, f, c, i) -> None: + ... + + def dmp_mul_term(self, f, c, i) -> None: + ... + + def dup_add_ground(self, f, c) -> None: + ... + + def dmp_add_ground(self, f, c) -> None: + ... + + def dup_sub_ground(self, f, c) -> None: + ... + + def dmp_sub_ground(self, f, c) -> None: + ... + + def dup_mul_ground(self, f, c) -> None: + ... + + def dmp_mul_ground(self, f, c) -> None: + ... + + def dup_quo_ground(self, f, c) -> None: + ... + + def dmp_quo_ground(self, f, c) -> None: + ... + + def dup_exquo_ground(self, f, c) -> None: + ... + + def dmp_exquo_ground(self, f, c) -> None: + ... + + def dup_lshift(self, f, n) -> None: + ... + + def dup_rshift(self, f, n) -> None: + ... + + def dup_abs(self, f) -> None: + ... + + def dmp_abs(self, f) -> None: + ... + + def dup_neg(self, f) -> None: + ... + + def dmp_neg(self, f) -> None: + ... + + def dup_add(self, f, g) -> None: + ... + + def dmp_add(self, f, g) -> None: + ... + + def dup_sub(self, f, g) -> None: + ... + + def dmp_sub(self, f, g) -> None: + ... + + def dup_add_mul(self, f, g, h) -> None: + ... + + def dmp_add_mul(self, f, g, h) -> None: + ... + + def dup_sub_mul(self, f, g, h) -> None: + ... + + def dmp_sub_mul(self, f, g, h) -> None: + ... + + def dup_mul(self, f, g) -> None: + ... + + def dmp_mul(self, f, g) -> None: + ... + + def dup_sqr(self, f) -> None: + ... + + def dmp_sqr(self, f) -> None: + ... + + def dup_pow(self, f, n) -> None: + ... + + def dmp_pow(self, f, n) -> None: + ... + + def dup_pdiv(self, f, g) -> tuple[None, None]: + ... + + def dup_prem(self, f, g) -> None: + ... + + def dup_pquo(self, f, g) -> None: + ... + + def dup_pexquo(self, f, g) -> None: + ... + + def dmp_pdiv(self, f, g) -> tuple[None, None]: + ... + + def dmp_prem(self, f, g) -> None: + ... + + def dmp_pquo(self, f, g) -> None: + ... + + def dmp_pexquo(self, f, g) -> None: + ... + + def dup_rr_div(self, f, g) -> tuple[None, None]: + ... + + def dmp_rr_div(self, f, g) -> tuple[None, None]: + ... + + def dup_ff_div(self, f, g) -> tuple[None, None]: + ... + + def dmp_ff_div(self, f, g) -> tuple[None, None]: + ... + + def dup_div(self, f, g) -> tuple[None, None]: + ... + + def dup_rem(self, f, g) -> None: + ... + + def dup_quo(self, f, g) -> None: + ... + + def dup_exquo(self, f, g) -> None: + ... + + def dmp_div(self, f, g) -> tuple[None, None]: + ... + + def dmp_rem(self, f, g) -> None: + ... + + def dmp_quo(self, f, g) -> None: + ... + + def dmp_exquo(self, f, g) -> None: + ... + + def dup_max_norm(self, f): + ... + + def dmp_max_norm(self, f): + ... + + def dup_l1_norm(self, f) -> int: + ... + + def dmp_l1_norm(self, f) -> int: + ... + + def dup_l2_norm_squared(self, f) -> int: + ... + + def dmp_l2_norm_squared(self, f) -> int: + ... + + def dup_expand(self, polys) -> None: + ... + + def dmp_expand(self, polys) -> None: + ... + + def dup_LC(self, f): + ... + + def dmp_LC(self, f): + ... + + def dup_TC(self, f): + ... + + def dmp_TC(self, f): + ... + + def dmp_ground_LC(self, f): + ... + + def dmp_ground_TC(self, f): + ... + + def dup_degree(self, f) -> int: + ... + + def dmp_degree(self, f) -> int: + ... + + def dmp_degree_in(self, f, j) -> int: + ... + + def dup_integrate(self, f, m) -> None: + ... + + def dmp_integrate(self, f, m) -> None: + ... + + def dup_diff(self, f, m) -> None: + ... + + def dmp_diff(self, f, m) -> None: + ... + + def dmp_diff_in(self, f, m, j) -> None: + ... + + def dmp_integrate_in(self, f, m, j) -> None: + ... + + def dup_eval(self, f, a): + ... + + def dmp_eval(self, f, a): + ... + + def dmp_eval_in(self, f, a, j): + ... + + def dmp_diff_eval_in(self, f, m, a, j): + ... + + def dmp_eval_tail(self, f, A): + ... + + def dup_trunc(self, f, p) -> None: + ... + + def dmp_trunc(self, f, g) -> None: + ... + + def dmp_ground_trunc(self, f, p) -> None: + ... + + def dup_monic(self, f) -> None: + ... + + def dmp_ground_monic(self, f) -> None: + ... + + def dup_extract(self, f, g) -> tuple[Any, None, None]: + ... + + def dmp_ground_extract(self, f, g) -> tuple[Any, None, None]: + ... + + def dup_real_imag(self, f) -> tuple[None, None]: + ... + + def dup_mirror(self, f) -> None: + ... + + def dup_scale(self, f, a) -> None: + ... + + def dup_shift(self, f, a) -> None: + ... + + def dup_transform(self, f, p, q) -> None: + ... + + def dup_compose(self, f, g) -> None: + ... + + def dmp_compose(self, f, g) -> None: + ... + + def dup_decompose(self, f) -> list[None]: + ... + + def dmp_lift(self, f): + ... + + def dup_sign_variations(self, f) -> int: + ... + + def dup_clear_denoms(self, f, convert=...) -> tuple[Any, None]: + ... + + def dmp_clear_denoms(self, f, convert=...) -> tuple[Any, None]: + ... + + def dup_revert(self, f, n) -> None: + ... + + def dup_half_gcdex(self, f, g) -> tuple[None, None]: + ... + + def dmp_half_gcdex(self, f, g) -> tuple[None, None]: + ... + + def dup_gcdex(self, f, g) -> tuple[None, None, None]: + ... + + def dmp_gcdex(self, f, g) -> tuple[None, None, None]: + ... + + def dup_invert(self, f, g) -> None: + ... + + def dmp_invert(self, f, g) -> None: + ... + + def dup_euclidean_prs(self, f, g) -> list[None]: + ... + + def dmp_euclidean_prs(self, f, g) -> list[None]: + ... + + def dup_primitive_prs(self, f, g) -> list[None]: + ... + + def dmp_primitive_prs(self, f, g) -> list[None]: + ... + + def dup_inner_subresultants(self, f, g) -> tuple[list[None], list[Any]]: + ... + + def dmp_inner_subresultants(self, f, g) -> tuple[list[None], list[list[list[Any]] | Any | list[Any]]]: + ... + + def dup_subresultants(self, f, g) -> list[None]: + ... + + def dmp_subresultants(self, f, g) -> list[None]: + ... + + def dup_prs_resultant(self, f, g) -> tuple[Any, list[None]]: + ... + + def dmp_prs_resultant(self, f, g) -> tuple[Any, list[None]]: + ... + + def dmp_zz_modular_resultant(self, f, g, p): + ... + + def dmp_zz_collins_resultant(self, f, g): + ... + + def dmp_qq_collins_resultant(self, f, g): + ... + + def dup_resultant(self, f, g) -> tuple[Any, list[Any]]: + ... + + def dmp_resultant(self, f, g) -> tuple[Any, list[Any]] | tuple[list[list[Any]], list[Any]] | tuple[list[list[Any]] | Any | list[Any], list[Any]]: + ... + + def dup_discriminant(self, f): + ... + + def dmp_discriminant(self, f): + ... + + def dup_rr_prs_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dup_ff_prs_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dmp_rr_prs_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dmp_ff_prs_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dup_zz_heu_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dmp_zz_heu_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dup_qq_heu_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dmp_qq_heu_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dup_inner_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dmp_inner_gcd(self, f, g) -> tuple[None, None, None]: + ... + + def dup_gcd(self, f, g) -> None: + ... + + def dmp_gcd(self, f, g) -> None: + ... + + def dup_rr_lcm(self, f, g) -> None: + ... + + def dup_ff_lcm(self, f, g) -> None: + ... + + def dup_lcm(self, f, g) -> None: + ... + + def dmp_rr_lcm(self, f, g) -> None: + ... + + def dmp_ff_lcm(self, f, g) -> None: + ... + + def dmp_lcm(self, f, g) -> None: + ... + + def dup_content(self, f): + ... + + def dup_primitive(self, f) -> tuple[Any, None]: + ... + + def dmp_content(self, f): + ... + + def dmp_primitive(self, f) -> tuple[Any, None]: + ... + + def dmp_ground_content(self, f): + ... + + def dmp_ground_primitive(self, f) -> tuple[Any, None]: + ... + + def dup_cancel(self, f, g, include=...) -> tuple[Any | list[Any], Any | list[Any], None, None] | tuple[None, None]: + ... + + def dmp_cancel(self, f, g, include=...) -> tuple[Any | list[Any], Any | list[Any], None, None] | tuple[None, None]: + ... + + def dup_trial_division(self, f, factors) -> list[tuple[None, Any]]: + ... + + def dmp_trial_division(self, f, factors) -> list[tuple[None, Any]]: + ... + + def dup_zz_mignotte_bound(self, f): + ... + + def dmp_zz_mignotte_bound(self, f): + ... + + def dup_zz_hensel_step(self, m, f, g, h, s, t) -> tuple[None, None, None, None]: + ... + + def dup_zz_hensel_lift(self, p, f, f_list, l) -> list[None]: + ... + + def dup_zz_zassenhaus(self, f) -> list[tuple[None, Any]]: + ... + + def dup_zz_irreducible_p(self, f) -> Literal[True] | None: + ... + + def dup_cyclotomic_p(self, f, irreducible=...) -> bool: + ... + + def dup_zz_cyclotomic_poly(self, n) -> None: + ... + + def dup_zz_cyclotomic_factor(self, f) -> list[None] | None: + ... + + def dmp_zz_wang_non_divisors(self, E, cs, ct) -> list[Any] | None: + ... + + def dmp_zz_wang_lead_coeffs(self, f, T, cs, E, H, A) -> tuple[None, list[Any], list[Any]]: + ... + + def dup_zz_diophantine(self, F, m, p) -> list[None]: + ... + + def dmp_zz_diophantine(self, F, c, A, d, p) -> list[None]: + ... + + def dmp_zz_wang_hensel_lifting(self, f, H, LC, A, p) -> list[None]: + ... + + def dmp_zz_wang(self, f, mod=..., seed=...) -> list[None]: + ... + + def dup_zz_factor_sqf(self, f) -> tuple[Any, list[None]]: + ... + + def dup_zz_factor(self, f) -> tuple[Any, list[tuple[None, Literal[1]]]]: + ... + + def dmp_zz_factor(self, f) -> tuple[Any, list[tuple[None, Literal[1]]]]: + ... + + def dup_qq_i_factor(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dmp_qq_i_factor(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dup_zz_i_factor(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dmp_zz_i_factor(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dup_ext_factor(self, f) -> tuple[Any, list[tuple[None, Any | int]]]: + ... + + def dmp_ext_factor(self, f) -> tuple[Any, list[tuple[None, Any | int]]]: + ... + + def dup_gf_factor(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dmp_gf_factor(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dup_factor_list(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dup_factor_list_include(self, f) -> list[tuple[None, Any | Literal[1]]]: + ... + + def dmp_factor_list(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dmp_factor_list_include(self, f) -> list[tuple[None, Any | Literal[1]]]: + ... + + def dup_irreducible_p(self, f) -> bool: + ... + + def dmp_irreducible_p(self, f) -> bool: + ... + + def dup_sturm(self, f) -> list[None]: + ... + + def dup_sqf_p(self, f) -> bool: + ... + + def dmp_sqf_p(self, f) -> bool: + ... + + def dup_sqf_norm(self, f) -> tuple[int, None, Any]: + ... + + def dmp_sqf_norm(self, f) -> tuple[int, None, Any]: + ... + + def dup_gf_sqf_part(self, f) -> None: + ... + + def dmp_gf_sqf_part(self, f) -> None: + ... + + def dup_sqf_part(self, f) -> None: + ... + + def dmp_sqf_part(self, f) -> None: + ... + + def dup_gf_sqf_list(self, f, all=...) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dmp_gf_sqf_list(self, f, all=...) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dup_sqf_list(self, f, all=...) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dup_sqf_list_include(self, f, all=...) -> list[tuple[None, Literal[1]]]: + ... + + def dmp_sqf_list(self, f, all=...) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def dmp_sqf_list_include(self, f, all=...) -> list[tuple[None, Literal[1]]]: + ... + + def dup_gff_list(self, f) -> list[tuple[None, Any]]: + ... + + def dmp_gff_list(self, f) -> list[tuple[None, Any]]: + ... + + def dup_root_upper_bound(self, f) -> None: + ... + + def dup_root_lower_bound(self, f) -> None: + ... + + def dup_step_refine_real_root(self, f, M, fast=...) -> tuple[Any, tuple[Any, Any, Any, Any]] | tuple[list[Any], tuple[Any, Any, Any, Any]] | tuple[list[Any] | Any, tuple[Any, Any, Any, Any]]: + ... + + def dup_inner_refine_real_root(self, f, M, eps=..., steps=..., disjoint=..., fast=..., mobius=...) -> tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]: + ... + + def dup_outer_refine_real_root(self, f, s, t, eps=..., steps=..., disjoint=..., fast=...) -> tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]: + ... + + def dup_refine_real_root(self, f, s, t, eps=..., steps=..., disjoint=..., fast=...) -> tuple[Any, Any] | tuple[Any | list[Any], Any | tuple[Any, Any, Any, Any]]: + ... + + def dup_inner_isolate_real_roots(self, f, eps=..., fast=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]]: + ... + + def dup_inner_isolate_positive_roots(self, f, eps=..., inf=..., sup=..., fast=..., mobius=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]]: + ... + + def dup_inner_isolate_negative_roots(self, f, inf=..., sup=..., eps=..., fast=..., mobius=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]]: + ... + + def dup_isolate_real_roots_sqf(self, f, eps=..., inf=..., sup=..., fast=..., blackbox=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] | list[RealInterval]: + ... + + def dup_isolate_real_roots(self, f, eps=..., inf=..., sup=..., basis=..., fast=...) -> list[Any] | list[tuple[tuple[Any, Any], Any, Any] | tuple[Any, Any]]: + ... + + def dup_isolate_real_roots_list(self, polys, eps=..., inf=..., sup=..., strict=..., basis=..., fast=...) -> list[tuple[tuple[Any, Any], Any, Any] | tuple[tuple[Any, Any], dict[Any, Any]]]: + ... + + def dup_count_real_roots(self, f, inf=..., sup=...) -> int: + ... + + def dup_count_complex_roots(self, f, inf=..., sup=..., exclude=...) -> int: + ... + + def dup_isolate_complex_roots_sqf(self, f, eps=..., inf=..., sup=..., blackbox=...): + ... + + def dup_isolate_all_roots_sqf(self, f, eps=..., inf=..., sup=..., fast=..., blackbox=...) -> tuple[list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] | list[RealInterval], Any]: + ... + + def dup_isolate_all_roots(self, f, eps=..., inf=..., sup=..., fast=...) -> tuple[list[tuple[tuple[Any | list[Any], Any | tuple[Any, Any, Any, Any]], Any]], list[tuple[tuple[Any, Any], Any]]]: + ... + + def fateman_poly_F_1(self) -> tuple[None, ...]: + ... + + def fateman_poly_F_2(self) -> tuple[None, ...]: + ... + + def fateman_poly_F_3(self) -> tuple[None, ...]: + ... + + def to_gf_dense(self, element): + ... + + def from_gf_dense(self, element) -> None: + ... + + def gf_degree(self, f) -> int: + ... + + def gf_LC(self, f): + ... + + def gf_TC(self, f): + ... + + def gf_strip(self, f) -> None: + ... + + def gf_trunc(self, f) -> None: + ... + + def gf_normal(self, f) -> None: + ... + + def gf_from_dict(self, f) -> None: + ... + + def gf_to_dict(self, f, symmetric=...) -> dict[Any, Any]: + ... + + def gf_from_int_poly(self, f) -> None: + ... + + def gf_to_int_poly(self, f, symmetric=...) -> list[Any]: + ... + + def gf_neg(self, f) -> None: + ... + + def gf_add_ground(self, f, a) -> None: + ... + + def gf_sub_ground(self, f, a) -> None: + ... + + def gf_mul_ground(self, f, a) -> None: + ... + + def gf_quo_ground(self, f, a) -> None: + ... + + def gf_add(self, f, g) -> None: + ... + + def gf_sub(self, f, g) -> None: + ... + + def gf_mul(self, f, g) -> None: + ... + + def gf_sqr(self, f) -> None: + ... + + def gf_add_mul(self, f, g, h) -> None: + ... + + def gf_sub_mul(self, f, g, h) -> None: + ... + + def gf_expand(self, F) -> None: + ... + + def gf_div(self, f, g) -> tuple[None, None]: + ... + + def gf_rem(self, f, g) -> None: + ... + + def gf_quo(self, f, g) -> None: + ... + + def gf_exquo(self, f, g) -> None: + ... + + def gf_lshift(self, f, n) -> None: + ... + + def gf_rshift(self, f, n) -> None: + ... + + def gf_pow(self, f, n) -> None: + ... + + def gf_pow_mod(self, f, n, g) -> None: + ... + + def gf_cofactors(self, f, g) -> tuple[None, None, None]: + ... + + def gf_gcd(self, f, g) -> None: + ... + + def gf_lcm(self, f, g) -> None: + ... + + def gf_gcdex(self, f, g) -> None: + ... + + def gf_monic(self, f) -> None: + ... + + def gf_diff(self, f) -> None: + ... + + def gf_eval(self, f, a): + ... + + def gf_multi_eval(self, f, A) -> list[Any]: + ... + + def gf_compose(self, f, g) -> None: + ... + + def gf_compose_mod(self, g, h, f) -> None: + ... + + def gf_trace_map(self, a, b, c, n, f) -> tuple[None, None]: + ... + + def gf_random(self, n) -> None: + ... + + def gf_irreducible(self, n) -> None: + ... + + def gf_irred_p_ben_or(self, f) -> bool: + ... + + def gf_irred_p_rabin(self, f) -> bool: + ... + + def gf_irreducible_p(self, f) -> bool: + ... + + def gf_sqf_p(self, f) -> bool: + ... + + def gf_sqf_part(self, f) -> None: + ... + + def gf_sqf_list(self, f, all=...) -> tuple[Any, list[tuple[None, Any]]]: + ... + + def gf_Qmatrix(self, f) -> list[list[Any]]: + ... + + def gf_berlekamp(self, f) -> list[None]: + ... + + def gf_ddf_zassenhaus(self, f) -> list[tuple[None, Any]]: + ... + + def gf_edf_zassenhaus(self, f, n) -> list[None]: + ... + + def gf_ddf_shoup(self, f) -> list[tuple[None, Any]]: + ... + + def gf_edf_shoup(self, f, n) -> list[None]: + ... + + def gf_zassenhaus(self, f) -> list[None]: + ... + + def gf_shoup(self, f) -> list[None]: + ... + + def gf_factor_sqf(self, f, method=...) -> tuple[Any, list[None]]: + ... + + def gf_factor(self, f) -> tuple[Any, list[tuple[None, Any]]]: + ... + + + diff --git a/stubs/sympy-stubs/polys/constructor.pyi b/stubs/sympy-stubs/polys/constructor.pyi new file mode 100644 index 00000000..eed86169 --- /dev/null +++ b/stubs/sympy-stubs/polys/constructor.pyi @@ -0,0 +1,8 @@ +from typing import Any +from sympy.polys.domains.gaussiandomains import GaussianIntegerRing, GaussianRationalField +from sympy.utilities import public + +@public +def construct_domain(obj, **args) -> tuple[Any | GaussianRationalField | GaussianIntegerRing, dict[Any, Any | int]] | tuple[Any | GaussianRationalField | GaussianIntegerRing, list[Any | int] | list[Any] | Any] | tuple[Any | GaussianRationalField | GaussianIntegerRing, Any | int]: + ... + diff --git a/stubs/sympy-stubs/polys/densearith.pyi b/stubs/sympy-stubs/polys/densearith.pyi new file mode 100644 index 00000000..d8f0b344 --- /dev/null +++ b/stubs/sympy-stubs/polys/densearith.pyi @@ -0,0 +1,194 @@ +from typing import Any + +def dup_add_term(f, c, i, K): + ... + +def dmp_add_term(f, c, i, u, K) -> list[list[Any]]: + ... + +def dup_sub_term(f, c, i, K): + ... + +def dmp_sub_term(f, c, i, u, K) -> list[list[Any]]: + ... + +def dup_mul_term(f, c, i, K) -> list[Any]: + ... + +def dmp_mul_term(f, c, i, u, K) -> list[Any] | list[list[Any]] | list[Any | list[Any] | list[list[Any]]]: + ... + +def dup_add_ground(f, c, K): + ... + +def dmp_add_ground(f, c, u, K) -> list[list[Any]]: + ... + +def dup_sub_ground(f, c, K): + ... + +def dmp_sub_ground(f, c, u, K) -> list[list[Any]]: + ... + +def dup_mul_ground(f, c, K) -> list[Any]: + ... + +def dmp_mul_ground(f, c, u, K) -> list[Any]: + ... + +def dup_quo_ground(f, c, K) -> list[Any]: + ... + +def dmp_quo_ground(f, c, u, K) -> list[Any]: + ... + +def dup_exquo_ground(f, c, K) -> list[Any]: + ... + +def dmp_exquo_ground(f, c, u, K) -> list[Any]: + ... + +def dup_lshift(f, n, K): + ... + +def dup_rshift(f, n, K): + ... + +def dup_abs(f, K) -> list[Any]: + ... + +def dmp_abs(f, u, K) -> list[Any]: + ... + +def dup_neg(f, K) -> list[Any]: + ... + +def dmp_neg(f, u, K) -> list[Any]: + ... + +def dup_add(f, g, K): + ... + +def dmp_add(f, g, u, K) -> list[list[Any]]: + ... + +def dup_sub(f, g, K) -> list[Any]: + ... + +def dmp_sub(f, g, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_add_mul(f, g, h, K): + ... + +def dmp_add_mul(f, g, h, u, K) -> list[list[Any]]: + ... + +def dup_sub_mul(f, g, h, K) -> list[Any]: + ... + +def dmp_sub_mul(f, g, h, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_mul(f, g, K) -> list[Any]: + ... + +def dmp_mul(f, g, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_sqr(f, K): + ... + +def dmp_sqr(f, u, K) -> list[list[Any]]: + ... + +def dup_pow(f, n, K) -> list[Any]: + ... + +def dmp_pow(f, n, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_pdiv(f, g, K) -> tuple[list[Any], Any] | tuple[list[Any], list[Any]]: + ... + +def dup_prem(f, g, K) -> list[Any]: + ... + +def dup_pquo(f, g, K) -> list[Any]: + ... + +def dup_pexquo(f, g, K) -> list[Any]: + ... + +def dmp_pdiv(f, g, u, K) -> tuple[list[Any], Any] | tuple[list[Any], list[Any]] | tuple[list[list[Any]], Any] | tuple[list[Any] | Any | list[list[Any]] | list[Any | list[Any] | list[list[Any]]], list[Any] | Any | list[list[Any]] | list[Any | list[Any] | list[list[Any]]]]: + ... + +def dmp_prem(f, g, u, K) -> list[Any] | list[list[Any]] | list[Any | list[Any] | list[list[Any]]]: + ... + +def dmp_pquo(f, g, u, K) -> list[list[Any]] | list[Any] | list[Any | list[Any] | list[list[Any]]]: + ... + +def dmp_pexquo(f, g, u, K) -> list[Any] | list[list[Any]] | list[Any | list[Any] | list[list[Any]]]: + ... + +def dup_rr_div(f, g, K) -> tuple[list[Any], Any] | tuple[Any | list[Any], Any | list[Any]]: + ... + +def dmp_rr_div(f, g, u, K) -> tuple[list[Any], Any] | tuple[Any | list[Any], Any | list[Any]] | tuple[list[list[Any]], Any] | tuple[list[list[Any]] | Any, Any | list[Any] | list[list[Any]]]: + ... + +def dup_ff_div(f, g, K) -> tuple[list[Any], Any] | tuple[Any, list[Any] | Any]: + ... + +def dmp_ff_div(f, g, u, K) -> tuple[list[Any], Any] | tuple[Any, list[Any] | Any] | tuple[list[list[Any]], Any] | tuple[list[list[Any]] | Any, Any | list[Any] | list[list[Any]]]: + ... + +def dup_div(f, g, K) -> tuple[list[Any], Any] | tuple[Any, list[Any] | Any] | tuple[Any | list[Any], Any | list[Any]]: + ... + +def dup_rem(f, g, K) -> list[Any]: + ... + +def dup_quo(f, g, K) -> list[Any]: + ... + +def dup_exquo(f, g, K) -> list[Any]: + ... + +def dmp_div(f, g, u, K) -> tuple[list[Any], Any] | tuple[Any, list[Any] | Any] | tuple[list[list[Any]], Any] | tuple[list[list[Any]] | Any, Any | list[Any] | list[list[Any]]] | tuple[Any | list[Any], Any | list[Any]]: + ... + +def dmp_rem(f, g, u, K) -> list[Any] | list[list[Any]]: + ... + +def dmp_quo(f, g, u, K) -> list[list[Any]]: + ... + +def dmp_exquo(f, g, u, K) -> list[list[Any]]: + ... + +def dup_max_norm(f, K): + ... + +def dmp_max_norm(f, u, K): + ... + +def dup_l1_norm(f, K) -> int: + ... + +def dmp_l1_norm(f, u, K) -> int: + ... + +def dup_l2_norm_squared(f, K) -> int: + ... + +def dmp_l2_norm_squared(f, u, K) -> int: + ... + +def dup_expand(polys, K) -> list[Any]: + ... + +def dmp_expand(polys, u, K) -> list[list[Any]] | list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/densebasic.pyi b/stubs/sympy-stubs/polys/densebasic.pyi new file mode 100644 index 00000000..2d7c2685 --- /dev/null +++ b/stubs/sympy-stubs/polys/densebasic.pyi @@ -0,0 +1,199 @@ +from typing import Any, Literal + +def poly_LC(f, K): + ... + +def poly_TC(f, K): + ... + +dmp_LC = ... +dmp_TC = ... +def dmp_ground_LC(f, u, K): + ... + +def dmp_ground_TC(f, u, K): + ... + +def dmp_true_LT(f, u, K) -> tuple[tuple[Any, ...], Any]: + ... + +def dup_degree(f) -> int: + ... + +def dmp_degree(f, u) -> int: + ... + +def dmp_degree_in(f, j, u) -> int: + ... + +def dmp_degree_list(f, u) -> tuple[Any, ...]: + ... + +def dup_strip(f): + ... + +def dmp_strip(f, u) -> list[list[Any]]: + ... + +def dmp_validate(f, K=...) -> tuple[Any | list[list[Any]], Any]: + ... + +def dup_reverse(f): + ... + +def dup_copy(f) -> list[Any]: + ... + +def dmp_copy(f, u) -> list[Any]: + ... + +def dup_to_tuple(f) -> tuple[Any, ...]: + ... + +def dmp_to_tuple(f, u) -> tuple[Any, ...]: + ... + +def dup_normal(f, K): + ... + +def dmp_normal(f, u, K) -> list[list[Any]]: + ... + +def dup_convert(f, K0, K1): + ... + +def dmp_convert(f, u, K0, K1) -> list[list[Any]]: + ... + +def dup_from_sympy(f, K): + ... + +def dmp_from_sympy(f, u, K) -> list[list[Any]]: + ... + +def dup_nth(f, n, K): + ... + +def dmp_nth(f, n, u, K) -> list[list[Any]]: + ... + +def dmp_ground_nth(f, N, u, K): + ... + +def dmp_zero_p(f, u) -> bool: + ... + +def dmp_zero(u) -> list[list[Any]]: + ... + +def dmp_one_p(f, u, K) -> bool: + ... + +def dmp_one(u, K) -> list[list[Any]] | list[Any]: + ... + +def dmp_ground_p(f, c, u) -> bool: + ... + +def dmp_ground(c, u) -> list[list[Any]] | list[Any]: + ... + +def dmp_zeros(n, u, K) -> list[Any] | list[list[list[Any]]]: + ... + +def dmp_grounds(c, n, u) -> list[Any] | list[list[list[Any]] | Any | list[Any]]: + ... + +def dmp_negative_p(f, u, K): + ... + +def dmp_positive_p(f, u, K): + ... + +def dup_from_dict(f, K) -> list[Any]: + ... + +def dup_from_raw_dict(f, K) -> list[Any]: + ... + +def dmp_from_dict(f, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_to_dict(f, K=..., zero=...) -> dict[tuple[Literal[0]], Any] | dict[Any, Any]: + ... + +def dup_to_raw_dict(f, K=..., zero=...) -> dict[int, Any] | dict[Any, Any]: + ... + +def dmp_to_dict(f, u, K=..., zero=...) -> dict[tuple[Literal[0]], Any] | dict[Any, Any]: + ... + +def dmp_swap(f, i, j, u, K) -> list[Any] | list[list[Any]]: + ... + +def dmp_permute(f, P, u, K) -> list[Any] | list[list[Any]]: + ... + +def dmp_nest(f, l, K) -> list[list[Any]] | list[Any]: + ... + +def dmp_raise(f, l, u, K) -> list[list[Any]] | list[list[list[Any]] | Any | list[Any]] | list[Any]: + ... + +def dup_deflate(f, K) -> tuple[Literal[1], Any] | tuple[int, Any]: + ... + +def dmp_deflate(f, u, K) -> tuple[Any, Any] | tuple[tuple[Any, ...], Any] | tuple[tuple[Any, ...], list[Any] | Any | list[list[Any]]]: + ... + +def dup_multi_deflate(polys, K) -> tuple[Literal[1], Any] | tuple[int, tuple[Any, ...]]: + ... + +def dmp_multi_deflate(polys, u, K) -> tuple[tuple[int], Any | tuple[Any, ...]] | tuple[tuple[Any, ...], Any] | tuple[tuple[Any, ...], tuple[Any, ...]]: + ... + +def dup_inflate(f, m, K) -> list[Any]: + ... + +def dmp_inflate(f, M, u, K) -> list[Any]: + ... + +def dmp_exclude(f, u, K) -> tuple[list[Any], Any, Any] | tuple[list[Any], list[Any] | Any | list[list[Any]], Any]: + ... + +def dmp_include(f, J, u, K) -> list[Any] | list[list[Any]]: + ... + +def dmp_inject(f, u, K, front=...) -> tuple[list[Any] | Any | list[list[Any]], Any]: + ... + +def dmp_eject(f, u, K, front=...) -> list[Any] | list[list[Any]]: + ... + +def dup_terms_gcd(f, K) -> tuple[Literal[0], Any] | tuple[int, Any]: + ... + +def dmp_terms_gcd(f, u, K) -> tuple[Any, Any] | tuple[tuple[Any, ...], Any] | tuple[tuple[Any, ...], list[Any] | Any | list[list[Any]]]: + ... + +def dmp_list_terms(f, u, K, order=...) -> list[tuple[Any, Any]] | list[Any]: + ... + +def dup_apply_pairs(f, g, h, args, K): + ... + +def dmp_apply_pairs(f, g, h, args, u, K) -> list[list[Any]]: + ... + +def dup_slice(f, m, n, K) -> list[Any]: + ... + +def dmp_slice(f, m, n, u, K) -> list[Any] | list[list[Any]]: + ... + +def dmp_slice_in(f, m, n, j, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_random(n, a, b, K) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/densetools.pyi b/stubs/sympy-stubs/polys/densetools.pyi new file mode 100644 index 00000000..8af45101 --- /dev/null +++ b/stubs/sympy-stubs/polys/densetools.pyi @@ -0,0 +1,110 @@ +from typing import Any + +def dup_integrate(f, m, K): + ... + +def dmp_integrate(f, m, u, K) -> list[Any] | list[list[list[Any]]]: + ... + +def dmp_integrate_in(f, m, j, u, K) -> list[Any] | list[list[list[Any]]] | list[list[Any]]: + ... + +def dup_diff(f, m, K) -> list[Any]: + ... + +def dmp_diff(f, m, u, K) -> list[Any] | list[list[Any]]: + ... + +def dmp_diff_in(f, m, j, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_eval(f, a, K): + ... + +def dmp_eval(f, a, u, K) -> list[list[Any]]: + ... + +def dmp_eval_in(f, a, j, u, K) -> list[list[Any]]: + ... + +def dmp_eval_tail(f, A, u, K) -> list[list[Any]] | list[Any]: + ... + +def dmp_diff_eval_in(f, m, a, j, u, K) -> list[list[Any]]: + ... + +def dup_trunc(f, p, K): + ... + +def dmp_trunc(f, p, u, K) -> list[list[Any]]: + ... + +def dmp_ground_trunc(f, p, u, K) -> list[list[Any]]: + ... + +def dup_monic(f, K) -> list[Any]: + ... + +def dmp_ground_monic(f, u, K) -> list[Any]: + ... + +def dup_content(f, K): + ... + +def dmp_ground_content(f, u, K): + ... + +def dup_primitive(f, K) -> tuple[Any, Any] | tuple[Any, Any | list[Any]]: + ... + +def dmp_ground_primitive(f, u, K) -> tuple[Any, Any] | tuple[Any, Any | list[Any]]: + ... + +def dup_extract(f, g, K) -> tuple[Any, Any | list[Any], Any | list[Any]]: + ... + +def dmp_ground_extract(f, g, u, K) -> tuple[Any, Any | list[Any], Any | list[Any]]: + ... + +def dup_real_imag(f, K) -> tuple[list[list[Any]], list[list[Any]]] | tuple[list[list[Any]] | Any | list[Any], list[list[Any]] | Any | list[Any]]: + ... + +def dup_mirror(f, K) -> list[Any]: + ... + +def dup_scale(f, a, K) -> list[Any]: + ... + +def dup_shift(f, a, K) -> list[Any]: + ... + +def dup_transform(f, p, q, K) -> list[Any]: + ... + +def dup_compose(f, g, K) -> list[Any]: + ... + +def dmp_compose(f, g, u, K) -> list[Any] | list[list[Any]]: + ... + +def dup_decompose(f, K) -> list[Any | list[Any]]: + ... + +def dmp_lift(f, u, K) -> list[list[Any]]: + ... + +def dup_sign_variations(f, K) -> int: + ... + +def dup_clear_denoms(f, K0, K1=..., convert=...) -> tuple[Any, list[Any] | Any] | tuple[Any, Any]: + ... + +def dmp_clear_denoms(f, u, K0, K1=..., convert=...) -> tuple[Any, list[Any] | Any] | tuple[Any, Any] | tuple[Any, Any | list[list[Any]]]: + ... + +def dup_revert(f, n, K) -> list[Any]: + ... + +def dmp_revert(f, g, u, K) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/dispersion.pyi b/stubs/sympy-stubs/polys/dispersion.pyi new file mode 100644 index 00000000..4219c3cb --- /dev/null +++ b/stubs/sympy-stubs/polys/dispersion.pyi @@ -0,0 +1,7 @@ +from typing import Any +def dispersionset(p, q=..., *gens, **args) -> set[int] | set[Any]: + ... + +def dispersion(p, q=..., *gens, **args) -> int: + ... + diff --git a/stubs/sympy-stubs/polys/distributedmodules.pyi b/stubs/sympy-stubs/polys/distributedmodules.pyi new file mode 100644 index 00000000..e78170bb --- /dev/null +++ b/stubs/sympy-stubs/polys/distributedmodules.pyi @@ -0,0 +1,71 @@ +from typing import Any + +def sdm_monomial_mul(M, X) -> tuple[Any, *tuple[Any, ...]]: + ... + +def sdm_monomial_deg(M) -> int: + ... + +def sdm_monomial_lcm(A, B) -> tuple[Any, *tuple[Any, ...]]: + ... + +def sdm_monomial_divides(A, B) -> bool: + ... + +def sdm_LC(f, K): + ... + +def sdm_to_dict(f) -> dict[Any, Any]: + ... + +def sdm_from_dict(d, O) -> list[tuple[Any, Any]]: + ... + +def sdm_sort(f, O) -> list[Any]: + ... + +def sdm_strip(f) -> list[tuple[Any, Any]]: + ... + +def sdm_add(f, g, O, K) -> list[tuple[Any, Any]]: + ... + +def sdm_LM(f): + ... + +def sdm_LT(f): + ... + +def sdm_mul_term(f, term, O, K) -> list[Any] | list[tuple[tuple[Any, *tuple[Any, ...]], Any]]: + ... + +def sdm_zero() -> list[Any]: + ... + +def sdm_deg(f) -> int: + ... + +def sdm_from_vector(vec, O, K, **opts) -> list[tuple[Any, Any]]: + ... + +def sdm_to_vector(f, gens, K, n=...) -> list[Any]: + ... + +def sdm_spoly(f, g, O, K, phantom=...) -> list[Any] | list[tuple[Any, Any]] | tuple[list[tuple[Any, Any]], list[tuple[Any, Any]]]: + ... + +def sdm_ecart(f) -> int: + ... + +def sdm_nf_mora(f, G, O, K, phantom=...) -> tuple[Any | tuple[Any, Any] | list[tuple[Any, Any]] | list[Any] | tuple[list[tuple[Any, Any]], list[tuple[Any, Any]]], Any | tuple[Any, Any] | list[tuple[Any, Any]]] | tuple[Any, Any] | list[tuple[Any, Any]] | list[Any] | tuple[list[tuple[Any, Any]], list[tuple[Any, Any]]]: + ... + +def sdm_nf_buchberger(f, G, O, K, phantom=...) -> tuple[Any | tuple[Any, Any] | list[tuple[Any, Any]] | list[Any] | tuple[list[tuple[Any, Any]], list[tuple[Any, Any]]], Any | tuple[Any, Any] | list[tuple[Any, Any]]] | tuple[Any, Any] | list[tuple[Any, Any]] | list[Any] | tuple[list[tuple[Any, Any]], list[tuple[Any, Any]]]: + ... + +def sdm_nf_buchberger_reduced(f, G, O, K) -> list[Any] | list[tuple[Any, Any]]: + ... + +def sdm_groebner(G, NF, O, K, extended=...) -> tuple[list[Any], list[Any]] | list[Any] | tuple[list[list[Any]], list[Any]] | list[list[Any]]: + ... + diff --git a/stubs/sympy-stubs/polys/domains/__init__.pyi b/stubs/sympy-stubs/polys/domains/__init__.pyi new file mode 100644 index 00000000..c3eb16c0 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/__init__.pyi @@ -0,0 +1,28 @@ +from sympy.polys.domains.domain import Domain +from sympy.polys.domains.finitefield import FF, FiniteField, GF +from sympy.polys.domains.integerring import IntegerRing, ZZ +from sympy.polys.domains.rationalfield import QQ, RationalField +from sympy.polys.domains.algebraicfield import AlgebraicField +from sympy.polys.domains.gaussiandomains import QQ_I, ZZ_I +from sympy.polys.domains.realfield import RR, RealField +from sympy.polys.domains.complexfield import CC, ComplexField +from sympy.polys.domains.polynomialring import PolynomialRing +from sympy.polys.domains.fractionfield import FractionField +from sympy.polys.domains.expressiondomain import EX, ExpressionDomain +from sympy.polys.domains.expressionrawdomain import EXRAW +from sympy.polys.domains.pythonrational import PythonRational +from sympy.external.gmpy import GROUND_TYPES +from sympy.polys.domains.pythonfinitefield import PythonFiniteField +from sympy.polys.domains.gmpyfinitefield import GMPYFiniteField +from sympy.polys.domains.pythonintegerring import PythonIntegerRing +from sympy.polys.domains.gmpyintegerring import GMPYIntegerRing +from sympy.polys.domains.pythonrationalfield import PythonRationalField +from sympy.polys.domains.gmpyrationalfield import GMPYRationalField + +__all__ = ['Domain', 'FiniteField', 'IntegerRing', 'RationalField', 'RealField', 'ComplexField', 'AlgebraicField', 'PolynomialRing', 'FractionField', 'ExpressionDomain', 'PythonRational', 'GF', 'FF', 'ZZ', 'QQ', 'ZZ_I', 'QQ_I', 'RR', 'CC', 'EX', 'EXRAW'] +FF_python = ... +FF_gmpy = ... +ZZ_python = ... +ZZ_gmpy = ... +QQ_python = ... +QQ_gmpy = ... diff --git a/stubs/sympy-stubs/polys/domains/algebraicfield.pyi b/stubs/sympy-stubs/polys/domains/algebraicfield.pyi new file mode 100644 index 00000000..a839d8cc --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/algebraicfield.pyi @@ -0,0 +1,108 @@ +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.field import Field +from sympy.polys.domains.simpledomain import SimpleDomain +from sympy.polys.polyclasses import ANP +from sympy.utilities import public + +@public +class AlgebraicField(Field, CharacteristicZero, SimpleDomain): + dtype = ANP + is_Algebraic = ... + is_Numerical = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def __init__(self, dom, *ext, alias=...) -> None: + ... + + def new(self, element) -> dtype: + ... + + def __str__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def algebraic_field(self, *extension, alias=...) -> Any: + ... + + def to_alg_num(self, a) -> Any: + ... + + def to_sympy(self, a) -> Order: + ... + + def from_sympy(self, a): + ... + + def from_ZZ(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ(K1, a, K0): + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_RealField(K1, a, K0): + ... + + def get_ring(self): + ... + + def is_positive(self, a): + ... + + def is_negative(self, a): + ... + + def is_nonpositive(self, a): + ... + + def is_nonnegative(self, a): + ... + + def numer(self, a): + ... + + def denom(self, a) -> ANP: + ... + + def from_AlgebraicField(K1, a, K0): + ... + + def from_GaussianIntegerRing(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0): + ... + + def maximal_order(self) -> Any | None: + ... + + def integral_basis(self, fmt=...) -> list[Any | Order] | list[Any] | list[dtype]: + ... + + def discriminant(self) -> Any | None: + ... + + def primes_above(self, p) -> Any: + ... + + def galois_group(self, by_name=..., max_tries=..., randomize=...) -> Any: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/characteristiczero.pyi b/stubs/sympy-stubs/polys/domains/characteristiczero.pyi new file mode 100644 index 00000000..1eff5dd8 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/characteristiczero.pyi @@ -0,0 +1,11 @@ +from typing import Literal +from sympy.polys.domains.domain import Domain +from sympy.utilities import public + +class CharacteristicZero(Domain): + has_CharacteristicZero = ... + def characteristic(self) -> Literal[0]: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/complexfield.pyi b/stubs/sympy-stubs/polys/domains/complexfield.pyi new file mode 100644 index 00000000..bb1714b6 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/complexfield.pyi @@ -0,0 +1,108 @@ +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.field import Field +from sympy.polys.domains.simpledomain import SimpleDomain +from sympy.utilities import public + +@public +class ComplexField(Field, CharacteristicZero, SimpleDomain): + rep = ... + is_CC = ... + is_Exact = ... + is_Numerical = ... + has_assoc_Ring = ... + has_assoc_Field = ... + _default_precision = ... + @property + def has_default_precision(self) -> Any: + ... + + @property + def precision(self) -> Any: + ... + + @property + def dps(self) -> Any: + ... + + @property + def tolerance(self) -> Any: + ... + + def __init__(self, prec=..., dps=..., tol=...) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def to_sympy(self, element): + ... + + def from_sympy(self, expr) -> Any: + ... + + def from_ZZ(self, element, base) -> Any: + ... + + def from_QQ(self, element, base) -> Any: + ... + + def from_ZZ_python(self, element, base) -> Any: + ... + + def from_QQ_python(self, element, base): + ... + + def from_ZZ_gmpy(self, element, base) -> Any: + ... + + def from_QQ_gmpy(self, element, base) -> Any: + ... + + def from_GaussianIntegerRing(self, element, base) -> Any: + ... + + def from_GaussianRationalField(self, element, base) -> Any: + ... + + def from_AlgebraicField(self, element, base) -> Any: + ... + + def from_RealField(self, element, base) -> Any: + ... + + def from_ComplexField(self, element, base) -> Any: + ... + + def get_ring(self): + ... + + def get_exact(self): + ... + + def is_negative(self, element) -> Literal[False]: + ... + + def is_positive(self, element) -> Literal[False]: + ... + + def is_nonnegative(self, element) -> Literal[False]: + ... + + def is_nonpositive(self, element) -> Literal[False]: + ... + + def gcd(self, a, b) -> Any: + ... + + def lcm(self, a, b): + ... + + def almosteq(self, a, b, tolerance=...) -> Any: + ... + + + +CC = ... diff --git a/stubs/sympy-stubs/polys/domains/compositedomain.pyi b/stubs/sympy-stubs/polys/domains/compositedomain.pyi new file mode 100644 index 00000000..c01cdd6b --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/compositedomain.pyi @@ -0,0 +1,13 @@ +from typing import Self +from sympy.polys.domains.domain import Domain + +class CompositeDomain(Domain): + is_Composite = ... + def inject(self, *symbols) -> Self: + ... + + def drop(self, *symbols) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/domain.pyi b/stubs/sympy-stubs/polys/domains/domain.pyi new file mode 100644 index 00000000..376b0ac8 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/domain.pyi @@ -0,0 +1,288 @@ +from typing import Any, Self + +class Domain: + dtype: type | None = ... + zero: Any = ... + one: Any = ... + is_Ring = ... + is_Field = ... + has_assoc_Ring = ... + has_assoc_Field = ... + is_FF = ... + is_ZZ = ... + is_QQ = ... + is_ZZ_I = ... + is_QQ_I = ... + is_RR = ... + is_CC = ... + is_Algebraic = ... + is_Poly = ... + is_Frac = ... + is_EX = ... + is_EXRAW = ... + is_FiniteExtension = ... + is_Exact = ... + is_Numerical = ... + is_Simple = ... + is_Composite = ... + is_PID = ... + has_CharacteristicZero = ... + rep: str | None = ... + alias: str | None = ... + def __init__(self) -> None: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def new(self, *args): + ... + + @property + def tp(self) -> None: + ... + + def __call__(self, *args): + ... + + def normal(self, *args): + ... + + def convert_from(self, element, base) -> Any: + ... + + def convert(self, element, base=...) -> Any: + ... + + def of_type(self, element) -> bool: + ... + + def __contains__(self, a) -> bool: + ... + + def to_sympy(self, a): + ... + + def from_sympy(self, a): + ... + + def sum(self, args) -> int: + ... + + def from_FF(K1, a, K0) -> None: + ... + + def from_FF_python(K1, a, K0) -> None: + ... + + def from_ZZ_python(K1, a, K0) -> None: + ... + + def from_QQ_python(K1, a, K0) -> None: + ... + + def from_FF_gmpy(K1, a, K0) -> None: + ... + + def from_ZZ_gmpy(K1, a, K0) -> None: + ... + + def from_QQ_gmpy(K1, a, K0) -> None: + ... + + def from_RealField(K1, a, K0) -> None: + ... + + def from_ComplexField(K1, a, K0) -> None: + ... + + def from_AlgebraicField(K1, a, K0) -> None: + ... + + def from_PolynomialRing(K1, a, K0) -> Any | None: + ... + + def from_FractionField(K1, a, K0) -> None: + ... + + def from_MonogenicFiniteExtension(K1, a, K0) -> Any: + ... + + def from_ExpressionDomain(K1, a, K0): + ... + + def from_ExpressionRawDomain(K1, a, K0): + ... + + def from_GlobalPolynomialRing(K1, a, K0) -> Any | None: + ... + + def from_GeneralizedPolynomialRing(K1, a, K0) -> None: + ... + + def unify_with_symbols(K0, K1, symbols): + ... + + def unify(K0, K1, symbols=...): + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def map(self, seq) -> list[Any]: + ... + + def get_ring(self): + ... + + def get_field(self): + ... + + def get_exact(self) -> Self: + ... + + def __getitem__(self, symbols) -> Any: + ... + + def poly_ring(self, *symbols, order=...) -> Any: + ... + + def frac_field(self, *symbols, order=...) -> Any: + ... + + def old_poly_ring(self, *symbols, **kwargs) -> Any: + ... + + def old_frac_field(self, *symbols, **kwargs) -> Any: + ... + + def algebraic_field(self, *extension, alias=...): + ... + + def alg_field_from_poly(self, poly, alias=..., root_index=...): + ... + + def cyclotomic_field(self, n, ss=..., alias=..., gen=..., root_index=...): + ... + + def inject(self, *symbols): + ... + + def drop(self, *symbols) -> Self: + ... + + def is_zero(self, a) -> bool: + ... + + def is_one(self, a): + ... + + def is_positive(self, a): + ... + + def is_negative(self, a): + ... + + def is_nonpositive(self, a): + ... + + def is_nonnegative(self, a): + ... + + def canonical_unit(self, a) -> Any: + ... + + def abs(self, a): + ... + + def neg(self, a): + ... + + def pos(self, a): + ... + + def add(self, a, b): + ... + + def sub(self, a, b): + ... + + def mul(self, a, b): + ... + + def pow(self, a, b): + ... + + def exquo(self, a, b): + ... + + def quo(self, a, b): + ... + + def rem(self, a, b): + ... + + def div(self, a, b): + ... + + def invert(self, a, b): + ... + + def revert(self, a): + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + def half_gcdex(self, a, b) -> tuple[Any, Any]: + ... + + def gcdex(self, a, b): + ... + + def cofactors(self, a, b) -> tuple[Any, Any, Any]: + ... + + def gcd(self, a, b): + ... + + def lcm(self, a, b): + ... + + def log(self, a, b): + ... + + def sqrt(self, a): + ... + + def evalf(self, a, prec=..., **options): + ... + + n = ... + def real(self, a): + ... + + def imag(self, a) -> Any: + ... + + def almosteq(self, a, b, tolerance=...): + ... + + def characteristic(self): + ... + + + +__all__ = ['Domain'] diff --git a/stubs/sympy-stubs/polys/domains/expressiondomain.pyi b/stubs/sympy-stubs/polys/domains/expressiondomain.pyi new file mode 100644 index 00000000..2b7e63e4 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/expressiondomain.pyi @@ -0,0 +1,171 @@ +from sympy.polys.domains.domainelement import DomainElement +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.field import Field +from sympy.polys.domains.simpledomain import SimpleDomain +from sympy.polys.polyutils import PicklableWithSlots +from sympy.utilities import public + +eflags = ... +@public +class ExpressionDomain(Field, CharacteristicZero, SimpleDomain): + is_EX = ... + class Expression(PicklableWithSlots): + __slots__ = ... + def __init__(self, ex) -> None: + ... + + def __repr__(f) -> str: + ... + + def __str__(f) -> str: + ... + + def __hash__(self) -> int: + ... + + def as_expr(f): + ... + + def numer(f) -> Self: + ... + + def denom(f) -> Self: + ... + + def simplify(f, ex) -> Self: + ... + + def __abs__(f) -> Self: + ... + + def __neg__(f) -> Self: + ... + + def __add__(f, g) -> NotImplementedType | Self: + ... + + def __radd__(f, g) -> Self: + ... + + def __sub__(f, g) -> NotImplementedType | Self | Expression: + ... + + def __rsub__(f, g) -> Self: + ... + + def __mul__(f, g) -> NotImplementedType | Any | Self: + ... + + def __rmul__(f, g) -> Self: + ... + + def __pow__(f, n) -> Self | NotImplementedType: + ... + + def __truediv__(f, g) -> Self | NotImplementedType: + ... + + def __rtruediv__(f, g) -> Self: + ... + + def __eq__(f, g) -> bool: + ... + + def __ne__(f, g) -> bool: + ... + + def __bool__(f) -> bool: + ... + + def gcd(f, g) -> Self: + ... + + def lcm(f, g) -> Self: + ... + + + + dtype = Expression + zero = ... + one = ... + rep = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def __init__(self) -> None: + ... + + def to_sympy(self, a): + ... + + def from_sympy(self, a) -> dtype: + ... + + def from_ZZ(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ(K1, a, K0): + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_GaussianIntegerRing(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0): + ... + + def from_RealField(K1, a, K0): + ... + + def from_PolynomialRing(K1, a, K0): + ... + + def from_FractionField(K1, a, K0): + ... + + def from_ExpressionDomain(K1, a, K0): + ... + + def get_ring(self) -> Self: + ... + + def get_field(self) -> Self: + ... + + def is_positive(self, a): + ... + + def is_negative(self, a): + ... + + def is_nonpositive(self, a): + ... + + def is_nonnegative(self, a): + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + def gcd(self, a, b): + ... + + def lcm(self, a, b): + ... + + + +EX = ... diff --git a/stubs/sympy-stubs/polys/domains/expressionrawdomain.pyi b/stubs/sympy-stubs/polys/domains/expressionrawdomain.pyi new file mode 100644 index 00000000..89b22cc5 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/expressionrawdomain.pyi @@ -0,0 +1,40 @@ +from sympy.core import Expr +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.field import Field +from sympy.polys.domains.simpledomain import SimpleDomain +from sympy.utilities import public + +@public +class ExpressionRawDomain(Field, CharacteristicZero, SimpleDomain): + is_EXRAW = ... + dtype = Expr + zero = ... + one = ... + rep = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def __init__(self) -> None: + ... + + @classmethod + def new(self, a): + ... + + def to_sympy(self, a): + ... + + def from_sympy(self, a) -> Expr: + ... + + def convert_from(self, a, K): + ... + + def get_field(self) -> Self: + ... + + def sum(self, items) -> Order: + ... + + + +EXRAW = ... diff --git a/stubs/sympy-stubs/polys/domains/field.pyi b/stubs/sympy-stubs/polys/domains/field.pyi new file mode 100644 index 00000000..8f6a187d --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/field.pyi @@ -0,0 +1,38 @@ +from typing import Any, Self +from sympy.polys.domains.ring import Ring + +class Field(Ring): + is_Field = ... + is_PID = ... + def get_ring(self): + ... + + def get_field(self) -> Self: + ... + + def exquo(self, a, b): + ... + + def quo(self, a, b): + ... + + def rem(self, a, b): + ... + + def div(self, a, b) -> tuple[Any, Any]: + ... + + def gcd(self, a, b): + ... + + def lcm(self, a, b): + ... + + def revert(self, a): + ... + + def is_unit(self, a) -> bool: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/finitefield.pyi b/stubs/sympy-stubs/polys/domains/finitefield.pyi new file mode 100644 index 00000000..af85468d --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/finitefield.pyi @@ -0,0 +1,74 @@ +from typing import Any, Literal, Self +from sympy.core.numbers import Integer +from sympy.external.gmpy import GROUND_TYPES +from sympy.utilities.decorator import doctest_depends_on +from sympy.polys.domains.field import Field +from sympy.polys.domains.simpledomain import SimpleDomain + +class FiniteField(Field, SimpleDomain): # type: ignore + rep = ... + alias = ... + is_FF = ... + is_Numerical = ... + has_assoc_Ring = ... + has_assoc_Field = ... + dom = ... + mod = ... + def __init__(self, mod, symmetric=...) -> None: + ... + + def __str__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def characteristic(self) -> Any | None: + ... + + def get_field(self) -> Self: + ... + + def to_sympy(self, a) -> Integer: + ... + + def from_sympy(self, a) -> Any | Self: + ... + + def from_FF(K1, a, K0=...) -> Any | Self: + ... + + def from_FF_python(K1, a, K0=...) -> Any | Self: + ... + + def from_ZZ(K1, a, K0=...) -> Any | Self: + ... + + def from_ZZ_python(K1, a, K0=...) -> Any | Self: + ... + + def from_QQ(K1, a, K0=...) -> Any | Self | None: + ... + + def from_QQ_python(K1, a, K0=...) -> Any | Self | None: + ... + + def from_FF_gmpy(K1, a, K0=...) -> Any | Self: + ... + + def from_ZZ_gmpy(K1, a, K0=...) -> Any | Self: + ... + + def from_QQ_gmpy(K1, a, K0=...) -> Any | Self | None: + ... + + def from_RealField(K1, a, K0) -> Any | Self | None: + ... + + + +GF = ... +FF = ... diff --git a/stubs/sympy-stubs/polys/domains/fractionfield.pyi b/stubs/sympy-stubs/polys/domains/fractionfield.pyi new file mode 100644 index 00000000..3468a91b --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/fractionfield.pyi @@ -0,0 +1,115 @@ +from typing import Any +from sympy.polys.domains.compositedomain import CompositeDomain +from sympy.polys.domains.field import Field +from sympy.polys.fields import FracElement +from sympy.utilities import public + +class FractionField(Field, CompositeDomain): + is_Frac = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def __init__(self, domain_or_field, symbols=..., order=...) -> None: + ... + + def new(self, element) -> FracElement: + ... + + @property + def zero(self): + ... + + @property + def one(self): + ... + + @property + def order(self): + ... + + @property + def is_Exact(self): + ... + + def get_exact(self) -> Any: + ... + + def __str__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def to_sympy(self, a): + ... + + def from_sympy(self, a): + ... + + def from_ZZ(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ(K1, a, K0): + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0): + ... + + def from_GaussianIntegerRing(K1, a, K0): + ... + + def from_RealField(K1, a, K0): + ... + + def from_ComplexField(K1, a, K0): + ... + + def from_AlgebraicField(K1, a, K0) -> FracElement | None: + ... + + def from_PolynomialRing(K1, a, K0) -> FracElement | None: + ... + + def from_FractionField(K1, a, K0) -> None: + ... + + def get_ring(self) -> Any: + ... + + def is_positive(self, a): + ... + + def is_negative(self, a): + ... + + def is_nonpositive(self, a): + ... + + def is_nonnegative(self, a): + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + def factorial(self, a): + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi b/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi new file mode 100644 index 00000000..30531037 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/gaussiandomains.pyi @@ -0,0 +1,234 @@ +from types import NotImplementedType +from typing import Any, Literal, LiteralString, Self +from sympy.polys.domains.integerring import ZZ +from sympy.polys.domains.rationalfield import QQ +from sympy.polys.domains.domain import Domain +from sympy.polys.domains.domainelement import DomainElement +from sympy.polys.domains.field import Field +from sympy.polys.domains.ring import Ring + +class GaussianElement(DomainElement): # type: ignore + base: Domain + _parent: Domain + __slots__ = ... + def __new__(cls, x, y=...): + ... + + @classmethod + def new(cls, x, y): + ... + + def parent(self): + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __pos__(self) -> Self: + ... + + def __neg__(self): + ... + + def __repr__(self) -> LiteralString: + ... + + def __str__(self) -> str: + ... + + def __add__(self, other) -> NotImplementedType: + ... + + __radd__ = ... + def __sub__(self, other) -> NotImplementedType: + ... + + def __rsub__(self, other) -> NotImplementedType: + ... + + def __mul__(self, other) -> NotImplementedType: + ... + + __rmul__ = ... + def __pow__(self, exp) -> float | Self: + ... + + def __bool__(self) -> bool: + ... + + def quadrant(self) -> Literal[0, 1, 2, 3]: + ... + + def __rdivmod__(self, other) -> NotImplementedType: + ... + + def __rtruediv__(self, other) -> NotImplementedType: + ... + + def __floordiv__(self, other): + ... + + def __rfloordiv__(self, other) -> NotImplementedType: + ... + + def __mod__(self, other): + ... + + def __rmod__(self, other) -> NotImplementedType: + ... + + + +class GaussianInteger(GaussianElement): + base = ... + def __truediv__(self, other): + ... + + def __divmod__(self, other) -> NotImplementedType | tuple[GaussianInteger, Any]: + ... + + + +class GaussianRational(GaussianElement): + base = ... + def __truediv__(self, other) -> NotImplementedType | GaussianRational: + ... + + def __divmod__(self, other) -> NotImplementedType | tuple[Any, Any]: + ... + + + +class GaussianDomain: + dom: Domain = ... + is_Numerical = ... + is_Exact = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def to_sympy(self, a): + ... + + def from_sympy(self, a): + ... + + def inject(self, *gens): + ... + + def canonical_unit(self, d): + ... + + def is_negative(self, element) -> Literal[False]: + ... + + def is_positive(self, element) -> Literal[False]: + ... + + def is_nonnegative(self, element) -> Literal[False]: + ... + + def is_nonpositive(self, element) -> Literal[False]: + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_ZZ(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_AlgebraicField(K1, a, K0) -> None: + ... + + + +class GaussianIntegerRing(GaussianDomain, Ring): + dom = ... + dtype = GaussianInteger + zero = dtype(ZZ(0), ZZ(0)) + one = dtype(ZZ(1), ZZ(0)) + imag_unit = dtype(ZZ(0), ZZ(1)) + units = ... + rep = ... + is_GaussianRing = ... + is_ZZ_I = ... + def __init__(self) -> None: + ... + + def get_ring(self) -> Self: + ... + + def get_field(self) -> GaussianRationalField: + ... + + def normalize(self, d, *args) -> tuple[Any, *tuple[Any, ...]]: + ... + + def gcd(self, a, b) -> tuple[Any, *tuple[Any, ...]]: + ... + + def lcm(self, a, b): + ... + + def from_GaussianIntegerRing(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0): + ... + + + +class GaussianRationalField(GaussianDomain, Field): + dom = ... + dtype = GaussianRational + zero = dtype(QQ(0), QQ(0)) + one = dtype(QQ(1), QQ(0)) + imag_unit = dtype(QQ(0), QQ(1)) + units = ... + rep = ... + is_GaussianField = ... + is_QQ_I = ... + def __init__(self) -> None: + ... + + def get_ring(self) -> GaussianIntegerRing: + ... + + def get_field(self) -> Self: + ... + + def as_AlgebraicField(self) -> Any: + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + def from_GaussianIntegerRing(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0): + ... + + + +QQ_I = ... +ZZ_I = ... \ No newline at end of file diff --git a/stubs/sympy-stubs/polys/domains/gmpyintegerring.pyi b/stubs/sympy-stubs/polys/domains/gmpyintegerring.pyi new file mode 100644 index 00000000..2868c792 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/gmpyintegerring.pyi @@ -0,0 +1,65 @@ +from typing import Any +from sympy.core.numbers import Integer +from sympy.polys.domains.groundtypes import _GMPYInteger, GMPYInteger +from sympy.polys.domains.integerring import IntegerRing +from sympy.utilities import public + +class GMPYIntegerRing(IntegerRing): + dtype = GMPYInteger + zero = dtype(0) + one = dtype(1) + tp = type(one) + alias = ... + def __init__(self) -> None: + ... + + def to_sympy(self, a) -> Integer: + ... + + def from_sympy(self, a) -> _GMPYInteger: + ... + + def from_FF_python(K1, a, K0) -> _GMPYInteger: + ... + + def from_ZZ_python(K1, a, K0) -> _GMPYInteger: + ... + + def from_QQ(K1, a, K0) -> _GMPYInteger | None: + ... + + def from_QQ_python(K1, a, K0) -> _GMPYInteger | None: + ... + + def from_FF_gmpy(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0) -> None: + ... + + def from_RealField(K1, a, K0) -> _GMPYInteger | None: + ... + + def from_GaussianIntegerRing(K1, a, K0) -> None: + ... + + def gcdex(self, a, b) -> tuple[Any, Any, Any]: + ... + + def gcd(self, a, b): + ... + + def lcm(self, a, b): + ... + + def sqrt(self, a) -> int: + ... + + def factorial(self, a) -> int: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/gmpyrationalfield.pyi b/stubs/sympy-stubs/polys/domains/gmpyrationalfield.pyi new file mode 100644 index 00000000..e594075d --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/gmpyrationalfield.pyi @@ -0,0 +1,65 @@ +from typing import Any +from sympy.core.numbers import Rational +from sympy.polys.domains.groundtypes import _GMPYRational, GMPYRational +from sympy.polys.domains.rationalfield import RationalField +from sympy.utilities import public + +class GMPYRationalField(RationalField): + dtype = GMPYRational + zero = dtype(0) + one = dtype(1) + tp = type(one) + alias = ... + def __init__(self) -> None: + ... + + def get_ring(self) -> Any: + ... + + def to_sympy(self, a) -> Rational: + ... + + def from_sympy(self, a) -> _GMPYRational: + ... + + def from_ZZ_python(K1, a, K0) -> _GMPYRational: + ... + + def from_QQ_python(K1, a, K0) -> _GMPYRational: + ... + + def from_ZZ_gmpy(K1, a, K0) -> _GMPYRational: + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0) -> _GMPYRational | None: + ... + + def from_RealField(K1, a, K0) -> _GMPYRational: + ... + + def exquo(self, a, b): + ... + + def quo(self, a, b): + ... + + def rem(self, a, b) -> dtype: + ... + + def div(self, a, b) -> tuple[Any, dtype]: + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + def factorial(self, a) -> _GMPYRational: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/integerring.pyi b/stubs/sympy-stubs/polys/domains/integerring.pyi new file mode 100644 index 00000000..9febc087 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/integerring.pyi @@ -0,0 +1,92 @@ +from typing import Any, Literal +from sympy.core.numbers import Integer +from sympy.external.gmpy import MPZ +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.ring import Ring +from sympy.polys.domains.simpledomain import SimpleDomain +from sympy.utilities import public + +class IntegerRing(Ring, CharacteristicZero, SimpleDomain): # type: ignore + rep = ... + alias = ... + dtype = MPZ + zero = dtype(0) + one = dtype(1) + tp = type(one) + is_ZZ = ... + is_Numerical = ... + is_PID = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def __init__(self) -> None: + ... + + def to_sympy(self, a) -> Integer: + ... + + def from_sympy(self, a) -> int: + ... + + def get_field(self) -> Any: + ... + + def algebraic_field(self, *extension, alias=...) -> Any: + ... + + def from_AlgebraicField(K1, a, K0) -> None: + ... + + def log(self, a, b) -> dtype: + ... + + def from_FF(K1, a, K0) -> int: + ... + + def from_FF_python(K1, a, K0) -> int: + ... + + def from_ZZ(K1, a, K0) -> int: + ... + + def from_ZZ_python(K1, a, K0) -> int: + ... + + def from_QQ(K1, a, K0) -> int | None: + ... + + def from_QQ_python(K1, a, K0) -> int | None: + ... + + def from_FF_gmpy(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0) -> None: + ... + + def from_RealField(K1, a, K0) -> int | None: + ... + + def from_GaussianIntegerRing(K1, a, K0) -> None: + ... + + def gcdex(self, a, b) -> tuple[Any | Literal[1, 0, -1], Any | Literal[0], Any | Literal[0, -1, 1]] | tuple[Any | Literal[0, -1, 1], Any | Literal[1, 0, -1], Any | Literal[0]]: + ... + + def gcd(self, a, b) -> int: + ... + + def lcm(self, a, b) -> Literal[0]: + ... + + def sqrt(self, a) -> int: + ... + + def factorial(self, a) -> int: + ... + + + +ZZ = ... diff --git a/stubs/sympy-stubs/polys/domains/modularinteger.pyi b/stubs/sympy-stubs/polys/domains/modularinteger.pyi new file mode 100644 index 00000000..9fe2c2f9 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/modularinteger.pyi @@ -0,0 +1,99 @@ +from types import NotImplementedType +from typing import Any, LiteralString, Self +from sympy.polys.polyutils import PicklableWithSlots +from sympy.polys.domains.domainelement import DomainElement +from sympy.utilities import public + +@public +class ModularInteger(PicklableWithSlots, DomainElement): + __slots__ = ... + def parent(self) -> None: + ... + + def __init__(self, val) -> None: + ... + + def __hash__(self) -> int: + ... + + def __repr__(self) -> LiteralString: + ... + + def __str__(self) -> str: + ... + + def __int__(self) -> int: + ... + + def to_int(self): + ... + + def __pos__(self) -> Self: + ... + + def __neg__(self) -> Self: + ... + + def __add__(self, other) -> Self | NotImplementedType: + ... + + def __radd__(self, other) -> Self | NotImplementedType: + ... + + def __sub__(self, other) -> Self | NotImplementedType: + ... + + def __rsub__(self, other) -> Self | NotImplementedType: + ... + + def __mul__(self, other) -> Self | NotImplementedType: + ... + + def __rmul__(self, other) -> Self | NotImplementedType: + ... + + def __truediv__(self, other) -> Self | NotImplementedType: + ... + + def __rtruediv__(self, other) -> Self | NotImplementedType: + ... + + def __mod__(self, other) -> Self | NotImplementedType: + ... + + def __rmod__(self, other) -> Self | NotImplementedType: + ... + + def __pow__(self, exp) -> Self: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __bool__(self) -> bool: + ... + + def invert(self) -> Self: + ... + + + +_modular_integer_cache: dict[tuple[Any, Any, Any], type[ModularInteger]] = ... +def ModularIntegerFactory(_mod, _dom, _sym, parent) -> type[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/domains/mpelements.pyi b/stubs/sympy-stubs/polys/domains/mpelements.pyi new file mode 100644 index 00000000..c526f496 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/mpelements.pyi @@ -0,0 +1,40 @@ +from typing import Any, Literal +from sympy.polys.domains.domainelement import DomainElement +from sympy.utilities import public +from mpmath.ctx_mp_python import PythonMPContext, _mpc, _mpf + +@public +class RealElement(_mpf, DomainElement): + __slots__ = ... + _mpf_ = ... + def parent(self): + ... + + + +@public +class ComplexElement(_mpc, DomainElement): + __slots__ = ... + _mpc_ = ... + def parent(self): + ... + + + +new = ... +@public +class MPContext(PythonMPContext): + def __init__(ctx, prec=..., dps=..., tol=..., real=...) -> None: + ... + + def make_tol(ctx) -> _mpf: + ... + + def to_rational(ctx, s, limit=...) -> tuple[Any, Any | Literal[1]]: + ... + + def almosteq(ctx, s, t, rel_eps=..., abs_eps=...) -> Literal[True]: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/old_fractionfield.pyi b/stubs/sympy-stubs/polys/domains/old_fractionfield.pyi new file mode 100644 index 00000000..a043790f --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/old_fractionfield.pyi @@ -0,0 +1,89 @@ +from typing import Any, Self +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.field import Field +from sympy.polys.domains.compositedomain import CompositeDomain +from sympy.polys.polyclasses import DMF +from sympy.utilities import public + +class FractionField(Field, CharacteristicZero, CompositeDomain): + dtype = DMF + is_Frac = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def __init__(self, dom, *gens) -> None: + ... + + def new(self, element) -> dtype: + ... + + def __str__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def to_sympy(self, a): + ... + + def from_sympy(self, a): + ... + + def from_ZZ(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_RealField(K1, a, K0): + ... + + def from_GlobalPolynomialRing(K1, a, K0): + ... + + def from_FractionField(K1, a, K0) -> None: + ... + + def get_ring(self) -> Any: + ... + + def poly_ring(self, *gens): + ... + + def frac_field(self, *gens): + ... + + def is_positive(self, a): + ... + + def is_negative(self, a): + ... + + def is_nonpositive(self, a): + ... + + def is_nonnegative(self, a): + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + def factorial(self, a) -> dtype: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/old_polynomialring.pyi b/stubs/sympy-stubs/polys/domains/old_polynomialring.pyi new file mode 100644 index 00000000..f6536c1d --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/old_polynomialring.pyi @@ -0,0 +1,137 @@ +from typing import Any, Literal, Self +from sympy.polys.agca.modules import FreeModulePolyRing +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.compositedomain import CompositeDomain +from sympy.polys.domains.ring import Ring +from sympy.polys.polyclasses import DMF, DMP +from sympy.series.order import Order +from sympy.utilities import public + +class PolynomialRingBase(Ring, CharacteristicZero, CompositeDomain): + has_assoc_Ring = ... + has_assoc_Field = ... + default_order = ... + def __init__(self, dom, *gens, **opts) -> None: + ... + + def new(self, element): + ... + + def __str__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def from_ZZ(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ(K1, a, K0): + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_RealField(K1, a, K0): + ... + + def from_AlgebraicField(K1, a, K0) -> None: + ... + + def from_PolynomialRing(K1, a, K0): + ... + + def from_GlobalPolynomialRing(K1, a, K0): + ... + + def get_field(self) -> Any: + ... + + def poly_ring(self, *gens): + ... + + def frac_field(self, *gens): + ... + + def revert(self, a): + ... + + def gcdex(self, a, b): + ... + + def gcd(self, a, b): + ... + + def lcm(self, a, b): + ... + + def factorial(self, a): + ... + + def free_module(self, rank) -> FreeModulePolyRing: + ... + + + +@public +class GlobalPolynomialRing(PolynomialRingBase): + is_Poly = ... + dtype = DMP + def from_FractionField(K1, a, K0) -> None: + ... + + def to_sympy(self, a) -> Order: + ... + + def from_sympy(self, a): + ... + + def is_positive(self, a): + ... + + def is_negative(self, a): + ... + + def is_nonpositive(self, a): + ... + + def is_nonnegative(self, a): + ... + + + +class GeneralizedPolynomialRing(PolynomialRingBase): + dtype = DMF + def new(self, a) -> dtype: + ... + + def __contains__(self, a) -> Literal[False]: + ... + + def from_FractionField(K1, a, K0): + ... + + def to_sympy(self, a): + ... + + def from_sympy(self, a): + ... + + + +@public +def PolynomialRing(dom, *gens, **opts) -> Any | GeneralizedPolynomialRing: + ... + diff --git a/stubs/sympy-stubs/polys/domains/polynomialring.pyi b/stubs/sympy-stubs/polys/domains/polynomialring.pyi new file mode 100644 index 00000000..e2f7fffd --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/polynomialring.pyi @@ -0,0 +1,120 @@ +from typing import Any, Literal +from sympy.polys.domains.ring import Ring +from sympy.polys.domains.compositedomain import CompositeDomain +from sympy.polys.rings import PolyElement +from sympy.utilities import public + +class PolynomialRing(Ring, CompositeDomain): + is_Poly = ... + has_assoc_Ring = ... + has_assoc_Field = ... + def __init__(self, domain_or_ring, symbols=..., order=...) -> None: + ... + + def new(self, element) -> PolyElement: + ... + + @property + def zero(self): + ... + + @property + def one(self): + ... + + @property + def order(self): + ... + + def __str__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def is_unit(self, a) -> Literal[False]: + ... + + def canonical_unit(self, a): + ... + + def to_sympy(self, a): + ... + + def from_sympy(self, a): + ... + + def from_ZZ(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ(K1, a, K0): + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0): + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_GaussianIntegerRing(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0): + ... + + def from_RealField(K1, a, K0): + ... + + def from_ComplexField(K1, a, K0): + ... + + def from_AlgebraicField(K1, a, K0) -> PolyElement | None: + ... + + def from_PolynomialRing(K1, a, K0) -> None: + ... + + def from_FractionField(K1, a, K0) -> None: + ... + + def from_GlobalPolynomialRing(K1, a, K0) -> None: + ... + + def get_field(self) -> Any: + ... + + def is_positive(self, a): + ... + + def is_negative(self, a): + ... + + def is_nonpositive(self, a): + ... + + def is_nonnegative(self, a): + ... + + def gcdex(self, a, b): + ... + + def gcd(self, a, b): + ... + + def lcm(self, a, b): + ... + + def factorial(self, a): + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/pythonintegerring.pyi b/stubs/sympy-stubs/polys/domains/pythonintegerring.pyi new file mode 100644 index 00000000..5e6722e2 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/pythonintegerring.pyi @@ -0,0 +1,61 @@ +from typing import Any, Literal +from sympy.core.numbers import Integer +from sympy.polys.domains.groundtypes import PythonInteger +from sympy.polys.domains.integerring import IntegerRing +from sympy.utilities import public + +class PythonIntegerRing(IntegerRing): + dtype = PythonInteger + zero = dtype(0) + one = dtype(1) + alias = ... + def __init__(self) -> None: + ... + + def to_sympy(self, a) -> Integer: + ... + + def from_sympy(self, a) -> PythonInteger: + ... + + def from_FF_python(K1, a, K0): + ... + + def from_ZZ_python(K1, a, K0): + ... + + def from_QQ(K1, a, K0) -> None: + ... + + def from_QQ_python(K1, a, K0) -> None: + ... + + def from_FF_gmpy(K1, a, K0) -> PythonInteger: + ... + + def from_ZZ_gmpy(K1, a, K0) -> PythonInteger: + ... + + def from_QQ_gmpy(K1, a, K0) -> PythonInteger | None: + ... + + def from_RealField(K1, a, K0) -> PythonInteger | None: + ... + + def gcdex(self, a, b) -> tuple[Literal[0], Literal[1], Literal[0]] | tuple[Literal[0], Any, Any] | tuple[Any, Literal[0], Any] | tuple[Literal[-1, 1, 0], Literal[0, -1, 1], Any]: + ... + + def gcd(self, a, b) -> int: + ... + + def lcm(self, a, b) -> Literal[0]: + ... + + def sqrt(self, a) -> int: + ... + + def factorial(self, a) -> int: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/pythonrational.pyi b/stubs/sympy-stubs/polys/domains/pythonrational.pyi new file mode 100644 index 00000000..5086e582 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/pythonrational.pyi @@ -0,0 +1,6 @@ +from sympy.core.numbers import Integer, Rational + +PythonRational = ... +def sympify_pythonrational(arg) -> Rational | Integer: + ... + diff --git a/stubs/sympy-stubs/polys/domains/pythonrationalfield.pyi b/stubs/sympy-stubs/polys/domains/pythonrationalfield.pyi new file mode 100644 index 00000000..309f099f --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/pythonrationalfield.pyi @@ -0,0 +1,45 @@ +from typing import Any +from sympy.core.numbers import Integer, Rational +from sympy.polys.domains.rationalfield import RationalField +from sympy.utilities import public + +class PythonRationalField(RationalField): + dtype = ... + zero = ... + one = ... + alias = ... + def __init__(self) -> None: + ... + + def get_ring(self) -> Any: + ... + + def to_sympy(self, a) -> Rational | Integer: + ... + + def from_sympy(self, a) -> Any: + ... + + def from_ZZ_python(K1, a, K0) -> Any: + ... + + def from_QQ_python(K1, a, K0): + ... + + def from_ZZ_gmpy(K1, a, K0) -> Any: + ... + + def from_QQ_gmpy(K1, a, K0) -> Any: + ... + + def from_RealField(K1, a, K0) -> Any: + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/quotientring.pyi b/stubs/sympy-stubs/polys/domains/quotientring.pyi new file mode 100644 index 00000000..71a19796 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/quotientring.pyi @@ -0,0 +1,106 @@ +from types import NotImplementedType +from typing import Any +from sympy.polys.agca.modules import FreeModuleQuotientRing +from sympy.polys.domains.ring import Ring +from sympy.utilities import public + +class QuotientRingElement: + def __init__(self, ring, data) -> None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __bool__(self) -> bool: + ... + + def __add__(self, om) -> NotImplementedType: + ... + + __radd__ = ... + def __neg__(self): + ... + + def __sub__(self, om) -> NotImplementedType: + ... + + def __rsub__(self, om): + ... + + def __mul__(self, o) -> NotImplementedType: + ... + + __rmul__ = ... + def __rtruediv__(self, o): + ... + + def __truediv__(self, o) -> NotImplementedType: + ... + + def __pow__(self, oth): + ... + + def __eq__(self, om) -> bool: + ... + + def __ne__(self, om) -> bool: + ... + + + +class QuotientRing(Ring): + has_assoc_Ring = ... + has_assoc_Field = ... + dtype = ... + def __init__(self, ring, ideal) -> None: + ... + + def __str__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def new(self, a) -> Any: + ... + + def __eq__(self, other) -> bool: + ... + + def from_ZZ(K1, a, K0): + ... + + from_ZZ_python = ... + from_QQ_python = ... + from_ZZ_gmpy = ... + from_QQ_gmpy = ... + from_RealField = ... + from_GlobalPolynomialRing = ... + from_FractionField = ... + def from_sympy(self, a): + ... + + def to_sympy(self, a): + ... + + def from_QuotientRing(self, a, K0) -> None: + ... + + def poly_ring(self, *gens): + ... + + def frac_field(self, *gens): + ... + + def revert(self, a): + ... + + def is_zero(self, a): + ... + + def free_module(self, rank) -> FreeModuleQuotientRing: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/rationalfield.pyi b/stubs/sympy-stubs/polys/domains/rationalfield.pyi new file mode 100644 index 00000000..f2aa2173 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/rationalfield.pyi @@ -0,0 +1,84 @@ +from types import NotImplementedType +from typing import Any, Literal, Self +from sympy.core.numbers import Integer, Rational +from sympy.external.gmpy import MPQ +from sympy.external.pythonmpq import PythonMPQ +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.polys.domains.field import Field +from sympy.polys.domains.simpledomain import SimpleDomain +from sympy.utilities import public + +class RationalField(Field, CharacteristicZero, SimpleDomain): + rep = ... + alias = ... + is_QQ = ... + is_Numerical = ... + has_assoc_Ring = ... + has_assoc_Field = ... + dtype = MPQ + zero = dtype(0) + one = dtype(1) + tp = type(one) + def __init__(self) -> None: + ... + + def get_ring(self) -> Any: + ... + + def to_sympy(self, a) -> Rational | Integer: + ... + + def from_sympy(self, a) -> PythonMPQ: + ... + + def algebraic_field(self, *extension, alias=...) -> Any: + ... + + def from_AlgebraicField(K1, a, K0) -> None: + ... + + def from_ZZ(K1, a, K0) -> PythonMPQ: + ... + + def from_ZZ_python(K1, a, K0) -> PythonMPQ: + ... + + def from_QQ(K1, a, K0) -> PythonMPQ: + ... + + def from_QQ_python(K1, a, K0) -> PythonMPQ: + ... + + def from_ZZ_gmpy(K1, a, K0) -> PythonMPQ: + ... + + def from_QQ_gmpy(K1, a, K0): + ... + + def from_GaussianRationalField(K1, a, K0) -> PythonMPQ | None: + ... + + def from_RealField(K1, a, K0) -> PythonMPQ: + ... + + def exquo(self, a, b) -> NotImplementedType | Self: + ... + + def quo(self, a, b) -> NotImplementedType | Self: + ... + + def rem(self, a, b) -> dtype: + ... + + def div(self, a, b) -> tuple[NotImplementedType | Self, dtype]: + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + + +QQ = ... diff --git a/stubs/sympy-stubs/polys/domains/realfield.pyi b/stubs/sympy-stubs/polys/domains/realfield.pyi new file mode 100644 index 00000000..f2afc3aa --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/realfield.pyi @@ -0,0 +1,95 @@ +from typing import Any, Self +from sympy.core.numbers import Float +from sympy.polys.domains.field import Field +from sympy.polys.domains.simpledomain import SimpleDomain +from sympy.polys.domains.characteristiczero import CharacteristicZero +from sympy.utilities import public + +class RealField(Field, CharacteristicZero, SimpleDomain): + rep = ... + is_RR = ... + is_Exact = ... + is_Numerical = ... + is_PID = ... + has_assoc_Ring = ... + has_assoc_Field = ... + _default_precision = ... + @property + def has_default_precision(self) -> Any: + ... + + @property + def precision(self) -> Any: + ... + + @property + def dps(self) -> Any: + ... + + @property + def tolerance(self) -> Any: + ... + + def __init__(self, prec=..., dps=..., tol=...) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def to_sympy(self, element) -> Float: + ... + + def from_sympy(self, expr) -> Any: + ... + + def from_ZZ(self, element, base) -> Any: + ... + + def from_ZZ_python(self, element, base) -> Any: + ... + + def from_QQ(self, element, base): + ... + + def from_QQ_python(self, element, base): + ... + + def from_ZZ_gmpy(self, element, base) -> Any: + ... + + def from_QQ_gmpy(self, element, base) -> Any: + ... + + def from_AlgebraicField(self, element, base) -> Any: + ... + + def from_RealField(self, element, base) -> Any: + ... + + def from_ComplexField(self, element, base) -> Any | None: + ... + + def to_rational(self, element, limit=...) -> Any: + ... + + def get_ring(self) -> Self: + ... + + def get_exact(self) -> Any: + ... + + def gcd(self, a, b) -> Any: + ... + + def lcm(self, a, b): + ... + + def almosteq(self, a, b, tolerance=...) -> Any: + ... + + + +RR = ... diff --git a/stubs/sympy-stubs/polys/domains/ring.pyi b/stubs/sympy-stubs/polys/domains/ring.pyi new file mode 100644 index 00000000..fdc6a5a4 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/ring.pyi @@ -0,0 +1,52 @@ +from typing import Self +from sympy.polys.agca.ideals import ModuleImplementedIdeal +from sympy.polys.domains.domain import Domain +from sympy.polys.domains.quotientring import QuotientRing +from sympy.utilities import public + +class Ring(Domain): + is_Ring = ... + def get_ring(self) -> Self: + ... + + def exquo(self, a, b): + ... + + def quo(self, a, b): + ... + + def rem(self, a, b): + ... + + def div(self, a, b): + ... + + def invert(self, a, b): + ... + + def revert(self, a): + ... + + def is_unit(self, a) -> bool: + ... + + def numer(self, a): + ... + + def denom(self, a): + ... + + def free_module(self, rank): + ... + + def ideal(self, *gens) -> ModuleImplementedIdeal: + ... + + def quotient_ring(self, e) -> QuotientRing: + ... + + def __truediv__(self, e) -> QuotientRing: + ... + + + diff --git a/stubs/sympy-stubs/polys/domains/simpledomain.pyi b/stubs/sympy-stubs/polys/domains/simpledomain.pyi new file mode 100644 index 00000000..05c39e53 --- /dev/null +++ b/stubs/sympy-stubs/polys/domains/simpledomain.pyi @@ -0,0 +1,8 @@ +from typing import Self +from sympy.polys.domains.domain import Domain + +class SimpleDomain(Domain): + is_Simple = True + def inject(self, *gens) -> Self: + ... + diff --git a/stubs/sympy-stubs/polys/euclidtools.pyi b/stubs/sympy-stubs/polys/euclidtools.pyi new file mode 100644 index 00000000..843a3e3a --- /dev/null +++ b/stubs/sympy-stubs/polys/euclidtools.pyi @@ -0,0 +1,138 @@ +from typing import Any + +def dup_half_gcdex(f, g, K) -> tuple[Any | list[Any], Any | list[Any]]: + ... + +def dmp_half_gcdex(f, g, u, K) -> tuple[Any | list[Any], Any | list[Any]]: + ... + +def dup_gcdex(f, g, K) -> tuple[Any | list[Any], Any | list[Any], Any | list[Any]]: + ... + +def dmp_gcdex(f, g, u, K) -> tuple[Any | list[Any], Any | list[Any], Any | list[Any]]: + ... + +def dup_invert(f, g, K) -> list[Any]: + ... + +def dmp_invert(f, g, u, K) -> list[Any]: + ... + +def dup_euclidean_prs(f, g, K) -> list[Any]: + ... + +def dmp_euclidean_prs(f, g, u, K) -> list[Any]: + ... + +def dup_primitive_prs(f, g, K) -> list[Any]: + ... + +def dmp_primitive_prs(f, g, u, K) -> list[Any]: + ... + +def dup_inner_subresultants(f, g, K) -> tuple[list[Any], list[Any]]: + ... + +def dup_subresultants(f, g, K) -> list[Any]: + ... + +def dup_prs_resultant(f, g, K) -> tuple[Any, list[Any]]: + ... + +def dup_resultant(f, g, K, includePRS=...) -> tuple[Any, list[Any]]: + ... + +def dmp_inner_subresultants(f, g, u, K) -> tuple[list[Any], list[Any]] | tuple[list[Any], list[list[list[Any]] | Any | list[Any]]]: + ... + +def dmp_subresultants(f, g, u, K) -> list[Any]: + ... + +def dmp_prs_resultant(f, g, u, K) -> tuple[Any, list[Any]] | tuple[list[list[Any]], list[Any]] | tuple[list[list[Any]] | Any | list[Any], list[Any]]: + ... + +def dmp_zz_modular_resultant(f, g, p, u, K) -> list[list[Any]]: + ... + +def dmp_zz_collins_resultant(f, g, u, K) -> list[list[Any]]: + ... + +def dmp_qq_collins_resultant(f, g, u, K0) -> list[list[Any]] | list[Any]: + ... + +def dmp_resultant(f, g, u, K, includePRS=...) -> tuple[Any, list[Any]] | tuple[list[list[Any]], list[Any]] | tuple[list[list[Any]] | Any | list[Any], list[Any]] | list[list[Any]] | list[Any]: + ... + +def dup_discriminant(f, K): + ... + +def dmp_discriminant(f, u, K) -> list[list[Any]]: + ... + +def dup_rr_prs_gcd(f, g, K) -> tuple[list[Any], list[Any], list[Any]] | tuple[Any, list[Any], list[Any]] | tuple[list[Any], Any | list[Any], Any | list[Any]]: + ... + +def dup_ff_prs_gcd(f, g, K) -> tuple[list[Any], list[Any], list[Any]] | tuple[Any | list[Any], list[Any], list[Any]] | tuple[Any | list[Any], Any | list[Any], Any | list[Any]]: + ... + +def dmp_rr_prs_gcd(f, g, u, K) -> tuple[list[Any], list[Any], list[Any]] | tuple[Any, list[Any], list[Any]] | tuple[list[Any], Any | list[Any], Any | list[Any]] | tuple[list[list[Any]], ...] | tuple[Any, list[list[Any]], list[list[Any]] | Any | list[Any]] | tuple[list[Any], list[list[Any]], list[list[Any]] | Any | list[Any]] | tuple[Any, list[list[Any]] | Any | list[Any], list[list[Any]]] | tuple[list[Any], list[list[Any]] | Any | list[Any], list[list[Any]]] | tuple[list[list[Any]] | Any | list[Any], Any, Any] | tuple[list[Any], list[Any | list[list[Any]]], list[Any | list[list[Any]]]] | tuple[list[Any] | Any | list[list[Any]] | list[Any | list[Any] | list[list[Any]]], Any | list[list[Any]], Any | list[list[Any]]]: + ... + +def dmp_ff_prs_gcd(f, g, u, K) -> tuple[list[Any], list[Any], list[Any]] | tuple[Any | list[Any], list[Any], list[Any]] | tuple[Any | list[Any], Any | list[Any], Any | list[Any]] | tuple[list[list[Any]], ...] | tuple[Any | list[Any], list[list[Any]], list[list[Any]] | Any | list[Any]] | tuple[Any | list[Any], list[list[Any]] | Any | list[Any], list[list[Any]]] | tuple[list[Any], list[Any | list[list[Any]]], list[Any | list[list[Any]]]] | tuple[Any | list[Any], Any | list[list[Any]], Any | list[list[Any]]]: + ... + +HEU_GCD_MAX = ... +def dup_zz_heu_gcd(f, g, K) -> tuple[list[Any], list[Any], list[Any]] | tuple[Any, list[Any], list[Any]] | tuple[list[Any], Any | list[Any], Any | list[Any]] | tuple[list[Any], list[Any], Any | list[Any]] | tuple[list[Any], Any | list[Any], list[Any]]: + ... + +def dmp_zz_heu_gcd(f, g, u, K) -> tuple[list[Any], list[Any], list[Any]] | tuple[Any, list[Any], list[Any]] | tuple[list[Any], Any | list[Any], Any | list[Any]] | tuple[list[Any], list[Any], Any | list[Any]] | tuple[list[Any], Any | list[Any], list[Any]] | tuple[list[list[Any]], ...] | tuple[Any, list[list[Any]], list[list[Any]] | Any | list[Any]] | tuple[list[Any], list[list[Any]], list[list[Any]] | Any | list[Any]] | tuple[Any, list[list[Any]] | Any | list[Any], list[list[Any]]] | tuple[list[Any], list[list[Any]] | Any | list[Any], list[list[Any]]] | tuple[list[list[Any]] | Any | list[Any], Any, Any] | tuple[list[Any], list[Any | list[list[Any]]], list[Any | list[list[Any]]]] | tuple[list[Any], Any | list[list[Any]], Any | list[list[Any]]] | tuple[list[Any], list[Any], Any | list[list[Any]]] | tuple[list[Any], Any | list[list[Any]], list[Any]]: + ... + +def dup_qq_heu_gcd(f, g, K0) -> tuple[list[Any], list[Any], list[Any]] | tuple[Any | list[Any], list[Any], list[Any]]: + ... + +def dmp_qq_heu_gcd(f, g, u, K0) -> tuple[list[list[Any]], ...] | tuple[Any | list[Any], list[list[Any]], list[list[Any]] | Any | list[Any]] | tuple[Any | list[Any], list[list[Any]] | Any | list[Any], list[list[Any]]] | tuple[list[Any], list[Any | list[list[Any]]], list[Any | list[list[Any]]]] | tuple[Any | list[Any], list[Any], list[Any]]: + ... + +def dup_inner_gcd(f, g, K) -> tuple[list[Any], Any, Any] | tuple[Any, Any, Any] | tuple[list[Any], list[Any], list[Any]] | tuple[Any | list[Any], list[Any], list[Any]] | tuple[Any | list[Any], Any | list[Any], Any | list[Any]] | tuple[Any, list[Any], list[Any]] | tuple[list[Any], Any | list[Any], Any | list[Any]] | tuple[list[Any], list[Any], Any | list[Any]] | tuple[list[Any], Any | list[Any], list[Any]]: + ... + +def dmp_inner_gcd(f, g, u, K) -> tuple[list[Any], Any, Any] | tuple[Any, Any, Any] | tuple[list[Any], list[Any], list[Any]] | tuple[Any | list[Any], list[Any], list[Any]] | tuple[Any | list[Any], Any | list[Any], Any | list[Any]] | tuple[Any, list[Any], list[Any]] | tuple[list[Any], Any | list[Any], Any | list[Any]] | tuple[list[Any], list[Any], Any | list[Any]] | tuple[list[Any], Any | list[Any], list[Any]]: + ... + +def dup_gcd(f, g, K) -> list[Any]: + ... + +def dmp_gcd(f, g, u, K): + ... + +def dup_rr_lcm(f, g, K) -> list[Any]: + ... + +def dup_ff_lcm(f, g, K) -> list[Any]: + ... + +def dup_lcm(f, g, K) -> list[Any]: + ... + +def dmp_rr_lcm(f, g, u, K) -> list[Any]: + ... + +def dmp_ff_lcm(f, g, u, K) -> list[Any]: + ... + +def dmp_lcm(f, g, u, K) -> list[Any]: + ... + +def dmp_content(f, u, K) -> list[Any]: + ... + +def dmp_primitive(f, u, K) -> tuple[Any | list[Any], Any] | tuple[Any | list[Any], list[Any | list[list[Any]]]]: + ... + +def dup_cancel(f, g, K, include=...) -> tuple[Any, Any, list[Any] | Any | list[list[Any]], list[Any] | Any | list[list[Any]]] | tuple[list[Any], list[Any]]: + ... + +def dmp_cancel(f, g, u, K, include=...) -> tuple[Any, Any, list[Any] | Any | list[list[Any]], list[Any] | Any | list[list[Any]]] | tuple[list[Any], list[Any]]: + ... + diff --git a/stubs/sympy-stubs/polys/factortools.pyi b/stubs/sympy-stubs/polys/factortools.pyi new file mode 100644 index 00000000..7f90ac53 --- /dev/null +++ b/stubs/sympy-stubs/polys/factortools.pyi @@ -0,0 +1,108 @@ +from typing import Any, Literal +from sympy.external.gmpy import GROUND_TYPES + +def dup_trial_division(f, factors, K) -> list[Any]: + ... + +def dmp_trial_division(f, factors, u, K) -> list[Any]: + ... + +def dup_zz_mignotte_bound(f, K): + ... + +def dmp_zz_mignotte_bound(f, u, K): + ... + +def dup_zz_hensel_step(m, f, g, h, s, t, K) -> tuple[Any, Any, Any, Any]: + ... + +def dup_zz_hensel_lift(p, f, f_list, l, K) -> list[Any]: + ... + +def dup_zz_zassenhaus(f, K) -> list[Any]: + ... + +def dup_zz_irreducible_p(f, K) -> Literal[True] | None: + ... + +def dup_cyclotomic_p(f, K, irreducible=...) -> bool: + ... + +def dup_zz_cyclotomic_poly(n, K) -> list[Any]: + ... + +def dup_zz_cyclotomic_factor(f, K) -> list[list[Any]] | list[Any] | None: + ... + +def dup_zz_factor_sqf(f, K) -> tuple[Any, list[Any]] | tuple[Any, list[list[Any] | Any]]: + ... + +def dup_zz_factor(f, K) -> tuple[Any, list[Any]] | tuple[Any, list[tuple[list[Any] | Any, Literal[1]]]]: + ... + +def dmp_zz_wang_non_divisors(E, cs, ct, K) -> list[Any] | None: + ... + +def dmp_zz_wang_test_points(f, T, ct, A, u, K) -> tuple[Any, list[Any] | Any, list[Any | list[list[Any]] | list[Any]]]: + ... + +def dmp_zz_wang_lead_coeffs(f, T, cs, E, H, A, u, K) -> tuple[Any, list[Any], list[Any]] | tuple[list[Any], list[Any], list[Any]]: + ... + +def dup_zz_diophantine(F, m, p, K) -> list[list[Any] | Any]: + ... + +def dmp_zz_diophantine(F, c, A, d, p, u, K) -> list[list[Any]] | list[Any | list[list[Any]]]: + ... + +def dmp_zz_wang_hensel_lifting(f, H, LC, A, p, u, K) -> list[Any]: + ... + +def dmp_zz_wang(f, u, K, mod=..., seed=...) -> list[Any]: + ... + +def dmp_zz_factor(f, u, K) -> tuple[Any, list[Any]] | tuple[Any, list[tuple[list[Any] | Any, Literal[1]]]]: + ... + +def dup_qq_i_factor(f, K0) -> tuple[Any, list[tuple[Any, Any]]]: + ... + +def dup_zz_i_factor(f, K0) -> tuple[Any, list[Any]]: + ... + +def dmp_qq_i_factor(f, u, K0) -> tuple[Any, list[tuple[Any | list[list[Any]], Any]]]: + ... + +def dmp_zz_i_factor(f, u, K0) -> tuple[Any, list[Any]]: + ... + +def dup_ext_factor(f, K) -> tuple[Any, list[Any]] | tuple[Any, list[tuple[Any | list[Any], Literal[1]]]] | tuple[Any, list[tuple[Any | list[Any], Any | int]]]: + ... + +def dmp_ext_factor(f, u, K) -> tuple[Any, list[Any]] | tuple[Any, list[tuple[Any | list[Any], Literal[1]]]] | tuple[Any, list[tuple[Any | list[Any], Any | int]]]: + ... + +def dup_gf_factor(f, K) -> tuple[Any, list[Any]]: + ... + +def dmp_gf_factor(f, u, K): + ... + +def dup_factor_list(f, K0) -> tuple[Any, list[Any]]: + ... + +def dup_factor_list_include(f, K) -> list[tuple[Any, Literal[1]]]: + ... + +def dmp_factor_list(f, u, K0) -> tuple[Any, list[Any]]: + ... + +def dmp_factor_list_include(f, u, K) -> list[tuple[Any, Literal[1]]] | list[tuple[list[list[Any]] | Any | list[Any], Literal[1]]]: + ... + +def dup_irreducible_p(f, K) -> bool: + ... + +def dmp_irreducible_p(f, u, K) -> bool: + ... + diff --git a/stubs/sympy-stubs/polys/fglmtools.pyi b/stubs/sympy-stubs/polys/fglmtools.pyi new file mode 100644 index 00000000..bd77952d --- /dev/null +++ b/stubs/sympy-stubs/polys/fglmtools.pyi @@ -0,0 +1,5 @@ +from typing import Any + +def matrix_fglm(F, ring, O_to) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/fields.pyi b/stubs/sympy-stubs/polys/fields.pyi new file mode 100644 index 00000000..f0f9d805 --- /dev/null +++ b/stubs/sympy-stubs/polys/fields.pyi @@ -0,0 +1,177 @@ +from types import NotImplementedType +from typing import Any, Self +from sympy.core.sympify import CantSympify +from sympy.polys.domains.domainelement import DomainElement +from sympy.polys.rings import PolyElement, PolyRing +from sympy.printing.defaults import DefaultPrinting +from sympy.utilities import public + +@public +def field(symbols, domain, order=...) -> Any: + ... + +@public +def xfield(symbols, domain, order=...) -> tuple[FracField | Any, Any]: + ... + +@public +def vfield(symbols, domain, order=...) -> FracField | Any: + ... + +@public +def sfield(exprs, *symbols, **options) -> tuple[FracField | Any, Any] | tuple[FracField | Any, list[Any]]: + ... + +_field_cache: dict[Any, Any] = ... +class FracField(DefaultPrinting): + def __new__(cls, symbols, domain, order=...) -> Self | Any: + ... + + def __getnewargs__(self) -> tuple[Any, Any, Any]: + ... + + def __hash__(self) -> int: + ... + + def index(self, gen): + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def raw_new(self, numer, denom=...): + ... + + def new(self, numer, denom=...): + ... + + def domain_new(self, element): + ... + + def ground_new(self, element): + ... + + def field_new(self, element) -> FracElement: + ... + + __call__ = ... + def from_expr(self, expr): + ... + + def to_domain(self) -> Any: + ... + + def to_ring(self) -> PolyRing | Any: + ... + + + +class FracElement(DomainElement, DefaultPrinting, CantSympify): # type: ignore + def __init__(self, numer, denom=...) -> None: + ... + + def raw_new(f, numer, denom) -> Self: + ... + + def new(f, numer, denom) -> Self: + ... + + def to_poly(f) -> Any: + ... + + def parent(self): + ... + + def __getnewargs__(self) -> tuple[Any, Any, Any]: + ... + + _hash = ... + def __hash__(self) -> int: + ... + + def copy(self) -> Self: + ... + + def set_field(self, new_field) -> Self: + ... + + def as_expr(self, *symbols): + ... + + def __eq__(f, g) -> bool: + ... + + def __ne__(f, g) -> bool: + ... + + def __bool__(f) -> bool: + ... + + def sort_key(self) -> tuple[Any, Any]: + ... + + def __lt__(f1, f2) -> bool: + ... + + def __le__(f1, f2) -> bool: + ... + + def __gt__(f1, f2) -> bool: + ... + + def __ge__(f1, f2) -> bool: + ... + + def __pos__(f) -> Self: + ... + + def __neg__(f) -> Self: + ... + + def __add__(f, g) -> Self | FracElement | NotImplementedType | PolyElement: + ... + + def __radd__(f, c) -> Self | NotImplementedType: + ... + + def __sub__(f, g) -> Self | FracElement | NotImplementedType: + ... + + def __rsub__(f, c) -> Self | NotImplementedType: + ... + + def __mul__(f, g) -> Self | FracElement | NotImplementedType: + ... + + def __rmul__(f, c) -> Self | NotImplementedType: + ... + + def __truediv__(f, g) -> Self | FracElement | NotImplementedType: + ... + + def __rtruediv__(f, c) -> Self | NotImplementedType: + ... + + def __pow__(f, n) -> Self: + ... + + def diff(f, x) -> Self: + ... + + def __call__(f, *values): + ... + + def evaluate(f, x, a=...): + ... + + def subs(f, x, a=...) -> Self: + ... + + def compose(f, x, a=...): + ... + + + diff --git a/stubs/sympy-stubs/polys/galoistools.pyi b/stubs/sympy-stubs/polys/galoistools.pyi new file mode 100644 index 00000000..0de68302 --- /dev/null +++ b/stubs/sympy-stubs/polys/galoistools.pyi @@ -0,0 +1,214 @@ +from typing import Any, Literal + +def gf_crt(U, M, K=...): + ... + +def gf_crt1(M, K) -> tuple[float, list[Any], list[Any]]: + ... + +def gf_crt2(U, M, p, E, S, K): + ... + +def gf_int(a, p): + ... + +def gf_degree(f) -> int: + ... + +def gf_LC(f, K): + ... + +def gf_TC(f, K): + ... + +def gf_strip(f): + ... + +def gf_trunc(f, p): + ... + +def gf_normal(f, p, K): + ... + +def gf_from_dict(f, p, K): + ... + +def gf_to_dict(f, p, symmetric=...) -> dict[Any, Any]: + ... + +def gf_from_int_poly(f, p): + ... + +def gf_to_int_poly(f, p, symmetric=...) -> list[Any]: + ... + +def gf_neg(f, p, K) -> list[Any]: + ... + +def gf_add_ground(f, a, p, K) -> list[Any]: + ... + +def gf_sub_ground(f, a, p, K) -> list[Any]: + ... + +def gf_mul_ground(f, a, p, K) -> list[Any]: + ... + +def gf_quo_ground(f, a, p, K) -> list[Any]: + ... + +def gf_add(f, g, p, K): + ... + +def gf_sub(f, g, p, K) -> list[Any]: + ... + +def gf_mul(f, g, p, K): + ... + +def gf_sqr(f, p, K): + ... + +def gf_add_mul(f, g, h, p, K): + ... + +def gf_sub_mul(f, g, h, p, K) -> list[Any]: + ... + +def gf_expand(F, p, K) -> list[Any]: + ... + +def gf_div(f, g, p, K) -> tuple[list[Any], Any]: + ... + +def gf_rem(f, g, p, K): + ... + +def gf_quo(f, g, p, K) -> list[Any]: + ... + +def gf_exquo(f, g, p, K) -> list[Any]: + ... + +def gf_lshift(f, n, K): + ... + +def gf_rshift(f, n, K) -> tuple[Any, list[Any]] | tuple[Any, Any]: + ... + +def gf_pow(f, n, p, K) -> list[Any]: + ... + +def gf_frobenius_monomial_base(g, p, K) -> list[Any] | list[int]: + ... + +def gf_frobenius_map(f, g, b, p, K) -> list[Any]: + ... + +def gf_pow_mod(f, n, g, p, K) -> list[Any]: + ... + +def gf_gcd(f, g, p, K) -> list[Any]: + ... + +def gf_lcm(f, g, p, K) -> list[Any]: + ... + +def gf_cofactors(f, g, p, K) -> tuple[list[Any], list[Any], list[Any]] | tuple[list[Any], list[Any] | Any, list[Any] | Any]: + ... + +def gf_gcdex(f, g, p, K) -> tuple[list[Any], list[Any], list[Any]]: + ... + +def gf_monic(f, p, K) -> tuple[Any, list[Any]]: + ... + +def gf_diff(f, p, K): + ... + +def gf_eval(f, a, p, K): + ... + +def gf_multi_eval(f, A, p, K) -> list[Any]: + ... + +def gf_compose(f, g, p, K) -> list[Any]: + ... + +def gf_compose_mod(g, h, f, p, K) -> list[Any]: + ... + +def gf_trace_map(a, b, c, n, f, p, K) -> tuple[list[Any] | Any, Any]: + ... + +def gf_random(n, p, K) -> list[Any]: + ... + +def gf_irreducible(n, p, K) -> list[Any]: + ... + +def gf_irred_p_ben_or(f, p, K) -> bool: + ... + +def gf_irred_p_rabin(f, p, K) -> bool: + ... + +_irred_methods = ... +def gf_irreducible_p(f, p, K) -> bool: + ... + +def gf_sqf_p(f, p, K) -> bool: + ... + +def gf_sqf_part(f, p, K) -> list[Any]: + ... + +def gf_sqf_list(f, p, K, all=...) -> tuple[Any, list[Any]]: + ... + +def gf_Qmatrix(f, p, K) -> list[list[Any]]: + ... + +def gf_Qbasis(Q, p, K) -> list[Any]: + ... + +def gf_berlekamp(f, p, K) -> list[Any]: + ... + +def gf_ddf_zassenhaus(f, p, K) -> list[Any]: + ... + +def gf_edf_zassenhaus(f, n, p, K) -> list[Any]: + ... + +def gf_ddf_shoup(f, p, K) -> list[Any]: + ... + +def gf_edf_shoup(f, n, p, K) -> list[Any]: + ... + +def gf_zassenhaus(f, p, K) -> list[Any]: + ... + +def gf_shoup(f, p, K) -> list[Any]: + ... + +_factor_methods = ... +def gf_factor_sqf(f, p, K, method=...) -> tuple[Any, list[Any]]: + ... + +def gf_factor(f, p, K) -> tuple[Any, list[Any]]: + ... + +def gf_value(f, a) -> Literal[0]: + ... + +def linear_congruence(a, b, m) -> list[int] | list[Any]: + ... + +def csolve_prime(f, p, e=...) -> list[int] | list[Any]: + ... + +def gf_csolve(f, n) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/groebnertools.pyi b/stubs/sympy-stubs/polys/groebnertools.pyi new file mode 100644 index 00000000..3290eafa --- /dev/null +++ b/stubs/sympy-stubs/polys/groebnertools.pyi @@ -0,0 +1,80 @@ +from typing import Any, Literal + +def groebner(seq, ring, method=...) -> list[Any]: + ... + +def spoly(p1, p2, ring): + ... + +def Sign(f): + ... + +def Polyn(f): + ... + +def Num(f): + ... + +def sig(monomial, index) -> tuple[Any, Any]: + ... + +def lbp(signature, polynomial, number) -> tuple[Any, Any, Any]: + ... + +def sig_cmp(u, v, order) -> Literal[-1, 1]: + ... + +def sig_key(s, order) -> tuple[Any, Any]: + ... + +def sig_mult(s, m) -> tuple[Any, Any]: + ... + +def lbp_sub(f, g) -> tuple[Any, Any, Any]: + ... + +def lbp_mul_term(f, cx) -> tuple[Any, Any, Any]: + ... + +def lbp_cmp(f, g) -> Literal[-1, 1]: + ... + +def lbp_key(f) -> tuple[tuple[Any, Any], Any]: + ... + +def critical_pair(f, g, ring) -> tuple[Any, tuple[tuple[Any, ...], Any] | None, Any, Any, tuple[tuple[Any, ...], Any] | None, Any]: + ... + +def cp_cmp(c, d) -> Literal[-1, 1]: + ... + +def cp_key(c, ring) -> tuple[tuple[tuple[Any, Any], Any], tuple[tuple[Any, Any], Any]]: + ... + +def s_poly(cp) -> tuple[Any, Any, Any]: + ... + +def is_rewritable_or_comparable(sign, num, B) -> bool: + ... + +def f5_reduce(f, B) -> tuple[Any, Any, Any]: + ... + +def red_groebner(G, ring) -> list[Any]: + ... + +def is_groebner(G, ring) -> bool: + ... + +def is_minimal(G, ring) -> bool: + ... + +def is_reduced(G, ring) -> bool: + ... + +def groebner_lcm(f, g): + ... + +def groebner_gcd(f, g): + ... + diff --git a/stubs/sympy-stubs/polys/heuristicgcd.pyi b/stubs/sympy-stubs/polys/heuristicgcd.pyi new file mode 100644 index 00000000..9bd98e39 --- /dev/null +++ b/stubs/sympy-stubs/polys/heuristicgcd.pyi @@ -0,0 +1,6 @@ +from typing import Any + +HEU_GCD_MAX = ... +def heugcd(f, g) -> tuple[Any, Any, Any]: + ... + diff --git a/stubs/sympy-stubs/polys/matrices/__init__.pyi b/stubs/sympy-stubs/polys/matrices/__init__.pyi new file mode 100644 index 00000000..edab0ccb --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.polys.matrices.domainmatrix import DM, DomainMatrix + +__all__ = ['DomainMatrix', 'DM'] diff --git a/stubs/sympy-stubs/polys/matrices/ddm.pyi b/stubs/sympy-stubs/polys/matrices/ddm.pyi new file mode 100644 index 00000000..300a33aa --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/ddm.pyi @@ -0,0 +1,169 @@ +from itertools import chain +from types import NotImplementedType +from typing import Any, Self +from sympy.polys.matrices.sdm import SDM +from sympy.utilities.decorator import doctest_depends_on + +class DDM(list): + fmt = ... + def __init__(self, rowslist, shape, domain) -> None: + ... + + def getitem(self, i, j): + ... + + def setitem(self, i, j, value) -> None: + ... + + def extract_slice(self, slice1, slice2) -> DDM: + ... + + def extract(self, rows, cols) -> DDM: + ... + + def to_list(self) -> list[Any]: + ... + + def to_list_flat(self) -> list[Any]: + ... + + def flatiter(self) -> chain[Any]: + ... + + def flat(self) -> list[Any]: + ... + + def to_dok(self) -> dict[tuple[int, int], Any]: + ... + + def to_ddm(self) -> Self: + ... + + def to_sdm(self) -> SDM: + ... + + def convert_to(self, K) -> DDM: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + @classmethod + def zeros(cls, shape, domain) -> DDM: + ... + + @classmethod + def ones(cls, shape, domain) -> DDM: + ... + + @classmethod + def eye(cls, size, domain) -> DDM: + ... + + def copy(self) -> DDM: + ... + + def transpose(self) -> DDM: + ... + + def __add__(a, b) -> NotImplementedType | DDM: + ... + + def __sub__(a, b) -> NotImplementedType | DDM: + ... + + def __neg__(a) -> DDM: + ... + + def __mul__(a, b) -> DDM | NotImplementedType: + ... + + def __rmul__(a, b) -> DDM | NotImplementedType: + ... + + def __matmul__(a, b) -> DDM | NotImplementedType: + ... + + def add(a, b) -> DDM: + ... + + def sub(a, b) -> DDM: + ... + + def neg(a) -> DDM: + ... + + def mul(a, b) -> DDM: + ... + + def rmul(a, b) -> DDM: + ... + + def matmul(a, b) -> DDM: + ... + + def mul_elementwise(a, b) -> DDM: + ... + + def hstack(A, *B) -> DDM: + ... + + def vstack(A, *B) -> DDM: + ... + + def applyfunc(self, func, domain) -> DDM: + ... + + def scc(a) -> list[Any]: + ... + + def rref(a) -> tuple[DDM, list[Any]]: + ... + + def nullspace(a) -> tuple[DDM, list[Any]]: + ... + + def particular(a) -> DDM: + ... + + def det(a): + ... + + def inv(a) -> DDM: + ... + + def lu(a) -> tuple[DDM, DDM, list[Any]]: + ... + + def lu_solve(a, b) -> DDM: + ... + + def charpoly(a) -> list[Any]: + ... + + def is_zero_matrix(self) -> bool: + ... + + def is_upper(self) -> bool: + ... + + def is_lower(self) -> bool: + ... + + def lll(A, delta=...): + ... + + def lll_transform(A, delta=...) -> tuple[Any, Any | None]: + ... + + + diff --git a/stubs/sympy-stubs/polys/matrices/dense.pyi b/stubs/sympy-stubs/polys/matrices/dense.pyi new file mode 100644 index 00000000..65cdcffe --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/dense.pyi @@ -0,0 +1,47 @@ +from typing import Any, Sequence, TypeVar +from sympy.polys.matrices._typing import RingElement + +T = TypeVar('T') +R = TypeVar('R', bound=RingElement) +def ddm_transpose(matrix: Sequence[Sequence[T]]) -> list[list[T]]: + ... + +def ddm_iadd(a: list[list[R]], b: Sequence[Sequence[R]]) -> None: + ... + +def ddm_isub(a: list[list[R]], b: Sequence[Sequence[R]]) -> None: + ... + +def ddm_ineg(a: list[list[R]]) -> None: + ... + +def ddm_imul(a: list[list[R]], b: R) -> None: + ... + +def ddm_irmul(a: list[list[R]], b: R) -> None: + ... + +def ddm_imatmul(a: list[list[R]], b: Sequence[Sequence[R]], c: Sequence[Sequence[R]]) -> None: + ... + +def ddm_irref(a, _partial_pivot=...) -> list[Any]: + ... + +def ddm_idet(a, K): + ... + +def ddm_iinv(ainv, a, K) -> None: + ... + +def ddm_ilu_split(L, U, K) -> list[Any]: + ... + +def ddm_ilu(a) -> list[Any]: + ... + +def ddm_ilu_solve(x, L, U, swaps, b) -> None: + ... + +def ddm_berk(M, K) -> list[list[Any]]: + ... + diff --git a/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi b/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi new file mode 100644 index 00000000..ea3c8f87 --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/domainmatrix.pyi @@ -0,0 +1,239 @@ +from types import NotImplementedType +from typing import Any, Literal, Self, Tuple as tTuple, Union as tUnion +from sympy.matrices.dense import MutableDenseMatrix +from sympy.polys.matrices.domainscalar import DomainScalar +from sympy.utilities.decorator import doctest_depends_on +from sympy.polys.domains import Domain +from sympy.polys.matrices.ddm import DDM +from sympy.polys.matrices.sdm import SDM + +def DM(rows, domain) -> DomainMatrix: + ... + +class DomainMatrix: + rep: tUnion[SDM, DDM] + shape: tTuple[int, int] + domain: Domain + def __new__(cls, rows, shape, domain, *, fmt=...) -> Self: + ... + + def __getnewargs__(self) -> tuple[list[Any] | dict[Any, Any], tTuple[int, int], Any]: + ... + + def __getitem__(self, key) -> DomainScalar | Self: + ... + + def getitem_sympy(self, i, j): + ... + + def extract(self, rowslist, colslist) -> Self: + ... + + def __setitem__(self, key, value) -> None: + ... + + @classmethod + def from_rep(cls, rep) -> Self: + ... + + @classmethod + def from_list(cls, rows, domain) -> DomainMatrix: + ... + + @classmethod + def from_list_sympy(cls, nrows, ncols, rows, **kwargs) -> DomainMatrix: + ... + + @classmethod + def from_dict_sympy(cls, nrows, ncols, elemsdict, **kwargs) -> DomainMatrix: + ... + + @classmethod + def from_Matrix(cls, M, fmt=..., **kwargs): + ... + + @classmethod + def get_domain(cls, items_sympy, **kwargs) -> tuple[Any, Any]: + ... + + def copy(self) -> Self: + ... + + def convert_to(self, K) -> Self: + ... + + def to_sympy(self) -> Self: + ... + + def to_field(self) -> Self: + ... + + def to_sparse(self) -> Self: + ... + + def to_dense(self) -> Self: + ... + + def unify(self, *others, fmt=...) -> tuple[Any, ...]: + ... + + def to_Matrix(self) -> MutableDenseMatrix: + ... + + def to_list(self) -> list[Any]: + ... + + def to_list_flat(self) -> list[Any]: + ... + + def to_dok(self) -> dict[tuple[int, int], Any] | dict[tuple[Any, Any], Any]: + ... + + def __repr__(self) -> str: + ... + + def transpose(self) -> Self: + ... + + def flat(self) -> list[Any]: + ... + + @property + def is_zero_matrix(self) -> bool: + ... + + @property + def is_upper(self) -> bool: + ... + + @property + def is_lower(self) -> bool: + ... + + @property + def is_square(self) -> bool: + ... + + def rank(self) -> int: + ... + + def hstack(A, *B) -> DomainMatrix: + ... + + def vstack(A, *B) -> DomainMatrix: + ... + + def applyfunc(self, func, domain=...) -> Self: + ... + + def __add__(A, B) -> NotImplementedType: + ... + + def __sub__(A, B) -> NotImplementedType: + ... + + def __neg__(A) -> Self: + ... + + def __mul__(A, B) -> DomainMatrix | Self | NotImplementedType: + ... + + def __rmul__(A, B) -> DomainMatrix | Self | NotImplementedType: + ... + + def __pow__(A, n) -> NotImplementedType | Self: + ... + + def add(A, B) -> Self: + ... + + def sub(A, B) -> Self: + ... + + def neg(A) -> Self: + ... + + def mul(A, b) -> Self: + ... + + def rmul(A, b) -> Self: + ... + + def matmul(A, B) -> Self: + ... + + def scalarmul(A, lamda) -> DomainMatrix | Self: + ... + + def rscalarmul(A, lamda) -> DomainMatrix | Self: + ... + + def mul_elementwise(A, B) -> Self: + ... + + def __truediv__(A, lamda) -> NotImplementedType: + ... + + def pow(A, n) -> Self: + ... + + def scc(self) -> list[Any]: + ... + + def rref(self) -> tuple[Self, tuple[Any, ...]]: + ... + + def columnspace(self) -> Self: + ... + + def rowspace(self) -> Self: + ... + + def nullspace(self) -> Self: + ... + + def inv(self) -> Self: + ... + + def det(self): + ... + + def lu(self) -> tuple[Self, Self, list[Any]]: + ... + + def lu_solve(self, rhs) -> Self: + ... + + def charpoly(self) -> list[Any]: + ... + + @classmethod + def eye(cls, shape, domain) -> Self: + ... + + @classmethod + def diag(cls, diagonal, domain, shape=...) -> Self: + ... + + @classmethod + def zeros(cls, shape, domain, *, fmt=...) -> Self: + ... + + @classmethod + def ones(cls, shape, domain) -> Self: + ... + + def __eq__(A, B) -> bool: + ... + + def unify_eq(A, B) -> Literal[False]: + ... + + def lll(A, delta=...) -> DomainMatrix: + ... + + def lll_transform(A, delta=...) -> tuple[DomainMatrix, DomainMatrix]: + ... + + + diff --git a/stubs/sympy-stubs/polys/matrices/domainscalar.pyi b/stubs/sympy-stubs/polys/matrices/domainscalar.pyi new file mode 100644 index 00000000..d6ba687d --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/domainscalar.pyi @@ -0,0 +1,65 @@ +from types import NotImplementedType +from typing import Any, Self + +class DomainScalar: + def __new__(cls, element, domain) -> Self: + ... + + @classmethod + def new(cls, element, domain) -> Self: + ... + + def __repr__(self) -> str: + ... + + @classmethod + def from_sympy(cls, expr) -> Self: + ... + + def to_sympy(self): + ... + + def to_domain(self, domain) -> Self: + ... + + def convert_to(self, domain) -> Self: + ... + + def unify(self, other) -> tuple[Self, Any]: + ... + + def __add__(self, other) -> NotImplementedType | Self: + ... + + def __sub__(self, other) -> NotImplementedType | Self: + ... + + def __mul__(self, other) -> NotImplementedType | Self: + ... + + def __floordiv__(self, other) -> NotImplementedType | Self: + ... + + def __mod__(self, other) -> NotImplementedType | Self: + ... + + def __divmod__(self, other) -> NotImplementedType | tuple[Self, Self]: + ... + + def __pow__(self, n) -> NotImplementedType | Self: + ... + + def __pos__(self) -> Self: + ... + + def __eq__(self, other) -> bool: + ... + + def is_zero(self): + ... + + def is_one(self): + ... + + + diff --git a/stubs/sympy-stubs/polys/matrices/eigen.pyi b/stubs/sympy-stubs/polys/matrices/eigen.pyi new file mode 100644 index 00000000..59099373 --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/eigen.pyi @@ -0,0 +1,8 @@ +from typing import Any + +def dom_eigenvects(A, l=...) -> tuple[list[Any], list[Any]]: + ... + +def dom_eigenvects_to_sympy(rational_eigenvects, algebraic_eigenvects, Matrix, **kwargs) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/matrices/linsolve.pyi b/stubs/sympy-stubs/polys/matrices/linsolve.pyi new file mode 100644 index 00000000..c3ca8a89 --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/linsolve.pyi @@ -0,0 +1,4 @@ +from sympy.polys.matrices.sdm import SDM +def sympy_dict_to_dm(eqs_coeffs, eqs_rhs, syms) -> SDM: + ... + diff --git a/stubs/sympy-stubs/polys/matrices/lll.pyi b/stubs/sympy-stubs/polys/matrices/lll.pyi new file mode 100644 index 00000000..9ab156ad --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/lll.pyi @@ -0,0 +1,7 @@ +from typing import Any +def ddm_lll(x, delta=...): + ... + +def ddm_lll_transform(x, delta=...) -> tuple[Any, Any | None]: + ... + diff --git a/stubs/sympy-stubs/polys/matrices/normalforms.pyi b/stubs/sympy-stubs/polys/matrices/normalforms.pyi new file mode 100644 index 00000000..5c984287 --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/normalforms.pyi @@ -0,0 +1,15 @@ +from typing import Any +from sympy.polys.matrices.domainmatrix import DomainMatrix +from sympy.polys.matrices.domainscalar import DomainScalar +def smith_normal_form(m) -> DomainMatrix: + ... + +def add_columns(m, i, j, a, b, c, d) -> None: + ... + +def invariant_factors(m) -> tuple[()] | tuple[Any, ...]: + ... + +def hermite_normal_form(A, *, D=..., check_rank=...) -> DomainMatrix | DomainScalar: + ... + diff --git a/stubs/sympy-stubs/polys/matrices/sdm.pyi b/stubs/sympy-stubs/polys/matrices/sdm.pyi new file mode 100644 index 00000000..eae28e3c --- /dev/null +++ b/stubs/sympy-stubs/polys/matrices/sdm.pyi @@ -0,0 +1,193 @@ +from types import NotImplementedType +from typing import Any, Self +from sympy.polys.matrices.ddm import DDM +from sympy.utilities.decorator import doctest_depends_on + +class SDM(dict): + fmt = ... + def __init__(self, elemsdict, shape, domain) -> None: + ... + + def getitem(self, i, j): + ... + + def setitem(self, i, j, value) -> None: + ... + + def extract_slice(self, slice1, slice2) -> Self: + ... + + def extract(self, rows, cols) -> Self: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + @classmethod + def new(cls, sdm, shape, domain) -> Self: + ... + + def copy(A) -> Self: + ... + + @classmethod + def from_list(cls, ddm, shape, domain) -> Self: + ... + + @classmethod + def from_ddm(cls, ddm) -> Self: + ... + + def to_list(M) -> list[Any]: + ... + + def to_list_flat(M): + ... + + def to_dok(M) -> dict[tuple[Any, Any], Any]: + ... + + def to_ddm(M) -> DDM: + ... + + def to_sdm(M) -> Self: + ... + + @classmethod + def zeros(cls, shape, domain) -> Self: + ... + + @classmethod + def ones(cls, shape, domain) -> Self: + ... + + @classmethod + def eye(cls, shape, domain) -> Self: + ... + + @classmethod + def diag(cls, diagonal, domain, shape) -> Self: + ... + + def transpose(M) -> Self: + ... + + def __add__(A, B) -> NotImplementedType | Self: + ... + + def __sub__(A, B) -> NotImplementedType | Self: + ... + + def __neg__(A) -> Self: + ... + + def __mul__(A, B) -> Self | NotImplementedType: + ... + + def __rmul__(a, b) -> Self | NotImplementedType: + ... + + def matmul(A, B) -> Self: + ... + + def mul(A, b) -> Self: + ... + + def rmul(A, b) -> Self: + ... + + def mul_elementwise(A, B) -> Self: + ... + + def add(A, B) -> Self: + ... + + def sub(A, B) -> Self: + ... + + def neg(A) -> Self: + ... + + def convert_to(A, K) -> Self: + ... + + def scc(A) -> list[Any]: + ... + + def rref(A) -> tuple[Self, list[Any]]: + ... + + def inv(A) -> Self: + ... + + def det(A): + ... + + def lu(A) -> tuple[Self, Self, list[Any]]: + ... + + def lu_solve(A, b) -> Self: + ... + + def nullspace(A) -> tuple[Self, list[int]]: + ... + + def particular(A) -> Self: + ... + + def hstack(A, *B) -> Self: + ... + + def vstack(A, *B) -> Self: + ... + + def applyfunc(self, func, domain) -> Self: + ... + + def charpoly(A) -> list[Any]: + ... + + def is_zero_matrix(self) -> bool: + ... + + def is_upper(self) -> bool: + ... + + def is_lower(self) -> bool: + ... + + def lll(A, delta=...) -> Self: + ... + + def lll_transform(A, delta=...) -> tuple[Self, Self]: + ... + + + +def binop_dict(A, B, fab, fa, fb) -> dict[Any, Any]: + ... + +def unop_dict(A, f) -> dict[Any, Any]: + ... + +def sdm_transpose(M) -> dict[Any, Any]: + ... + +def sdm_matmul(A, B, K, m, o) -> dict[Any, Any]: + ... + +def sdm_matmul_exraw(A, B, K, m, o) -> dict[Any, Any]: + ... + +def sdm_irref(A) -> tuple[dict[int, Any], list[Any], dict[Any, set[int]]]: + ... + +def sdm_nullspace_from_rref(A, one, ncols, pivots, nonzero_cols) -> tuple[list[Any], list[int]]: + ... + +def sdm_particular_from_rref(A, ncols, pivots) -> dict[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/polys/monomials.pyi b/stubs/sympy-stubs/polys/monomials.pyi new file mode 100644 index 00000000..39805bea --- /dev/null +++ b/stubs/sympy-stubs/polys/monomials.pyi @@ -0,0 +1,123 @@ +from typing import Any, Generator, Iterator, Self +from sympy.polys.polyutils import PicklableWithSlots +from sympy.series.order import Order +from sympy.utilities import public + +@public +def itermonomials(variables, max_degrees, min_degrees=...) -> Generator[Any | Order, Any, None]: + ... + +def monomial_count(V, N): + ... + +def monomial_mul(A, B) -> tuple[Any, ...]: + ... + +def monomial_div(A, B) -> tuple[Any, ...] | None: + ... + +def monomial_ldiv(A, B) -> tuple[Any, ...]: + ... + +def monomial_pow(A, n) -> tuple[Any, ...]: + ... + +def monomial_gcd(A, B) -> tuple[Any, ...]: + ... + +def monomial_lcm(A, B) -> tuple[Any, ...]: + ... + +def monomial_divides(A, B) -> bool: + ... + +def monomial_max(*monoms) -> tuple[Any, ...]: + ... + +def monomial_min(*monoms) -> tuple[Any, ...]: + ... + +def monomial_deg(M) -> int: + ... + +def term_div(a, b, domain) -> tuple[tuple[Any, ...], Any] | None: + ... + +class MonomialOps: + def __init__(self, ngens) -> None: + ... + + def mul(self): + ... + + def pow(self): + ... + + def mulpow(self): + ... + + def ldiv(self): + ... + + def div(self): + ... + + def lcm(self): + ... + + def gcd(self): + ... + + + +@public +class Monomial(PicklableWithSlots): + __slots__ = ... + def __init__(self, monom, gens=...) -> None: + ... + + def rebuild(self, exponents, gens=...) -> Self: + ... + + def __len__(self) -> int: + ... + + def __iter__(self) -> Iterator[int]: + ... + + def __getitem__(self, item): + ... + + def __hash__(self) -> int: + ... + + def __str__(self) -> str: + ... + + def as_expr(self, *gens) -> Order: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def __mul__(self, other) -> Self: + ... + + def __truediv__(self, other) -> Self: + ... + + __floordiv__ = ... + def __pow__(self, other) -> Self: + ... + + def gcd(self, other) -> Self: + ... + + def lcm(self, other) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/polys/numberfields/__init__.pyi b/stubs/sympy-stubs/polys/numberfields/__init__.pyi new file mode 100644 index 00000000..39dbcf1e --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/__init__.pyi @@ -0,0 +1,8 @@ +from sympy.polys.numberfields.minpoly import minimal_polynomial, minpoly +from sympy.polys.numberfields.subfield import field_isomorphism, primitive_element, to_number_field +from sympy.polys.numberfields.utilities import isolate +from sympy.polys.numberfields.basis import round_two +from sympy.polys.numberfields.primes import prime_decomp, prime_valuation +from sympy.polys.numberfields.galoisgroups import galois_group + +__all__ = ['minpoly', 'minimal_polynomial', 'field_isomorphism', 'primitive_element', 'to_number_field', 'isolate', 'round_two', 'prime_decomp', 'prime_valuation', 'galois_group'] diff --git a/stubs/sympy-stubs/polys/numberfields/basis.pyi b/stubs/sympy-stubs/polys/numberfields/basis.pyi new file mode 100644 index 00000000..0a9b3eda --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/basis.pyi @@ -0,0 +1,11 @@ +from typing import Any +from sympy.polys.numberfields.modules import Submodule +from sympy.utilities.decorator import public + +def nilradical_mod_p(H, p, q=...): + ... + +@public +def round_two(T, radicals=...) -> tuple[Submodule | Any, Any]: + ... + diff --git a/stubs/sympy-stubs/polys/numberfields/galois_resolvents.pyi b/stubs/sympy-stubs/polys/numberfields/galois_resolvents.pyi new file mode 100644 index 00000000..33ab240b --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/galois_resolvents.pyi @@ -0,0 +1,54 @@ +from typing import Any, Literal, LiteralString + +class GaloisGroupException(Exception): + ... + + +class ResolventException(GaloisGroupException): + ... + + +class Resolvent: + def __init__(self, F, X, s) -> None: + ... + + def get_prec(self, M, target=...) -> int | Any: + ... + + def approximate_roots_of_poly(self, T, target=...) -> list[Any]: + ... + + @staticmethod + def round_mpf(a) -> int | Any: + ... + + def round_roots_to_integers_for_poly(self, T) -> dict[int, int | Any]: + ... + + def eval_for_poly(self, T, find_integer_root=...) -> tuple[list[Any], int | Any | None, int | None]: + ... + + + +def wrap(text, width=...) -> LiteralString | Literal['']: + ... + +def s_vars(n) -> Any: + ... + +def sparse_symmetrize_resolvent_coeffs(F, X, s, verbose=...) -> tuple[list[Any], list[Any]]: + ... + +def define_resolvents() -> dict[tuple[Literal[4], Literal[0]] | tuple[Literal[4], Literal[1]] | tuple[Literal[5], Literal[1]] | tuple[Literal[6], Literal[1]] | tuple[Literal[6], Literal[2]], Any]: + ... + +def generate_lambda_lookup(verbose=..., trial_run=...) -> str: + ... + +def get_resolvent_by_lookup(T, number) -> list[Any]: + ... + +if __name__ == "__main__": + verbose = ... + trial_run = ... + table = ... diff --git a/stubs/sympy-stubs/polys/numberfields/galoisgroups.pyi b/stubs/sympy-stubs/polys/numberfields/galoisgroups.pyi new file mode 100644 index 00000000..681f4652 --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/galoisgroups.pyi @@ -0,0 +1,18 @@ +from typing import Any +from sympy.polys.numberfields.galois_resolvents import GaloisGroupException +from sympy.utilities import public + +class MaxTriesException(GaloisGroupException): + ... + + +def tschirnhausen_transformation(T, max_coeff=..., max_tries=..., history=..., fixed_order=...) -> tuple[Any, Any]: + ... + +def has_square_disc(T) -> bool: + ... + +@public +def galois_group(f, *gens, by_name=..., max_tries=..., randomize=..., **args) -> Any: + ... + diff --git a/stubs/sympy-stubs/polys/numberfields/minpoly.pyi b/stubs/sympy-stubs/polys/numberfields/minpoly.pyi new file mode 100644 index 00000000..d71cd013 --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/minpoly.pyi @@ -0,0 +1,11 @@ +from typing import Any +from sympy.utilities import public + +@public +def minimal_polynomial(ex, x=..., compose=..., polys=..., domain=...) -> Any: + ... + +@public +def minpoly(ex, x=..., compose=..., polys=..., domain=...) -> Any: + ... + diff --git a/stubs/sympy-stubs/polys/numberfields/modules.pyi b/stubs/sympy-stubs/polys/numberfields/modules.pyi new file mode 100644 index 00000000..986c0a43 --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/modules.pyi @@ -0,0 +1,370 @@ +from types import NotImplementedType +from typing import Any, Literal, Self +from sympy.polys.matrices.domainmatrix import DomainMatrix +from sympy.polys.polyclasses import ANP +from sympy.polys.polyutils import IntegerPowerable + +def to_col(coeffs) -> DomainMatrix: + ... + +class Module: + @property + def n(self): + ... + + def mult_tab(self): + ... + + @property + def parent(self) -> None: + ... + + def represent(self, elt): + ... + + def ancestors(self, include_self=...) -> list[Any]: + ... + + def power_basis_ancestor(self) -> PowerBasis | None: + ... + + def nearest_common_ancestor(self, other) -> None: + ... + + @property + def number_field(self) -> Any | None: + ... + + def is_compat_col(self, col) -> Literal[False]: + ... + + def __call__(self, spec, denom=...) -> PowerBasisElement | ModuleElement: + ... + + def starts_with_unity(self): + ... + + def basis_elements(self) -> list[PowerBasisElement | ModuleElement]: + ... + + def zero(self) -> PowerBasisElement | NotImplementedType | ModuleElement: + ... + + def one(self): + ... + + def element_from_rational(self, a): + ... + + def submodule_from_gens(self, gens, hnf=..., hnf_modulus=...) -> Submodule: + ... + + def submodule_from_matrix(self, B, denom=...) -> Submodule: + ... + + def whole_submodule(self) -> Submodule: + ... + + def endomorphism_ring(self) -> EndomorphismRing: + ... + + + +class PowerBasis(Module): + def __init__(self, T) -> None: + ... + + @property + def number_field(self) -> Any | None: + ... + + def __repr__(self) -> str: + ... + + def __eq__(self, other) -> bool: + ... + + @property + def n(self): + ... + + def mult_tab(self) -> dict[Any, Any] | None: + ... + + def compute_mult_tab(self) -> None: + ... + + def represent(self, elt): + ... + + def starts_with_unity(self) -> Literal[True]: + ... + + def element_from_rational(self, a): + ... + + def element_from_poly(self, f) -> PowerBasisElement | NotImplementedType | ModuleElement: + ... + + def element_from_ANP(self, a) -> PowerBasisElement | NotImplementedType | ModuleElement: + ... + + def element_from_alg_num(self, a) -> PowerBasisElement | NotImplementedType | ModuleElement: + ... + + + +class Submodule(Module, IntegerPowerable): + def __init__(self, parent, matrix, denom=..., mult_tab=...) -> None: + ... + + def __repr__(self) -> str: + ... + + def reduced(self) -> Self: + ... + + def discard_before(self, r) -> Submodule: + ... + + @property + def n(self): + ... + + def mult_tab(self) -> dict[Any, Any] | None: + ... + + def compute_mult_tab(self) -> None: + ... + + @property + def parent(self) -> Any: + ... + + @property + def matrix(self) -> Any: + ... + + @property + def coeffs(self): + ... + + @property + def denom(self) -> int: + ... + + @property + def QQ_matrix(self): + ... + + def starts_with_unity(self) -> bool: + ... + + def is_sq_maxrank_HNF(self) -> bool: + ... + + def is_power_basis_submodule(self) -> bool: + ... + + def element_from_rational(self, a): + ... + + def basis_element_pullbacks(self) -> list[PowerBasisElement | ModuleElement]: + ... + + def represent(self, elt): + ... + + def is_compat_submodule(self, other) -> Literal[False]: + ... + + def __eq__(self, other) -> bool: + ... + + def add(self, other, hnf=..., hnf_modulus=...): + ... + + def __add__(self, other) -> NotImplementedType: + ... + + __radd__ = ... + def mul(self, other, hnf=..., hnf_modulus=...) -> Self | Submodule | NotImplementedType: + ... + + def __mul__(self, other) -> Self | Submodule | NotImplementedType: + ... + + __rmul__ = ... + def reduce_element(self, elt): + ... + + + +def is_sq_maxrank_HNF(dm) -> bool: + ... + +def make_mod_elt(module, col, denom=...) -> PowerBasisElement | ModuleElement: + ... + +class ModuleElement(IntegerPowerable): + def __init__(self, module, col, denom=...) -> None: + ... + + def __repr__(self) -> str: + ... + + def reduced(self) -> Self: + ... + + def reduced_mod_p(self, p) -> PowerBasisElement | ModuleElement: + ... + + @classmethod + def from_int_list(cls, module, coeffs, denom=...) -> Self: + ... + + @property + def n(self): + ... + + def __len__(self): + ... + + def column(self, domain=...): + ... + + @property + def coeffs(self): + ... + + @property + def QQ_col(self): + ... + + def to_parent(self) -> PowerBasisElement | ModuleElement: + ... + + def to_ancestor(self, anc) -> Self: + ... + + def over_power_basis(self) -> Self | PowerBasisElement | ModuleElement: + ... + + def is_compat(self, other) -> Literal[False]: + ... + + def unify(self, other) -> tuple[Self, Any] | tuple[Self | Any, Any]: + ... + + def __eq__(self, other) -> bool: + ... + + def equiv(self, other) -> bool: + ... + + def __add__(self, other) -> Self | NotImplementedType: + ... + + __radd__ = ... + def __neg__(self) -> Self | NotImplementedType | PowerBasisElement | ModuleElement: + ... + + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + def __mul__(self, other) -> Self | NotImplementedType | PowerBasisElement | ModuleElement: + ... + + __rmul__ = ... + def __floordiv__(self, a) -> Any | NotImplementedType: + ... + + def __rfloordiv__(self, a): + ... + + def __mod__(self, m) -> NotImplementedType: + ... + + + +class PowerBasisElement(ModuleElement): + @property + def T(self): + ... + + def numerator(self, x=...) -> Any: + ... + + def poly(self, x=...) -> Any: + ... + + @property + def is_rational(self): + ... + + @property + def generator(self): + ... + + def as_expr(self, x=...) -> Any: + ... + + def norm(self, T=...): + ... + + def inverse(self): + ... + + def __rfloordiv__(self, a): + ... + + def to_ANP(self) -> ANP: + ... + + def to_alg_num(self): + ... + + + +class ModuleHomomorphism: + def __init__(self, domain, codomain, mapping) -> None: + ... + + def matrix(self, modulus=...) -> DomainMatrix: + ... + + def kernel(self, modulus=...): + ... + + + +class ModuleEndomorphism(ModuleHomomorphism): + def __init__(self, domain, mapping) -> None: + ... + + + +class InnerEndomorphism(ModuleEndomorphism): + def __init__(self, domain, multiplier) -> None: + ... + + + +class EndomorphismRing: + def __init__(self, domain) -> None: + ... + + def inner_endomorphism(self, multiplier) -> InnerEndomorphism: + ... + + def represent(self, element) -> DomainMatrix: + ... + + + +def find_min_poly(alpha, domain, x=..., powers=...) -> Any | None: + ... + diff --git a/stubs/sympy-stubs/polys/numberfields/primes.pyi b/stubs/sympy-stubs/polys/numberfields/primes.pyi new file mode 100644 index 00000000..45229858 --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/primes.pyi @@ -0,0 +1,60 @@ +from typing import Any +from sympy.polys.polyutils import IntegerPowerable +from sympy.utilities.decorator import public + +class PrimeIdeal(IntegerPowerable): + def __init__(self, ZK, p, alpha, f, e=...) -> None: + ... + + def __str__(self) -> str: + ... + + @property + def is_inert(self): + ... + + def repr(self, field_gen=..., just_gens=...) -> str: + ... + + def __repr__(self) -> str: + ... + + def as_submodule(self): + ... + + def __eq__(self, other) -> bool: + ... + + def __add__(self, other): + ... + + __radd__ = ... + def __mul__(self, other): + ... + + __rmul__ = ... + def test_factor(self): + ... + + def valuation(self, I) -> Any: + ... + + def reduce_element(self, elt): + ... + + def reduce_ANP(self, a): + ... + + def reduce_alg_num(self, a): + ... + + + +@public +def prime_valuation(I, P) -> int: + ... + +@public +def prime_decomp(p, T=..., ZK=..., dK=..., radical=...) -> list[PrimeIdeal] | list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/numberfields/subfield.pyi b/stubs/sympy-stubs/polys/numberfields/subfield.pyi new file mode 100644 index 00000000..e6050104 --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/subfield.pyi @@ -0,0 +1,25 @@ +from typing import Any +from sympy.core.numbers import AlgebraicNumber +from sympy.utilities import public + +def is_isomorphism_possible(a, b) -> bool: + ... + +def field_isomorphism_pslq(a, b) -> list[Any] | None: + ... + +def field_isomorphism_factor(a, b) -> Any | None: + ... + +@public +def field_isomorphism(a, b, *, fast=...) -> list[Any] | Any | None: + ... + +@public +def primitive_element(extension, x=..., *, ex=..., polys=...) -> tuple[Any, list[int]] | tuple[Any, list[int], list[Any]]: + ... + +@public +def to_number_field(extension, theta=..., *, gen=..., alias=...) -> AlgebraicNumber: + ... + diff --git a/stubs/sympy-stubs/polys/numberfields/utilities.pyi b/stubs/sympy-stubs/polys/numberfields/utilities.pyi new file mode 100644 index 00000000..6741781c --- /dev/null +++ b/stubs/sympy-stubs/polys/numberfields/utilities.pyi @@ -0,0 +1,49 @@ +from typing import Any, Generator, Literal, NoReturn +from sympy.utilities.decorator import public + +def is_rat(c) -> Any | Literal[True]: + ... + +def is_int(c) -> Any | Literal[True]: + ... + +def get_num_denom(c) -> tuple[Any, Any]: + ... + +@public +def extract_fundamental_discriminant(a) -> tuple[dict[Any, Any], dict[int, int]] | tuple[dict[Any, Any], dict[Any, Any]]: + ... + +@public +class AlgIntPowers: + def __init__(self, T, modulus=...) -> None: + ... + + def red(self, exp): + ... + + def __rmod__(self, other): + ... + + def compute_up_through(self, e) -> None: + ... + + def get(self, e) -> list[int] | list[Any]: + ... + + def __getitem__(self, item) -> list[int] | list[Any]: + ... + + + +@public +def coeff_search(m, R) -> Generator[Any, Any, NoReturn]: + ... + +def supplement_a_subspace(M): + ... + +@public +def isolate(alg, eps=..., fast=...) -> tuple[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/polys/orderings.pyi b/stubs/sympy-stubs/polys/orderings.pyi new file mode 100644 index 00000000..488eda52 --- /dev/null +++ b/stubs/sympy-stubs/polys/orderings.pyi @@ -0,0 +1,124 @@ +from typing import Any, Callable + +__all__ = ["lex", "grlex", "grevlex", "ilex", "igrlex", "igrevlex"] +class MonomialOrder: + alias: str | None = ... + is_global: bool | None = ... + is_default = ... + def __repr__(self) -> str: + ... + + def __str__(self) -> str: + ... + + def __call__(self, monomial): + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __ne__(self, other) -> bool: + ... + + + +class LexOrder(MonomialOrder): + alias = ... + is_global = ... + is_default = ... + def __call__(self, monomial): + ... + + + +class GradedLexOrder(MonomialOrder): + alias = ... + is_global = ... + def __call__(self, monomial) -> tuple[int, Any]: + ... + + + +class ReversedGradedLexOrder(MonomialOrder): + alias = ... + is_global = ... + def __call__(self, monomial) -> tuple[int, tuple[Any, ...]]: + ... + + + +class ProductOrder(MonomialOrder): + def __init__(self, *args) -> None: + ... + + def __call__(self, monomial) -> tuple[Any, ...]: + ... + + def __repr__(self) -> str: + ... + + def __str__(self) -> str: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + @property + def is_global(self) -> bool | None: + ... + + + +class InverseOrder(MonomialOrder): + def __init__(self, O) -> None: + ... + + def __str__(self) -> str: + ... + + def __call__(self, monomial) -> tuple[Any, ...]: + ... + + @property + def is_global(self) -> bool | None: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +lex = ... +grlex = ... +grevlex = ... +ilex = ... +igrlex = ... +igrevlex = ... +_monomial_key = ... +def monomial_key(order=..., gens=...) -> Callable[..., Any] | LexOrder: + ... + +class _ItemGetter: + def __init__(self, seq) -> None: + ... + + def __call__(self, m) -> tuple[Any, ...]: + ... + + def __eq__(self, other) -> bool: + ... + + + +def build_product_order(arg, gens) -> ProductOrder: + ... + diff --git a/stubs/sympy-stubs/polys/orthopolys.pyi b/stubs/sympy-stubs/polys/orthopolys.pyi new file mode 100644 index 00000000..b77ca474 --- /dev/null +++ b/stubs/sympy-stubs/polys/orthopolys.pyi @@ -0,0 +1,67 @@ +from typing import Any +from sympy.utilities import public + +def dup_jacobi(n, a, b, K) -> list[Any]: + ... + +@public +def jacobi_poly(n, a, b, x=..., polys=...): + ... + +def dup_gegenbauer(n, a, K) -> list[Any]: + ... + +def gegenbauer_poly(n, a, x=..., polys=...): + ... + +def dup_chebyshevt(n, K) -> list[Any]: + ... + +def dup_chebyshevu(n, K) -> list[Any]: + ... + +@public +def chebyshevt_poly(n, x=..., polys=...): + ... + +@public +def chebyshevu_poly(n, x=..., polys=...): + ... + +def dup_hermite(n, K) -> list[Any]: + ... + +def dup_hermite_prob(n, K) -> list[Any]: + ... + +@public +def hermite_poly(n, x=..., polys=...): + ... + +@public +def hermite_prob_poly(n, x=..., polys=...): + ... + +def dup_legendre(n, K) -> list[Any]: + ... + +@public +def legendre_poly(n, x=..., polys=...): + ... + +def dup_laguerre(n, alpha, K) -> list[Any]: + ... + +@public +def laguerre_poly(n, x=..., alpha=..., polys=...): + ... + +def dup_spherical_bessel_fn(n, K) -> list[Any]: + ... + +def dup_spherical_bessel_fn_minus(n, K) -> list[Any]: + ... + +def spherical_bessel_fn(n, x=..., polys=...): + ... + diff --git a/stubs/sympy-stubs/polys/partfrac.pyi b/stubs/sympy-stubs/polys/partfrac.pyi new file mode 100644 index 00000000..d14a7e05 --- /dev/null +++ b/stubs/sympy-stubs/polys/partfrac.pyi @@ -0,0 +1,25 @@ +from typing import Any +from sympy.utilities import public, xthreaded + +@xthreaded +@public +def apart(f, x=..., full=..., **options) -> Any: + ... + +def apart_undetermined_coeffs(P, Q): + ... + +def apart_full_decomposition(P, Q) -> Any: + ... + +@public +def apart_list(f, x=..., dummies=..., **options) -> tuple[Any, Any, list[Any]]: + ... + +def apart_list_full_decomposition(P, Q, dummygen) -> list[Any]: + ... + +@public +def assemble_partfrac_list(partial_list): + ... + diff --git a/stubs/sympy-stubs/polys/polyclasses.pyi b/stubs/sympy-stubs/polys/polyclasses.pyi new file mode 100644 index 00000000..88011bb2 --- /dev/null +++ b/stubs/sympy-stubs/polys/polyclasses.pyi @@ -0,0 +1,740 @@ +from types import NotImplementedType +from typing import Any, Callable, Literal, Never, Self +from sympy.external.gmpy import GROUND_TYPES +from sympy.core.sympify import CantSympify +from sympy.polys.polyutils import PicklableWithSlots +from sympy.polys.domains import Domain + +class GenericPoly(PicklableWithSlots): + def ground_to_ring(f): + ... + + def ground_to_field(f): + ... + + def ground_to_exact(f): + ... + + + +def init_normal_DMP(rep, lev, dom) -> DMP: + ... + +class DMP(PicklableWithSlots, CantSympify): + __slots__ = ... + def __init__(self, rep, dom, lev=..., ring=...) -> None: + ... + + def __repr__(f) -> str: + ... + + def __hash__(f) -> int: + ... + + def unify(f, g) -> tuple[Any, Any, Callable[..., Any | DMP], list[Any] | Any | list[list[Any]], list[Any] | Any | list[list[Any]]] | tuple[Any, Any, Callable[..., Any | DMP], Any | list[list[Any]], Any | list[list[Any]]]: + ... + + def per(f, rep, dom=..., kill=..., ring=...) -> DMP: + ... + + @classmethod + def zero(cls, lev, dom, ring=...) -> DMP: + ... + + @classmethod + def one(cls, lev, dom, ring=...) -> DMP: + ... + + @classmethod + def from_list(cls, rep, lev, dom) -> Self: + ... + + @classmethod + def from_sympy_list(cls, rep, lev, dom) -> Self: + ... + + def to_dict(f, zero=...) -> dict[tuple[Literal[0]], Any] | dict[Any, Any]: + ... + + def to_sympy_dict(f, zero=...) -> dict[tuple[Literal[0]], Any] | dict[Any, Any]: + ... + + def to_list(f) -> list[Any] | list[list[Any]]: + ... + + def to_sympy_list(f) -> list[Any]: + ... + + def to_tuple(f) -> tuple[Any, ...]: + ... + + @classmethod + def from_dict(cls, rep, lev, dom) -> Self: + ... + + @classmethod + def from_monoms_coeffs(cls, monoms, coeffs, lev, dom, ring=...) -> DMP: + ... + + def to_ring(f) -> Self | DMP: + ... + + def to_field(f) -> Self | DMP: + ... + + def to_exact(f) -> Self | DMP: + ... + + def convert(f, dom) -> Self | DMP: + ... + + def slice(f, m, n, j=...) -> DMP: + ... + + def coeffs(f, order=...) -> list[Any]: + ... + + def monoms(f, order=...) -> list[Any]: + ... + + def terms(f, order=...) -> list[tuple[Any, Any]] | list[Any]: + ... + + def all_coeffs(f) -> list[Any] | list[list[Any]]: + ... + + def all_monoms(f) -> list[tuple[Literal[0]]] | list[tuple[Any | int]]: + ... + + def all_terms(f) -> list[tuple[tuple[Literal[0]], Any]] | list[tuple[tuple[Any | int], list[Any]]]: + ... + + def lift(f) -> DMP: + ... + + def deflate(f) -> tuple[Any | tuple[Any, ...], Any | DMP]: + ... + + def inject(f, front=...) -> Self: + ... + + def eject(f, dom, front=...) -> Self: + ... + + def exclude(f) -> tuple[list[Any], Self]: + ... + + def permute(f, P) -> DMP: + ... + + def terms_gcd(f) -> tuple[Any | tuple[Any, ...], Any | DMP]: + ... + + def add_ground(f, c) -> DMP: + ... + + def sub_ground(f, c) -> DMP: + ... + + def mul_ground(f, c) -> DMP: + ... + + def quo_ground(f, c) -> DMP: + ... + + def exquo_ground(f, c) -> DMP: + ... + + def abs(f) -> DMP: + ... + + def neg(f) -> DMP: + ... + + def add(f, g) -> DMP: + ... + + def sub(f, g) -> DMP: + ... + + def mul(f, g) -> DMP: + ... + + def sqr(f) -> DMP: + ... + + def pow(f, n) -> DMP: + ... + + def pdiv(f, g) -> tuple[Any | DMP, Any | DMP]: + ... + + def prem(f, g) -> DMP: + ... + + def pquo(f, g) -> DMP: + ... + + def pexquo(f, g) -> DMP: + ... + + def div(f, g) -> tuple[Any | DMP, Any | DMP]: + ... + + def rem(f, g) -> DMP: + ... + + def quo(f, g) -> DMP: + ... + + def exquo(f, g) -> DMP: + ... + + def degree(f, j=...) -> int: + ... + + def degree_list(f) -> tuple[Any, ...]: + ... + + def total_degree(f) -> int: + ... + + def homogenize(f, s) -> DMP: + ... + + def homogeneous_order(f) -> int | None: + ... + + def LC(f): + ... + + def TC(f): + ... + + def nth(f, *N): + ... + + def max_norm(f): + ... + + def l1_norm(f) -> int: + ... + + def l2_norm_squared(f) -> int: + ... + + def clear_denoms(f) -> tuple[Any, Any | DMP]: + ... + + def integrate(f, m=..., j=...) -> DMP: + ... + + def diff(f, m=..., j=...) -> DMP: + ... + + def eval(f, a, j=...) -> DMP: + ... + + def half_gcdex(f, g) -> tuple[Any | DMP, Any | DMP]: + ... + + def gcdex(f, g) -> tuple[Any | DMP, Any | DMP, Any | DMP]: + ... + + def invert(f, g) -> DMP: + ... + + def revert(f, n) -> DMP: + ... + + def subresultants(f, g) -> list[Any | DMP]: + ... + + def resultant(f, g, includePRS=...) -> tuple[Any | DMP, list[Any | DMP]] | DMP: + ... + + def discriminant(f) -> DMP: + ... + + def cofactors(f, g) -> tuple[Any | DMP, Any | DMP, Any | DMP]: + ... + + def gcd(f, g) -> DMP: + ... + + def lcm(f, g) -> DMP: + ... + + def cancel(f, g, include=...) -> tuple[Any | DMP, Any | DMP] | tuple[Any | list[Any], Any | list[Any], Any | DMP, Any | DMP]: + ... + + def trunc(f, p) -> DMP: + ... + + def monic(f) -> DMP: + ... + + def content(f): + ... + + def primitive(f) -> tuple[Any, Any | DMP]: + ... + + def compose(f, g) -> DMP: + ... + + def decompose(f) -> list[Any | DMP]: + ... + + def shift(f, a) -> DMP: + ... + + def transform(f, p, q) -> DMP: + ... + + def sturm(f) -> list[Any | DMP]: + ... + + def cauchy_upper_bound(f): + ... + + def cauchy_lower_bound(f): + ... + + def mignotte_sep_bound_squared(f): + ... + + def gff_list(f) -> list[tuple[Any | DMP, Any]]: + ... + + def norm(f) -> DMP: + ... + + def sqf_norm(f) -> tuple[int, Any | DMP, Any | DMP]: + ... + + def sqf_part(f) -> DMP: + ... + + def sqf_list(f, all=...) -> tuple[Any, list[tuple[Any | DMP, Any]]]: + ... + + def sqf_list_include(f, all=...) -> list[tuple[Any | DMP, Literal[1]]]: + ... + + def factor_list(f) -> tuple[Any, list[tuple[Any | DMP, Any]]]: + ... + + def factor_list_include(f) -> list[tuple[Any | DMP, Any | Literal[1]]]: + ... + + def intervals(f, all=..., eps=..., inf=..., sup=..., fast=..., sqf=...) -> list[Any] | list[tuple[tuple[Any, Any], Any, Any] | tuple[Any, Any]] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] | list[Any] | tuple[list[tuple[tuple[Any | list[Any], Any | tuple[Any, Any, Any, Any]], Any]], list[tuple[tuple[Any, Any], Any]]] | tuple[list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] | list[Any], Any]: + ... + + def refine_root(f, s, t, eps=..., steps=..., fast=...) -> tuple[Any, Any] | tuple[Any | list[Any], Any | tuple[Any, Any, Any, Any]]: + ... + + def count_real_roots(f, inf=..., sup=...) -> int: + ... + + def count_complex_roots(f, inf=..., sup=...) -> int: + ... + + @property + def is_zero(f) -> bool: + ... + + @property + def is_one(f) -> bool: + ... + + @property + def is_ground(f) -> bool: + ... + + @property + def is_sqf(f) -> bool: + ... + + @property + def is_monic(f): + ... + + @property + def is_primitive(f): + ... + + @property + def is_linear(f) -> bool: + ... + + @property + def is_quadratic(f) -> bool: + ... + + @property + def is_monomial(f) -> bool: + ... + + @property + def is_homogeneous(f) -> bool: + ... + + @property + def is_irreducible(f) -> bool: + ... + + @property + def is_cyclotomic(f) -> bool: + ... + + def __abs__(f) -> DMP: + ... + + def __neg__(f) -> DMP: + ... + + def __add__(f, g) -> NotImplementedType | DMP: + ... + + def __radd__(f, g) -> NotImplementedType | DMP: + ... + + def __sub__(f, g) -> NotImplementedType | DMP: + ... + + def __rsub__(f, g) -> NotImplementedType | DMP: + ... + + def __mul__(f, g) -> DMP | NotImplementedType: + ... + + def __truediv__(f, g) -> DMP | NotImplementedType: + ... + + def __rtruediv__(f, g) -> DMP | NotImplementedType: + ... + + def __rmul__(f, g) -> DMP | NotImplementedType: + ... + + def __pow__(f, n) -> DMP: + ... + + def __divmod__(f, g) -> tuple[Any | DMP, Any | DMP]: + ... + + def __mod__(f, g) -> DMP: + ... + + def __floordiv__(f, g) -> DMP | NotImplementedType: + ... + + def __eq__(f, g) -> bool: + ... + + def __ne__(f, g) -> bool: + ... + + def eq(f, g, strict=...) -> bool: + ... + + def ne(f, g, strict=...) -> bool: + ... + + def __lt__(f, g) -> bool: + ... + + def __le__(f, g) -> bool: + ... + + def __gt__(f, g) -> bool: + ... + + def __ge__(f, g) -> bool: + ... + + def __bool__(f) -> bool: + ... + + + +def init_normal_DMF(num, den, lev, dom) -> DMF: + ... + +class DMF(PicklableWithSlots, CantSympify): + __slots__ = ... + def __init__(self, rep, dom, lev=..., ring=...) -> None: + ... + + @classmethod + def new(cls, rep, dom, lev=..., ring=...) -> Self: + ... + + def __repr__(f) -> str: + ... + + def __hash__(f) -> int: + ... + + def poly_unify(f, g) -> tuple[Any, Any, Callable[..., Any | Self], tuple[Any | list[Any], Any | list[Any]], list[Any] | Any | list[list[Any]]] | tuple[Any, Any, Callable[..., Any | Self], tuple[Any | list[list[Any]], Any | list[list[Any]]], Any | list[list[Any]]]: + ... + + def frac_unify(f, g) -> tuple[Any, Any, Callable[..., Any | Self], tuple[Any | list[Any], Any | list[Any]], tuple[Any | list[Any], Any | list[Any]]] | tuple[Any, Any, Callable[..., Any | Self], tuple[Any | list[list[Any]], Any | list[list[Any]]], tuple[Any | list[list[Any]], Any | list[list[Any]]]]: + ... + + def per(f, num, den, cancel=..., kill=..., ring=...) -> Self: + ... + + def half_per(f, rep, kill=...) -> DMP: + ... + + @classmethod + def zero(cls, lev, dom, ring=...) -> Self: + ... + + @classmethod + def one(cls, lev, dom, ring=...) -> Self: + ... + + def numer(f) -> DMP: + ... + + def denom(f) -> DMP: + ... + + def cancel(f) -> Self: + ... + + def neg(f) -> Self: + ... + + def add(f, g) -> Self: + ... + + def sub(f, g) -> Self: + ... + + def mul(f, g) -> Self: + ... + + def pow(f, n) -> Self: + ... + + def quo(f, g) -> Self: + ... + + exquo = ... + def invert(f, check=...) -> Self: + ... + + @property + def is_zero(f) -> bool: + ... + + @property + def is_one(f) -> bool: + ... + + def __neg__(f) -> Self: + ... + + def __add__(f, g) -> Self | NotImplementedType: + ... + + def __radd__(f, g) -> Self | NotImplementedType: + ... + + def __sub__(f, g) -> Self | NotImplementedType: + ... + + def __rsub__(f, g) -> DMF | NotImplementedType: + ... + + def __mul__(f, g) -> Self | NotImplementedType: + ... + + def __rmul__(f, g) -> Self | NotImplementedType: + ... + + def __pow__(f, n) -> Self: + ... + + def __truediv__(f, g) -> Self | NotImplementedType: + ... + + def __rtruediv__(self, g): + ... + + def __eq__(f, g) -> bool: + ... + + def __ne__(f, g) -> bool: + ... + + def __lt__(f, g) -> bool: + ... + + def __le__(f, g) -> bool: + ... + + def __gt__(f, g) -> bool: + ... + + def __ge__(f, g) -> bool: + ... + + def __bool__(f) -> bool: + ... + + + +def init_normal_ANP(rep, mod, dom) -> ANP: + ... + +class ANP(PicklableWithSlots, CantSympify): + __slots__ = ... + def __init__(self, rep, mod, dom) -> None: + ... + + def __repr__(f) -> str: + ... + + def __hash__(f) -> int: + ... + + def unify(f, g) -> tuple[Any, Callable[..., ANP], list[Any] | Any, list[Any] | Any, list[Any] | Any | list[list[Any]]] | tuple[Any, Callable[..., ANP], Any, Any, Any | list[Any] | list[list[Any]]]: + ... + + def per(f, rep, mod=..., dom=...) -> ANP: + ... + + @classmethod + def zero(cls, mod, dom) -> ANP: + ... + + @classmethod + def one(cls, mod, dom) -> ANP: + ... + + def to_dict(f) -> dict[tuple[Literal[0]], Any] | dict[Any, Any]: + ... + + def to_sympy_dict(f) -> dict[tuple[Literal[0]], Any] | dict[Any, Any]: + ... + + def to_list(f) -> list[Any]: + ... + + def to_sympy_list(f) -> list[Any]: + ... + + def to_tuple(f) -> tuple[Any, ...]: + ... + + @classmethod + def from_list(cls, rep, mod, dom) -> ANP: + ... + + def neg(f) -> ANP: + ... + + def add(f, g) -> ANP: + ... + + def sub(f, g) -> ANP: + ... + + def mul(f, g) -> ANP: + ... + + def pow(f, n) -> ANP: + ... + + def div(f, g) -> tuple[ANP, ANP]: + ... + + def rem(f, g) -> ANP: + ... + + def quo(f, g) -> ANP: + ... + + exquo = ... + def LC(f): + ... + + def TC(f): + ... + + @property + def is_zero(f) -> bool: + ... + + @property + def is_one(f) -> bool: + ... + + @property + def is_ground(f) -> bool: + ... + + def __pos__(f) -> Self: + ... + + def __neg__(f) -> ANP: + ... + + def __add__(f, g) -> ANP | NotImplementedType: + ... + + def __radd__(f, g) -> ANP | NotImplementedType: + ... + + def __sub__(f, g) -> ANP | NotImplementedType: + ... + + def __rsub__(f, g) -> ANP | NotImplementedType: + ... + + def __mul__(f, g) -> ANP | NotImplementedType: + ... + + def __rmul__(f, g) -> ANP | NotImplementedType: + ... + + def __pow__(f, n) -> ANP: + ... + + def __divmod__(f, g) -> tuple[ANP, ANP]: + ... + + def __mod__(f, g) -> ANP: + ... + + def __truediv__(f, g) -> ANP | NotImplementedType: + ... + + def __eq__(f, g) -> bool: + ... + + def __ne__(f, g) -> bool: + ... + + def __lt__(f, g) -> bool: + ... + + def __le__(f, g) -> bool: + ... + + def __gt__(f, g) -> bool: + ... + + def __ge__(f, g) -> bool: + ... + + def __bool__(f) -> bool: + ... + + + diff --git a/stubs/sympy-stubs/polys/polyconfig.pyi b/stubs/sympy-stubs/polys/polyconfig.pyi new file mode 100644 index 00000000..0b0da36e --- /dev/null +++ b/stubs/sympy-stubs/polys/polyconfig.pyi @@ -0,0 +1,18 @@ +from contextlib import contextmanager +from typing import Any, Generator + +_default_config = ... +_current_config = ... +@contextmanager +def using(**kwargs) -> Generator[None, Any, None]: + ... + +def setup(key, value=...) -> None: + ... + +def query(key): + ... + +def configure() -> None: + ... + diff --git a/stubs/sympy-stubs/polys/polyerrors.pyi b/stubs/sympy-stubs/polys/polyerrors.pyi new file mode 100644 index 00000000..b7dc2c42 --- /dev/null +++ b/stubs/sympy-stubs/polys/polyerrors.pyi @@ -0,0 +1,166 @@ +from typing import Self +from sympy.utilities import public + +@public +class BasePolynomialError(Exception): + def new(self, *args): + ... + + + +@public +class ExactQuotientFailed(BasePolynomialError): + def __init__(self, f, g, dom=...) -> None: + ... + + def __str__(self) -> str: + ... + + def new(self, f, g) -> Self: + ... + + + +@public +class PolynomialDivisionFailed(BasePolynomialError): + def __init__(self, f, g, domain) -> None: + ... + + def __str__(self) -> str: + ... + + + +@public +class OperationNotSupported(BasePolynomialError): + def __init__(self, poly, func) -> None: + ... + + def __str__(self) -> str: + ... + + + +@public +class HeuristicGCDFailed(BasePolynomialError): + ... + + +class ModularGCDFailed(BasePolynomialError): + ... + + +@public +class HomomorphismFailed(BasePolynomialError): + ... + + +@public +class IsomorphismFailed(BasePolynomialError): + ... + + +@public +class ExtraneousFactors(BasePolynomialError): + ... + + +@public +class EvaluationFailed(BasePolynomialError): + ... + + +@public +class RefinementFailed(BasePolynomialError): + ... + + +class CoercionFailed(BasePolynomialError): + ... + + +@public +class NotInvertible(BasePolynomialError): + ... + + +@public +class NotReversible(BasePolynomialError): + ... + + +@public +class NotAlgebraic(BasePolynomialError): + ... + + +@public +class DomainError(BasePolynomialError): + ... + + +@public +class PolynomialError(BasePolynomialError): + ... + + +@public +class UnificationFailed(BasePolynomialError): + ... + + +@public +class UnsolvableFactorError(BasePolynomialError): + ... + + +@public +class GeneratorsError(BasePolynomialError): + ... + + +@public +class GeneratorsNeeded(GeneratorsError): + ... + + +@public +class ComputationFailed(BasePolynomialError): + def __init__(self, func, nargs, exc) -> None: + ... + + def __str__(self) -> str: + ... + + + +@public +class UnivariatePolynomialError(PolynomialError): + ... + + +@public +class MultivariatePolynomialError(PolynomialError): + ... + + +@public +class PolificationFailed(PolynomialError): + def __init__(self, opt, origs, exprs, seq=...) -> None: + ... + + def __str__(self) -> str: + ... + + + +@public +class OptionError(BasePolynomialError): + ... + + +@public +class FlagError(OptionError): + ... + + diff --git a/stubs/sympy-stubs/polys/polyfuncs.pyi b/stubs/sympy-stubs/polys/polyfuncs.pyi new file mode 100644 index 00000000..d119bcb4 --- /dev/null +++ b/stubs/sympy-stubs/polys/polyfuncs.pyi @@ -0,0 +1,23 @@ +from typing import Any +from sympy.utilities import public + +@public +def symmetrize(F, *gens, **args) -> list[Any] | tuple[Any | list[Any], list[tuple[Any, Any]]]: + ... + +@public +def horner(f, *gens, **args): + ... + +@public +def interpolate(data, x) -> Any: + ... + +@public +def rational_interpolate(data, degnum, X=...) -> float: + ... + +@public +def viete(f, roots=..., *gens, **args) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/polymatrix.pyi b/stubs/sympy-stubs/polys/polymatrix.pyi new file mode 100644 index 00000000..28b88899 --- /dev/null +++ b/stubs/sympy-stubs/polys/polymatrix.pyi @@ -0,0 +1,98 @@ +from types import NotImplementedType +from typing import Any, Self +class MutablePolyDenseMatrix: + def __new__(cls, *args, ring=...) -> Self: + ... + + @classmethod + def from_list(cls, rows, cols, items, gens, ring) -> Self: + ... + + @classmethod + def from_dm(cls, dm) -> Self: + ... + + def to_Matrix(self): + ... + + @classmethod + def from_Matrix(cls, other, *gens, ring=...) -> Self: + ... + + def set_gens(self, gens) -> Self: + ... + + def __repr__(self) -> str: + ... + + @property + def shape(self): + ... + + @property + def rows(self): + ... + + @property + def cols(self): + ... + + def __len__(self): + ... + + def __getitem__(self, key) -> list[Any] | Any | Self: + ... + + def __eq__(self, other) -> bool: + ... + + def __add__(self, other) -> Self | NotImplementedType: + ... + + def __sub__(self, other) -> Self | NotImplementedType: + ... + + def __mul__(self, other) -> Self | NotImplementedType: + ... + + def __rmul__(self, other) -> Self | NotImplementedType: + ... + + def __truediv__(self, other) -> NotImplementedType | Self: + ... + + def __neg__(self) -> Self: + ... + + def transpose(self) -> Self: + ... + + def row_join(self, other) -> Self: + ... + + def col_join(self, other) -> Self: + ... + + def applyfunc(self, func) -> Self: + ... + + @classmethod + def eye(cls, n, gens) -> Self: + ... + + @classmethod + def zeros(cls, m, n, gens) -> Self: + ... + + def rref(self, simplify=..., normalize_last=...) -> tuple[Self, Any]: + ... + + def nullspace(self) -> list[Self]: + ... + + def rank(self): + ... + + + +PolyMatrix = MutablePolyMatrix = MutablePolyDenseMatrix diff --git a/stubs/sympy-stubs/polys/polyoptions.pyi b/stubs/sympy-stubs/polys/polyoptions.pyi new file mode 100644 index 00000000..fe261eb8 --- /dev/null +++ b/stubs/sympy-stubs/polys/polyoptions.pyi @@ -0,0 +1,339 @@ +from typing import Any, Callable, Generator, Literal, NoReturn, Self +from sympy.core.basic import Basic +from sympy.core.symbol import Symbol +from sympy.polys.domains.gaussiandomains import GaussianIntegerRing, GaussianRationalField +from sympy.polys.orderings import LexOrder +from sympy.utilities import public + +__all__ = ["Options"] +class Option: + option: str | None = ... + is_Flag = ... + requires: list[str] = ... + excludes: list[str] = ... + after: list[str] = ... + before: list[str] = ... + @classmethod + def default(cls) -> None: + ... + + @classmethod + def preprocess(cls, option) -> None: + ... + + @classmethod + def postprocess(cls, options) -> None: + ... + + + +class Flag(Option): + is_Flag = ... + + +class BooleanOption(Option): + @classmethod + def preprocess(cls, value) -> bool: + ... + + + +class OptionType(type): + def __init__(cls, *args, **kwargs) -> None: + ... + + + +@public +class Options(dict): + __order__ = ... + __options__: dict[str, type[Option]] = ... + def __init__(self, gens, args, flags=..., strict=...) -> None: + ... + + def clone(self, updates=...) -> Self: + ... + + def __setattr__(self, attr, value) -> None: + ... + + @property + def args(self) -> dict[Any, Any]: + ... + + @property + def options(self) -> dict[Any, Any]: + ... + + @property + def flags(self) -> dict[Any, Any]: + ... + + + +class Expand(BooleanOption, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes: list[str] = ... + @classmethod + def default(cls) -> Literal[True]: + ... + + + +class Gens(Option, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes: list[str] = ... + @classmethod + def default(cls) -> tuple[()]: + ... + + @classmethod + def preprocess(cls, gens) -> tuple[Basic, ...]: + ... + + + +class Wrt(Option, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes: list[str] = ... + _re_split = ... + @classmethod + def preprocess(cls, wrt) -> list[str] | list[Any] | list[str | Any]: + ... + + + +class Sort(Option, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes: list[str] = ... + @classmethod + def default(cls) -> list[Any]: + ... + + @classmethod + def preprocess(cls, sort) -> list[str]: + ... + + + +class Order(Option, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes: list[str] = ... + @classmethod + def default(cls) -> LexOrder: + ... + + @classmethod + def preprocess(cls, order) -> Callable[..., Any] | LexOrder: + ... + + + +class Field(BooleanOption, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes = ... + + +class Greedy(BooleanOption, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes = ... + + +class Composite(BooleanOption, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> None: + ... + + requires: list[str] = ... + excludes = ... + + +class Domain(Option, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes = ... + after = ... + _re_realfield = ... + _re_complexfield = ... + _re_finitefield = ... + _re_polynomial = ... + _re_fraction = ... + _re_algebraic = ... + @classmethod + def preprocess(cls, domain) -> Any | GaussianIntegerRing | GaussianRationalField: + ... + + @classmethod + def postprocess(cls, options) -> None: + ... + + + +class Split(BooleanOption, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes = ... + @classmethod + def postprocess(cls, options) -> None: + ... + + + +class Gaussian(BooleanOption, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes = ... + @classmethod + def postprocess(cls, options) -> None: + ... + + + +class Extension(Option, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes = ... + @classmethod + def preprocess(cls, extension) -> bool | set[Any] | None: + ... + + @classmethod + def postprocess(cls, options) -> None: + ... + + + +class Modulus(Option, metaclass=OptionType): + option = ... + requires: list[str] = ... + excludes = ... + @classmethod + def preprocess(cls, modulus) -> int: + ... + + @classmethod + def postprocess(cls, options) -> None: + ... + + + +class Symmetric(BooleanOption, metaclass=OptionType): + option = ... + requires = ... + excludes = ... + + +class Strict(BooleanOption, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Literal[True]: + ... + + + +class Auto(BooleanOption, Flag, metaclass=OptionType): + option = ... + after = ... + @classmethod + def default(cls) -> Literal[True]: + ... + + @classmethod + def postprocess(cls, options) -> None: + ... + + + +class Frac(BooleanOption, Flag, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Literal[False]: + ... + + + +class Formal(BooleanOption, Flag, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Literal[False]: + ... + + + +class Polys(BooleanOption, Flag, metaclass=OptionType): + option = ... + + +class Include(BooleanOption, Flag, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Literal[False]: + ... + + + +class All(BooleanOption, Flag, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Literal[False]: + ... + + + +class Gen(Flag, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Literal[0]: + ... + + @classmethod + def preprocess(cls, gen) -> Basic | int: + ... + + + +class Series(BooleanOption, Flag, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Literal[False]: + ... + + + +class Symbols(Flag, metaclass=OptionType): + option = ... + @classmethod + def default(cls) -> Generator[Symbol | Any, Any, NoReturn]: + ... + + @classmethod + def preprocess(cls, symbols): + ... + + + +class Method(Flag, metaclass=OptionType): + option = ... + @classmethod + def preprocess(cls, method) -> str: + ... + + + +def build_options(gens, args=...) -> Any: + ... + +def allowed_flags(args, flags) -> None: + ... + +def set_defaults(options, **defaults) -> dict[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/polys/polyquinticconst.pyi b/stubs/sympy-stubs/polys/polyquinticconst.pyi new file mode 100644 index 00000000..2a255db3 --- /dev/null +++ b/stubs/sympy-stubs/polys/polyquinticconst.pyi @@ -0,0 +1,51 @@ +from typing import Any +from sympy.utilities import public + +x = ... +@public +class PolyQuintic: + def __init__(self, poly) -> None: + ... + + @property + def f20(self) -> Any: + ... + + @property + def b(self) -> tuple[list[Any], list[int], list[int], list[int], list[int]]: + ... + + @property + def o(self) -> list[int]: + ... + + @property + def a(self) -> list[int]: + ... + + @property + def c(self) -> list[int]: + ... + + @property + def F(self): + ... + + def l0(self, theta): + ... + + def T(self, theta, d) -> list[int]: + ... + + def order(self, theta, d): + ... + + def uv(self, theta, d) -> tuple[Any, Any]: + ... + + @property + def zeta(self) -> list[Any]: + ... + + + diff --git a/stubs/sympy-stubs/polys/polyroots.pyi b/stubs/sympy-stubs/polys/polyroots.pyi new file mode 100644 index 00000000..a98ed444 --- /dev/null +++ b/stubs/sympy-stubs/polys/polyroots.pyi @@ -0,0 +1,36 @@ +from typing import Any +from sympy.functions.elementary.piecewise import Piecewise +from sympy.utilities import public + +z = ... +def roots_linear(f) -> list[Any]: + ... + +def roots_quadratic(f) -> list[Any]: + ... + +def roots_cubic(f, trig=...) -> list[Any]: + ... + +def roots_quartic(f) -> Any | list[Any] | list[Any | Piecewise]: + ... + +def roots_binomial(f) -> list[Any]: + ... + +def roots_cyclotomic(f, factor=...) -> list[Any]: + ... + +def roots_quintic(f) -> list[Any]: + ... + +def preprocess_roots(poly) -> tuple[Any, Any]: + ... + +@public +def roots(f, *gens, auto=..., cubics=..., trig=..., quartics=..., quintics=..., multiple=..., filter=..., predicate=..., strict=..., **flags): + ... + +def root_factors(f, *gens, filter=..., **args) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/polys/polytools.pyi b/stubs/sympy-stubs/polys/polytools.pyi new file mode 100644 index 00000000..9198a05a --- /dev/null +++ b/stubs/sympy-stubs/polys/polytools.pyi @@ -0,0 +1,889 @@ +from functools import _Wrapped +from types import NotImplementedType +from typing import Any, Callable, Iterator, Literal, Self, Tuple +from sympy.combinatorics.galois import S1TransitiveSubgroups, S2TransitiveSubgroups, S3TransitiveSubgroups +from sympy.combinatorics.perm_groups import PermutationGroup +from sympy.core.add import Add +from sympy.core.basic import Basic +from sympy.core.decorators import _sympifyit +from sympy.core.expr import Expr +from sympy.core.function import Derivative +from sympy.core.mul import Mul +from sympy.core.numbers import Integer +from sympy.core.relational import Equality, Ne, Relational +from sympy.series.order import Order +from sympy.utilities import public + +def _polifyit(func) -> _Wrapped[..., Any, ..., Any]: + ... + +@public +class Poly(Basic): + __slots__ = ... + is_commutative = ... + is_Poly = ... + _op_priority = ... + def __new__(cls, rep, *gens, **args) -> Self: + ... + + @classmethod + def new(cls, rep, *gens) -> Self: + ... + + @property + def expr(self) -> Order: + ... + + @property + def args(self) -> tuple[Any | Order, ...]: + ... + + @classmethod + def from_dict(cls, rep, *gens, **args) -> Self: + ... + + @classmethod + def from_list(cls, rep, *gens, **args) -> Self: + ... + + @classmethod + def from_poly(cls, rep, *gens, **args) -> Self: + ... + + @classmethod + def from_expr(cls, rep, *gens, **args) -> Self: + ... + + def __hash__(self) -> int: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + @property + def free_symbols_in_domain(self) -> set[Any]: + ... + + @property + def gen(self): + ... + + @property + def domain(self): + ... + + @property + def zero(self) -> Self: + ... + + @property + def one(self) -> Self: + ... + + @property + def unit(self) -> Self: + ... + + def unify(f, g) -> tuple[Any | Self, Any | Self]: + ... + + def per(f, rep, gens=..., remove=...) -> Self: + ... + + def set_domain(f, domain) -> Self: + ... + + def get_domain(f): + ... + + def set_modulus(f, modulus) -> Self: + ... + + def get_modulus(f) -> Integer: + ... + + def exclude(f) -> Self: + ... + + def replace(f, x, y=..., **_ignore) -> Self: + ... + + def match(f, *args, **kwargs): + ... + + def reorder(f, *gens, **args) -> Self: + ... + + def ltrim(f, gen) -> Self: + ... + + def has_only_gens(f, *gens) -> bool: + ... + + def to_ring(f) -> Self: + ... + + def to_field(f) -> Self: + ... + + def to_exact(f) -> Self: + ... + + def retract(f, field=...) -> Self: + ... + + def slice(f, x, m, n=...) -> Self: + ... + + def coeffs(f, order=...) -> list[Any]: + ... + + def monoms(f, order=...): + ... + + def terms(f, order=...) -> list[tuple[Any, Any]]: + ... + + def all_coeffs(f) -> list[Any]: + ... + + def all_monoms(f): + ... + + def all_terms(f) -> list[tuple[Any, Any]]: + ... + + def termwise(f, func, *gens, **args) -> Self: + ... + + def length(f) -> int: + ... + + def as_dict(f, native=..., zero=...): + ... + + def as_list(f, native=...): + ... + + def as_expr(f, *gens) -> Order: + ... + + def as_poly(self, *gens, **args) -> Any | None: + ... + + def lift(f) -> Self: + ... + + def deflate(f) -> tuple[Any, Any | Self]: + ... + + def inject(f, front=...) -> Self: + ... + + def eject(f, *gens) -> Self: + ... + + def terms_gcd(f) -> tuple[Any, Any | Self]: + ... + + def add_ground(f, coeff) -> Self: + ... + + def sub_ground(f, coeff) -> Self: + ... + + def mul_ground(f, coeff) -> Self: + ... + + def quo_ground(f, coeff) -> Self: + ... + + def exquo_ground(f, coeff) -> Self: + ... + + def abs(f) -> Self: + ... + + def neg(f) -> Self: + ... + + def add(f, g) -> Self: + ... + + def sub(f, g) -> Self: + ... + + def mul(f, g) -> Self: + ... + + def sqr(f) -> Self: + ... + + def pow(f, n) -> Self: + ... + + def pdiv(f, g) -> tuple[Any | Self, Any | Self]: + ... + + def prem(f, g) -> Self: + ... + + def pquo(f, g) -> Self: + ... + + def pexquo(f, g) -> Self: + ... + + def div(f, g, auto=...) -> tuple[Any | Self, Any | Self]: + ... + + def rem(f, g, auto=...) -> Self: + ... + + def quo(f, g, auto=...) -> Self: + ... + + def exquo(f, g, auto=...) -> Self: + ... + + def degree(f, gen=...): + ... + + def degree_list(f): + ... + + def total_degree(f): + ... + + def homogenize(f, s) -> Self: + ... + + def homogeneous_order(f): + ... + + def LC(f, order=...): + ... + + def TC(f): + ... + + def EC(f, order=...): + ... + + def coeff_monomial(f, monom): + ... + + def nth(f, *N): + ... + + def coeff(f, x, n=..., right=...): + ... + + def LM(f, order=...) -> Any: + ... + + def EM(f, order=...) -> Any: + ... + + def LT(f, order=...) -> tuple[Any, Any]: + ... + + def ET(f, order=...) -> tuple[Any, Any]: + ... + + def max_norm(f): + ... + + def l1_norm(f): + ... + + def clear_denoms(self, convert=...) -> tuple[Any, Self] | tuple[Any, Any | Self]: + ... + + def rat_clear_denoms(self, g) -> tuple[Any | Self, Any | Self]: + ... + + def integrate(self, *specs, **args) -> Self: + ... + + def diff(f, *specs, **kwargs) -> Derivative | Self: + ... + + _eval_derivative = ... + def eval(self, x, a=..., auto=...) -> Self: + ... + + def __call__(f, *values) -> Self: + ... + + def half_gcdex(f, g, auto=...) -> tuple[Any | Self, Any | Self]: + ... + + def gcdex(f, g, auto=...) -> tuple[Any | Self, Any | Self, Any | Self]: + ... + + def invert(f, g, auto=...) -> Self: + ... + + def revert(f, n) -> Self: + ... + + def subresultants(f, g) -> list[Any | Self]: + ... + + def resultant(f, g, includePRS=...) -> tuple[Any | Self, list[Any | Self]] | Self: + ... + + def discriminant(f) -> Self: + ... + + def dispersionset(f, g=...) -> set[int] | set[Any]: + ... + + def dispersion(f, g=...) -> int: + ... + + def cofactors(f, g) -> tuple[Any | Self, Any | Self, Any | Self]: + ... + + def gcd(f, g) -> Self: + ... + + def lcm(f, g) -> Self: + ... + + def trunc(f, p) -> Self: + ... + + def monic(self, auto=...) -> Self: + ... + + def content(f): + ... + + def primitive(f) -> tuple[Any, Any | Self]: + ... + + def compose(f, g) -> Self: + ... + + def decompose(f) -> list[Any | Self]: + ... + + def shift(f, a) -> Self: + ... + + def transform(f, p, q) -> Self: + ... + + def sturm(self, auto=...) -> list[Any | Self]: + ... + + def gff_list(f) -> list[tuple[Any | Self, Any]]: + ... + + def norm(f) -> Self: + ... + + def sqf_norm(f) -> tuple[Any, Any | Self, Any | Self]: + ... + + def sqf_part(f) -> Self: + ... + + def sqf_list(f, all=...) -> tuple[Any, list[tuple[Any | Self, Any]]]: + ... + + def sqf_list_include(f, all=...) -> list[tuple[Any | Self, Any]]: + ... + + def factor_list(f) -> tuple[Any, list[tuple[Self, Literal[1]]]] | tuple[Any, list[tuple[Any | Self, Any]]]: + ... + + def factor_list_include(f) -> list[tuple[Self, Literal[1]]] | list[tuple[Any | Self, Any]]: + ... + + def intervals(f, all=..., eps=..., inf=..., sup=..., fast=..., sqf=...) -> list[tuple[Any, Any]] | tuple[list[tuple[Any, Any]], list[tuple[Any, Any]]] | list[tuple[tuple[Any, Any], Any]] | tuple[list[tuple[tuple[Any, Any], Any]], list[tuple[tuple[Any, Any], Any]]]: + ... + + def refine_root(f, s, t, eps=..., steps=..., fast=..., check_sqf=...) -> tuple[Any, Any]: + ... + + def count_roots(f, inf=..., sup=...) -> Integer: + ... + + def root(f, index, radicals=...) -> Any: + ... + + def real_roots(f, multiple=..., radicals=...) -> list[list[Any]] | list[tuple[Any, int]]: + ... + + def all_roots(f, multiple=..., radicals=...) -> list[list[Any]] | list[tuple[Any, int]]: + ... + + def nroots(f, n=..., maxsteps=..., cleanup=...) -> list[Any]: + ... + + def ground_roots(f) -> dict[Any, Any]: + ... + + def nth_power_roots_poly(f, n) -> Self: + ... + + def same_root(f, a, b): + ... + + def cancel(f, g, include=...) -> tuple[Any, Any | Self, Any | Self] | tuple[Any | Self, ...]: + ... + + def make_monic_over_integers_by_scaling_roots(f) -> tuple[Self, Any] | tuple[Any | Self, Any]: + ... + + def galois_group(f, by_name=..., max_tries=..., randomize=...) -> tuple[PermutationGroup | Literal[S1TransitiveSubgroups.S1, S2TransitiveSubgroups.S2, S3TransitiveSubgroups.A3, S3TransitiveSubgroups.S3] | None, bool]: + ... + + @property + def is_zero(f): + ... + + @property + def is_one(f): + ... + + @property + def is_sqf(f): + ... + + @property + def is_monic(f): + ... + + @property + def is_primitive(f): + ... + + @property + def is_ground(f): + ... + + @property + def is_linear(f): + ... + + @property + def is_quadratic(f): + ... + + @property + def is_monomial(f): + ... + + @property + def is_homogeneous(f): + ... + + @property + def is_irreducible(f): + ... + + @property + def is_univariate(f) -> bool: + ... + + @property + def is_multivariate(f) -> bool: + ... + + @property + def is_cyclotomic(f): + ... + + def __abs__(f) -> Self: + ... + + def __neg__(f) -> Self: + ... + + @_polifyit + def __add__(f, g) -> Self: + ... + + @_polifyit + def __radd__(f, g): + ... + + @_polifyit + def __sub__(f, g) -> Self: + ... + + @_polifyit + def __rsub__(f, g): + ... + + @_polifyit + def __mul__(f, g) -> Self: + ... + + @_polifyit + def __rmul__(f, g): + ... + + @_sympifyit('n', NotImplemented) + def __pow__(f, n) -> Self | NotImplementedType: + ... + + @_polifyit + def __divmod__(f, g) -> tuple[Any | Self, Any | Self]: + ... + + @_polifyit + def __rdivmod__(f, g): + ... + + @_polifyit + def __mod__(f, g) -> Self: + ... + + @_polifyit + def __rmod__(f, g): + ... + + @_polifyit + def __floordiv__(f, g) -> Self: + ... + + @_polifyit + def __rfloordiv__(f, g): + ... + + @_sympifyit('g', NotImplemented) + def __truediv__(f, g): + ... + + @_sympifyit('g', NotImplemented) + def __rtruediv__(f, g): + ... + + @_sympifyit('other', NotImplemented) + def __eq__(self, other) -> bool: + ... + + @_sympifyit('g', NotImplemented) + def __ne__(f, g) -> bool: + ... + + def __bool__(f) -> bool: + ... + + def eq(f, g, strict=...) -> Literal[False]: + ... + + def ne(f, g, strict=...) -> bool: + ... + + + +@public +class PurePoly(Poly): + def __hash__(self) -> int: + ... + + @property + def free_symbols(self): + ... + + @_sympifyit('other', NotImplemented) + def __eq__(self, other) -> bool: + ... + + + +@public +def poly_from_expr(expr, *gens, **args) -> tuple[Any, Any]: + ... + +@public +def parallel_poly_from_expr(exprs, *gens, **args) -> tuple[list[Any], Any]: + ... + +@public +def degree(f, gen=...) -> Integer: + ... + +@public +def total_degree(f, *gens) -> Integer: + ... + +@public +def degree_list(f, *gens, **args) -> tuple[Any | Integer, ...]: + ... + +@public +def LC(f, *gens, **args) -> Any: + ... + +@public +def LM(f, *gens, **args) -> Any: + ... + +@public +def LT(f, *gens, **args) -> Any: + ... + +@public +def pdiv(f, g, *gens, **args) -> tuple[Any, Any]: + ... + +@public +def prem(f, g, *gens, **args) -> Any: + ... + +@public +def pquo(f, g, *gens, **args) -> Any: + ... + +@public +def pexquo(f, g, *gens, **args) -> Any: + ... + +@public +def div(f, g, *gens, **args) -> tuple[Any, Any]: + ... + +@public +def rem(f, g, *gens, **args) -> Any: + ... + +@public +def quo(f, g, *gens, **args) -> Any: + ... + +@public +def exquo(f, g, *gens, **args) -> Any: + ... + +@public +def half_gcdex(f, g, *gens, **args) -> tuple[Any, Any]: + ... + +@public +def gcdex(f, g, *gens, **args) -> tuple[Any, Any, Any]: + ... + +@public +def invert(f, g, *gens, **args) -> Any: + ... + +@public +def subresultants(f, g, *gens, **args) -> list[Any] | Any: + ... + +@public +def resultant(f, g, *gens, includePRS=..., **args) -> tuple[Any, list[Any]] | Any | tuple[Any, Any]: + ... + +@public +def discriminant(f, *gens, **args) -> Any: + ... + +@public +def cofactors(f, g, *gens, **args) -> tuple[Any, Any, Any]: + ... + +@public +def gcd_list(seq, *gens, **args) -> Any: + ... + +@public +def gcd(f, g=..., *gens, **args) -> Any: + ... + +@public +def lcm_list(seq, *gens, **args) -> Expr | Any: + ... + +@public +def lcm(f, g=..., *gens, **args) -> Any: + ... + +@public +def terms_gcd(f, *gens, **args) -> Equality | Relational | Ne | Any | Add | Order | Mul: + ... + +@public +def trunc(f, p, *gens, **args) -> Any: + ... + +@public +def monic(f, *gens, **args) -> Any: + ... + +@public +def content(f, *gens, **args) -> Any: + ... + +@public +def primitive(f, *gens, **args) -> tuple[Any, Any]: + ... + +@public +def compose(f, g, *gens, **args) -> Any: + ... + +@public +def decompose(f, *gens, **args) -> list[Any] | Any: + ... + +@public +def sturm(f, *gens, **args) -> list[Any] | Any: + ... + +@public +def gff_list(f, *gens, **args) -> list[tuple[Any, Any]] | Any: + ... + +@public +def gff(f, *gens, **args): + ... + +@public +def sqf_norm(f, *gens, **args) -> tuple[Any | Integer, Any, Any]: + ... + +@public +def sqf_part(f, *gens, **args) -> Any: + ... + +def to_rational_coeffs(f) -> tuple[Any | None, Any, None, Any | None] | tuple[None, None, Any | None, Any] | None: + ... + +@public +def sqf_list(f, *gens, **args) -> tuple[Any, list[tuple[Any, Any]] | list[Any]] | tuple[Any, list[tuple[Any, Any]] | list[Any], list[tuple[Any, Any]] | list[Any]]: + ... + +@public +def sqf(f, *gens, **args) -> Add | Order | Mul: + ... + +@public +def factor_list(f, *gens, **args) -> tuple[Any, list[tuple[Any, Any]] | list[Any]] | tuple[Any, list[tuple[Any, Any]] | list[Any], list[tuple[Any, Any]] | list[Any]]: + ... + +@public +def factor(f, *gens, deep=..., **args) -> Add | Order | Mul | Expr | Any: + ... + +@public +def intervals(F, all=..., eps=..., inf=..., sup=..., strict=..., fast=..., sqf=...) -> list[Any] | Any: + ... + +@public +def refine_root(f, s, t, eps=..., steps=..., fast=..., check_sqf=...) -> Any: + ... + +@public +def count_roots(f, inf=..., sup=...) -> Any: + ... + +@public +def real_roots(f, multiple=...) -> Any: + ... + +@public +def nroots(f, n=..., maxsteps=..., cleanup=...) -> Any: + ... + +@public +def ground_roots(f, *gens, **args) -> Any: + ... + +@public +def nth_power_roots_poly(f, n, *gens, **args) -> Any: + ... + +@public +def cancel(f, *gens, _signsimp=..., **args): + ... + +@public +def reduced(f, G, *gens, **args) -> tuple[list[Any], Any]: + ... + +@public +def groebner(F, *gens, **args) -> Any: + ... + +@public +def is_zero_dimensional(F, *gens, **args) -> Any: + ... + +@public +class GroebnerBasis(Basic): + def __new__(cls, F, *gens, **args) -> Self: + ... + + @property + def args(self) -> tuple[Tuple, Tuple]: + ... + + @property + def exprs(self) -> list[Any]: + ... + + @property + def polys(self) -> list[Any]: + ... + + @property + def gens(self): + ... + + @property + def domain(self): + ... + + @property + def order(self): + ... + + def __len__(self) -> int: + ... + + def __iter__(self) -> Iterator[Any]: + ... + + def __getitem__(self, item): + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + @property + def is_zero_dimensional(self) -> bool: + ... + + def fglm(self, order) -> Self: + ... + + def reduce(self, expr, auto=...) -> tuple[list[Any], Any]: + ... + + def contains(self, poly): + ... + + + +@public +def poly(expr, *gens, **args) -> Any: + ... + +def named_poly(n, f, K, name, x, polys): + ... + diff --git a/stubs/sympy-stubs/polys/polyutils.pyi b/stubs/sympy-stubs/polys/polyutils.pyi new file mode 100644 index 00000000..3a290113 --- /dev/null +++ b/stubs/sympy-stubs/polys/polyutils.pyi @@ -0,0 +1,38 @@ +from types import NotImplementedType +from typing import Any, Self +from sympy.external.gmpy import GROUND_TYPES +from sympy.series.order import Order + +_gens_order = ... +_max_order = ... +_re_gen = ... +illegal_types = ... +finf = ... +def parallel_dict_from_expr(exprs, **args) -> tuple[list[Any], Any]: + ... + +def dict_from_expr(expr, **args) -> tuple[Any, Any]: + ... + +def expr_from_dict(rep, *gens) -> Order: + ... + +parallel_dict_from_basic = ... +dict_from_basic = ... +basic_from_dict = ... +class PicklableWithSlots: + __slots__ = ... + def __getstate__(self, cls=...) -> dict[Any, Any]: + ... + + def __setstate__(self, d) -> None: + ... + + + +class IntegerPowerable: + def __pow__(self, e, modulo=...) -> NotImplementedType | Self: + ... + + + diff --git a/stubs/sympy-stubs/polys/rationaltools.pyi b/stubs/sympy-stubs/polys/rationaltools.pyi new file mode 100644 index 00000000..b4477ed8 --- /dev/null +++ b/stubs/sympy-stubs/polys/rationaltools.pyi @@ -0,0 +1,11 @@ +from typing import Dict +from sympy.core.add import Add +from sympy.core.basic import Basic +from sympy.core.mul import Mul +from sympy.series.order import Order +from sympy.utilities import public + +@public +def together(expr, deep=..., fraction=...) -> Basic | Add | Order | Mul | Dict: + ... + diff --git a/stubs/sympy-stubs/polys/ring_series.pyi b/stubs/sympy-stubs/polys/ring_series.pyi new file mode 100644 index 00000000..8bfd59de --- /dev/null +++ b/stubs/sympy-stubs/polys/ring_series.pyi @@ -0,0 +1,111 @@ +from typing import Any, Literal + +def rs_trunc(p1, x, prec): + ... + +def rs_is_puiseux(p, x) -> bool: + ... + +def rs_puiseux(f, p, x, prec) -> tuple[Any, ...]: + ... + +def rs_puiseux2(f, p, q, x, prec): + ... + +def rs_mul(p1, p2, x, prec): + ... + +def rs_square(p1, x, prec): + ... + +def rs_pow(p1, n, x, prec) -> tuple[Any, ...] | Literal[1]: + ... + +def rs_subs(p, rules, x, prec): + ... + +def rs_series_inversion(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_series_reversion(p, x, n, y): + ... + +def rs_series_from_list(p, c, x, prec, concur=...): + ... + +def rs_diff(p, x): + ... + +def rs_integrate(p, x): + ... + +def rs_fun(p, f, *args): + ... + +def mul_xin(p, i, n): + ... + +def pow_xin(p, i, n): + ... + +def rs_nth_root(p, n, x, prec) -> tuple[Any, ...] | Literal[1]: + ... + +def rs_log(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_LambertW(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_exp(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_atan(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_asin(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_tan(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_cot(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_sin(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_cos(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_cos_sin(p, x, prec) -> tuple[Any, ...] | tuple[Any, Any]: + ... + +def rs_atanh(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_sinh(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_cosh(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_tanh(p, x, prec) -> tuple[Any, ...]: + ... + +def rs_newton(p, x, prec): + ... + +def rs_hadamard_exp(p1, inverse=...): + ... + +def rs_compose_add(p1, p2): + ... + +_convert_func = ... +def rs_min_pow(expr, series_rs, a): + ... + +def rs_series(expr, a, prec): + ... + diff --git a/stubs/sympy-stubs/polys/rings.pyi b/stubs/sympy-stubs/polys/rings.pyi new file mode 100644 index 00000000..b885a4b8 --- /dev/null +++ b/stubs/sympy-stubs/polys/rings.pyi @@ -0,0 +1,530 @@ +from types import NotImplementedType +from typing import Any, Iterator, Literal, LiteralString, Self +from sympy.core.sympify import CantSympify +from sympy.polys.compatibility import IPolys +from sympy.polys.domains.domainelement import DomainElement +from sympy.polys.fields import FracField +from sympy.printing.defaults import DefaultPrinting +from sympy.series.order import Order +from sympy.utilities import public + +@public +def ring(symbols, domain, order=...) -> Any: + ... + +@public +def xring(symbols, domain, order=...) -> tuple[PolyRing | Any, Any]: + ... + +@public +def vring(symbols, domain, order=...) -> PolyRing | Any: + ... + +@public +def sring(exprs, *symbols, **options) -> tuple[PolyRing | Any, Any] | tuple[PolyRing | Any, list[Any]]: + ... + +_ring_cache: dict[Any, Any] = ... +class PolyRing(DefaultPrinting, IPolys): + def __new__(cls, symbols, domain, order=...) -> Self | Any: + ... + + def __getnewargs__(self) -> tuple[Any, Any, Any]: + ... + + def __getstate__(self) -> dict[str, Any]: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def clone(self, symbols=..., domain=..., order=...) -> Self: + ... + + def monomial_basis(self, i) -> tuple[Any, ...]: + ... + + @property + def zero(self): + ... + + @property + def one(self): + ... + + def domain_new(self, element, orig_domain=...): + ... + + def ground_new(self, coeff): + ... + + def term_new(self, monom, coeff): + ... + + def ring_new(self, element) -> PolyElement: + ... + + __call__ = ... + def from_dict(self, element, orig_domain=...): + ... + + def from_terms(self, element, orig_domain=...): + ... + + def from_list(self, element): + ... + + def from_expr(self, expr): + ... + + def index(self, gen) -> int: + ... + + def drop(self, *gens) -> Self: + ... + + def __getitem__(self, key) -> Self: + ... + + def to_ground(self) -> Self: + ... + + def to_domain(self) -> Any: + ... + + def to_field(self) -> FracField | Any: + ... + + @property + def is_univariate(self) -> bool: + ... + + @property + def is_multivariate(self) -> bool: + ... + + def add(self, *objs): + ... + + def mul(self, *objs): + ... + + def drop_to_ground(self, *gens) -> Self: + ... + + def compose(self, other) -> Self: + ... + + def add_gens(self, symbols) -> Self: + ... + + def symmetric_poly(self, n): + ... + + + +class PolyElement(DomainElement, DefaultPrinting, CantSympify, dict): + def new(self, init) -> Self: + ... + + def parent(self): + ... + + def __getnewargs__(self) -> tuple[Any, list[tuple[Any, Any]]]: + ... + + _hash = ... + def __hash__(self) -> int: + ... + + def copy(self) -> Self: + ... + + def set_ring(self, new_ring) -> Self: + ... + + def as_expr(self, *symbols) -> Order: + ... + + def as_expr_dict(self) -> dict[Any, Any]: + ... + + def clear_denoms(self) -> tuple[Any, Self]: + ... + + def strip_zero(self) -> None: + ... + + def __eq__(p1, p2) -> bool: + ... + + def __ne__(p1, p2) -> bool: + ... + + def almosteq(p1, p2, tolerance=...) -> bool: + ... + + def sort_key(self) -> tuple[int, list[Any]]: + ... + + def __lt__(p1, p2) -> bool: + ... + + def __le__(p1, p2) -> bool: + ... + + def __gt__(p1, p2) -> bool: + ... + + def __ge__(p1, p2) -> bool: + ... + + def drop(self, gen): + ... + + def drop_to_ground(self, gen): + ... + + def to_dense(self) -> list[Any] | list[list[Any]]: + ... + + def to_dict(self) -> dict[Any, Any]: + ... + + def str(self, printer, precedence, exp_pattern, mul_symbol) -> LiteralString: + ... + + @property + def is_generator(self) -> bool: + ... + + @property + def is_ground(self) -> bool: + ... + + @property + def is_monomial(self) -> bool: + ... + + @property + def is_term(self) -> bool: + ... + + @property + def is_negative(self): + ... + + @property + def is_positive(self): + ... + + @property + def is_nonnegative(self): + ... + + @property + def is_nonpositive(self): + ... + + @property + def is_zero(f) -> bool: + ... + + @property + def is_one(f): + ... + + @property + def is_monic(f): + ... + + @property + def is_primitive(f): + ... + + @property + def is_linear(f) -> bool: + ... + + @property + def is_quadratic(f) -> bool: + ... + + @property + def is_squarefree(f) -> Literal[True]: + ... + + @property + def is_irreducible(f) -> Literal[True]: + ... + + @property + def is_cyclotomic(f): + ... + + def __neg__(self) -> Self: + ... + + def __pos__(self) -> Self: + ... + + def __add__(p1, p2) -> Self | PolyElement | NotImplementedType: + ... + + def __radd__(p1, n) -> Self | NotImplementedType: + ... + + def __sub__(p1, p2) -> Self | NotImplementedType: + ... + + def __rsub__(p1, n) -> NotImplementedType: + ... + + def __mul__(p1, p2) -> NotImplementedType: + ... + + def __rmul__(p1, p2) -> NotImplementedType: + ... + + def __pow__(self, n) -> Self: + ... + + def square(self): + ... + + def __divmod__(p1, p2) -> tuple[Any, Any] | tuple[list[Any], Any] | NotImplementedType | tuple[Self, Self]: + ... + + def __rdivmod__(p1, p2) -> NotImplementedType: + ... + + def __mod__(p1, p2) -> NotImplementedType | Self: + ... + + def __rmod__(p1, p2) -> NotImplementedType: + ... + + def __truediv__(p1, p2) -> list[Any] | NotImplementedType | Self: + ... + + def __rtruediv__(p1, p2) -> NotImplementedType: + ... + + __floordiv__ = ... + __rfloordiv__ = ... + def div(self, fv) -> tuple[Any, Any] | tuple[list[Any], Any]: + ... + + def rem(self, G): + ... + + def quo(f, G) -> list[Any]: + ... + + def exquo(f, G) -> list[Any]: + ... + + def degree(f, x=...) -> Literal[0]: + ... + + def degrees(f) -> tuple[Any, ...]: + ... + + def tail_degree(f, x=...) -> Literal[0]: + ... + + def tail_degrees(f) -> tuple[Any, ...]: + ... + + def leading_expv(self) -> None: + ... + + def coeff(self, element): + ... + + def const(self): + ... + + @property + def LC(self): + ... + + @property + def LM(self): + ... + + def leading_monom(self): + ... + + @property + def LT(self) -> tuple[Any, Any]: + ... + + def leading_term(self): + ... + + def coeffs(self, order=...) -> list[Any]: + ... + + def monoms(self, order=...) -> list[Any]: + ... + + def terms(self, order=...) -> list[Any]: + ... + + def itercoeffs(self) -> Iterator[Any]: + ... + + def itermonoms(self) -> Iterator[Any]: + ... + + def iterterms(self) -> Iterator[tuple[Any, Any]]: + ... + + def listcoeffs(self) -> list[Any]: + ... + + def listmonoms(self) -> list[Any]: + ... + + def listterms(self) -> list[tuple[Any, Any]]: + ... + + def imul_num(p, c) -> Self | None: + ... + + def content(f): + ... + + def primitive(f) -> tuple[Any, Self]: + ... + + def monic(f) -> Self: + ... + + def mul_ground(f, x) -> Self: + ... + + def mul_monom(f, monom) -> Self: + ... + + def mul_term(f, term) -> Self: + ... + + def quo_ground(f, x) -> Self: + ... + + def quo_term(f, term) -> Self: + ... + + def trunc_ground(f, p) -> Self: + ... + + rem_ground = ... + def extract_ground(self, g) -> tuple[Any, Self, Any]: + ... + + def max_norm(f): + ... + + def l1_norm(f) -> int: + ... + + def deflate(f, *G) -> tuple[tuple[Any, ...], list[Self]] | tuple[tuple[Any, ...], list[Any]]: + ... + + def inflate(f, J): + ... + + def lcm(self, g): + ... + + def gcd(f, g) -> Self: + ... + + def cofactors(f, g) -> tuple[Any, Any, Any] | tuple[Self, Self, Self]: + ... + + def cancel(self, g) -> tuple[Self, Any] | tuple[Any | Self | PolyElement, Any | Self | PolyElement]: + ... + + def canonical_unit(f): + ... + + def diff(f, x): + ... + + def __call__(f, *values): + ... + + def evaluate(self, x, a=...): + ... + + def subs(self, x, a=...) -> Self: + ... + + def symmetrize(self) -> tuple[Self, Any, list[Any]] | tuple[Any, Self | Any, list[tuple[Any, Any]]]: + ... + + def compose(f, x, a=...): + ... + + def pdiv(f, g): + ... + + def prem(f, g): + ... + + def pquo(f, g): + ... + + def pexquo(f, g): + ... + + def half_gcdex(f, g): + ... + + def gcdex(f, g): + ... + + def subresultants(f, g): + ... + + def resultant(f, g): + ... + + def discriminant(f): + ... + + def decompose(f): + ... + + def shift(f, a): + ... + + def sturm(f): + ... + + def gff_list(f): + ... + + def sqf_norm(f): + ... + + def sqf_part(f): + ... + + def sqf_list(f, all=...): + ... + + def factor_list(f): + ... + + + diff --git a/stubs/sympy-stubs/polys/rootisolation.pyi b/stubs/sympy-stubs/polys/rootisolation.pyi new file mode 100644 index 00000000..7ede46a2 --- /dev/null +++ b/stubs/sympy-stubs/polys/rootisolation.pyi @@ -0,0 +1,214 @@ +from typing import Any, Literal, LiteralString, Self + +def dup_sturm(f, K) -> list[Any | list[Any]]: + ... + +def dup_root_upper_bound(f, K) -> None: + ... + +def dup_root_lower_bound(f, K) -> None: + ... + +def dup_cauchy_upper_bound(f, K): + ... + +def dup_cauchy_lower_bound(f, K): + ... + +def dup_mignotte_sep_bound_squared(f, K): + ... + +def dup_step_refine_real_root(f, M, K, fast=...) -> tuple[Any, tuple[Any, Any, Any, Any]] | tuple[list[Any], tuple[Any, Any, Any, Any]] | tuple[list[Any] | Any, tuple[Any, Any, Any, Any]]: + ... + +def dup_inner_refine_real_root(f, M, K, eps=..., steps=..., disjoint=..., fast=..., mobius=...) -> tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]: + ... + +def dup_outer_refine_real_root(f, s, t, K, eps=..., steps=..., disjoint=..., fast=...) -> tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]: + ... + +def dup_refine_real_root(f, s, t, K, eps=..., steps=..., disjoint=..., fast=...) -> tuple[Any, Any] | tuple[Any | list[Any], Any | tuple[Any, Any, Any, Any]]: + ... + +def dup_inner_isolate_real_roots(f, K, eps=..., fast=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]]: + ... + +def dup_inner_isolate_positive_roots(f, K, eps=..., inf=..., sup=..., fast=..., mobius=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]]: + ... + +def dup_inner_isolate_negative_roots(f, K, inf=..., sup=..., eps=..., fast=..., mobius=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]]: + ... + +def dup_isolate_real_roots_sqf(f, K, eps=..., inf=..., sup=..., fast=..., blackbox=...) -> list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] | list[RealInterval]: + ... + +def dup_isolate_real_roots(f, K, eps=..., inf=..., sup=..., basis=..., fast=...) -> list[Any] | list[tuple[tuple[Any, Any], Any, Any] | tuple[Any, Any]]: + ... + +def dup_isolate_real_roots_list(polys, K, eps=..., inf=..., sup=..., strict=..., basis=..., fast=...) -> list[tuple[tuple[Any, Any], Any, Any] | tuple[tuple[Any, Any], dict[Any, Any]]]: + ... + +def dup_count_real_roots(f, K, inf=..., sup=...) -> int: + ... + +OO = ... +Q1 = ... +Q2 = ... +Q3 = ... +Q4 = ... +A1 = ... +A2 = ... +A3 = ... +A4 = ... +_rules_simple = ... +_rules_ambiguous = ... +_values = ... +def dup_count_complex_roots(f, K, inf=..., sup=..., exclude=...) -> int: + ... + +def dup_isolate_complex_roots_sqf(f, K, eps=..., inf=..., sup=..., blackbox=...): + ... + +def dup_isolate_all_roots_sqf(f, K, eps=..., inf=..., sup=..., fast=..., blackbox=...) -> tuple[list[Any] | list[tuple[Any, Any] | tuple[Any | list[Any], tuple[Any, Any, Any, Any]]] | list[RealInterval], Any]: + ... + +def dup_isolate_all_roots(f, K, eps=..., inf=..., sup=..., fast=...) -> tuple[list[tuple[tuple[Any | list[Any], Any | tuple[Any, Any, Any, Any]], Any]], list[tuple[tuple[Any, Any], Any]]]: + ... + +class RealInterval: + def __init__(self, data, f, dom) -> None: + ... + + @property + def func(self) -> type[RealInterval]: + ... + + @property + def args(self) -> tuple[tuple[Any, ...] | Any, list[Any] | Any, Any]: + ... + + def __eq__(self, other) -> bool: + ... + + @property + def a(self): + ... + + @property + def b(self): + ... + + @property + def dx(self): + ... + + @property + def center(self): + ... + + @property + def max_denom(self): + ... + + def as_tuple(self) -> tuple[Any, Any]: + ... + + def __repr__(self) -> LiteralString: + ... + + def __contains__(self, item) -> Literal[False]: + ... + + def is_disjoint(self, other): + ... + + def refine_disjoint(self, other) -> tuple[Self | RealInterval, Any]: + ... + + def refine_size(self, dx) -> Self | RealInterval: + ... + + def refine_step(self, steps=...) -> Self | RealInterval: + ... + + def refine(self) -> Self | RealInterval: + ... + + + +class ComplexInterval: + def __init__(self, a, b, I, Q, F1, F2, f1, f2, dom, conj=...) -> None: + ... + + @property + def func(self) -> type[ComplexInterval]: + ... + + @property + def args(self) -> tuple[Any, Any, Any, Any, Any, Any, Any, Any, Any, bool]: + ... + + def __eq__(self, other) -> bool: + ... + + @property + def ax(self): + ... + + @property + def ay(self): + ... + + @property + def bx(self): + ... + + @property + def by(self): + ... + + @property + def dx(self): + ... + + @property + def dy(self): + ... + + @property + def center(self) -> tuple[Any, Any]: + ... + + @property + def max_denom(self): + ... + + def as_tuple(self) -> tuple[tuple[Any, Any], tuple[Any, Any]]: + ... + + def __repr__(self) -> LiteralString: + ... + + def conjugate(self) -> ComplexInterval: + ... + + def __contains__(self, item): + ... + + def is_disjoint(self, other) -> Literal[True]: + ... + + def refine_disjoint(self, other) -> tuple[Self | ComplexInterval, Any]: + ... + + def refine_size(self, dx, dy=...) -> Self | ComplexInterval: + ... + + def refine_step(self, steps=...) -> Self | ComplexInterval: + ... + + def refine(self) -> ComplexInterval: + ... + + + diff --git a/stubs/sympy-stubs/polys/rootoftools.pyi b/stubs/sympy-stubs/polys/rootoftools.pyi new file mode 100644 index 00000000..0a31d615 --- /dev/null +++ b/stubs/sympy-stubs/polys/rootoftools.pyi @@ -0,0 +1,109 @@ +from typing import Any, Literal, Self +from sympy.core import Expr +from sympy.core.numbers import Integer +from sympy.series.order import Order +from sympy.utilities import public + +__all__ = ['CRootOf'] +class _pure_key_dict: + def __init__(self) -> None: + ... + + def __getitem__(self, k): + ... + + def __setitem__(self, k, v) -> None: + ... + + def __contains__(self, k) -> bool: + ... + + + +_reals_cache = ... +_complexes_cache = ... +@public +def rootof(f, x, index=..., radicals=..., expand=...) -> Any: + ... + +@public +class RootOf(Expr): + __slots__ = ... + def __new__(cls, f, x, index=..., radicals=..., expand=...) -> Any: + ... + + + +@public +class ComplexRootOf(RootOf): + __slots__ = ... + is_complex = ... + is_number = ... + is_finite = ... + def __new__(cls, f, x, index=..., radicals=..., expand=...) -> Any: + ... + + @property + def expr(self): + ... + + @property + def args(self) -> tuple[Any, Any | Integer]: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + @classmethod + def real_roots(cls, poly, radicals=...) -> list[Any]: + ... + + @classmethod + def all_roots(cls, poly, radicals=...) -> list[Any]: + ... + + @classmethod + def clear_cache(cls) -> None: + ... + + def eval_approx(self, n, return_mpmath=...): + ... + + def eval_rational(self, dx=..., dy=..., n=...): + ... + + + +CRootOf = ... +@public +class RootSum(Expr): + __slots__ = ... + def __new__(cls, expr, func=..., x=..., auto=..., quadratic=...): + ... + + @classmethod + def new(cls, poly, func, auto=...) -> Self | Any: + ... + + @property + def expr(self): + ... + + @property + def args(self) -> tuple[Any, Any, Any]: + ... + + @property + def free_symbols(self): + ... + + @property + def is_commutative(self) -> Literal[True]: + ... + + def doit(self, **hints) -> Self | Order: + ... + + + diff --git a/stubs/sympy-stubs/polys/solvers.pyi b/stubs/sympy-stubs/polys/solvers.pyi new file mode 100644 index 00000000..74b97bd8 --- /dev/null +++ b/stubs/sympy-stubs/polys/solvers.pyi @@ -0,0 +1,24 @@ +from typing import Any +from sympy.matrices.dense import MutableDenseMatrix +from sympy.polys.matrices.domainmatrix import DomainMatrix + +class PolyNonlinearError(Exception): + ... + + +class RawMatrix(MutableDenseMatrix): + _sympify = ... + def __init__(self, *args, **kwargs) -> None: + ... + + + +def eqs_to_matrix(eqs_coeffs, eqs_rhs, gens, domain) -> DomainMatrix: + ... + +def sympy_eqs_to_ring(eqs, symbols) -> tuple[Any, Any]: + ... + +def solve_lin_sys(eqs, ring, _raw=...) -> dict[Any, Any] | None: + ... + diff --git a/stubs/sympy-stubs/polys/specialpolys.pyi b/stubs/sympy-stubs/polys/specialpolys.pyi new file mode 100644 index 00000000..3d9a5415 --- /dev/null +++ b/stubs/sympy-stubs/polys/specialpolys.pyi @@ -0,0 +1,48 @@ +from typing import Any +from sympy.series.order import Order +from sympy.utilities import public + +@public +def swinnerton_dyer_poly(n, x=..., polys=...) -> Any: + ... + +@public +def cyclotomic_poly(n, x=..., polys=...): + ... + +@public +def symmetric_poly(n, *gens, polys=...) -> Any | Order: + ... + +@public +def random_poly(x, n, inf, sup, domain=..., polys=...) -> Any: + ... + +@public +def interpolating_poly(n, x, X=..., Y=...) -> Order: + ... + +def fateman_poly_F_1(n) -> tuple[Any, Any, Any]: + ... + +def dmp_fateman_poly_F_1(n, K) -> tuple[Any | list[Any] | list[list[Any]], Any | list[Any] | list[list[Any]], list[list[Any]] | Any | list[Any]]: + ... + +def fateman_poly_F_2(n) -> tuple[Any, Any, Any]: + ... + +def dmp_fateman_poly_F_2(n, K) -> tuple[Any | list[Any] | list[list[Any]], Any | list[Any] | list[list[Any]], Any | list[list[Any]]]: + ... + +def fateman_poly_F_3(n) -> tuple[Any, Any, Any]: + ... + +def dmp_fateman_poly_F_3(n, K) -> tuple[Any | list[Any] | list[list[Any]], Any | list[Any] | list[list[Any]], Any | list[list[Any]]]: + ... + +def f_polys() -> tuple[Any, Any, Any, Any, Any, Any, Any]: + ... + +def w_polys() -> tuple[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/polys/sqfreetools.pyi b/stubs/sympy-stubs/polys/sqfreetools.pyi new file mode 100644 index 00000000..b162f590 --- /dev/null +++ b/stubs/sympy-stubs/polys/sqfreetools.pyi @@ -0,0 +1,53 @@ +from typing import Any, Literal + +def dup_sqf_p(f, K) -> bool: + ... + +def dmp_sqf_p(f, u, K) -> bool: + ... + +def dup_sqf_norm(f, K) -> tuple[int, Any | list[Any], tuple[Any, list[Any]] | Any | tuple[list[list[Any]], list[Any]] | tuple[list[list[Any]] | Any | list[Any], list[Any]] | list[list[Any]] | list[Any]]: + ... + +def dmp_sqf_norm(f, u, K) -> tuple[int, Any | list[Any], tuple[Any, list[Any]] | Any | tuple[list[list[Any]], list[Any]] | tuple[list[list[Any]] | Any | list[Any], list[Any]] | list[list[Any]] | list[Any]] | tuple[int, Any | list[Any] | list[list[Any]], tuple[Any, list[Any]] | Any | tuple[list[list[Any]], list[Any]] | tuple[list[list[Any]] | Any | list[Any], list[Any]] | list[list[Any]] | list[Any]]: + ... + +def dmp_norm(f, u, K) -> tuple[Any, list[Any]] | tuple[list[list[Any]], list[Any]] | tuple[list[list[Any]] | Any | list[Any], list[Any]] | list[list[Any]] | list[Any]: + ... + +def dup_gf_sqf_part(f, K): + ... + +def dmp_gf_sqf_part(f, u, K): + ... + +def dup_sqf_part(f, K) -> list[Any]: + ... + +def dmp_sqf_part(f, u, K) -> list[Any]: + ... + +def dup_gf_sqf_list(f, K, all=...) -> tuple[Any, list[Any]]: + ... + +def dmp_gf_sqf_list(f, u, K, all=...): + ... + +def dup_sqf_list(f, K, all=...) -> tuple[Any, list[Any]]: + ... + +def dup_sqf_list_include(f, K, all=...) -> list[tuple[list[Any], Literal[1]]] | list[tuple[Any, Literal[1]]]: + ... + +def dmp_sqf_list(f, u, K, all=...) -> tuple[Any, list[Any]]: + ... + +def dmp_sqf_list_include(f, u, K, all=...) -> list[tuple[list[Any], Literal[1]]] | list[tuple[Any, Literal[1]]] | list[tuple[list[list[Any]] | Any | list[Any], Literal[1]]]: + ... + +def dup_gff_list(f, K) -> list[Any]: + ... + +def dmp_gff_list(f, u, K) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/printing/__init__.pyi b/stubs/sympy-stubs/printing/__init__.pyi new file mode 100644 index 00000000..ca46c832 --- /dev/null +++ b/stubs/sympy-stubs/printing/__init__.pyi @@ -0,0 +1,24 @@ +from sympy.printing.pretty import pager_print, pprint, pprint_try_use_unicode, pprint_use_unicode, pretty, pretty_print +from sympy.printing.latex import latex, multiline_latex, print_latex +from sympy.printing.mathml import mathml, print_mathml +from sympy.printing.python import print_python, python +from sympy.printing.pycode import pycode +from sympy.printing.codeprinter import ccode, cxxcode, fcode, print_ccode, print_fcode +from sympy.printing.smtlib import smtlib_code +from sympy.printing.glsl import glsl_code, print_glsl +from sympy.printing.rcode import print_rcode, rcode +from sympy.printing.jscode import jscode, print_jscode +from sympy.printing.julia import julia_code +from sympy.printing.mathematica import mathematica_code +from sympy.printing.octave import octave_code +from sympy.printing.rust import rust_code +from sympy.printing.gtk import print_gtk +from sympy.printing.preview import preview +from sympy.printing.repr import srepr +from sympy.printing.tree import print_tree +from sympy.printing.str import StrPrinter, sstr, sstrrepr +from sympy.printing.tableform import TableForm +from sympy.printing.dot import dotprint +from sympy.printing.maple import maple_code, print_maple_code + +__all__ = ['pager_print', 'pretty', 'pretty_print', 'pprint', 'pprint_use_unicode', 'pprint_try_use_unicode', 'latex', 'print_latex', 'multiline_latex', 'mathml', 'print_mathml', 'python', 'print_python', 'pycode', 'ccode', 'print_ccode', 'cxxcode', 'fcode', 'print_fcode', 'smtlib_code', 'glsl_code', 'print_glsl', 'rcode', 'print_rcode', 'jscode', 'print_jscode', 'julia_code', 'mathematica_code', 'octave_code', 'rust_code', 'print_gtk', 'preview', 'srepr', 'print_tree', 'StrPrinter', 'sstr', 'sstrrepr', 'TableForm', 'dotprint', 'maple_code', 'print_maple_code'] diff --git a/stubs/sympy-stubs/printing/c.pyi b/stubs/sympy-stubs/printing/c.pyi new file mode 100644 index 00000000..2289454d --- /dev/null +++ b/stubs/sympy-stubs/printing/c.pyi @@ -0,0 +1,53 @@ +from typing import Any +from sympy.codegen.ast import Type +from sympy.core.function import UndefinedFunction +from sympy.core.power import Pow +from sympy.printing.codeprinter import CodePrinter + +known_functions_C89 = ... +known_functions_C99 = ... +reserved_words = ... +reserved_words_c99 = ... +def get_math_macros() -> dict[Any | type[UndefinedFunction] | Pow, str]: + ... + +class C89CodePrinter(CodePrinter): + printmethod = ... + language = ... + standard = ... + reserved_words = ... + _default_settings: dict[str, Any] = ... + type_aliases = ... + type_mappings: dict[Type, Any] = ... + type_headers = ... + type_macros: dict[Type, tuple[str, ...]] = ... + type_func_suffixes = ... + type_literal_suffixes = ... + type_math_macro_suffixes = ... + math_macros = ... + _ns = ... + _kf: dict[str, Any] = ... + def __init__(self, settings=...) -> None: + ... + + def indent_code(self, code) -> str | list[Any]: + ... + + _print_List = ... + _print_union = ... + + +class C99CodePrinter(C89CodePrinter): + standard = ... + reserved_words = ... + type_mappings = ... + type_headers = ... + _kf: dict[str, Any] = ... + _prec_funcs = ... + + +class C11CodePrinter(C99CodePrinter): + ... + + +c_code_printers = ... diff --git a/stubs/sympy-stubs/printing/codeprinter.pyi b/stubs/sympy-stubs/printing/codeprinter.pyi new file mode 100644 index 00000000..cdabd291 --- /dev/null +++ b/stubs/sympy-stubs/printing/codeprinter.pyi @@ -0,0 +1,69 @@ +from functools import _Wrapped +from typing import Any +from sympy.printing.str import StrPrinter + +class requires: + def __init__(self, **kwargs) -> None: + ... + + def __call__(self, method) -> _Wrapped[..., Any, ..., Any]: + ... + + + +class AssignmentError(Exception): + ... + + +class CodePrinter(StrPrinter): + _operators = ... + _default_settings: dict[str, Any] = ... + _rewriteable_functions = ... + def __init__(self, settings=...) -> None: + ... + + def doprint(self, expr, assign_to=...) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + + _print_Expr = ... + _print_Heaviside = ... + _print_Basic = ... + _print_ComplexInfinity = ... + _print_Derivative = ... + _print_ExprCondPair = ... + _print_GeometryEntity = ... + _print_Infinity = ... + _print_Integral = ... + _print_Interval = ... + _print_AccumulationBounds = ... + _print_Limit = ... + _print_MatrixBase = ... + _print_DeferredVector = ... + _print_NaN = ... + _print_NegativeInfinity = ... + _print_Order = ... + _print_RootOf = ... + _print_RootsOf = ... + _print_RootSum = ... + _print_Uniform = ... + _print_Unit = ... + _print_Wild = ... + _print_WildFunction = ... + _print_Relational = ... + + +def ccode(expr, assign_to=..., standard=..., **settings): + ... + +def print_ccode(expr, **settings) -> None: + ... + +def fcode(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_fcode(expr, **settings) -> None: + ... + +def cxxcode(expr, assign_to=..., standard=..., **settings): + ... + diff --git a/stubs/sympy-stubs/printing/conventions.pyi b/stubs/sympy-stubs/printing/conventions.pyi new file mode 100644 index 00000000..90ee9234 --- /dev/null +++ b/stubs/sympy-stubs/printing/conventions.pyi @@ -0,0 +1,9 @@ +from typing import Any + +_name_with_digits_p = ... +def split_super_sub(text) -> tuple[Any, list[Any], list[Any]] | tuple[Any | None, list[Any], list[Any]]: + ... + +def requires_partial(expr) -> bool: + ... + diff --git a/stubs/sympy-stubs/printing/cxx.pyi b/stubs/sympy-stubs/printing/cxx.pyi new file mode 100644 index 00000000..e260e9ad --- /dev/null +++ b/stubs/sympy-stubs/printing/cxx.pyi @@ -0,0 +1,31 @@ +from sympy.printing.c import C89CodePrinter, C99CodePrinter + +reserved = ... +_math_functions = ... +class _CXXCodePrinterBase: + printmethod = ... + language = ... + _ns = ... + def __init__(self, settings=...) -> None: + ... + + + +class CXX98CodePrinter(_CXXCodePrinterBase, C89CodePrinter): + standard = ... + reserved_words = ... + + +class CXX11CodePrinter(_CXXCodePrinterBase, C99CodePrinter): + standard = ... + reserved_words = ... + type_mappings = ... + + +class CXX17CodePrinter(_CXXCodePrinterBase, C99CodePrinter): + standard = ... + reserved_words = ... + _kf = ... + + +cxx_code_printers = ... diff --git a/stubs/sympy-stubs/printing/dot.pyi b/stubs/sympy-stubs/printing/dot.pyi new file mode 100644 index 00000000..d6e661f6 --- /dev/null +++ b/stubs/sympy-stubs/printing/dot.pyi @@ -0,0 +1,24 @@ +from typing import Any +__all__ = ['dotprint'] +default_styles = ... +slotClasses = ... +def purestr(x, with_args=...) -> tuple[str | Any, tuple[()] | tuple[Any, ...]] | str: + ... + +def styleof(expr, styles=...) -> dict[Any, Any]: + ... + +def attrprint(d, delimiter=...) -> str: + ... + +def dotnode(expr, styles=..., labelfunc=..., pos=..., repeat=...) -> str: + ... + +def dotedges(expr, atom=..., pos=..., repeat=...) -> list[Any] | list[str]: + ... + +template = ... +_graphstyle = ... +def dotprint(expr, styles=..., atom=..., maxdepth=..., repeat=..., labelfunc=..., **kwargs) -> str: + ... + diff --git a/stubs/sympy-stubs/printing/fortran.pyi b/stubs/sympy-stubs/printing/fortran.pyi new file mode 100644 index 00000000..69776f86 --- /dev/null +++ b/stubs/sympy-stubs/printing/fortran.pyi @@ -0,0 +1,21 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +known_functions = ... +class FCodePrinter(CodePrinter): + printmethod = ... + language = ... + type_aliases = ... + type_mappings = ... + type_modules = ... + _default_settings: dict[str, Any] = ... + _operators = ... + _relationals = ... + def __init__(self, settings=...) -> None: + ... + + def indent_code(self, code) -> str | list[Any]: + ... + + + diff --git a/stubs/sympy-stubs/printing/glsl.pyi b/stubs/sympy-stubs/printing/glsl.pyi new file mode 100644 index 00000000..9abbbe09 --- /dev/null +++ b/stubs/sympy-stubs/printing/glsl.pyi @@ -0,0 +1,26 @@ +from typing import Any +from sympy.core import Basic +from sympy.printing.codeprinter import CodePrinter + +known_functions = ... +class GLSLPrinter(CodePrinter): + _not_supported: set[Basic] = ... + printmethod = ... + language = ... + _default_settings = ... + def __init__(self, settings=...) -> None: + ... + + def indent_code(self, code) -> str | list[Any]: + ... + + _print_tuple = ... + _print_Tuple = ... + + +def glsl_code(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_glsl(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/gtk.pyi b/stubs/sympy-stubs/printing/gtk.pyi new file mode 100644 index 00000000..f47daf54 --- /dev/null +++ b/stubs/sympy-stubs/printing/gtk.pyi @@ -0,0 +1,3 @@ +def print_gtk(x, start_viewer=...) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/jscode.pyi b/stubs/sympy-stubs/printing/jscode.pyi new file mode 100644 index 00000000..2800247c --- /dev/null +++ b/stubs/sympy-stubs/printing/jscode.pyi @@ -0,0 +1,22 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +known_functions = ... +class JavascriptCodePrinter(CodePrinter): + printmethod = ... + language = ... + _default_settings: dict[str, Any] = ... + def __init__(self, settings=...) -> None: + ... + + def indent_code(self, code) -> str | list[Any]: + ... + + + +def jscode(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_jscode(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/julia.pyi b/stubs/sympy-stubs/printing/julia.pyi new file mode 100644 index 00000000..7aa2cc01 --- /dev/null +++ b/stubs/sympy-stubs/printing/julia.pyi @@ -0,0 +1,25 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +known_fcns_src1 = ... +known_fcns_src2 = ... +class JuliaCodePrinter(CodePrinter): + printmethod = ... + language = ... + _operators = ... + _default_settings: dict[str, Any] = ... + def __init__(self, settings=...) -> None: + ... + + _print_Tuple = ... + def indent_code(self, code) -> str | list[Any]: + ... + + + +def julia_code(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_julia_code(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/lambdarepr.pyi b/stubs/sympy-stubs/printing/lambdarepr.pyi new file mode 100644 index 00000000..771e4dd0 --- /dev/null +++ b/stubs/sympy-stubs/printing/lambdarepr.pyi @@ -0,0 +1,29 @@ +from typing import Any +from sympy.printing.pycode import MpmathPrinter, PythonCodePrinter + +__all__ = ['PythonCodePrinter', 'MpmathPrinter', 'NumPyPrinter', 'LambdaPrinter', 'NumPyPrinter', 'IntervalPrinter', 'lambdarepr'] +class LambdaPrinter(PythonCodePrinter): + printmethod = ... + + +class NumExprPrinter(LambdaPrinter): + printmethod = ... + _numexpr_functions = ... + module = ... + def blacklisted(self, expr): + ... + + _print_ImmutableDenseMatrix = ... + _print_Dict = ... + def doprint(self, expr) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + + + +class IntervalPrinter(MpmathPrinter, LambdaPrinter): + ... + + +def lambdarepr(expr, **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + diff --git a/stubs/sympy-stubs/printing/latex.pyi b/stubs/sympy-stubs/printing/latex.pyi new file mode 100644 index 00000000..47181d5e --- /dev/null +++ b/stubs/sympy-stubs/printing/latex.pyi @@ -0,0 +1,57 @@ +from typing import Any, Callable, TYPE_CHECKING +from sympy.printing.printer import Printer, print_function + +if TYPE_CHECKING: + ... +accepted_latex_functions = ... +tex_greek_dictionary = ... +other_symbols = ... +modifier_dict: dict[str, Callable[[str], str]] = ... +greek_letters_set = ... +_between_two_numbers_p = ... +def latex_escape(s: str) -> str: + ... + +class LatexPrinter(Printer): + printmethod = ... + _default_settings: dict[str, Any] = ... + def __init__(self, settings=...) -> None: + ... + + def parenthesize(self, item, level, is_neg=..., strict=...) -> str: + ... + + def parenthesize_super(self, s) -> str: + ... + + def doprint(self, expr) -> str: + ... + + _print_BooleanTrue = ... + _print_BooleanFalse = ... + _print_Max = ... + _print_gamma = ... + _print_RandomSymbol = ... + _print_frozenset = ... + _print_SeqPer = ... + _print_SeqAdd = ... + _print_SeqMul = ... + _print_IDFT = ... + def emptyPrinter(self, expr) -> str: + ... + + + +def translate(s: str) -> str: + ... + +@print_function(LatexPrinter) +def latex(expr, **settings) -> str: + ... + +def print_latex(expr, **settings) -> None: + ... + +def multiline_latex(lhs, rhs, terms_per_line=..., environment=..., use_dots=..., **settings) -> str: + ... + diff --git a/stubs/sympy-stubs/printing/maple.pyi b/stubs/sympy-stubs/printing/maple.pyi new file mode 100644 index 00000000..623dbb13 --- /dev/null +++ b/stubs/sympy-stubs/printing/maple.pyi @@ -0,0 +1,23 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +_known_func_same_name = ... +known_functions = ... +number_symbols = ... +spec_relational_ops = ... +not_supported_symbol = ... +class MapleCodePrinter(CodePrinter): + printmethod = ... + language = ... + _default_settings = ... + def __init__(self, settings=...) -> None: + ... + + + +def maple_code(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_maple_code(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/mathematica.pyi b/stubs/sympy-stubs/printing/mathematica.pyi new file mode 100644 index 00000000..0782745f --- /dev/null +++ b/stubs/sympy-stubs/printing/mathematica.pyi @@ -0,0 +1,22 @@ +from typing import Any +from sympy.core import Basic, Expr, Float +from sympy.printing.codeprinter import CodePrinter + +known_functions = ... +class MCodePrinter(CodePrinter): + printmethod = ... + language = ... + _default_settings: dict[str, Any] = ... + _number_symbols: set[tuple[Expr, Float]] = ... + _not_supported: set[Basic] = ... + def __init__(self, settings=...) -> None: + ... + + _print_tuple = ... + _print_Tuple = ... + _print_MinMaxBase = ... + + +def mathematica_code(expr, **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + diff --git a/stubs/sympy-stubs/printing/mathml.pyi b/stubs/sympy-stubs/printing/mathml.pyi new file mode 100644 index 00000000..d13900c6 --- /dev/null +++ b/stubs/sympy-stubs/printing/mathml.pyi @@ -0,0 +1,60 @@ +from typing import Any, Text +from sympy.codegen.ast import Element +from sympy.printing.printer import Printer, print_function + +class MathMLPrinterBase(Printer): + _default_settings: dict[str, Any] = ... + def __init__(self, settings=...) -> None: + class RawText(Text): + ... + + + + def doprint(self, expr): + ... + + def apply_patch(self) -> None: + ... + + def restore_patch(self) -> None: + ... + + + +class MathMLContentPrinter(MathMLPrinterBase): + printmethod = ... + def mathml_tag(self, e) -> str: + ... + + _print_MatrixSymbol = ... + _print_RandomSymbol = ... + _print_Implies = ... + _print_Not = ... + _print_Xor = ... + + +class MathMLPresentationPrinter(MathMLPrinterBase): + printmethod = ... + def mathml_tag(self, e) -> str: + ... + + def parenthesize(self, item, level, strict=...) -> Element | str: + ... + + _print_RandomSymbol = ... + _print_Determinant = ... + _print_frozenset = ... + _print_BooleanTrue = ... + _print_BooleanFalse = ... + _print_Max = ... + _print_bell = ... + + +@print_function(MathMLPrinterBase) +def mathml(expr, printer=..., **settings): + ... + +def print_mathml(expr, printer=..., **settings) -> None: + ... + +MathMLPrinter = MathMLContentPrinter diff --git a/stubs/sympy-stubs/printing/numpy.pyi b/stubs/sympy-stubs/printing/numpy.pyi new file mode 100644 index 00000000..68adf262 --- /dev/null +++ b/stubs/sympy-stubs/printing/numpy.pyi @@ -0,0 +1,61 @@ +from sympy.printing.pycode import ArrayPrinter, PythonCodePrinter + +_not_in_numpy = ... +_in_numpy = ... +_known_functions_numpy = ... +_known_constants_numpy = ... +_numpy_known_functions = ... +_numpy_known_constants = ... +class NumPyPrinter(ArrayPrinter, PythonCodePrinter): + _module = ... + _kf = ... + _kc = ... + def __init__(self, settings=...) -> None: + ... + + _add = ... + _einsum = ... + _transpose = ... + _ones = ... + _zeros = ... + _print_lowergamma = ... + _print_uppergamma = ... + _print_fresnelc = ... + _print_fresnels = ... + + +_known_functions_scipy_special = ... +_known_constants_scipy_constants = ... +_scipy_known_functions = ... +_scipy_known_constants = ... +class SciPyPrinter(NumPyPrinter): + _kf = ... + _kc = ... + def __init__(self, settings=...) -> None: + ... + + _print_ImmutableSparseMatrix = ... + + +_cupy_known_functions = ... +_cupy_known_constants = ... +class CuPyPrinter(NumPyPrinter): + _module = ... + _kf = ... + _kc = ... + def __init__(self, settings=...) -> None: + ... + + + +_jax_known_functions = ... +_jax_known_constants = ... +class JaxPrinter(NumPyPrinter): + _module = ... + _kf = ... + _kc = ... + def __init__(self, settings=...) -> None: + ... + + + diff --git a/stubs/sympy-stubs/printing/octave.pyi b/stubs/sympy-stubs/printing/octave.pyi new file mode 100644 index 00000000..d4e4a041 --- /dev/null +++ b/stubs/sympy-stubs/printing/octave.pyi @@ -0,0 +1,29 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +known_fcns_src1 = ... +known_fcns_src2 = ... +class OctaveCodePrinter(CodePrinter): + printmethod = ... + language = ... + _operators = ... + _default_settings: dict[str, Any] = ... + def __init__(self, settings=...) -> None: + ... + + _print_tuple = ... + _print_Tuple = ... + _print_List = ... + _print_LambertW = ... + _print_Min = ... + def indent_code(self, code) -> str | list[Any]: + ... + + + +def octave_code(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_octave_code(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/precedence.pyi b/stubs/sympy-stubs/printing/precedence.pyi new file mode 100644 index 00000000..083c741d --- /dev/null +++ b/stubs/sympy-stubs/printing/precedence.pyi @@ -0,0 +1,32 @@ + +PRECEDENCE = ... +PRECEDENCE_VALUES = ... +def precedence_Mul(item) -> int: + ... + +def precedence_Rational(item) -> int: + ... + +def precedence_Integer(item) -> int: + ... + +def precedence_Float(item) -> int: + ... + +def precedence_PolyElement(item) -> int: + ... + +def precedence_FracElement(item) -> int: + ... + +def precedence_UnevaluatedExpr(item) -> float: + ... + +PRECEDENCE_FUNCTIONS = ... +def precedence(item) -> int: + ... + +PRECEDENCE_TRADITIONAL = ... +def precedence_traditional(item) -> int: + ... + diff --git a/stubs/sympy-stubs/printing/pretty/__init__.pyi b/stubs/sympy-stubs/printing/pretty/__init__.pyi new file mode 100644 index 00000000..410d44f1 --- /dev/null +++ b/stubs/sympy-stubs/printing/pretty/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.printing.pretty.pretty import pager_print, pprint, pprint_try_use_unicode, pprint_use_unicode, pretty, pretty_print + +__all__ = ['pretty', 'pretty_print', 'pprint', 'pprint_use_unicode', 'pprint_try_use_unicode', 'pager_print'] diff --git a/stubs/sympy-stubs/printing/pretty/pretty.pyi b/stubs/sympy-stubs/printing/pretty/pretty.pyi new file mode 100644 index 00000000..a4a60d64 --- /dev/null +++ b/stubs/sympy-stubs/printing/pretty/pretty.pyi @@ -0,0 +1,47 @@ +from sympy.printing.pretty.stringpict import prettyForm +from sympy.printing.printer import Printer, print_function + +pprint_use_unicode = ... +pprint_try_use_unicode = ... +class PrettyPrinter(Printer): + printmethod = ... + _default_settings = ... + def __init__(self, settings=...) -> None: + ... + + def emptyPrinter(self, expr) -> prettyForm: + ... + + def doprint(self, expr): + ... + + _print_RandomSymbol = ... + _print_Infinity = ... + _print_NegativeInfinity = ... + _print_EmptySet = ... + _print_Naturals = ... + _print_Naturals0 = ... + _print_Integers = ... + _print_Rationals = ... + _print_Complexes = ... + _print_EmptySequence = ... + _print_SeqPer = ... + _print_SeqAdd = ... + _print_SeqMul = ... + def join(self, delimiter, args) -> prettyForm: + ... + + _print_bell = ... + + +@print_function(PrettyPrinter) +def pretty(expr, **settings): + ... + +def pretty_print(expr, **kwargs) -> None: + ... + +pprint = ... +def pager_print(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/pretty/pretty_symbology.pyi b/stubs/sympy-stubs/printing/pretty/pretty_symbology.pyi new file mode 100644 index 00000000..94b4f5aa --- /dev/null +++ b/stubs/sympy-stubs/printing/pretty/pretty_symbology.pyi @@ -0,0 +1,86 @@ +from typing import Any, LiteralString + +unicode_warnings = ... +def U(name) -> str | None: + ... + +__all__ = ['greek_unicode', 'sub', 'sup', 'xsym', 'vobj', 'hobj', 'pretty_symbol', 'annotated'] +_use_unicode = ... +def pretty_use_unicode(flag=...) -> bool: + ... + +def pretty_try_use_unicode() -> None: + ... + +def xstr(*args) -> str: + ... + +g = ... +G = ... +greek_letters = ... +greek_unicode = ... +b = ... +B = ... +bold_unicode = ... +gb = ... +GB = ... +greek_bold_letters = ... +greek_bold_unicode = ... +digit_2txt = ... +symb_2txt = ... +LSUB = ... +GSUB = ... +DSUB = ... +SSUB = ... +LSUP = ... +DSUP = ... +SSUP = ... +sub = ... +sup = ... +modifier_dict = ... +HUP = ... +CUP = ... +MID = ... +EXT = ... +HLO = ... +CLO = ... +TOP = ... +BOT = ... +_xobj_unicode = ... +_xobj_ascii = ... +def xobj(symb, length): + ... + +def vobj(symb, height) -> str: + ... + +def hobj(symb, width) -> str: + ... + +root = ... +VF = ... +frac = ... +_xsym = ... +def xsym(sym): + ... + +atoms_table = ... +def pretty_atom(atom_name, default=..., printer=...) -> str | None: + ... + +def pretty_symbol(symb_name, bold_name=...) -> str: + ... + +def annotated(letter): + ... + +_remove_combining = ... +def is_combining(sym) -> bool: + ... + +def center_accent(string, accent): + ... + +def line_width(line) -> int: + ... + diff --git a/stubs/sympy-stubs/printing/pretty/stringpict.pyi b/stubs/sympy-stubs/printing/pretty/stringpict.pyi new file mode 100644 index 00000000..58a6103d --- /dev/null +++ b/stubs/sympy-stubs/printing/pretty/stringpict.pyi @@ -0,0 +1,102 @@ +from typing import Any, Literal, LiteralString, Self + +class stringPict: + LINE = ... + def __init__(self, s, baseline=...) -> None: + ... + + @staticmethod + def equalLengths(lines) -> list[str] | list[Any]: + ... + + def height(self) -> int: + ... + + def width(self) -> int: + ... + + @staticmethod + def next(*args) -> tuple[str, Any]: + ... + + def right(self, *args) -> tuple[str, Any]: + ... + + def left(self, *args) -> tuple[str, Any]: + ... + + @staticmethod + def stack(*args) -> tuple[LiteralString, Any]: + ... + + def below(self, *args) -> tuple[LiteralString, int]: + ... + + def above(self, *args) -> tuple[LiteralString, int]: + ... + + def parens(self, left=..., right=..., ifascii_nougly=...) -> tuple[str, int]: + ... + + def leftslash(self) -> tuple[str, Any]: + ... + + def root(self, n=...): + ... + + def render(self, *args, **kwargs) -> str | Any | LiteralString: + ... + + def terminal_width(self) -> Any | Literal[0]: + ... + + def __eq__(self, o) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + def __getitem__(self, index): + ... + + def __len__(self) -> int: + ... + + + +class prettyForm(stringPict): + def __init__(self, s, baseline=..., binding=..., unicode=...) -> None: + ... + + @property + def unicode(self) -> Any: + ... + + def __add__(self, *others) -> prettyForm: + ... + + def __truediv__(self, den, slashed=...) -> prettyForm: + ... + + def __mul__(self, *others) -> Self | prettyForm: + ... + + def __repr__(self) -> str: + ... + + def __pow__(self, b) -> prettyForm: + ... + + simpleFunctions = ... + @staticmethod + def apply(function, *args) -> prettyForm: + ... + + + diff --git a/stubs/sympy-stubs/printing/preview.pyi b/stubs/sympy-stubs/printing/preview.pyi new file mode 100644 index 00000000..49b4025a --- /dev/null +++ b/stubs/sympy-stubs/printing/preview.pyi @@ -0,0 +1,13 @@ +from sympy.utilities.decorator import doctest_depends_on + +__doctest_requires__ = ... +def system_default_viewer(fname, fmt) -> None: + ... + +def pyglet_viewer(fname, fmt) -> None: + ... + +@doctest_depends_on(exe=('latex', 'dvipng'), modules=('pyglet', ), disable_viewers=('evince', 'gimp', 'superior-dvi-viewer')) +def preview(expr, output=..., viewer=..., euler=..., packages=..., filename=..., outputbuffer=..., preamble=..., dvioptions=..., outputTexFile=..., extra_preamble=..., fontsize=..., **latex_settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/printer.pyi b/stubs/sympy-stubs/printing/printer.pyi new file mode 100644 index 00000000..d5212678 --- /dev/null +++ b/stubs/sympy-stubs/printing/printer.pyi @@ -0,0 +1,50 @@ +import inspect +from typing import Any, Callable, Generator, Type +from contextlib import contextmanager + +@contextmanager +def printer_context(printer, **kwargs) -> Generator[None, Any, None]: + ... + +class Printer: + _global_settings: dict[str, Any] = ... + _default_settings: dict[str, Any] = ... + printmethod: str = ... + def __init__(self, settings=...) -> None: + ... + + @classmethod + def set_global_settings(cls, **settings) -> None: + ... + + @property + def order(self) -> Any: + ... + + def doprint(self, expr) -> str: + ... + + def emptyPrinter(self, expr) -> str: + ... + + + +class _PrintFunction: + def __init__(self, f, print_cls: Type[Printer]) -> None: + ... + + def __reduce__(self): + ... + + def __call__(self, *args, **kwargs): + ... + + @property + def __signature__(self) -> inspect.Signature: + ... + + + +def print_function(print_cls) -> Callable[..., _PrintFunction]: + ... + diff --git a/stubs/sympy-stubs/printing/pycode.pyi b/stubs/sympy-stubs/printing/pycode.pyi new file mode 100644 index 00000000..776bd7a4 --- /dev/null +++ b/stubs/sympy-stubs/printing/pycode.pyi @@ -0,0 +1,52 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +_kw = ... +_known_functions = ... +_known_functions_math = ... +_known_constants_math = ... +class AbstractPythonCodePrinter(CodePrinter): + printmethod = ... + language = ... + reserved_words = ... + modules = ... + tab = ... + _kf = ... + _kc = ... + _operators = ... + _default_settings = ... + def __init__(self, settings=...) -> None: + ... + + _print_ImmutableDenseMatrix = ... + + +class ArrayPrinter: + ... + + +class PythonCodePrinter(AbstractPythonCodePrinter): + _print_lowergamma = ... + _print_uppergamma = ... + _print_fresnelc = ... + _print_fresnels = ... + + +def pycode(expr, **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +_not_in_mpmath = ... +_in_mpmath = ... +_known_functions_mpmath = ... +_known_constants_mpmath = ... +class MpmathPrinter(PythonCodePrinter): + printmethod = ... + language = ... + _kf = ... + _kc = ... + + +class SymPyPrinter(AbstractPythonCodePrinter): + language = ... + + diff --git a/stubs/sympy-stubs/printing/python.pyi b/stubs/sympy-stubs/printing/python.pyi new file mode 100644 index 00000000..f24f9cd1 --- /dev/null +++ b/stubs/sympy-stubs/printing/python.pyi @@ -0,0 +1,16 @@ +from sympy.printing.repr import ReprPrinter +from sympy.printing.str import StrPrinter + +STRPRINT = ... +class PythonPrinter(ReprPrinter, StrPrinter): + def __init__(self, settings=...) -> None: + ... + + + +def python(expr, **settings) -> str: + ... + +def print_python(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/rcode.pyi b/stubs/sympy-stubs/printing/rcode.pyi new file mode 100644 index 00000000..a3b96bba --- /dev/null +++ b/stubs/sympy-stubs/printing/rcode.pyi @@ -0,0 +1,25 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +known_functions = ... +reserved_words = ... +class RCodePrinter(CodePrinter): + printmethod = ... + language = ... + _default_settings: dict[str, Any] = ... + _operators = ... + _relationals: dict[str, str] = ... + def __init__(self, settings=...) -> None: + ... + + def indent_code(self, code) -> str | list[Any]: + ... + + + +def rcode(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_rcode(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/repr.pyi b/stubs/sympy-stubs/printing/repr.pyi new file mode 100644 index 00000000..9804c5f5 --- /dev/null +++ b/stubs/sympy-stubs/printing/repr.pyi @@ -0,0 +1,18 @@ +from typing import Any, LiteralString +from sympy.printing.printer import Printer, print_function + +class ReprPrinter(Printer): + printmethod = ... + _default_settings: dict[str, Any] = ... + def reprify(self, args, sep): + ... + + def emptyPrinter(self, expr) -> str | LiteralString: + ... + + + +@print_function(ReprPrinter) +def srepr(expr, **settings) -> str: + ... + diff --git a/stubs/sympy-stubs/printing/rust.pyi b/stubs/sympy-stubs/printing/rust.pyi new file mode 100644 index 00000000..414018ba --- /dev/null +++ b/stubs/sympy-stubs/printing/rust.pyi @@ -0,0 +1,23 @@ +from typing import Any +from sympy.printing.codeprinter import CodePrinter + +known_functions = ... +reserved_words = ... +class RustCodePrinter(CodePrinter): + printmethod = ... + language = ... + _default_settings: dict[str, Any] = ... + def __init__(self, settings=...) -> None: + ... + + def indent_code(self, code) -> str | list[Any]: + ... + + + +def rust_code(expr, assign_to=..., **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + +def print_rust_code(expr, **settings) -> None: + ... + diff --git a/stubs/sympy-stubs/printing/str.pyi b/stubs/sympy-stubs/printing/str.pyi new file mode 100644 index 00000000..7b7b2ed8 --- /dev/null +++ b/stubs/sympy-stubs/printing/str.pyi @@ -0,0 +1,32 @@ +from typing import Any +from sympy.printing.printer import Printer, print_function + +class StrPrinter(Printer): + printmethod = ... + _default_settings: dict[str, Any] = ... + _relationals: dict[str, str] = ... + def parenthesize(self, item, level, strict=...) -> str: + ... + + def stringify(self, args, sep, level=...): + ... + + def emptyPrinter(self, expr) -> str: + ... + + _print_MatrixSymbol = ... + _print_RandomSymbol = ... + + +@print_function(StrPrinter) +def sstr(expr, **settings) -> str: + ... + +class StrReprPrinter(StrPrinter): + ... + + +@print_function(StrReprPrinter) +def sstrrepr(expr, **settings) -> str: + ... + diff --git a/stubs/sympy-stubs/printing/tableform.pyi b/stubs/sympy-stubs/printing/tableform.pyi new file mode 100644 index 00000000..749405d2 --- /dev/null +++ b/stubs/sympy-stubs/printing/tableform.pyi @@ -0,0 +1,22 @@ +from sympy.matrices import Matrix +class TableForm: + def __init__(self, data, **kwarg) -> None: + ... + + def __repr__(self): + ... + + def __str__(self) -> str: + ... + + def as_matrix(self) -> Matrix: + ... + + def as_str(self) -> str: + ... + + def as_latex(self): + ... + + + diff --git a/stubs/sympy-stubs/printing/tensorflow.pyi b/stubs/sympy-stubs/printing/tensorflow.pyi new file mode 100644 index 00000000..74b2bd40 --- /dev/null +++ b/stubs/sympy-stubs/printing/tensorflow.pyi @@ -0,0 +1,32 @@ +from typing import Any +from sympy.printing.pycode import AbstractPythonCodePrinter, ArrayPrinter + +tensorflow = ... +class TensorflowPrinter(ArrayPrinter, AbstractPythonCodePrinter): + printmethod = ... + mapping = ... + _default_settings = ... + def __init__(self, settings=...) -> None: + ... + + _print_Expr = ... + _print_Application = ... + _print_MatrixExpr = ... + _print_Relational = ... + _print_Not = ... + _print_And = ... + _print_Or = ... + _print_HadamardProduct = ... + _print_Trace = ... + _print_Determinant = ... + _module = ... + _einsum = ... + _add = ... + _transpose = ... + _ones = ... + _zeros = ... + + +def tensorflow_code(expr, **settings) -> str | tuple[set[tuple[Any, str]], set[Any], str]: + ... + diff --git a/stubs/sympy-stubs/printing/tree.pyi b/stubs/sympy-stubs/printing/tree.pyi new file mode 100644 index 00000000..971b4c0d --- /dev/null +++ b/stubs/sympy-stubs/printing/tree.pyi @@ -0,0 +1,13 @@ +from typing import Literal +def pprint_nodes(subtrees) -> Literal['']: + ... + +def print_node(node, assumptions=...) -> str: + ... + +def tree(node, assumptions=...) -> str: + ... + +def print_tree(node, assumptions=...) -> None: + ... + diff --git a/stubs/sympy-stubs/py.typed b/stubs/sympy-stubs/py.typed new file mode 100644 index 00000000..5fcb8520 --- /dev/null +++ b/stubs/sympy-stubs/py.typed @@ -0,0 +1 @@ +partial \ No newline at end of file diff --git a/stubs/sympy-stubs/series/__init__.pyi b/stubs/sympy-stubs/series/__init__.pyi new file mode 100644 index 00000000..473a9de1 --- /dev/null +++ b/stubs/sympy-stubs/series/__init__.pyi @@ -0,0 +1,15 @@ +from sympy.series.order import Order +from sympy.series.limits import Limit, limit +from sympy.series.gruntz import gruntz +from sympy.series.series import series +from sympy.series.approximants import approximants +from sympy.series.residues import residue +from sympy.series.sequences import SeqAdd, SeqFormula, SeqMul, SeqPer, sequence +from sympy.series.fourier import fourier_series +from sympy.series.formal import fps +from sympy.series.limitseq import difference_delta, limit_seq +from sympy.core.singleton import S + +EmptySequence = ... +O = Order +__all__ = ['Order', 'O', 'limit', 'Limit', 'gruntz', 'series', 'approximants', 'residue', 'EmptySequence', 'SeqPer', 'SeqFormula', 'sequence', 'SeqAdd', 'SeqMul', 'fourier_series', 'fps', 'difference_delta', 'limit_seq'] diff --git a/stubs/sympy-stubs/series/approximants.pyi b/stubs/sympy-stubs/series/approximants.pyi new file mode 100644 index 00000000..e54e24de --- /dev/null +++ b/stubs/sympy-stubs/series/approximants.pyi @@ -0,0 +1,7 @@ +from typing import Any, Generator +from sympy.utilities import public + +@public +def approximants(l, X=..., simplify=...) -> Generator[Any, Any, None]: + ... + diff --git a/stubs/sympy-stubs/series/formal.pyi b/stubs/sympy-stubs/series/formal.pyi new file mode 100644 index 00000000..1404276a --- /dev/null +++ b/stubs/sympy-stubs/series/formal.pyi @@ -0,0 +1,220 @@ +from typing import Any, Generator, Self +from sympy.core.basic import Basic +from sympy.core.function import Function, UndefinedFunction +from sympy.core.numbers import Float, Integer, Rational +from sympy.core.relational import Equality, Ne, Relational +from sympy.functions.elementary.piecewise import Piecewise +from sympy.series.order import Order +from sympy.series.sequences import SeqFormula, SeqPer +from sympy.series.series_class import SeriesBase +from sympy.sets.sets import FiniteSet, Interval + +def rational_algorithm(f, x, k, order=..., full=...) -> tuple[Any, Any, int] | None: + ... + +def rational_independent(terms, x) -> list[Any]: + ... + +def simpleDE(f, x, g, order=...) -> Generator[tuple[Any, int], Any, None]: + ... + +def exp_re(DE, r, k): + ... + +def hyper_re(DE, r, k): + ... + +def rsolve_hypergeometric(f, x, P, Q, k, m) -> tuple[Any | Piecewise, Any, Any | type[UndefinedFunction] | Rational | Integer | Float | Order] | None: + ... + +def solve_de(f, x, DE, order, g, k) -> tuple[Any | Piecewise, Any, Any | type[UndefinedFunction] | Rational | Integer | Float | Order] | tuple[Any, Any, Any] | None: + ... + +def hyper_algorithm(f, x, k, order=...) -> tuple[Any | Piecewise, Any, Any | type[UndefinedFunction] | Rational | Integer | Float | Order] | tuple[Any, Any, Any] | None: + ... + +def compute_fps(f, x, x0=..., dir=..., hyper=..., order=..., rational=..., full=...) -> tuple[Any, Any, Any] | tuple[Any | SeqPer | SeqFormula, Any | SeqPer | SeqFormula, Any] | tuple[Any | SeqPer | SeqFormula, Any | None, Any] | None: + ... + +class Coeff(Function): + @classmethod + def eval(cls, p, x, n) -> None: + ... + + + +class FormalPowerSeries(SeriesBase): + def __new__(cls, *args) -> Self: + ... + + def __init__(self, *args) -> None: + ... + + @property + def function(self) -> Basic: + ... + + @property + def x(self) -> Basic: + ... + + @property + def x0(self) -> Basic: + ... + + @property + def dir(self) -> Basic: + ... + + @property + def ak(self): + ... + + @property + def xk(self): + ... + + @property + def ind(self): + ... + + @property + def interval(self) -> FiniteSet | Interval: + ... + + @property + def start(self): + ... + + @property + def stop(self): + ... + + @property + def length(self): + ... + + @property + def infinite(self): + ... + + def polynomial(self, n=...) -> Order: + ... + + def truncate(self, n=...) -> Generator[Any, Any, None]: + ... + + def zero_coeff(self): + ... + + def integrate(self, x=..., **kwargs) -> Equality | Relational | Ne | Self: + ... + + def product(self, other, x=..., n=...) -> Generator[Any, Any, None] | FormalPowerSeriesProduct: + ... + + def coeff_bell(self, n) -> SeqPer | SeqFormula: + ... + + def compose(self, other, x=..., n=...) -> Generator[Any, Any, None] | FormalPowerSeriesCompose: + ... + + def inverse(self, x=..., n=...) -> Generator[Any, Any, None] | FormalPowerSeriesInverse: + ... + + def __add__(self, other) -> Self | Order: + ... + + def __radd__(self, other) -> Self | Order: + ... + + def __neg__(self) -> Self: + ... + + def __sub__(self, other) -> Self | Order: + ... + + def __rsub__(self, other) -> FormalPowerSeries | Order: + ... + + def __mul__(self, other) -> Order | Self: + ... + + def __rmul__(self, other) -> Order | Self: + ... + + + +class FiniteFormalPowerSeries(FormalPowerSeries): + def __init__(self, *args) -> None: + ... + + @property + def ffps(self) -> Basic: + ... + + @property + def gfps(self) -> Basic: + ... + + @property + def f(self): + ... + + @property + def g(self): + ... + + @property + def infinite(self): + ... + + def polynomial(self, n): + ... + + def truncate(self, n=...): + ... + + def integrate(self, x): + ... + + + +class FormalPowerSeriesProduct(FiniteFormalPowerSeries): + def __init__(self, *args) -> None: + ... + + @property + def function(self): + ... + + + +class FormalPowerSeriesCompose(FiniteFormalPowerSeries): + @property + def function(self): + ... + + + +class FormalPowerSeriesInverse(FiniteFormalPowerSeries): + def __init__(self, *args) -> None: + ... + + @property + def function(self): + ... + + @property + def g(self): + ... + + @property + def gfps(self): + ... + + + +def fps(f, x=..., x0=..., dir=..., hyper=..., order=..., rational=..., full=...) -> FormalPowerSeries: + ... + diff --git a/stubs/sympy-stubs/series/fourier.pyi b/stubs/sympy-stubs/series/fourier.pyi new file mode 100644 index 00000000..68f7c468 --- /dev/null +++ b/stubs/sympy-stubs/series/fourier.pyi @@ -0,0 +1,122 @@ +from typing import Any, Generator, Literal, Self +from sympy.core.basic import Basic +from sympy.series.order import Order +from sympy.series.sequences import SeqFormula +from sympy.series.series_class import SeriesBase +from sympy.sets.sets import FiniteSet, Interval + +def fourier_cos_seq(func, limits, n) -> tuple[Any, Any | SeqFormula]: + ... + +def fourier_sin_seq(func, limits, n) -> SeqFormula: + ... + +def finite_check(f, x, L) -> tuple[Literal[False], Any] | tuple[Literal[True], Any]: + ... + +class FourierSeries(SeriesBase): + def __new__(cls, *args) -> Self: + ... + + @property + def function(self) -> Basic: + ... + + @property + def x(self): + ... + + @property + def period(self) -> tuple[Any, Any]: + ... + + @property + def a0(self): + ... + + @property + def an(self): + ... + + @property + def bn(self): + ... + + @property + def interval(self) -> FiniteSet | Interval: + ... + + @property + def start(self): + ... + + @property + def stop(self): + ... + + @property + def length(self): + ... + + @property + def L(self): + ... + + def truncate(self, n=...) -> Generator[Any, Any, None] | Order: + ... + + def sigma_approximation(self, n=...) -> Order: + ... + + def shift(self, s) -> Self: + ... + + def shiftx(self, s) -> Self: + ... + + def scale(self, s) -> Self: + ... + + def scalex(self, s) -> Self: + ... + + def __neg__(self) -> Self: + ... + + def __add__(self, other) -> Self | Order: + ... + + def __sub__(self, other) -> Self | Order: + ... + + + +class FiniteFourierSeries(FourierSeries): + def __new__(cls, f, limits, exprs) -> Self: + ... + + @property + def interval(self) -> FiniteSet | Interval: + ... + + @property + def length(self): + ... + + def shiftx(self, s) -> Self: + ... + + def scale(self, s) -> Self: + ... + + def scalex(self, s) -> Self: + ... + + def __add__(self, other) -> FourierSeries | Order | FiniteFourierSeries | None: + ... + + + +def fourier_series(f, limits=..., finite=...) -> FiniteFourierSeries | FourierSeries: + ... + diff --git a/stubs/sympy-stubs/series/gruntz.pyi b/stubs/sympy-stubs/series/gruntz.pyi new file mode 100644 index 00000000..71954b7c --- /dev/null +++ b/stubs/sympy-stubs/series/gruntz.pyi @@ -0,0 +1,87 @@ +from typing import Any, Literal +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.function import UndefinedFunction +from sympy.utilities.misc import debug_decorator as debug + +timeit = ... +def compare(a, b, x) -> Literal['<', '>', '=']: + ... + +class SubsSet(dict): + def __init__(self) -> None: + ... + + def __repr__(self) -> str: + ... + + def __getitem__(self, key): + ... + + def do_subs(self, e): + ... + + def meets(self, s2) -> bool: + ... + + def union(self, s2, exps=...) -> tuple[SubsSet, Any | None]: + ... + + def copy(self) -> SubsSet: + ... + + + +@debug +def mrv(e, x) -> tuple[SubsSet, Basic] | tuple[SubsSet, Any] | tuple[Any, Basic] | tuple[Any, Any] | tuple[SubsSet, Any | Literal[1]] | tuple[Any, type[UndefinedFunction] | Any]: + ... + +def mrv_max3(f, expsf, g, expsg, union, expsboth, x) -> tuple[SubsSet, Any] | tuple[Any, Any]: + ... + +def mrv_max1(f, g, exps, x) -> tuple[SubsSet, Any] | tuple[Any, Any]: + ... + +@debug +@cacheit +@timeit +def sign(e, x) -> type[UndefinedFunction] | Literal[1, -1, 0]: + ... + +@debug +@timeit +@cacheit +def limitinf(e, x): + ... + +def moveup2(s, x) -> SubsSet: + ... + +def moveup(l, x) -> list[Any]: + ... + +@debug +@timeit +def calculate_series(e, x, logx=...) -> bool | Basic: + ... + +@debug +@timeit +@cacheit +def mrv_leadterm(e, x) -> tuple[Any, Any] | tuple[Basic | Any | type[UndefinedFunction] | Literal[1], Any]: + ... + +def build_expression_tree(Omega, rewrites) -> dict[Any, Any]: + class Node: + ... + + + +@debug +@timeit +def rewrite(e, Omega, x, wsym) -> tuple[Any, Any]: + ... + +def gruntz(e, z, z0, dir=...): + ... + diff --git a/stubs/sympy-stubs/series/limits.pyi b/stubs/sympy-stubs/series/limits.pyi new file mode 100644 index 00000000..4794f578 --- /dev/null +++ b/stubs/sympy-stubs/series/limits.pyi @@ -0,0 +1,27 @@ +from typing import Self +from sympy.core import Expr +from sympy.core.basic import Basic +from sympy.core.function import UndefinedFunction + +def limit(e, z, z0, dir=...): + ... + +def heuristics(e, z, z0, dir): + ... + +class Limit(Expr): + def __new__(cls, e, z, z0, dir=...) -> Self: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + def pow_heuristics(self, e) -> type[UndefinedFunction] | None: + ... + + def doit(self, **hints): + ... + + + diff --git a/stubs/sympy-stubs/series/limitseq.pyi b/stubs/sympy-stubs/series/limitseq.pyi new file mode 100644 index 00000000..159ab84c --- /dev/null +++ b/stubs/sympy-stubs/series/limitseq.pyi @@ -0,0 +1,13 @@ +from sympy.calculus.accumulationbounds import AccumulationBounds +from sympy.core.basic import Basic +from sympy.series.order import Order + +def difference_delta(expr, n=..., step=...): + ... + +def dominant(expr, n) -> Basic | None: + ... + +def limit_seq(expr, n=..., trials=...) -> AccumulationBounds | Order | None: + ... + diff --git a/stubs/sympy-stubs/series/order.pyi b/stubs/sympy-stubs/series/order.pyi new file mode 100644 index 00000000..58ede4b4 --- /dev/null +++ b/stubs/sympy-stubs/series/order.pyi @@ -0,0 +1,50 @@ +from typing import Any, Self +from sympy.core import Expr +from sympy.core.basic import Basic +from sympy.core.cache import cacheit + +class Order(Expr): + is_Order = ... + __slots__ = ... + @cacheit + def __new__(cls, expr, *args, **kwargs): + ... + + @property + def expr(self) -> Basic: + ... + + @property + def variables(self) -> tuple[Any, ...] | tuple[()]: + ... + + @property + def point(self) -> tuple[Any, ...] | tuple[()]: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + def as_expr_variables(self, order_symbols) -> tuple[Basic, tuple[tuple[Any, Any] | Basic, ...]]: + ... + + def removeO(self): + ... + + def getO(self) -> Self: + ... + + @cacheit + def contains(self, expr): + ... + + def __contains__(self, other): + ... + + def __neg__(self) -> Self: + ... + + + +O = Order diff --git a/stubs/sympy-stubs/series/sequences.pyi b/stubs/sympy-stubs/series/sequences.pyi new file mode 100644 index 00000000..be3bd046 --- /dev/null +++ b/stubs/sympy-stubs/series/sequences.pyi @@ -0,0 +1,250 @@ +from typing import Any, Generator, Iterator, NoReturn, Self +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.decorators import call_highest_priority +from sympy.core.relational import Eq, Ne, Relational +from sympy.core.singleton import Singleton +from sympy.series.order import Order +from sympy.sets.sets import Complement, FiniteSet, Intersection, Interval, Union + +class SeqBase(Basic): + is_commutative = ... + _op_priority = ... + @property + def gen(self): + ... + + @property + def interval(self): + ... + + @property + def start(self): + ... + + @property + def stop(self): + ... + + @property + def length(self): + ... + + @property + def variables(self) -> tuple[()]: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + @cacheit + def coeff(self, pt): + ... + + def coeff_mul(self, other) -> Order: + ... + + def __add__(self, other) -> SeqAdd: + ... + + @call_highest_priority('__add__') + def __radd__(self, other): + ... + + def __sub__(self, other) -> SeqAdd: + ... + + @call_highest_priority('__sub__') + def __rsub__(self, other): + ... + + def __neg__(self) -> Order: + ... + + def __mul__(self, other) -> SeqMul: + ... + + @call_highest_priority('__mul__') + def __rmul__(self, other): + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def __getitem__(self, index) -> list[Any] | None: + ... + + def find_linear_recurrence(self, n, d=..., gfvar=...) -> list[Any] | tuple[list[Any], None] | tuple[Any | list[Any], Any]: + ... + + + +class EmptySequence(SeqBase, metaclass=Singleton): + @property + def interval(self): + ... + + @property + def length(self): + ... + + def coeff_mul(self, coeff) -> Self: + ... + + def __iter__(self) -> Iterator[Any]: + ... + + + +class SeqExpr(SeqBase): + @property + def gen(self) -> Basic: + ... + + @property + def interval(self) -> FiniteSet | Interval: + ... + + @property + def start(self): + ... + + @property + def stop(self): + ... + + @property + def length(self): + ... + + @property + def variables(self) -> tuple[Any]: + ... + + + +class SeqPer(SeqExpr): + def __new__(cls, periodical, limits=...) -> Self: + ... + + @property + def period(self) -> int: + ... + + @property + def periodical(self) -> Basic: + ... + + def coeff_mul(self, coeff) -> SeqPer: + ... + + + +class SeqFormula(SeqExpr): + def __new__(cls, formula, limits=...) -> Self: + ... + + @property + def formula(self) -> Basic: + ... + + def coeff_mul(self, coeff) -> SeqFormula: + ... + + def expand(self, *args, **kwargs) -> SeqFormula: + ... + + + +class RecursiveSeq(SeqBase): + def __new__(cls, recurrence, yn, n, initial=..., start=...) -> Self: + ... + + @property + def recurrence(self) -> Eq | Relational | Ne: + ... + + @property + def yn(self) -> Basic: + ... + + @property + def y(self) -> type[Basic]: + ... + + @property + def n(self) -> Basic: + ... + + @property + def initial(self) -> Basic: + ... + + @property + def start(self) -> Basic: + ... + + @property + def stop(self): + ... + + @property + def interval(self) -> tuple[Basic, Any]: + ... + + def __iter__(self) -> Generator[Any, Any, NoReturn]: + ... + + + +def sequence(seq, limits=...) -> SeqPer | SeqFormula: + ... + +class SeqExprOp(SeqBase): + @property + def gen(self) -> tuple[Any, ...]: + ... + + @property + def interval(self) -> FiniteSet | Intersection | Union | Complement: + ... + + @property + def start(self): + ... + + @property + def stop(self): + ... + + @property + def variables(self) -> tuple[Any, ...]: + ... + + @property + def length(self): + ... + + + +class SeqAdd(SeqExprOp): + def __new__(cls, *args, **kwargs) -> SeqAdd | Self: + ... + + @staticmethod + def reduce(args) -> SeqAdd: + ... + + + +class SeqMul(SeqExprOp): + def __new__(cls, *args, **kwargs) -> SeqMul | Self: + ... + + @staticmethod + def reduce(args) -> SeqMul: + ... + + + diff --git a/stubs/sympy-stubs/series/series_class.pyi b/stubs/sympy-stubs/series/series_class.pyi new file mode 100644 index 00000000..6b59f220 --- /dev/null +++ b/stubs/sympy-stubs/series/series_class.pyi @@ -0,0 +1,42 @@ +from typing import Any, Generator +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.cache import cacheit + +class SeriesBase(Expr): + @property + def interval(self): + ... + + @property + def start(self): + ... + + @property + def stop(self): + ... + + @property + def length(self): + ... + + @property + def variables(self) -> tuple[()]: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + @cacheit + def term(self, pt): + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def __getitem__(self, index) -> list[Any] | None: + ... + + + diff --git a/stubs/sympy-stubs/sets/__init__.pyi b/stubs/sympy-stubs/sets/__init__.pyi new file mode 100644 index 00000000..5236d24f --- /dev/null +++ b/stubs/sympy-stubs/sets/__init__.pyi @@ -0,0 +1,18 @@ +from sympy.sets.sets import Complement, DisjointUnion, FiniteSet, Intersection, Interval, ProductSet, Set, SymmetricDifference, Union, imageset +from sympy.sets.fancysets import ComplexRegion, ImageSet, Range +from sympy.sets.contains import Contains +from sympy.sets.conditionset import ConditionSet +from sympy.sets.ordinals import OmegaPower, Ordinal, ord0 +from sympy.sets.powerset import PowerSet +from sympy.core.singleton import S +from sympy.sets.handlers.comparison import _eval_is_eq + +Complexes = ... +EmptySet = ... +Integers = ... +Naturals = ... +Naturals0 = ... +Rationals = ... +Reals = ... +UniversalSet = ... +__all__ = ['Set', 'Interval', 'Union', 'EmptySet', 'FiniteSet', 'ProductSet', 'Intersection', 'imageset', 'Complement', 'SymmetricDifference', 'DisjointUnion', 'ImageSet', 'Range', 'ComplexRegion', 'Reals', 'Contains', 'ConditionSet', 'Ordinal', 'OmegaPower', 'ord0', 'PowerSet', 'Reals', 'Naturals', 'Naturals0', 'UniversalSet', 'Integers', 'Rationals'] diff --git a/stubs/sympy-stubs/sets/conditionset.pyi b/stubs/sympy-stubs/sets/conditionset.pyi new file mode 100644 index 00000000..dc85f539 --- /dev/null +++ b/stubs/sympy-stubs/sets/conditionset.pyi @@ -0,0 +1,25 @@ +from typing import Any, Self +from sympy.core.logic import And +from sympy.sets.sets import Complement, FiniteSet, Intersection, Set, Union + +adummy = ... +class ConditionSet(Set): + def __new__(cls, sym, condition, base_set=...) -> Set | FiniteSet | Intersection | Union | Complement | Self: + ... + + sym = ... + condition = ... + base_set = ... + @property + def free_symbols(self) -> Any: + ... + + @property + def bound_symbols(self) -> list[Any]: + ... + + def as_relational(self, other) -> And: + ... + + + diff --git a/stubs/sympy-stubs/sets/contains.pyi b/stubs/sympy-stubs/sets/contains.pyi new file mode 100644 index 00000000..f18d9d00 --- /dev/null +++ b/stubs/sympy-stubs/sets/contains.pyi @@ -0,0 +1,19 @@ +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.logic.boolalg import BooleanFunction +from sympy.sets.sets import Set + +class Contains(BooleanFunction): + @classmethod + def eval(cls, x, s) -> Set | None: + ... + + @property + def binary_symbols(self) -> set[Any | Basic]: + ... + + def as_set(self) -> Basic: + ... + + + diff --git a/stubs/sympy-stubs/sets/fancysets.pyi b/stubs/sympy-stubs/sets/fancysets.pyi new file mode 100644 index 00000000..00d52500 --- /dev/null +++ b/stubs/sympy-stubs/sets/fancysets.pyi @@ -0,0 +1,209 @@ +from typing import Any, Generator, Literal, NoReturn, Self +from sympy.core.basic import Basic +from sympy.core.logic import And +from sympy.core.numbers import Integer, Rational +from sympy.core.singleton import Singleton +from sympy.sets.sets import FiniteSet, Interval, ProductSet, Set, Union + +class Rationals(Set, metaclass=Singleton): + is_iterable = ... + _inf = ... + _sup = ... + is_empty = ... + is_finite_set = ... + def __iter__(self) -> Generator[Any | Rational | Integer, Any, NoReturn]: + ... + + + +class Naturals(Set, metaclass=Singleton): + is_iterable = ... + _inf = ... + _sup = ... + is_empty = ... + is_finite_set = ... + def __iter__(self) -> Generator[Any, Any, NoReturn]: + ... + + def as_relational(self, x) -> And: + ... + + + +class Naturals0(Naturals): + _inf = ... + + +class Integers(Set, metaclass=Singleton): + is_iterable = ... + is_empty = ... + is_finite_set = ... + def __iter__(self) -> Generator[Any, Any, NoReturn]: + ... + + def as_relational(self, x) -> And: + ... + + + +class Reals(Interval, metaclass=Singleton): + @property + def start(self): + ... + + @property + def end(self): + ... + + @property + def left_open(self) -> Literal[True]: + ... + + @property + def right_open(self) -> Literal[True]: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + + +class ImageSet(Set): + def __new__(cls, flambda, *sets) -> FiniteSet | Self: + ... + + lamda = ... + base_sets = ... + @property + def base_set(self) -> Any | FiniteSet | ProductSet: + ... + + @property + def base_pset(self) -> FiniteSet | ProductSet: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + @property + def is_iterable(self) -> bool: + ... + + def doit(self, **hints) -> Any | FiniteSet | Self: + ... + + + +class Range(Set): + def __new__(cls, *args): + ... + + start = ... + stop = ... + step = ... + @property + def reversed(self) -> Self: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + @property + def is_iterable(self) -> bool: + ... + + def __len__(self) -> int: + ... + + @property + def size(self): + ... + + @property + def is_finite_set(self) -> Literal[True]: + ... + + @property + def is_empty(self) -> None: + ... + + def __bool__(self) -> bool: + ... + + def __getitem__(self, i): + ... + + def as_relational(self, x) -> And: + ... + + + +def normalize_theta_set(theta) -> FiniteSet | Union | Interval: + ... + +class ComplexRegion(Set): + is_ComplexRegion = ... + def __new__(cls, sets, polar=...) -> FiniteSet | CartesianComplexRegion | PolarComplexRegion: + ... + + @property + def sets(self) -> Basic: + ... + + @property + def psets(self) -> tuple[Basic] | tuple[Basic, ...]: + ... + + @property + def a_interval(self) -> FiniteSet | Union: + ... + + @property + def b_interval(self) -> FiniteSet | Union: + ... + + @classmethod + def from_real(cls, sets) -> FiniteSet | CartesianComplexRegion: + ... + + + +class CartesianComplexRegion(ComplexRegion): + polar = ... + variables = ... + def __new__(cls, sets) -> FiniteSet | Self: + ... + + @property + def expr(self): + ... + + + +class PolarComplexRegion(ComplexRegion): + polar = ... + variables = ... + def __new__(cls, sets) -> Self: + ... + + @property + def expr(self): + ... + + + +class Complexes(CartesianComplexRegion, metaclass=Singleton): + is_empty = ... + is_finite_set = ... + @property + def sets(self) -> FiniteSet | ProductSet: + ... + + def __new__(cls) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/sets/handlers/add.pyi b/stubs/sympy-stubs/sets/handlers/add.pyi new file mode 100644 index 00000000..de721791 --- /dev/null +++ b/stubs/sympy-stubs/sets/handlers/add.pyi @@ -0,0 +1,47 @@ +from sympy.core.numbers import Infinity, NegativeInfinity +from sympy.core import Basic, Expr +from sympy.sets import Interval +from sympy.sets.sets import FiniteSet + +_set_add = ... +_set_sub = ... +@_set_add.register(Basic, Basic) +def _(x, y) -> None: + ... + +@_set_add.register(Expr, Expr) +def _(x, y): + ... + +@_set_add.register(Interval, Interval) +def _(x, y) -> FiniteSet | Interval: + ... + +@_set_add.register(Interval, Infinity) +def _(x, y) -> FiniteSet | Interval: + ... + +@_set_add.register(Interval, NegativeInfinity) +def _(x, y) -> FiniteSet | Interval: + ... + +@_set_sub.register(Basic, Basic) +def _(x, y) -> None: + ... + +@_set_sub.register(Expr, Expr) +def _(x, y): + ... + +@_set_sub.register(Interval, Interval) +def _(x, y) -> FiniteSet | Interval: + ... + +@_set_sub.register(Interval, Infinity) +def _(x, y) -> FiniteSet | Interval: + ... + +@_set_sub.register(Interval, NegativeInfinity) +def _(x, y) -> FiniteSet | Interval: + ... + diff --git a/stubs/sympy-stubs/sets/handlers/functions.pyi b/stubs/sympy-stubs/sets/handlers/functions.pyi new file mode 100644 index 00000000..cef4e28e --- /dev/null +++ b/stubs/sympy-stubs/sets/handlers/functions.pyi @@ -0,0 +1,56 @@ +from sympy.core.basic import Basic +from sympy.sets.sets import Complement, EmptySet, Set +from sympy.core.function import FunctionClass, Lambda +from sympy.sets import FiniteSet, Intersection, Interval, Range, Union +from sympy.sets.fancysets import ImageSet, Integers, Naturals, Reals + +FunctionUnion = ... +_set_function = ... +@_set_function.register(FunctionClass, Set) +def _(f, x) -> None: + ... + +@_set_function.register(FunctionUnion, FiniteSet) +def _(f, x) -> FiniteSet: + ... + +@_set_function.register(Lambda, Interval) +def _(f, x): + ... + +@_set_function.register(FunctionClass, Interval) +def _(f, x) -> FiniteSet | Interval | ImageSet: + ... + +@_set_function.register(FunctionUnion, Union) +def _(f, x) -> FiniteSet | Union: + ... + +@_set_function.register(FunctionUnion, Intersection) +def _(f, x) -> FiniteSet | Intersection | Union | Complement | ImageSet: + ... + +@_set_function.register(FunctionUnion, EmptySet) +def _(f, x): + ... + +@_set_function.register(FunctionUnion, Set) +def _(f, x) -> FiniteSet | ImageSet: + ... + +@_set_function.register(FunctionUnion, Range) +def _(f, self) -> FiniteSet | Basic | ImageSet | None: + ... + +@_set_function.register(FunctionUnion, Integers) +def _(f, self) -> FiniteSet | ImageSet | None: + ... + +@_set_function.register(FunctionUnion, Naturals) +def _(f, self) -> Range | None: + ... + +@_set_function.register(FunctionUnion, Reals) +def _(f, self) -> None: + ... + diff --git a/stubs/sympy-stubs/sets/handlers/intersection.pyi b/stubs/sympy-stubs/sets/handlers/intersection.pyi new file mode 100644 index 00000000..f093ee9a --- /dev/null +++ b/stubs/sympy-stubs/sets/handlers/intersection.pyi @@ -0,0 +1,105 @@ +from sympy.sets.fancysets import CartesianComplexRegion, ComplexRegion, ImageSet, Integers, Naturals, PolarComplexRegion, Range, Rationals, Reals +from sympy.sets.sets import Complement, EmptySet, FiniteSet, Intersection, Interval, ProductSet, Set, Union, UniversalSet +from sympy.sets.conditionset import ConditionSet + +intersection_sets = ... +@intersection_sets.register(ConditionSet, ConditionSet) +def _(a, b) -> None: + ... + +@intersection_sets.register(ConditionSet, Set) +def _(a, b) -> Set | FiniteSet | Intersection | Union | Complement | ConditionSet: + ... + +@intersection_sets.register(Naturals, Integers) +def _(a, b): + ... + +@intersection_sets.register(Naturals, Naturals) +def _(a, b): + ... + +@intersection_sets.register(Interval, Naturals) +def _(a, b): + ... + +@intersection_sets.register(ComplexRegion, Set) +def _(self, other) -> FiniteSet | CartesianComplexRegion | PolarComplexRegion | ComplexRegion | Intersection | Union | Complement | None: + ... + +@intersection_sets.register(Integers, Reals) +def _(a, b): + ... + +@intersection_sets.register(Range, Interval) +def _(a, b) -> None: + ... + +@intersection_sets.register(Range, Naturals) +def _(a, b): + ... + +@intersection_sets.register(Range, Range) +def _(a, b) -> Range | None: + ... + +@intersection_sets.register(Range, Integers) +def _(a, b): + ... + +@intersection_sets.register(Range, Rationals) +def _(a, b): + ... + +@intersection_sets.register(ImageSet, Set) +def _(self, other): + ... + +@intersection_sets.register(ProductSet, ProductSet) +def _(a, b) -> FiniteSet | ProductSet: + ... + +@intersection_sets.register(Interval, Interval) +def _(a, b) -> FiniteSet | Interval | None: + ... + +@intersection_sets.register(EmptySet, Set) +def _(a, b): + ... + +@intersection_sets.register(UniversalSet, Set) +def _(a, b): + ... + +@intersection_sets.register(FiniteSet, FiniteSet) +def _(a, b) -> FiniteSet: + ... + +@intersection_sets.register(FiniteSet, Set) +def _(a, b) -> FiniteSet | None: + ... + +@intersection_sets.register(Set, Set) +def _(a, b) -> None: + ... + +@intersection_sets.register(Integers, Rationals) +def _(a, b): + ... + +@intersection_sets.register(Naturals, Rationals) +def _(a, b): + ... + +@intersection_sets.register(Rationals, Reals) +def _(a, b): + ... + +@intersection_sets.register(Integers, Interval) +def _(a, b) -> None: + ... + +@intersection_sets.register(Naturals, Interval) +def _(a, b) -> None: + ... + diff --git a/stubs/sympy-stubs/sets/handlers/issubset.pyi b/stubs/sympy-stubs/sets/handlers/issubset.pyi new file mode 100644 index 00000000..754f6ff1 --- /dev/null +++ b/stubs/sympy-stubs/sets/handlers/issubset.pyi @@ -0,0 +1,70 @@ +from typing import Literal +from sympy.sets.sets import FiniteSet, Interval, ProductSet, Set, Union +from sympy.sets.fancysets import Complexes, Range, Rationals, Reals + +_inf_sets = ... +is_subset_sets = ... +@is_subset_sets.register(Set, Set) +def _(a, b) -> None: + ... + +@is_subset_sets.register(Interval, Interval) +def _(a, b) -> Literal[False] | None: + ... + +@is_subset_sets.register(Interval, FiniteSet) +def _(a_interval, b_fs) -> Literal[False] | None: + ... + +@is_subset_sets.register(Interval, Union) +def _(a_interval, b_u) -> Literal[False] | None: + ... + +@is_subset_sets.register(Range, Range) +def _(a, b) -> bool | None: + ... + +@is_subset_sets.register(Range, Interval) +def _(a_range, b_interval) -> bool | None: + ... + +@is_subset_sets.register(Range, FiniteSet) +def _(a_range, b_finiteset) -> bool | None: + ... + +@is_subset_sets.register(Interval, Range) +def _(a_interval, b_range) -> Literal[False] | None: + ... + +@is_subset_sets.register(Interval, Rationals) +def _(a_interval, b_rationals) -> Literal[False] | None: + ... + +@is_subset_sets.register(Range, Complexes) +def _(a, b) -> Literal[True]: + ... + +@is_subset_sets.register(Complexes, Interval) +def _(a, b) -> Literal[False]: + ... + +@is_subset_sets.register(Complexes, Range) +def _(a, b) -> Literal[False]: + ... + +@is_subset_sets.register(Complexes, Rationals) +def _(a, b) -> Literal[False]: + ... + +@is_subset_sets.register(Rationals, Reals) +def _(a, b) -> Literal[True]: + ... + +@is_subset_sets.register(Rationals, Range) +def _(a, b) -> Literal[False]: + ... + +@is_subset_sets.register(ProductSet, FiniteSet) +def _(a_ps, b_fs) -> bool | None: + ... + diff --git a/stubs/sympy-stubs/sets/handlers/mul.pyi b/stubs/sympy-stubs/sets/handlers/mul.pyi new file mode 100644 index 00000000..037b5221 --- /dev/null +++ b/stubs/sympy-stubs/sets/handlers/mul.pyi @@ -0,0 +1,39 @@ +from typing import Any +from sympy.core import Basic, Expr +from sympy.sets.fancysets import ImageSet +from sympy.sets.sets import FiniteSet, Interval, Set, Union + +_set_mul = ... +_set_div = ... +@_set_mul.register(Basic, Basic) +def _(x, y) -> None: + ... + +@_set_mul.register(Set, Set) +def _(x, y) -> None: + ... + +@_set_mul.register(Expr, Expr) +def _(x, y): + ... + +@_set_mul.register(Interval, Interval) +def _(x, y) -> FiniteSet | Interval: + ... + +@_set_div.register(Basic, Basic) +def _(x, y) -> None: + ... + +@_set_div.register(Expr, Expr) +def _(x, y): + ... + +@_set_div.register(Set, Set) +def _(x, y) -> None: + ... + +@_set_div.register(Interval, Interval) +def _(x, y) -> FiniteSet | Interval | Any | ImageSet | Union: + ... + diff --git a/stubs/sympy-stubs/sets/handlers/power.pyi b/stubs/sympy-stubs/sets/handlers/power.pyi new file mode 100644 index 00000000..dd13b22b --- /dev/null +++ b/stubs/sympy-stubs/sets/handlers/power.pyi @@ -0,0 +1,34 @@ +from sympy.core import Basic, Expr +from sympy.core.numbers import Infinity, Integer, NegativeInfinity, Zero +from sympy.sets.fancysets import ImageSet +from sympy.sets.sets import FiniteSet, Interval, Set, Union + +_set_pow = ... +@_set_pow.register(Basic, Basic) +def _(x, y) -> None: + ... + +@_set_pow.register(Set, Set) +def _(x, y) -> FiniteSet | ImageSet: + ... + +@_set_pow.register(Expr, Expr) +def _(x, y): + ... + +@_set_pow.register(Interval, Zero) +def _(x, z) -> FiniteSet: + ... + +@_set_pow.register(Interval, Integer) +def _(x, exponent) -> FiniteSet | Interval | Union | None: + ... + +@_set_pow.register(Interval, Infinity) +def _(b, e) -> FiniteSet | Interval: + ... + +@_set_pow.register(Interval, NegativeInfinity) +def _(b, e): + ... + diff --git a/stubs/sympy-stubs/sets/handlers/union.pyi b/stubs/sympy-stubs/sets/handlers/union.pyi new file mode 100644 index 00000000..607c68ce --- /dev/null +++ b/stubs/sympy-stubs/sets/handlers/union.pyi @@ -0,0 +1,77 @@ +from typing import Any +from sympy.sets.sets import EmptySet, FiniteSet, Interval, ProductSet, Set, UniversalSet +from sympy.sets.fancysets import CartesianComplexRegion, ComplexRegion, Integers, Naturals, Naturals0, PolarComplexRegion, Rationals, Reals + +union_sets = ... +@union_sets.register(Naturals0, Naturals) +def _(a, b): + ... + +@union_sets.register(Rationals, Naturals) +def _(a, b): + ... + +@union_sets.register(Rationals, Naturals0) +def _(a, b): + ... + +@union_sets.register(Reals, Naturals) +def _(a, b): + ... + +@union_sets.register(Reals, Naturals0) +def _(a, b): + ... + +@union_sets.register(Reals, Rationals) +def _(a, b): + ... + +@union_sets.register(Integers, Set) +def _(a, b) -> None: + ... + +@union_sets.register(ComplexRegion, Set) +def _(a, b) -> FiniteSet | CartesianComplexRegion | PolarComplexRegion | None: + ... + +@union_sets.register(EmptySet, Set) +def _(a, b): + ... + +@union_sets.register(UniversalSet, Set) +def _(a, b): + ... + +@union_sets.register(ProductSet, ProductSet) +def _(a, b) -> None: + ... + +@union_sets.register(ProductSet, Set) +def _(a, b) -> None: + ... + +@union_sets.register(Interval, Interval) +def _(a, b) -> FiniteSet | Interval | None: + ... + +@union_sets.register(Interval, UniversalSet) +def _(a, b): + ... + +@union_sets.register(Interval, Set) +def _(a, b) -> set[Any] | None: + ... + +@union_sets.register(FiniteSet, FiniteSet) +def _(a, b) -> FiniteSet: + ... + +@union_sets.register(FiniteSet, Set) +def _(a, b) -> set[Any] | None: + ... + +@union_sets.register(Set, Set) +def _(a, b) -> None: + ... + diff --git a/stubs/sympy-stubs/sets/ordinals.pyi b/stubs/sympy-stubs/sets/ordinals.pyi new file mode 100644 index 00000000..2d93a75a --- /dev/null +++ b/stubs/sympy-stubs/sets/ordinals.pyi @@ -0,0 +1,114 @@ +from types import NotImplementedType +from typing import Literal, Self +from sympy.core import Basic + +class OmegaPower(Basic): + def __new__(cls, a, b) -> Self: + ... + + @property + def exp(self) -> Basic: + ... + + @property + def mult(self) -> Basic: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __lt__(self, other) -> bool: + ... + + + +class Ordinal(Basic): + def __new__(cls, *terms) -> Self: + ... + + @property + def terms(self) -> tuple[Basic, ...]: + ... + + @property + def leading_term(self) -> Basic: + ... + + @property + def trailing_term(self) -> Basic: + ... + + @property + def is_successor_ordinal(self) -> Literal[False]: + ... + + @property + def is_limit_ordinal(self) -> bool: + ... + + @property + def degree(self): + ... + + @classmethod + def convert(cls, integer_value) -> OrdinalZero | Ordinal: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __lt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __ge__(self, other) -> bool: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __add__(self, other) -> NotImplementedType | Self | Ordinal: + ... + + def __radd__(self, other) -> NotImplementedType | OrdinalZero | Ordinal: + ... + + def __mul__(self, other) -> NotImplementedType | OrdinalZero | Ordinal: + ... + + def __rmul__(self, other) -> NotImplementedType | OrdinalZero | Ordinal: + ... + + def __pow__(self, other) -> NotImplementedType | Ordinal: + ... + + + +class OrdinalZero(Ordinal): + ... + + +class OrdinalOmega(Ordinal): + def __new__(cls) -> Self: + ... + + @property + def terms(self) -> tuple[OmegaPower]: + ... + + + +ord0 = ... +omega = ... diff --git a/stubs/sympy-stubs/sets/powerset.pyi b/stubs/sympy-stubs/sets/powerset.pyi new file mode 100644 index 00000000..2090fff5 --- /dev/null +++ b/stubs/sympy-stubs/sets/powerset.pyi @@ -0,0 +1,24 @@ +from typing import Any, Generator, Self +from sympy.core.basic import Basic +from sympy.sets.sets import Set, SetKind + +class PowerSet(Set): + def __new__(cls, arg, evaluate=...) -> Self: + ... + + @property + def arg(self) -> Basic: + ... + + def __len__(self) -> Any: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + @property + def kind(self) -> SetKind: + ... + + + diff --git a/stubs/sympy-stubs/sets/setexpr.pyi b/stubs/sympy-stubs/sets/setexpr.pyi new file mode 100644 index 00000000..a4cf3d05 --- /dev/null +++ b/stubs/sympy-stubs/sets/setexpr.pyi @@ -0,0 +1,62 @@ +from typing import Self +from sympy.core import Expr +from sympy.core.decorators import _sympifyit, call_highest_priority + +class SetExpr(Expr): + _op_priority = ... + def __new__(cls, setarg) -> Self: + ... + + set = ... + @_sympifyit('other', NotImplemented) + @call_highest_priority('__radd__') + def __add__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__add__') + def __radd__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rmul__') + def __mul__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__mul__') + def __rmul__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rsub__') + def __sub__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__sub__') + def __rsub__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rpow__') + def __pow__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__pow__') + def __rpow__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rtruediv__') + def __truediv__(self, other) -> SetExpr: + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__truediv__') + def __rtruediv__(self, other) -> SetExpr: + ... + + + diff --git a/stubs/sympy-stubs/sets/sets.pyi b/stubs/sympy-stubs/sets/sets.pyi new file mode 100644 index 00000000..2f137f57 --- /dev/null +++ b/stubs/sympy-stubs/sets/sets.pyi @@ -0,0 +1,510 @@ +from types import NotImplementedType +from typing import Any, Callable, Generator, Iterator, Literal, Self +from sympy.core.kind import Kind +from sympy.core.basic import Basic +from sympy.core.decorators import sympify_method_args, sympify_return +from sympy.core.evalf import EvalfMixin +from sympy.core.expr import Expr +from sympy.core.logic import And, FuzzyBool, Not, Or +from sympy.core.operations import LatticeOp +from sympy.core.singleton import Singleton +from sympy.logic.boolalg import Boolean, BooleanFalse, BooleanTrue, Xor +from sympy.sets.contains import Contains +from sympy.sets.fancysets import ImageSet +from sympy.sets.powerset import PowerSet +from sympy.utilities.decorator import deprecated + +tfn = ... +@sympify_method_args +class Set(Basic, EvalfMixin): + __slots__ = ... + is_number = ... + is_iterable = ... + is_interval = ... + is_FiniteSet = ... + is_Interval = ... + is_ProductSet = ... + is_Union = ... + is_Intersection: FuzzyBool = ... + is_UniversalSet: FuzzyBool = ... + is_Complement: FuzzyBool = ... + is_ComplexRegion = ... + is_empty: FuzzyBool = ... + is_finite_set: FuzzyBool = ... + @property + def is_EmptySet(self) -> None: + ... + + def union(self, other) -> FiniteSet | Union: + ... + + def intersect(self, other) -> FiniteSet | Intersection | Union | Complement: + ... + + def intersection(self, other) -> FiniteSet | Intersection | Union | Complement: + ... + + def is_disjoint(self, other): + ... + + def isdisjoint(self, other): + ... + + def complement(self, universe) -> Intersection | Complement: + ... + + def symmetric_difference(self, other) -> SymmetricDifference: + ... + + @property + def inf(self): + ... + + @property + def sup(self): + ... + + def contains(self, other) -> Contains: + ... + + def is_subset(self, other) -> bool | None: + ... + + def issubset(self, other) -> bool | None: + ... + + def is_proper_subset(self, other) -> bool | None: + ... + + def is_superset(self, other) -> bool | None: + ... + + def issuperset(self, other) -> bool | None: + ... + + def is_proper_superset(self, other) -> bool | None: + ... + + def powerset(self) -> PowerSet: + ... + + @property + def measure(self): + ... + + @property + def kind(self) -> SetKind: + ... + + @property + def boundary(self): + ... + + @property + def is_open(self) -> FuzzyBool: + ... + + @property + def is_closed(self): + ... + + @property + def closure(self): + ... + + @property + def interior(self): + ... + + @sympify_return([('other', 'Set')], NotImplemented) + def __add__(self, other) -> FiniteSet | Union: + ... + + @sympify_return([('other', 'Set')], NotImplemented) + def __or__(self, other) -> FiniteSet | Union: + ... + + @sympify_return([('other', 'Set')], NotImplemented) + def __and__(self, other) -> FiniteSet | Intersection | Union | Complement: + ... + + @sympify_return([('other', 'Set')], NotImplemented) + def __mul__(self, other) -> FiniteSet | ProductSet: + ... + + @sympify_return([('other', 'Set')], NotImplemented) + def __xor__(self, other) -> SymmetricDifference: + ... + + @sympify_return([('exp', Expr)], NotImplemented) + def __pow__(self, exp) -> FiniteSet | ProductSet: + ... + + @sympify_return([('other', 'Set')], NotImplemented) + def __sub__(self, other) -> Intersection | Complement: + ... + + def __contains__(self, other): + ... + + + +class ProductSet(Set): + is_ProductSet = ... + def __new__(cls, *sets, **assumptions) -> FiniteSet | Self: + ... + + @property + def sets(self) -> tuple[Basic, ...]: + ... + + def flatten(self) -> FiniteSet | ProductSet: + ... + + def as_relational(self, *symbols) -> And: + ... + + @property + def is_iterable(self) -> bool: + ... + + def __iter__(self) -> Generator[tuple[()] | tuple[Any] | tuple[Any, Any] | Any, Any, None]: + ... + + @property + def is_empty(self) -> bool | None: + ... + + @property + def is_finite_set(self) -> bool | None: + ... + + def __len__(self) -> int: + ... + + def __bool__(self) -> bool: + ... + + + +class Interval(Set): + is_Interval = ... + def __new__(cls, start, end, left_open=..., right_open=...) -> FiniteSet | Self: + ... + + @property + def start(self) -> Basic: + ... + + @property + def end(self) -> Basic: + ... + + @property + def left_open(self) -> Basic: + ... + + @property + def right_open(self) -> Basic: + ... + + @classmethod + def open(cls, a, b) -> Self: + ... + + @classmethod + def Lopen(cls, a, b) -> Self: + ... + + @classmethod + def Ropen(cls, a, b) -> Self: + ... + + @property + def left(self) -> Basic: + ... + + @property + def right(self) -> Basic: + ... + + @property + def is_empty(self) -> bool | None: + ... + + @property + def is_finite_set(self): + ... + + def as_relational(self, x) -> And: + ... + + def to_mpi(self, prec=...) -> Any: + ... + + @property + def is_left_unbounded(self) -> NotImplementedType | bool: + ... + + @property + def is_right_unbounded(self) -> NotImplementedType | bool: + ... + + + +class Union(Set, LatticeOp): + is_Union = ... + @property + def identity(self): + ... + + @property + def zero(self): + ... + + def __new__(cls, *args, **kwargs) -> FiniteSet | Union | Self: + ... + + @property + def args(self) -> tuple[Basic, ...]: + ... + + @property + def is_empty(self) -> bool | None: + ... + + @property + def is_finite_set(self) -> bool | None: + ... + + def is_subset(self, other) -> bool | None: + ... + + def as_relational(self, symbol) -> And | Or: + ... + + @property + def is_iterable(self) -> bool: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + + +class Intersection(Set, LatticeOp): + is_Intersection = ... + @property + def identity(self): + ... + + @property + def zero(self): + ... + + def __new__(cls, *args, **kwargs) -> FiniteSet | Intersection | Union | Complement | Self: + ... + + @property + def args(self) -> tuple[Basic, ...]: + ... + + @property + def is_iterable(self) -> bool: + ... + + @property + def is_finite_set(self) -> Literal[True] | None: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def as_relational(self, symbol) -> And: + ... + + + +class Complement(Set): + is_Complement = ... + def __new__(cls, a, b, evaluate=...) -> Intersection | Complement | Self: + ... + + @staticmethod + def reduce(A, B) -> Intersection | Complement: + ... + + def as_relational(self, symbol) -> And: + ... + + @property + def is_iterable(self) -> Literal[True] | None: + ... + + @property + def is_finite_set(self) -> bool | None: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + + +class EmptySet(Set, metaclass=Singleton): + is_empty = ... + is_finite_set = ... + is_FiniteSet = ... + @property + def is_EmptySet(self) -> Literal[True]: + ... + + def as_relational(self, symbol) -> BooleanFalse: + ... + + def __len__(self) -> Literal[0]: + ... + + def __iter__(self) -> Iterator[Any]: + ... + + + +class UniversalSet(Set, metaclass=Singleton): + is_UniversalSet = ... + is_empty = ... + is_finite_set = ... + def as_relational(self, symbol) -> BooleanTrue: + ... + + + +class FiniteSet(Set): + is_FiniteSet = ... + is_iterable = ... + is_empty = ... + is_finite_set = ... + def __new__(cls, *args, **kwargs) -> Self: + ... + + def __iter__(self) -> Iterator[Basic]: + ... + + @property + def measure(self) -> Literal[0]: + ... + + def __len__(self) -> int: + ... + + def as_relational(self, symbol) -> Or: + ... + + def compare(self, other) -> int: + ... + + def __ge__(self, other) -> bool: + ... + + def __gt__(self, other) -> bool: + ... + + def __le__(self, other) -> bool: + ... + + def __lt__(self, other) -> bool: + ... + + def __eq__(self, other) -> bool: + ... + + __hash__: Callable[[Basic], Any] = ... + + +class SymmetricDifference(Set): + is_SymmetricDifference = ... + def __new__(cls, a, b, evaluate=...) -> SymmetricDifference | Self: + ... + + @staticmethod + def reduce(A, B) -> SymmetricDifference: + ... + + def as_relational(self, symbol) -> BooleanFalse | Not | Xor: + ... + + @property + def is_iterable(self) -> Literal[True] | None: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + + +class DisjointUnion(Set): + def __new__(cls, *sets) -> Self: + ... + + @property + def sets(self) -> tuple[Basic, ...]: + ... + + @property + def is_empty(self) -> bool | None: + ... + + @property + def is_finite_set(self) -> bool | None: + ... + + @property + def is_iterable(self) -> bool: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def __len__(self) -> int: + ... + + + +def imageset(*args) -> Basic | ImageSet | FiniteSet: + ... + +def is_function_invertible_in_set(func, setv) -> Literal[True] | None: + ... + +def simplify_union(args) -> FiniteSet | Union: + ... + +def simplify_intersection(args) -> FiniteSet | Intersection | Union | Complement: + ... + +def set_add(x, y) -> Any | FiniteSet | ImageSet | Union: + ... + +def set_sub(x, y) -> Any | FiniteSet | ImageSet | Union: + ... + +def set_mul(x, y) -> Any | FiniteSet | ImageSet | Union: + ... + +def set_div(x, y) -> Any | FiniteSet | ImageSet | Union: + ... + +def set_pow(x, y) -> Any | FiniteSet | ImageSet | Union: + ... + +def set_function(f, x): + ... + +class SetKind(Kind): + def __new__(cls, element_kind=...) -> Self: + ... + + def __repr__(self) -> Literal['SetKind()']: + ... + + + diff --git a/stubs/sympy-stubs/simplify/__init__.pyi b/stubs/sympy-stubs/simplify/__init__.pyi new file mode 100644 index 00000000..550262da --- /dev/null +++ b/stubs/sympy-stubs/simplify/__init__.pyi @@ -0,0 +1,14 @@ +from sympy.simplify.simplify import besselsimp, hypersimilar, hypersimp, kroneckersimp, logcombine, nsimplify, posify, separatevars, signsimp, simplify +from sympy.simplify.fu import FU, fu +from sympy.simplify.sqrtdenest import sqrtdenest +from sympy.simplify.cse_main import cse +from sympy.simplify.epathtools import EPath, epath +from sympy.simplify.hyperexpand import hyperexpand +from sympy.simplify.radsimp import collect, collect_const, denom, fraction, numer, radsimp, rcollect +from sympy.simplify.trigsimp import exptrigsimp, trigsimp +from sympy.simplify.powsimp import powdenest, powsimp +from sympy.simplify.combsimp import combsimp +from sympy.simplify.gammasimp import gammasimp +from sympy.simplify.ratsimp import ratsimp, ratsimpmodprime + +__all__ = ['simplify', 'hypersimp', 'hypersimilar', 'logcombine', 'separatevars', 'posify', 'besselsimp', 'kroneckersimp', 'signsimp', 'nsimplify', 'FU', 'fu', 'sqrtdenest', 'cse', 'epath', 'EPath', 'hyperexpand', 'collect', 'rcollect', 'radsimp', 'collect_const', 'fraction', 'numer', 'denom', 'trigsimp', 'exptrigsimp', 'powsimp', 'powdenest', 'combsimp', 'gammasimp', 'ratsimp', 'ratsimpmodprime'] diff --git a/stubs/sympy-stubs/simplify/combsimp.pyi b/stubs/sympy-stubs/simplify/combsimp.pyi new file mode 100644 index 00000000..836e5fb4 --- /dev/null +++ b/stubs/sympy-stubs/simplify/combsimp.pyi @@ -0,0 +1,7 @@ +from typing import Any +from sympy.utilities.timeutils import timethis + +@timethis('combsimp') +def combsimp(expr) -> Any: + ... + diff --git a/stubs/sympy-stubs/simplify/cse_main.pyi b/stubs/sympy-stubs/simplify/cse_main.pyi new file mode 100644 index 00000000..0799186f --- /dev/null +++ b/stubs/sympy-stubs/simplify/cse_main.pyi @@ -0,0 +1,73 @@ +from collections import defaultdict +from typing import Any +from sympy.core.containers import OrderedSet + +basic_optimizations = ... +def reps_toposort(r) -> list[Any]: + ... + +def cse_separate(r, e) -> list[list[Any]]: + ... + +def cse_release_variables(r, e) -> tuple[Any, Any] | tuple[list[Any], Any]: + ... + +def preprocess_for_cse(expr, optimizations): + ... + +def postprocess_for_cse(expr, optimizations): + ... + +class FuncArgTracker: + def __init__(self, funcs) -> None: + ... + + def get_args_in_value_order(self, argset) -> list[Any]: + ... + + def get_or_add_value_number(self, value): + ... + + def stop_arg_tracking(self, func_i) -> None: + ... + + def get_common_arg_candidates(self, argset, min_func_i=...) -> defaultdict[Any, int] | dict[Any, int]: + ... + + def get_subset_candidates(self, argset, restrict_to_funcset=...) -> OrderedSet: + ... + + def update_func_argset(self, func_i, new_argset) -> None: + ... + + + +class Unevaluated: + def __init__(self, func, args) -> None: + ... + + def __str__(self) -> str: + ... + + def as_unevaluated_basic(self): + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + __repr__ = ... + + +def match_common_args(func_class, funcs, opt_subs) -> None: + ... + +def opt_cse(exprs, order=...) -> dict[Any, Any]: + ... + +def tree_cse(exprs, symbols, opt_subs=..., order=..., ignore=...) -> tuple[list[Any], list[Any]]: + ... + +def cse(exprs, symbols=..., optimizations=..., postprocess=..., order=..., ignore=..., list=...) -> tuple[Any, str] | tuple[Any, list[Any] | set[Any] | tuple[Any, ...]] | tuple[Any, dict[Any, Any]] | tuple[Any, Any] | tuple[list[Any], Any] | tuple[list[Any], list[Any]]: + ... + diff --git a/stubs/sympy-stubs/simplify/cse_opts.pyi b/stubs/sympy-stubs/simplify/cse_opts.pyi new file mode 100644 index 00000000..e7706984 --- /dev/null +++ b/stubs/sympy-stubs/simplify/cse_opts.pyi @@ -0,0 +1,8 @@ +from sympy.core.basic import Basic + +def sub_pre(e) -> Basic: + ... + +def sub_post(e): + ... + diff --git a/stubs/sympy-stubs/simplify/epathtools.pyi b/stubs/sympy-stubs/simplify/epathtools.pyi new file mode 100644 index 00000000..7c80966e --- /dev/null +++ b/stubs/sympy-stubs/simplify/epathtools.pyi @@ -0,0 +1,22 @@ +from typing import Any, Self +from sympy.core.basic import Basic + +class EPath: + __slots__ = ... + def __new__(cls, path) -> EPath | Self: + ... + + def __repr__(self) -> str: + ... + + def apply(self, expr, func, args=..., kwargs=...) -> Basic: + ... + + def select(self, expr) -> list[Any]: + ... + + + +def epath(path, expr=..., func=..., args=..., kwargs=...) -> EPath | list[Any] | Basic: + ... + diff --git a/stubs/sympy-stubs/simplify/fu.pyi b/stubs/sympy-stubs/simplify/fu.pyi new file mode 100644 index 00000000..88532bdf --- /dev/null +++ b/stubs/sympy-stubs/simplify/fu.pyi @@ -0,0 +1,108 @@ +from typing import Any, Callable, Literal +from sympy import SYMPY_DEBUG +from sympy.series.order import Order + +def TR0(rv): + ... + +def TR1(rv): + ... + +def TR2(rv): + ... + +def TR2i(rv, half=...): + ... + +def TR3(rv): + ... + +def TR4(rv): + ... + +def TR5(rv, max=..., pow=...): + ... + +def TR6(rv, max=..., pow=...): + ... + +def TR7(rv): + ... + +def TR8(rv, first=...): + ... + +def TR9(rv): + ... + +def TR10(rv, first=...): + ... + +def TR10i(rv): + ... + +def TR11(rv, base=...): + ... + +def TR12(rv, first=...): + ... + +def TR12i(rv): + ... + +def TR13(rv): + ... + +def TRmorrie(rv): + ... + +def TR14(rv, first=...): + ... + +def TR15(rv, max=..., pow=...): + ... + +def TR16(rv, max=..., pow=...): + ... + +def TR111(rv): + ... + +def TR22(rv, max=..., pow=...): + ... + +def TRpower(rv): + ... + +def L(rv): + ... + +if SYMPY_DEBUG: + ... +CTR1 = ... +CTR2 = ... +CTR3 = ... +CTR4 = ... +RL1 = ... +RL2 = ... +def fu(rv, measure=...): + ... + +def process_common_addends(rv, do, key2=..., key1=...) -> Order: + ... + +fufuncs = ... +FU = ... +_ROOT2 = ... +def trig_split(a, b, two=...): + ... + +def as_f_sign_1(e) -> tuple[Any, Any, Any] | tuple[Any | Order, Any | Order, Literal[1, -1]] | None: + ... + +def hyper_as_trig(rv) -> tuple[Any, Callable[..., Any]]: + ... + +def sincos_to_sum(expr): + ... + diff --git a/stubs/sympy-stubs/simplify/gammasimp.pyi b/stubs/sympy-stubs/simplify/gammasimp.pyi new file mode 100644 index 00000000..59689953 --- /dev/null +++ b/stubs/sympy-stubs/simplify/gammasimp.pyi @@ -0,0 +1,14 @@ +from typing import Any +from sympy.core import Function +from sympy.series.order import Order + +def gammasimp(expr) -> Any: + ... + +class _rf(Function): + @classmethod + def eval(cls, a, b) -> Order | None: + ... + + + diff --git a/stubs/sympy-stubs/simplify/hyperexpand.pyi b/stubs/sympy-stubs/simplify/hyperexpand.pyi new file mode 100644 index 00000000..c0c49436 --- /dev/null +++ b/stubs/sympy-stubs/simplify/hyperexpand.pyi @@ -0,0 +1,283 @@ +from typing import Any, Callable, Literal, Self +from sympy.core import Expr +from sympy.core.function import UndefinedFunction + +def add_formulae(formulae) -> None: + ... + +def add_meijerg_formulae(formulae) -> None: + ... + +def make_simp(z) -> Callable[..., Any]: + ... + +def debug(*args) -> None: + ... + +class Hyper_Function(Expr): + def __new__(cls, ap, bq) -> Self: + ... + + @property + def args(self) -> tuple[Any, Any]: + ... + + @property + def sizes(self) -> tuple[int, int]: + ... + + @property + def gamma(self) -> int: + ... + + def __call__(self, arg) -> type[UndefinedFunction]: + ... + + def build_invariants(self) -> tuple[int, tuple[tuple[Any, int], ...], tuple[tuple[Any, int], ...]]: + ... + + def difficulty(self, func) -> Literal[-1, 0]: + ... + + + +class G_Function(Expr): + def __new__(cls, an, ap, bm, bq) -> Self: + ... + + @property + def args(self) -> tuple[Any, Any, Any, Any]: + ... + + def __call__(self, z) -> type[UndefinedFunction]: + ... + + def compute_buckets(self) -> tuple[dict[Any, list[Any]], ...]: + ... + + @property + def signature(self) -> tuple[int, int, int, int]: + ... + + + +_x = ... +class Formula: + def __init__(self, func, z, res, symbols, B=..., C=..., M=...) -> None: + ... + + @property + def closed_form(self): + ... + + def find_instantiations(self, func) -> list[Any]: + ... + + + +class FormulaCollection: + def __init__(self) -> None: + ... + + def lookup_origin(self, func) -> Formula | None: + ... + + + +class MeijerFormula: + def __init__(self, an, ap, bm, bq, z, symbols, B, C, M, matcher) -> None: + ... + + @property + def closed_form(self): + ... + + def try_instantiate(self, func) -> MeijerFormula | None: + ... + + + +class MeijerFormulaCollection: + def __init__(self) -> None: + ... + + def lookup_origin(self, func) -> None: + ... + + + +class Operator: + def apply(self, obj, op): + ... + + + +class MultOperator(Operator): + def __init__(self, p) -> None: + ... + + + +class ShiftA(Operator): + def __init__(self, ai) -> None: + ... + + def __str__(self) -> str: + ... + + + +class ShiftB(Operator): + def __init__(self, bi) -> None: + ... + + def __str__(self) -> str: + ... + + + +class UnShiftA(Operator): + def __init__(self, ap, bq, i, z) -> None: + ... + + def __str__(self) -> str: + ... + + + +class UnShiftB(Operator): + def __init__(self, ap, bq, i, z) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerShiftA(Operator): + def __init__(self, bi) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerShiftB(Operator): + def __init__(self, bi) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerShiftC(Operator): + def __init__(self, bi) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerShiftD(Operator): + def __init__(self, bi) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerUnShiftA(Operator): + def __init__(self, an, ap, bm, bq, i, z) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerUnShiftB(Operator): + def __init__(self, an, ap, bm, bq, i, z) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerUnShiftC(Operator): + def __init__(self, an, ap, bm, bq, i, z) -> None: + ... + + def __str__(self) -> str: + ... + + + +class MeijerUnShiftD(Operator): + def __init__(self, an, ap, bm, bq, i, z) -> None: + ... + + def __str__(self) -> str: + ... + + + +class ReduceOrder(Operator): + def __new__(cls, ai, bj) -> Self | None: + ... + + @classmethod + def meijer_minus(cls, b, a) -> Self | None: + ... + + @classmethod + def meijer_plus(cls, a, b) -> Self | None: + ... + + def __str__(self) -> str: + ... + + + +def reduce_order(func) -> tuple[Hyper_Function, list[Any]]: + ... + +def reduce_order_meijer(func) -> tuple[G_Function, list[Any]]: + ... + +def make_derivative_operator(M, z) -> Callable[..., Any]: + ... + +def apply_operators(obj, ops, op): + ... + +def devise_plan(target, origin, z) -> list[Any]: + ... + +def try_shifted_sum(func, z) -> tuple[Hyper_Function, list[Any], Any | int] | None: + ... + +def try_polynomial(func, z) -> None: + ... + +def try_lerchphi(func) -> Formula | None: + ... + +def build_hypergeometric_formula(func) -> Formula: + ... + +def hyperexpand_special(ap, bq, z) -> type[UndefinedFunction]: + ... + +_collection = ... +def devise_plan_meijer(fro, to, z) -> list[Any]: + ... + +_meijercollection = ... +def hyperexpand(f, allow_hyper=..., rewrite=..., place=...): + ... + diff --git a/stubs/sympy-stubs/simplify/powsimp.pyi b/stubs/sympy-stubs/simplify/powsimp.pyi new file mode 100644 index 00000000..d37435e7 --- /dev/null +++ b/stubs/sympy-stubs/simplify/powsimp.pyi @@ -0,0 +1,8 @@ +from sympy.core.basic import Basic +def powsimp(expr, deep=..., combine=..., force=..., measure=...): + ... + +def powdenest(eq, force=..., polar=...) -> bool | Basic: + ... + +_y = ... diff --git a/stubs/sympy-stubs/simplify/radsimp.pyi b/stubs/sympy-stubs/simplify/radsimp.pyi new file mode 100644 index 00000000..9908b2e0 --- /dev/null +++ b/stubs/sympy-stubs/simplify/radsimp.pyi @@ -0,0 +1,48 @@ +from typing import Any +from sympy.core.add import Add +from sympy.series.order import Order +def collect(expr, syms, func=..., evaluate=..., exact=..., distribute_order_term=...): + ... + +def rcollect(expr, *vars): + ... + +def collect_sqrt(expr, evaluate=...) -> tuple[tuple[Any | Order, ...], int]: + ... + +def collect_abs(expr): + ... + +def collect_const(expr, *vars, Numbers=...) -> Add | Order: + ... + +def radsimp(expr, symbolic=..., max_terms=...): + ... + +def rad_rationalize(num, den) -> tuple[Any, Any]: + ... + +def fraction(expr, exact=...) -> tuple[Any | Order, Any | Order]: + ... + +def numer(expr) -> Order: + ... + +def denom(expr) -> Order: + ... + +def fraction_expand(expr, **hints): + ... + +def numer_expand(expr, **hints): + ... + +def denom_expand(expr, **hints): + ... + +expand_numer = ... +expand_denom = ... +expand_fraction = ... +def split_surds(expr) -> tuple[Any, Any | Order, Any | Order]: + ... + diff --git a/stubs/sympy-stubs/simplify/ratsimp.pyi b/stubs/sympy-stubs/simplify/ratsimp.pyi new file mode 100644 index 00000000..3e3c26a3 --- /dev/null +++ b/stubs/sympy-stubs/simplify/ratsimp.pyi @@ -0,0 +1,7 @@ +from typing import Any +def ratsimp(expr) -> Any: + ... + +def ratsimpmodprime(expr, G, *gens, quick=..., polynomial=..., **args) -> Any: + ... + diff --git a/stubs/sympy-stubs/simplify/simplify.pyi b/stubs/sympy-stubs/simplify/simplify.pyi new file mode 100644 index 00000000..6d391b7a --- /dev/null +++ b/stubs/sympy-stubs/simplify/simplify.pyi @@ -0,0 +1,77 @@ +from typing import Any +from sympy.concrete.products import Product +from sympy.core.add import Add +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.function import UndefinedFunction +from sympy.core.mul import Mul +from sympy.core.power import Pow +from sympy.core.relational import Eq, Equality, Ne, Relational +from sympy.core.symbol import Dummy +from sympy.functions.elementary.complexes import Abs +from sympy.series.order import Order +def separatevars(expr, symbols=..., dict=..., force=...) -> dict[str, Any] | dict[Any, list[Any]] | Order | Abs | type[UndefinedFunction] | Any | None: + ... + +def posify(eq) -> tuple[Any, dict[Any, Any]] | tuple[Any, dict[Dummy, Any]]: + ... + +def hypersimp(f, k) -> None: + ... + +def hypersimilar(f, g, k): + ... + +def signsimp(expr, evaluate=...) -> Expr | Relational | Order | Eq | Ne | Add | tuple[Any, dict[Any, Any]]: + ... + +def simplify(expr, ratio=..., measure=..., rational=..., inverse=..., doit=..., **kwargs): + ... + +def sum_simplify(s, **kwargs) -> Order: + ... + +def sum_combine(s_t) -> Order: + ... + +def factor_sum(self, limits=..., radical=..., clear=..., fraction=..., sign=...) -> Basic | Any | Add | Order | Mul: + ... + +def sum_add(self, other, method=...) -> Basic | Any | Add | Order | Mul: + ... + +def product_simplify(s, **kwargs) -> Order: + ... + +def product_mul(self, other, method=...) -> Equality | Relational | Ne | Product | Order: + ... + +def logcombine(expr, force=...): + ... + +def inversecombine(expr): + ... + +def kroneckersimp(expr) -> None: + ... + +def besselsimp(expr): + ... + +def nthroot(expr, n, max_len=..., prec=...) -> Mul | Pow | Order | Add | None: + ... + +def nsimplify(expr, constants=..., tolerance=..., full=..., rational=..., rational_conversion=...): + ... + +def clear_coefficients(expr, rhs=...) -> tuple[Any, Any] | tuple[Any | Expr | Relational | Order | Eq | Ne | Add | tuple[Any, dict[Any, Any]], Any]: + ... + +def nc_simplify(expr, deep=...): + ... + +def dotprodsimp(expr, withsimp=...) -> tuple[Any | Basic, bool] | Any | Basic: + ... + +bottom_up = ... +walk = ... diff --git a/stubs/sympy-stubs/simplify/sqrtdenest.pyi b/stubs/sympy-stubs/simplify/sqrtdenest.pyi new file mode 100644 index 00000000..fe9ba6fd --- /dev/null +++ b/stubs/sympy-stubs/simplify/sqrtdenest.pyi @@ -0,0 +1,24 @@ +from typing import Literal +from sympy.core.add import Add +from sympy.core.mul import Mul +from sympy.core.power import Pow +from sympy.series.order import Order +def is_sqrt(expr) -> bool: + ... + +def sqrt_depth(p) -> Literal[1, 0]: + ... + +def is_algebraic(p) -> bool: + ... + +def sqrtdenest(expr, max_iter=...) -> Mul | Pow | Order | Add | None: + ... + +class SqrtdenestStopIteration(StopIteration): + ... + + +def sqrt_biquadratic_denest(expr, a, b, r, d2) -> None: + ... + diff --git a/stubs/sympy-stubs/simplify/trigsimp.pyi b/stubs/sympy-stubs/simplify/trigsimp.pyi new file mode 100644 index 00000000..2f1ae720 --- /dev/null +++ b/stubs/sympy-stubs/simplify/trigsimp.pyi @@ -0,0 +1,23 @@ +from typing import Any +from sympy.core.basic import Basic +from sympy.series.order import Order +def trigsimp_groebner(expr, hints=..., quick=..., order=..., polynomial=...) -> Order | Any: + ... + +_trigs = ... +def trigsimp(expr, inverse=..., **opts) -> Any: + ... + +def exptrigsimp(expr) -> Order: + ... + +def trigsimp_old(expr, *, first=..., **opts): + ... + +_trigpat = ... +_idn = ... +_midn = ... +_one = ... +def futrig(e, *, hyper=..., **kwargs) -> Basic | Order: + ... + diff --git a/stubs/sympy-stubs/solvers/__init__.pyi b/stubs/sympy-stubs/solvers/__init__.pyi new file mode 100644 index 00000000..f552921e --- /dev/null +++ b/stubs/sympy-stubs/solvers/__init__.pyi @@ -0,0 +1,15 @@ +from sympy.core.assumptions import check_assumptions, failing_assumptions +from sympy.solvers.solvers import checksol, det_quick, inv_quick, nsolve, solve, solve_linear, solve_linear_system, solve_linear_system_LU, solve_undetermined_coeffs +from sympy.solvers.diophantine import diophantine +from sympy.solvers.recurr import rsolve, rsolve_hyper, rsolve_poly, rsolve_ratio +from sympy.solvers.ode import checkodesol, classify_ode, dsolve, homogeneous_order +from sympy.solvers.polysys import solve_poly_system, solve_triangulated +from sympy.solvers.pde import checkpdesol, classify_pde, pde_separate, pde_separate_add, pde_separate_mul, pdsolve +from sympy.solvers.deutils import ode_order +from sympy.solvers.inequalities import reduce_abs_inequalities, reduce_abs_inequality, reduce_inequalities, solve_poly_inequality, solve_rational_inequalities, solve_univariate_inequality +from sympy.solvers.decompogen import decompogen +from sympy.solvers.solveset import linear_eq_to_matrix, linsolve, nonlinsolve, solveset, substitution +from sympy.core.singleton import S + +Complexes = ... +__all__ = ['solve', 'solve_linear_system', 'solve_linear_system_LU', 'solve_undetermined_coeffs', 'nsolve', 'solve_linear', 'checksol', 'det_quick', 'inv_quick', 'check_assumptions', 'failing_assumptions', 'diophantine', 'rsolve', 'rsolve_poly', 'rsolve_ratio', 'rsolve_hyper', 'checkodesol', 'classify_ode', 'dsolve', 'homogeneous_order', 'solve_poly_system', 'solve_triangulated', 'pde_separate', 'pde_separate_add', 'pde_separate_mul', 'pdsolve', 'classify_pde', 'checkpdesol', 'ode_order', 'reduce_inequalities', 'reduce_abs_inequality', 'reduce_abs_inequalities', 'solve_poly_inequality', 'solve_rational_inequalities', 'solve_univariate_inequality', 'decompogen', 'solveset', 'linsolve', 'linear_eq_to_matrix', 'nonlinsolve', 'substitution', 'Complexes'] diff --git a/stubs/sympy-stubs/solvers/bivariate.pyi b/stubs/sympy-stubs/solvers/bivariate.pyi new file mode 100644 index 00000000..08cb3a24 --- /dev/null +++ b/stubs/sympy-stubs/solvers/bivariate.pyi @@ -0,0 +1,6 @@ +from typing import Any +from sympy.core.symbol import Dummy +from sympy.series.order import Order +def bivariate_type(f, x, y, *, first=...) -> tuple[Any, Any, Any] | tuple[Any, Any | Order, Dummy] | tuple[Any, Any, Dummy] | None: + ... + diff --git a/stubs/sympy-stubs/solvers/decompogen.pyi b/stubs/sympy-stubs/solvers/decompogen.pyi new file mode 100644 index 00000000..e66a4520 --- /dev/null +++ b/stubs/sympy-stubs/solvers/decompogen.pyi @@ -0,0 +1,11 @@ +from typing import Any +from sympy.core.expr import Expr +from sympy.core.function import Function +from sympy.core.power import Pow +from sympy.functions.elementary.miscellaneous import Max, Min +def decompogen(f, symbol) -> list[Expr] | list[Function | Pow] | list[Min | Max] | Any: + ... + +def compogen(g_s, symbol): + ... + diff --git a/stubs/sympy-stubs/solvers/deutils.pyi b/stubs/sympy-stubs/solvers/deutils.pyi new file mode 100644 index 00000000..eb75fc43 --- /dev/null +++ b/stubs/sympy-stubs/solvers/deutils.pyi @@ -0,0 +1,4 @@ + +def ode_order(expr, func) -> int: + ... + diff --git a/stubs/sympy-stubs/solvers/diophantine/__init__.pyi b/stubs/sympy-stubs/solvers/diophantine/__init__.pyi new file mode 100644 index 00000000..fb598652 --- /dev/null +++ b/stubs/sympy-stubs/solvers/diophantine/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.solvers.diophantine.diophantine import classify_diop, diop_solve, diophantine + +__all__ = ['diophantine', 'classify_diop', 'diop_solve'] diff --git a/stubs/sympy-stubs/solvers/diophantine/diophantine.pyi b/stubs/sympy-stubs/solvers/diophantine/diophantine.pyi new file mode 100644 index 00000000..14577cb5 --- /dev/null +++ b/stubs/sympy-stubs/solvers/diophantine/diophantine.pyi @@ -0,0 +1,293 @@ +from types import NotImplementedType +from typing import Any, Generator, Literal, NoReturn +from sympy import Pow +from sympy.core.function import UndefinedFunction +from sympy.matrices.dense import MutableDenseMatrix +from sympy.series.order import Order +__all__ = ['diophantine', 'classify_diop'] +class DiophantineSolutionSet(set): + def __init__(self, symbols_seq, parameters) -> None: + ... + + def add(self, solution) -> None: + ... + + def update(self, *solutions) -> None: + ... + + def dict_iterator(self) -> Generator[dict[Any, Any], Any, None]: + ... + + def subs(self, *args, **kwargs) -> DiophantineSolutionSet: + ... + + def __call__(self, *args) -> DiophantineSolutionSet: + ... + + + +class DiophantineEquationType: + name: str = ... + def __init__(self, equation, free_symbols=...) -> None: + ... + + def matches(self) -> Literal[False]: + ... + + @property + def n_parameters(self) -> int: + ... + + @property + def parameters(self) -> Any: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + def pre_solve(self, parameters=...) -> None: + ... + + + +class Univariate(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +class Linear(DiophantineEquationType): + name = ... + def matches(self) -> Any: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +class BinaryQuadratic(DiophantineEquationType): + name = ... + def matches(self) -> Any | bool: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +class InhomogeneousTernaryQuadratic(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + + +class HomogeneousTernaryQuadraticNormal(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +class HomogeneousTernaryQuadratic(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +class InhomogeneousGeneralQuadratic(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + + +class HomogeneousGeneralQuadratic(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + + +class GeneralSumOfSquares(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +class GeneralPythagorean(DiophantineEquationType): + name = ... + def matches(self) -> Literal[False]: + ... + + @property + def n_parameters(self) -> int: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +class CubicThue(DiophantineEquationType): + name = ... + def matches(self) -> Any | bool: + ... + + + +class GeneralSumOfEvenPowers(DiophantineEquationType): + name = ... + def matches(self) -> bool: + ... + + def solve(self, parameters=..., limit=...) -> DiophantineSolutionSet: + ... + + + +all_diop_classes = ... +diop_known = ... +def diophantine(eq, param=..., syms=..., permute=...): + ... + +def merge_solution(var, var_t, solution) -> tuple[()] | tuple[Any, ...]: + ... + +def diop_solve(eq, param=...) -> tuple[None, ...] | set[Any] | tuple[None, None, None] | tuple[Any, Any, Any] | tuple[Any, ...] | tuple[Any | None, Any | None, Any | None] | set[tuple[int]] | None: + ... + +def classify_diop(eq, _dict=...) -> tuple[Any, dict[Any, Any] | Any, Any]: + ... + +def diop_linear(eq, param=...) -> tuple[None, ...] | None: + ... + +def base_solution_linear(c, a, b, t=...) -> tuple[Any, Any] | tuple[Literal[0], Literal[0]] | tuple[None, None]: + ... + +def diop_univariate(eq) -> set[tuple[int]] | None: + ... + +def divisible(a, b) -> bool: + ... + +def diop_quadratic(eq, param=...) -> set[Any] | None: + ... + +def is_solution_quad(var, coeff, u, v) -> NotImplementedType | bool: + ... + +def diop_DN(D, N, t=...): + ... + +def cornacchia(a, b, m) -> set[Any] | None: + ... + +def PQa(P_0, Q_0, D) -> Generator[tuple[Any, Any, type[UndefinedFunction] | Any, Any, Any, Any], Any, NoReturn]: + ... + +def diop_bf_DN(D, N, t=...) -> list[tuple[Literal[0], Literal[0]]] | list[tuple[Literal[0], Any]] | list[tuple[Any, Any]] | list[Any]: + ... + +def equivalent(u, v, r, s, D, N) -> bool: + ... + +def length(P, Q, D) -> int: + ... + +def transformation_to_DN(eq) -> tuple[Any, Any] | tuple[MutableDenseMatrix, MutableDenseMatrix] | None: + ... + +def find_DN(eq) -> tuple[Any, Any] | None: + ... + +def check_param(x, y, a, params) -> DiophantineSolutionSet | None: + ... + +def diop_ternary_quadratic(eq, parameterize=...) -> tuple[None, None, None] | tuple[Any, Any, Any] | tuple[Any, ...] | tuple[Any | None, Any | None, Any | None] | None: + ... + +def transformation_to_normal(eq) -> MutableDenseMatrix | None: + ... + +def parametrize_ternary_quadratic(eq) -> tuple[None, None, None] | tuple[Any, Any, Any] | tuple[Any, ...] | None: + ... + +def diop_ternary_quadratic_normal(eq, parameterize=...) -> tuple[None, None, None] | tuple[Any, Any, Any] | tuple[Any, ...] | tuple[Any | None, Any | None, Any | None] | None: + ... + +def sqf_normal(a, b, c, steps=...) -> tuple[tuple[Any | Order, ...], tuple[Any, ...], tuple[Any, Any, Any]] | tuple[Any, Any, Any]: + ... + +def square_factor(a) -> Order: + ... + +def reconstruct(A, B, z): + ... + +def ldescent(A, B) -> tuple[Any, Any, Any] | tuple[Literal[1], Literal[1], Literal[0]] | tuple[Literal[1], Literal[0], Literal[1]] | tuple[Any, ...] | None: + ... + +def descent(A, B) -> tuple[Any, Any, Any] | tuple[Literal[1], Literal[0], Literal[1]] | tuple[Literal[1], Literal[1], Literal[0]] | tuple[Literal[0], Literal[1], Literal[1]] | tuple[Any, ...]: + ... + +def gaussian_reduce(w, a, b) -> tuple[Any, Any | int]: + ... + +def dot(u, v, w, a, b): + ... + +def norm(u, w, a, b) -> Pow: + ... + +def holzer(x, y, z, a, b, c) -> tuple[int, ...]: + ... + +def diop_general_pythagorean(eq, param=...) -> None: + ... + +def diop_general_sum_of_squares(eq, limit=...) -> set[Any] | None: + ... + +def diop_general_sum_of_even_powers(eq, limit=...) -> set[Any] | None: + ... + +def partition(n, k=..., zeros=...) -> Generator[tuple[Any, ...] | Any, Any, None]: + ... + +def prime_as_sum_of_two_squares(p) -> tuple[int, int] | None: + ... + +def sum_of_three_squares(n) -> tuple[Literal[0], Literal[0], Literal[0]] | tuple[Any, ...] | tuple[Any, Literal[0], Literal[0]] | None: + ... + +def sum_of_four_squares(n) -> tuple[Literal[0], Literal[0], Literal[0], Literal[0]] | tuple[Any, ...]: + ... + +def power_representation(n, p, k, zeros=...) -> Generator[tuple[Any, ...] | tuple[Literal[0], ...] | tuple[int] | tuple[Any] | tuple[int, int] | None, Any, None]: + ... + +sum_of_powers = ... +def pow_rep_recursive(n_i, k, n_remaining, terms, p) -> Generator[tuple[Any, ...] | Any, Any, None]: + ... + +def sum_of_squares(n, k, zeros=...) -> Generator[tuple[Any, ...] | tuple[Literal[0], ...] | tuple[int] | tuple[Any] | tuple[int, int] | None, Any, None]: + ... + diff --git a/stubs/sympy-stubs/solvers/inequalities.pyi b/stubs/sympy-stubs/solvers/inequalities.pyi new file mode 100644 index 00000000..391683c0 --- /dev/null +++ b/stubs/sympy-stubs/solvers/inequalities.pyi @@ -0,0 +1,28 @@ +from typing import Any +from sympy.core.logic import And +from sympy.sets.sets import FiniteSet, Union + +def solve_poly_inequality(poly, rel) -> list[Any]: + ... + +def solve_poly_inequalities(polys) -> FiniteSet | Union: + ... + +def solve_rational_inequalities(eqs): + ... + +def reduce_rational_inequalities(exprs, gen, relational=...): + ... + +def reduce_abs_inequality(expr, rel, gen): + ... + +def reduce_abs_inequalities(exprs, gen) -> And: + ... + +def solve_univariate_inequality(expr, gen, relational=..., domain=..., continuous=...): + ... + +def reduce_inequalities(inequalities, symbols=...) -> And: + ... + diff --git a/stubs/sympy-stubs/solvers/ode/__init__.pyi b/stubs/sympy-stubs/solvers/ode/__init__.pyi new file mode 100644 index 00000000..6d75901a --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/__init__.pyi @@ -0,0 +1,6 @@ +from sympy.solvers.ode.ode import allhints, checkinfsol, classify_ode, constantsimp, dsolve, homogeneous_order +from sympy.solvers.ode.lie_group import infinitesimals +from sympy.solvers.ode.subscheck import checkodesol +from sympy.solvers.ode.systems import canonical_odes, linear_ode_to_matrix, linodesolve + +__all__ = ['allhints', 'checkinfsol', 'checkodesol', 'classify_ode', 'constantsimp', 'dsolve', 'homogeneous_order', 'infinitesimals', 'canonical_odes', 'linear_ode_to_matrix', 'linodesolve'] diff --git a/stubs/sympy-stubs/solvers/ode/hypergeometric.pyi b/stubs/sympy-stubs/solvers/ode/hypergeometric.pyi new file mode 100644 index 00000000..9f5e902e --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/hypergeometric.pyi @@ -0,0 +1,17 @@ +from typing import Any, Literal +from sympy.core.relational import Eq, Ne, Relational +def match_2nd_hypergeometric(eq, func) -> list[Any]: + ... + +def equivalence_hypergeometric(A, B, func) -> dict[str, Any] | None: + ... + +def match_2nd_2F1_hypergeometric(I, k, sing_point, func) -> dict[str, Any]: + ... + +def equivalence(max_num_pow, dem_pow) -> Literal['2F1'] | None: + ... + +def get_sol_2F1_hypergeometric(eq, func, match_object) -> Eq | Relational | Ne | None: + ... + diff --git a/stubs/sympy-stubs/solvers/ode/lie_group.pyi b/stubs/sympy-stubs/solvers/ode/lie_group.pyi new file mode 100644 index 00000000..1299a50c --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/lie_group.pyi @@ -0,0 +1,36 @@ +from typing import Any +from sympy.core.basic import Basic +from sympy.core.function import UndefinedFunction +from sympy.core.symbol import Symbol + +lie_heuristics = ... +def infinitesimals(eq, func=..., order=..., hint=..., match=...) -> list[Any] | Any: + ... + +def lie_heuristic_abaco1_simple(match, comp=...): + ... + +def lie_heuristic_abaco1_product(match, comp=...) -> list[dict[UndefinedFunction | Any, Any]] | list[Any] | None: + ... + +def lie_heuristic_bivariate(match, comp=...) -> list[dict[UndefinedFunction | Any, Any | Symbol | Basic]] | None: + ... + +def lie_heuristic_chi(match, comp=...) -> list[dict[UndefinedFunction | Any, Any]] | None: + ... + +def lie_heuristic_function_sum(match, comp=...) -> list[dict[UndefinedFunction | Any, Any]] | list[Any] | None: + ... + +def lie_heuristic_abaco2_similar(match, comp=...) -> list[dict[UndefinedFunction | Any, Any]] | None: + ... + +def lie_heuristic_abaco2_unique_unknown(match, comp=...) -> list[dict[UndefinedFunction | Any, Any]] | None: + ... + +def lie_heuristic_abaco2_unique_general(match, comp=...) -> list[dict[UndefinedFunction | Any, Any]] | None: + ... + +def lie_heuristic_linear(match, comp=...) -> list[dict[UndefinedFunction | Any, Any]] | None: + ... + diff --git a/stubs/sympy-stubs/solvers/ode/ode.pyi b/stubs/sympy-stubs/solvers/ode/ode.pyi new file mode 100644 index 00000000..9d09d6b5 --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/ode.pyi @@ -0,0 +1,79 @@ +from typing import Any, Generator, Literal, NoReturn, Tuple +from sympy.core.add import Add +from sympy.core.basic import Basic +from sympy.core.multidimensional import vectorize +from sympy.core.relational import Eq, Equality, Ne, Relational +from sympy.core.symbol import Symbol + +allhints = ... +def get_numbered_constants(eq, num=..., start=..., prefix=...) -> Symbol | tuple[Symbol | Any, ...]: + ... + +def iter_numbered_constants(eq, start=..., prefix=...) -> Generator[Symbol | Any, Any, NoReturn]: + ... + +def dsolve(eq, func=..., hint=..., simplify=..., ics=..., xi=..., eta=..., x0=..., n=..., **kwargs) -> list[Any] | Any | dict[Any, Any] | Equality | Basic | list[list[Any] | Any] | list[list[list[Any] | Any] | Any] | list[Equality]: + ... + +def solve_ics(sols, funcs, constants, ics): + ... + +def classify_ode(eq, func=..., dict=..., ics=..., *, prep=..., xi=..., eta=..., n=..., **kwargs): + ... + +def classify_sysode(eq, funcs=..., **kwargs) -> dict[str, int]: + ... + +def check_linear_2eq_order1(eq, func, func_coef) -> Literal['type6', 'type7'] | None: + ... + +def check_nonlinear_2eq_order1(eq, func, func_coef) -> Literal['type5', 'type1', 'type2', 'type3', 'type4'] | None: + ... + +def check_nonlinear_2eq_order2(eq, func, func_coef) -> None: + ... + +def check_nonlinear_3eq_order1(eq, func, func_coef): + ... + +def check_nonlinear_3eq_order2(eq, func, func_coef) -> None: + ... + +@vectorize(0) +def odesimp(ode, eq, func, hint) -> list[Eq | Any | Relational | Ne] | list[list[Any] | Any] | Eq | Relational | Ne | list[list[Eq | Any | Relational | Ne] | list[list[Any] | Any] | Any]: + ... + +def ode_sol_simplicity(sol, func, trysolving=...) -> int: + ... + +@vectorize(0) +def constantsimp(expr, constants) -> list[list[Any] | Any] | Eq | Relational | Ne | Add | Basic | Any: + ... + +def constant_renumber(expr, variables=..., newconstants=...) -> list[Any] | set[Any] | tuple[Any, ...] | Tuple | Basic | Eq | Relational | Ne: + ... + +def homogeneous_order(eq, *symbols) -> Any | None: + ... + +def ode_2nd_power_series_ordinary(eq, func, order, match) -> Eq | Relational | Ne: + ... + +def ode_2nd_power_series_regular(eq, func, order, match) -> Eq | Relational | Ne | None: + ... + +def ode_1st_power_series(eq, func, order, match) -> Eq | Relational | Ne: + ... + +def checkinfsol(eq, infinitesimals, func=..., order=...) -> list[Any]: + ... + +def sysode_linear_2eq_order1(match_) -> list[Eq | Any | Relational | Ne]: + ... + +def sysode_nonlinear_2eq_order1(match_) -> set[Eq] | list[Any] | set[Any]: + ... + +def sysode_nonlinear_3eq_order1(match_) -> list[Any | Basic] | list[Any | list[Any] | dict[Any, Any] | Equality | Basic | list[list[Any] | Any] | list[list[list[Any] | Any] | Any] | list[Equality]]: + ... + diff --git a/stubs/sympy-stubs/solvers/ode/riccati.pyi b/stubs/sympy-stubs/solvers/ode/riccati.pyi new file mode 100644 index 00000000..e4d0faa1 --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/riccati.pyi @@ -0,0 +1,72 @@ +from typing import Any, Literal +from sympy.core.relational import Eq, Ne, Relational + +def riccati_normal(w, x, b1, b2): + ... + +def riccati_inverse_normal(y, x, b1, b2, bp=...): + ... + +def riccati_reduced(eq, f, x) -> Literal[False]: + ... + +def linsolve_dict(eq, syms) -> dict[Any, Any]: + ... + +def match_riccati(eq, f, x) -> tuple[Literal[False], list[Any]] | tuple[Literal[True], list[Any]]: + ... + +def val_at_inf(num, den, x): + ... + +def check_necessary_conds(val_inf, muls) -> bool: + ... + +def inverse_transform_poly(num, den, x): + ... + +def limit_at_inf(num, den, x) -> Literal[0]: + ... + +def construct_c_case_1(num, den, x, pole) -> list[list[Any]]: + ... + +def construct_c_case_2(num, den, x, pole, mul) -> list[list[int]] | list[int]: + ... + +def construct_c_case_3() -> list[list[int]]: + ... + +def construct_c(num, den, x, poles, muls) -> list[Any]: + ... + +def construct_d_case_4(ser, N) -> list[list[int]] | list[int]: + ... + +def construct_d_case_5(ser) -> list[list[int]] | list[int]: + ... + +def construct_d_case_6(num, den, x) -> list[list[Any]]: + ... + +def construct_d(num, den, x, val_inf) -> list[list[int]] | list[int] | list[list[Any]]: + ... + +def rational_laurent_series(num, den, x, r, m, n) -> dict[Any, Any]: + ... + +def compute_m_ybar(x, poles, choice, N) -> tuple[Any, Any]: + ... + +def solve_aux_eq(numa, dena, numy, deny, x, m) -> tuple[Any, dict[Any, Any], Literal[True]] | tuple[Any, Any, Any]: + ... + +def remove_redundant_sols(sol1, sol2, x) -> None: + ... + +def get_gen_sol_from_part_sol(part_sols, a, x) -> list[Any]: + ... + +def solve_riccati(fx, x, b0, b1, b2, gensol=...) -> list[Eq | Any | Relational | Ne]: + ... + diff --git a/stubs/sympy-stubs/solvers/ode/single.pyi b/stubs/sympy-stubs/solvers/ode/single.pyi new file mode 100644 index 00000000..3ce8ac80 --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/single.pyi @@ -0,0 +1,231 @@ +from typing import Any, ClassVar, Iterator +from sympy.core.cache import cached_property +from sympy.core.expr import Expr +from sympy.core.function import AppliedUndef, Function +from sympy.core.relational import Equality +from sympy.core.symbol import Symbol +from sympy.series.order import Order + +class ODEMatchError(NotImplementedError): + ... + + +class SingleODEProblem: + eq: Expr = ... + func: AppliedUndef = ... + sym: Symbol = ... + _order: int = ... + _eq_expanded: Expr = ... + _eq_preprocessed: Expr = ... + _eq_high_order_free = ... + def __init__(self, eq, func, sym, prep=..., **kwargs) -> None: + ... + + @cached_property + def order(self) -> int: + ... + + @cached_property + def eq_preprocessed(self) -> Expr: + ... + + @cached_property + def eq_high_order_free(self) -> Expr: + ... + + @cached_property + def eq_expanded(self) -> Expr: + ... + + def get_numbered_constants(self, num=..., start=..., prefix=...) -> list[Symbol]: + ... + + def iter_numbered_constants(self, start=..., prefix=...) -> Iterator[Symbol]: + ... + + @cached_property + def is_autonomous(self) -> bool: + ... + + def get_linear_coefficients(self, eq, func, order) -> dict[int, Any | Order] | None: + ... + + + +class SingleODESolver: + hint: ClassVar[str] + has_integral: ClassVar[bool] + ode_problem: SingleODEProblem = ... + _matched: bool | None = ... + order: list | None = ... + def __init__(self, ode_problem) -> None: + ... + + def matches(self) -> bool: + ... + + def get_general_solution(self, *, simplify: bool = ...) -> list[Equality]: + ... + + + +class SinglePatternODESolver(SingleODESolver): + def wilds(self): + ... + + def wilds_match(self) -> list[Any]: + ... + + + +class NthAlgebraic(SingleODESolver): + hint = ... + has_integral = ... + _diffx_stored: dict[Symbol, type[Function]] = ... + + +class FirstExact(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class FirstLinear(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class AlmostLinear(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class Bernoulli(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class Factorable(SingleODESolver): + hint = ... + has_integral = ... + + +class RiccatiSpecial(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class RationalRiccati(SinglePatternODESolver): + has_integral = ... + hint = ... + order = ... + + +class SecondNonlinearAutonomousConserved(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class Liouville(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class Separable(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class SeparableReduced(Separable): + hint = ... + has_integral = ... + order = ... + + +class HomogeneousCoeffSubsDepDivIndep(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class HomogeneousCoeffSubsIndepDivDep(SinglePatternODESolver): + hint = ... + has_integral = ... + order = ... + + +class HomogeneousCoeffBest(HomogeneousCoeffSubsIndepDivDep, HomogeneousCoeffSubsDepDivIndep): + hint = ... + has_integral = ... + order = ... + + +class LinearCoefficients(HomogeneousCoeffBest): + hint = ... + has_integral = ... + order = ... + + +class NthOrderReducible(SingleODESolver): + hint = ... + has_integral = ... + + +class SecondHypergeometric(SingleODESolver): + hint = ... + has_integral = ... + + +class NthLinearConstantCoeffHomogeneous(SingleODESolver): + hint = ... + has_integral = ... + + +class NthLinearConstantCoeffVariationOfParameters(SingleODESolver): + hint = ... + has_integral = ... + + +class NthLinearConstantCoeffUndeterminedCoefficients(SingleODESolver): + hint = ... + has_integral = ... + + +class NthLinearEulerEqHomogeneous(SingleODESolver): + hint = ... + has_integral = ... + + +class NthLinearEulerEqNonhomogeneousVariationOfParameters(SingleODESolver): + hint = ... + has_integral = ... + + +class NthLinearEulerEqNonhomogeneousUndeterminedCoefficients(SingleODESolver): + hint = ... + has_integral = ... + + +class SecondLinearBessel(SingleODESolver): + hint = ... + has_integral = ... + + +class SecondLinearAiry(SingleODESolver): + hint = ... + has_integral = ... + + +class LieGroup(SingleODESolver): + hint = ... + has_integral = ... + + +solver_map = ... diff --git a/stubs/sympy-stubs/solvers/ode/subscheck.pyi b/stubs/sympy-stubs/solvers/ode/subscheck.pyi new file mode 100644 index 00000000..ab311f39 --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/subscheck.pyi @@ -0,0 +1,10 @@ +from typing import Any, Literal +def sub_func_doit(eq, func, new): + ... + +def checkodesol(ode, sol, func=..., order=..., solve_for_func=...): + ... + +def checksysodesol(eqs, sols, func=...) -> tuple[Literal[True], list[Any]] | tuple[Literal[False], list[Any]]: + ... + diff --git a/stubs/sympy-stubs/solvers/ode/systems.pyi b/stubs/sympy-stubs/solvers/ode/systems.pyi new file mode 100644 index 00000000..b86608fe --- /dev/null +++ b/stubs/sympy-stubs/solvers/ode/systems.pyi @@ -0,0 +1,37 @@ +from typing import Any +from sympy.core.relational import Eq, Ne, Relational +from sympy.matrices import Matrix +from sympy.solvers.solveset import NonlinearError + +class ODEOrderError(ValueError): + ... + + +class ODENonlinearError(NonlinearError): + ... + + +def simpsol(sol, wrt1, wrt2, doit=...) -> list[Eq | Any | Relational | Ne]: + ... + +def linodesolve_type(A, t, b=...) -> dict[Any, Any]: + ... + +def linear_ode_to_matrix(eqs, funcs, t, order) -> tuple[list[Any], Any | Matrix]: + ... + +def matrix_exp(A, t): + ... + +def matrix_exp_jordan_form(A, t) -> tuple[Matrix, Any]: + ... + +def linodesolve(A, t, b=..., B=..., type=..., doit=..., tau=...) -> list[Any]: + ... + +def canonical_odes(eqs, funcs, t) -> list[Any]: + ... + +def dsolve_system(eqs, funcs=..., t=..., ics=..., doit=..., simplify=...) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/solvers/pde.pyi b/stubs/sympy-stubs/solvers/pde.pyi new file mode 100644 index 00000000..9aa6d590 --- /dev/null +++ b/stubs/sympy-stubs/solvers/pde.pyi @@ -0,0 +1,31 @@ +from typing import Any +from sympy.core.relational import Eq, Ne, Relational + +allhints = ... +def pdsolve(eq, func=..., hint=..., dict=..., solvefun=..., **kwargs) -> dict[Any, Any] | Any: + ... + +def classify_pde(eq, func=..., dict=..., *, prep=..., **kwargs): + ... + +def checkpdesol(pde, sol, func=..., solve_for_func=...) -> Any | tuple[bool, Any]: + ... + +def pde_1st_linear_constant_coeff_homogeneous(eq, func, order, match, solvefun) -> Eq | Relational | Ne: + ... + +def pde_1st_linear_constant_coeff(eq, func, order, match, solvefun) -> Eq | Relational | Ne: + ... + +def pde_1st_linear_variable_coeff(eq, func, order, match, solvefun) -> Eq | Relational | Ne: + ... + +def pde_separate(eq, fun, sep, strategy=...) -> list[Any] | None: + ... + +def pde_separate_add(eq, fun, sep) -> list[Any] | None: + ... + +def pde_separate_mul(eq, fun, sep) -> list[Any] | None: + ... + diff --git a/stubs/sympy-stubs/solvers/polysys.pyi b/stubs/sympy-stubs/solvers/polysys.pyi new file mode 100644 index 00000000..b0745d43 --- /dev/null +++ b/stubs/sympy-stubs/solvers/polysys.pyi @@ -0,0 +1,18 @@ +from typing import Any + +class SolveFailed(Exception): + ... + + +def solve_poly_system(seq, *gens, strict=..., **args) -> list[tuple[Any, Any]] | list[tuple[Any]] | None: + ... + +def solve_biquadratic(f, g, opt) -> list[tuple[Any, Any]] | None: + ... + +def solve_generic(polys, opt, strict=...) -> list[tuple[Any]] | None: + ... + +def solve_triangulated(polys, *gens, **args) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/solvers/recurr.pyi b/stubs/sympy-stubs/solvers/recurr.pyi new file mode 100644 index 00000000..3dc206c8 --- /dev/null +++ b/stubs/sympy-stubs/solvers/recurr.pyi @@ -0,0 +1,14 @@ +from typing import Any + +def rsolve_poly(coeffs, f, n, shift=..., **hints): + ... + +def rsolve_ratio(coeffs, f, n, **hints) -> tuple[Any, Any] | None: + ... + +def rsolve_hyper(coeffs, f, n, **hints): + ... + +def rsolve(f, y, init=...): + ... + diff --git a/stubs/sympy-stubs/solvers/solvers.pyi b/stubs/sympy-stubs/solvers/solvers.pyi new file mode 100644 index 00000000..186315ad --- /dev/null +++ b/stubs/sympy-stubs/solvers/solvers.pyi @@ -0,0 +1,52 @@ +from typing import Any +from sympy.matrices import Matrix +from sympy.series.order import Order +from sympy.utilities.decorator import conserve_mpmath_dps + +def recast_to_symbols(eqs, symbols) -> tuple[list[Any], list[Any], dict[Any, Any]]: + ... + +def denoms(eq, *symbols) -> set[Any]: + ... + +def checksol(f, symbol, sol=..., **flags): + ... + +def solve(f, *symbols, **flags): + ... + +def solve_linear(lhs, rhs=..., symbols=..., exclude=...) -> tuple[Any, Any]: + ... + +def minsolve_linear_system(system, *symbols, **flags) -> dict[Any, Any] | None: + ... + +def solve_linear_system(system, *symbols, **flags) -> dict[Any, Any] | None: + ... + +def solve_undetermined_coeffs(equ, coeffs, *syms, **flags) -> tuple[list[Any], dict[Any, Any]] | list[Any] | dict[Any, Any] | None: + ... + +def solve_linear_system_LU(matrix, syms) -> dict[Any, Any]: + ... + +def det_perm(M) -> Order: + ... + +def det_minor(M): + ... + +def det_quick(M, method=...) -> Order: + ... + +def inv_quick(M): + ... + +multi_inverses = ... +@conserve_mpmath_dps +def nsolve(*args, dict=..., **kwargs) -> list[dict[Any, Any]] | Matrix: + ... + +def unrad(eq, *syms, **flags): + ... + diff --git a/stubs/sympy-stubs/solvers/solveset.pyi b/stubs/sympy-stubs/solvers/solveset.pyi new file mode 100644 index 00000000..70d483b5 --- /dev/null +++ b/stubs/sympy-stubs/solvers/solveset.pyi @@ -0,0 +1,52 @@ +from typing import Any +from sympy.core.basic import Basic +from sympy.matrices import Matrix +from sympy.sets.conditionset import ConditionSet +from sympy.sets.sets import Complement, FiniteSet, Intersection, Set, Union + +class NonlinearError(ValueError): + ... + + +_rc = ... +invert_complex = ... +def invert_real(f_x, y, x) -> tuple[Any, Any | FiniteSet] | tuple[Any, FiniteSet] | tuple[Any, Any | FiniteSet | Intersection | Union | Complement]: + ... + +def domain_check(f, symbol, p) -> bool | None: + ... + +class _SolveTrig1Error(Exception): + ... + + +def solve_decomposition(f, symbol, domain) -> Set | FiniteSet | Intersection | Union | Complement | ConditionSet: + ... + +def solveset(f, symbol=..., domain=...) -> Set: + ... + +def solveset_real(f, symbol) -> Set: + ... + +def solveset_complex(f, symbol) -> Set: + ... + +def solvify(f, symbol, domain) -> list[Basic] | None: + ... + +def linear_coeffs(eq, *syms, dict=...) -> list[Any]: + ... + +def linear_eq_to_matrix(equations, *symbols) -> tuple[Any, Matrix]: + ... + +def linsolve(system, *symbols) -> FiniteSet | Basic: + ... + +def substitution(system, symbols, result=..., known_symbols=..., exclude=..., all_symbols=...) -> Set | FiniteSet | Intersection | Union | Complement | ConditionSet: + ... + +def nonlinsolve(system, *symbols) -> FiniteSet | Set | Intersection | Union | Complement | ConditionSet: + ... + diff --git a/stubs/sympy-stubs/stats/__init__.pyi b/stubs/sympy-stubs/stats/__init__.pyi new file mode 100644 index 00000000..f01e62dc --- /dev/null +++ b/stubs/sympy-stubs/stats/__init__.pyi @@ -0,0 +1,13 @@ +from sympy.stats.rv_interface import E, H, P, cmoment, correlation, coskewness, covariance, entropy, factorial_moment, kurtosis, median, moment, skewness, smoment, std, variance +from sympy.stats.frv_types import Bernoulli, BetaBinomial, Binomial, Coin, Die, DiscreteUniform, FiniteDistributionHandmade, FiniteRV, Hypergeometric, IdealSoliton, Rademacher, RobustSoliton +from sympy.stats.crv_types import Arcsin, Benini, Beta, BetaNoncentral, BetaPrime, BoundedPareto, Cauchy, Chi, ChiNoncentral, ChiSquared, ContinuousDistributionHandmade, ContinuousRV, Dagum, Erlang, ExGaussian, Exponential, ExponentialPower, FDistribution, FisherZ, Frechet, Gamma, GammaInverse, GaussianInverse, Gompertz, Gumbel, Kumaraswamy, Laplace, Levy, LogCauchy, LogLogistic, LogNormal, Logistic, LogitNormal, Lomax, Maxwell, Moyal, Nakagami, Normal, Pareto, PowerFunction, QuadraticU, RaisedCosine, Rayleigh, Reciprocal, ShiftedGompertz, StudentT, Trapezoidal, Triangular, Uniform, UniformSum, VonMises, Wald, Weibull, WignerSemicircle +from sympy.stats.drv_types import DiscreteDistributionHandmade, DiscreteRV, FlorySchulz, Geometric, Hermite, Logarithmic, NegativeBinomial, Poisson, Skellam, YuleSimon, Zeta +from sympy.stats.joint_rv_types import Dirichlet, GeneralizedMultivariateLogGamma, GeneralizedMultivariateLogGammaOmega, JointRV, Multinomial, MultivariateBeta, MultivariateEwens, MultivariateLaplace, MultivariateNormal, MultivariateT, NegativeMultinomial, NormalGamma, marginal_distribution +from sympy.stats.stochastic_process_types import BernoulliProcess, ContinuousMarkovChain, DiscreteMarkovChain, DiscreteTimeStochasticProcess, GammaProcess, GeneratorMatrixOf, PoissonProcess, StochasticProcess, StochasticStateSpaceOf, TransitionMatrixOf, WienerProcess +from sympy.stats.random_matrix_models import CircularEnsemble, CircularOrthogonalEnsemble, CircularSymplecticEnsemble, CircularUnitaryEnsemble, GaussianEnsemble, GaussianOrthogonalEnsemble, GaussianSymplecticEnsemble, GaussianUnitaryEnsemble, JointEigenDistribution, joint_eigen_distribution, level_spacing_distribution +from sympy.stats.matrix_distributions import MatrixGamma, MatrixNormal, MatrixStudentT, Wishart +from sympy.stats.symbolic_probability import CentralMoment, Covariance, Expectation, Moment, Probability, Variance +from sympy.stats.symbolic_multivariate_probability import CrossCovarianceMatrix, ExpectationMatrix, VarianceMatrix +from sympy.stats.rv_interface import cdf, characteristic_function, density, dependent, entropy, given, independent, moment_generating_function, pspace, random_symbols, sample, sample_iter, sample_stochastic_process, sampling_density, where, quantile + +__all__ = ['P', 'E', 'H', 'density', 'where', 'given', 'sample', 'cdf', 'median', 'characteristic_function', 'pspace', 'sample_iter', 'variance', 'std', 'skewness', 'kurtosis', 'covariance', 'dependent', 'entropy', 'independent', 'random_symbols', 'correlation', 'factorial_moment', 'moment', 'cmoment', 'sampling_density', 'moment_generating_function', 'smoment', 'quantile', 'coskewness', 'sample_stochastic_process', 'FiniteRV', 'DiscreteUniform', 'Die', 'Bernoulli', 'Coin', 'Binomial', 'BetaBinomial', 'Hypergeometric', 'Rademacher', 'IdealSoliton', 'RobustSoliton', 'FiniteDistributionHandmade', 'ContinuousRV', 'Arcsin', 'Benini', 'Beta', 'BetaNoncentral', 'BetaPrime', 'BoundedPareto', 'Cauchy', 'Chi', 'ChiNoncentral', 'ChiSquared', 'Dagum', 'Erlang', 'ExGaussian', 'Exponential', 'ExponentialPower', 'FDistribution', 'FisherZ', 'Frechet', 'Gamma', 'GammaInverse', 'Gompertz', 'Gumbel', 'Kumaraswamy', 'Laplace', 'Levy', 'Logistic', 'LogCauchy', 'LogLogistic', 'LogitNormal', 'LogNormal', 'Lomax', 'Moyal', 'Maxwell', 'Nakagami', 'Normal', 'GaussianInverse', 'Pareto', 'PowerFunction', 'QuadraticU', 'RaisedCosine', 'Rayleigh', 'Reciprocal', 'StudentT', 'ShiftedGompertz', 'Trapezoidal', 'Triangular', 'Uniform', 'UniformSum', 'VonMises', 'Wald', 'Weibull', 'WignerSemicircle', 'ContinuousDistributionHandmade', 'FlorySchulz', 'Geometric', 'Hermite', 'Logarithmic', 'NegativeBinomial', 'Poisson', 'Skellam', 'YuleSimon', 'Zeta', 'DiscreteRV', 'DiscreteDistributionHandmade', 'JointRV', 'Dirichlet', 'GeneralizedMultivariateLogGamma', 'GeneralizedMultivariateLogGammaOmega', 'Multinomial', 'MultivariateBeta', 'MultivariateEwens', 'MultivariateT', 'NegativeMultinomial', 'NormalGamma', 'MultivariateNormal', 'MultivariateLaplace', 'marginal_distribution', 'StochasticProcess', 'DiscreteTimeStochasticProcess', 'DiscreteMarkovChain', 'TransitionMatrixOf', 'StochasticStateSpaceOf', 'GeneratorMatrixOf', 'ContinuousMarkovChain', 'BernoulliProcess', 'PoissonProcess', 'WienerProcess', 'GammaProcess', 'CircularEnsemble', 'CircularUnitaryEnsemble', 'CircularOrthogonalEnsemble', 'CircularSymplecticEnsemble', 'GaussianEnsemble', 'GaussianUnitaryEnsemble', 'GaussianOrthogonalEnsemble', 'GaussianSymplecticEnsemble', 'joint_eigen_distribution', 'JointEigenDistribution', 'level_spacing_distribution', 'MatrixGamma', 'Wishart', 'MatrixNormal', 'MatrixStudentT', 'Probability', 'Expectation', 'Variance', 'Covariance', 'Moment', 'CentralMoment', 'ExpectationMatrix', 'VarianceMatrix', 'CrossCovarianceMatrix'] diff --git a/stubs/sympy-stubs/stats/compound_rv.pyi b/stubs/sympy-stubs/stats/compound_rv.pyi new file mode 100644 index 00000000..9bc32913 --- /dev/null +++ b/stubs/sympy-stubs/stats/compound_rv.pyi @@ -0,0 +1,93 @@ +from typing import Any, Self +from sympy import Basic, Equality, Integral, Ne, Piecewise, Sum +from sympy.core.function import Lambda +from sympy.core.relational import Relational +from sympy.series.order import Order +from sympy.stats.crv import ContinuousDistribution, ContinuousPSpace, SingleContinuousDomain, SingleContinuousPSpace +from sympy.stats.drv import DiscreteDistribution, DiscretePSpace, SingleDiscreteDomain, SingleDiscretePSpace +from sympy.stats.frv import FiniteDensity, FinitePSpace, SingleFiniteDistribution, SingleFiniteDomain, SingleFinitePSpace +from sympy.stats.rv import Distribution, NamedArgsMixin, PSpace, RandomSymbol +from sympy.stats.symbolic_probability import Probability + +class CompoundPSpace(PSpace): + def __new__(cls, s, distribution) -> SingleContinuousPSpace | SingleDiscretePSpace | SingleFinitePSpace | Self: + ... + + @property + def value(self) -> RandomSymbol: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def is_Continuous(self): + ... + + @property + def is_Finite(self): + ... + + @property + def is_Discrete(self): + ... + + @property + def distribution(self) -> Basic: + ... + + @property + def pdf(self): + ... + + @property + def set(self): + ... + + @property + def domain(self) -> SingleContinuousDomain | SingleDiscreteDomain | SingleFiniteDomain: + ... + + def compute_density(self, expr, *, compound_evaluate=..., **kwargs) -> Basic | Lambda | FiniteDensity: + ... + + def compute_cdf(self, expr, *, compound_evaluate=..., **kwargs) -> Lambda | dict[Any, Any]: + ... + + def compute_expectation(self, expr, rvs=..., evaluate=..., **kwargs) -> tuple[Any, ...] | Sum | Order | Any | Piecewise | Basic | Equality | Relational | Ne | Integral | None: + ... + + def probability(self, condition, *, compound_evaluate=..., **kwargs) -> Probability | Equality | Relational | Ne | int: + ... + + def conditional_space(self, condition, *, compound_evaluate=..., **kwargs) -> ContinuousPSpace | DiscretePSpace | FinitePSpace: + ... + + + +class CompoundDistribution(Distribution, NamedArgsMixin): + def __new__(cls, dist) -> ContinuousDistribution | SingleFiniteDistribution | DiscreteDistribution | Self: + ... + + @property + def set(self): + ... + + @property + def is_Continuous(self) -> bool: + ... + + @property + def is_Finite(self) -> bool: + ... + + @property + def is_Discrete(self) -> bool: + ... + + def pdf(self, x, evaluate=...) -> Basic: + ... + + + diff --git a/stubs/sympy-stubs/stats/crv.pyi b/stubs/sympy-stubs/stats/crv.pyi new file mode 100644 index 00000000..101e0a6a --- /dev/null +++ b/stubs/sympy-stubs/stats/crv.pyi @@ -0,0 +1,170 @@ +from typing import Any, Literal, Self +from sympy import Basic, Equality, FiniteSet, Integral, Ne +from sympy.core.cache import cacheit +from sympy.core.function import Lambda +from sympy.core.logic import And +from sympy.core.relational import Relational +from sympy.sets.sets import Union +from sympy.stats.rv import ConditionalDomain, Distribution, NamedArgsMixin, PSpace, ProductDomain, RandomDomain, RandomSymbol, SingleDomain, SinglePSpace + +class ContinuousDomain(RandomDomain): + is_Continuous = ... + def as_boolean(self): + ... + + + +class SingleContinuousDomain(ContinuousDomain, SingleDomain): + def compute_expectation(self, expr, variables=..., **kwargs) -> Equality | Relational | Ne | Integral: + ... + + def as_boolean(self): + ... + + + +class ProductContinuousDomain(ProductDomain, ContinuousDomain): + def compute_expectation(self, expr, variables=..., **kwargs): + ... + + def as_boolean(self) -> And: + ... + + + +class ConditionalContinuousDomain(ContinuousDomain, ConditionalDomain): + def compute_expectation(self, expr, variables=..., **kwargs) -> Equality | Relational | Ne | Integral: + ... + + def as_boolean(self) -> And: + ... + + @property + def set(self): + ... + + + +class ContinuousDistribution(Distribution): + def __call__(self, *args): + ... + + + +class SingleContinuousDistribution(ContinuousDistribution, NamedArgsMixin): + set = ... + def __new__(cls, *args) -> Self: + ... + + @staticmethod + def check(*args) -> None: + ... + + @cacheit + def compute_cdf(self, **kwargs) -> Lambda: + ... + + def cdf(self, x, **kwargs) -> Basic: + ... + + @cacheit + def compute_characteristic_function(self, **kwargs) -> Lambda: + ... + + def characteristic_function(self, t, **kwargs) -> Basic: + ... + + @cacheit + def compute_moment_generating_function(self, **kwargs) -> Lambda: + ... + + def moment_generating_function(self, t, **kwargs) -> Basic: + ... + + def expectation(self, expr, var, evaluate=..., **kwargs) -> Equality | Relational | Ne | Any | Integral | Literal[0]: + ... + + @cacheit + def compute_quantile(self, **kwargs) -> Lambda: + ... + + def quantile(self, x, **kwargs) -> Basic: + ... + + + +class ContinuousPSpace(PSpace): + is_Continuous = ... + is_real = ... + @property + def pdf(self): + ... + + def compute_expectation(self, expr, rvs=..., evaluate=..., **kwargs): + ... + + def compute_density(self, expr, **kwargs) -> Lambda: + ... + + @cacheit + def compute_cdf(self, expr, **kwargs) -> Lambda: + ... + + @cacheit + def compute_characteristic_function(self, expr, **kwargs) -> Lambda: + ... + + @cacheit + def compute_moment_generating_function(self, expr, **kwargs) -> Lambda: + ... + + @cacheit + def compute_quantile(self, expr, **kwargs) -> Lambda: + ... + + def probability(self, condition, **kwargs): + ... + + def where(self, condition) -> SingleContinuousDomain: + ... + + def conditional_space(self, condition, normalize=..., **kwargs) -> ContinuousPSpace: + ... + + + +class SingleContinuousPSpace(ContinuousPSpace, SinglePSpace): + @property + def set(self): + ... + + @property + def domain(self) -> SingleContinuousDomain: + ... + + def sample(self, size=..., library=..., seed=...) -> dict[RandomSymbol, Any]: + ... + + def compute_expectation(self, expr, rvs=..., evaluate=..., **kwargs) -> Equality | Relational | Ne | Integral: + ... + + def compute_cdf(self, expr, **kwargs) -> Lambda: + ... + + def compute_characteristic_function(self, expr, **kwargs) -> Lambda: + ... + + def compute_moment_generating_function(self, expr, **kwargs) -> Lambda: + ... + + def compute_density(self, expr, **kwargs) -> Basic | Lambda: + ... + + def compute_quantile(self, expr, **kwargs) -> Lambda: + ... + + + +def reduce_rational_inequalities_wrap(condition, var) -> FiniteSet | Union | None: + ... + diff --git a/stubs/sympy-stubs/stats/crv_types.pyi b/stubs/sympy-stubs/stats/crv_types.pyi new file mode 100644 index 00000000..e86103bd --- /dev/null +++ b/stubs/sympy-stubs/stats/crv_types.pyi @@ -0,0 +1,837 @@ +from typing import Any, Self +from sympy import Equality, FiniteSet, Integral, Interval, Ne, Piecewise, Sum +from sympy.core.basic import Basic +from sympy.core.relational import Relational +from sympy.matrices import MatrixBase +from sympy.stats.crv import SingleContinuousDistribution +from sympy.stats.joint_rv import JointRandomSymbol +from sympy.stats.rv import RandomSymbol, is_random + +oo = ... +__all__ = ['ContinuousRV', 'Arcsin', 'Benini', 'Beta', 'BetaNoncentral', 'BetaPrime', 'BoundedPareto', 'Cauchy', 'Chi', 'ChiNoncentral', 'ChiSquared', 'Dagum', 'Erlang', 'ExGaussian', 'Exponential', 'ExponentialPower', 'FDistribution', 'FisherZ', 'Frechet', 'Gamma', 'GammaInverse', 'Gompertz', 'Gumbel', 'Kumaraswamy', 'Laplace', 'Levy', 'LogCauchy', 'Logistic', 'LogLogistic', 'LogitNormal', 'LogNormal', 'Lomax', 'Maxwell', 'Moyal', 'Nakagami', 'Normal', 'GaussianInverse', 'Pareto', 'PowerFunction', 'QuadraticU', 'RaisedCosine', 'Rayleigh', 'Reciprocal', 'StudentT', 'ShiftedGompertz', 'Trapezoidal', 'Triangular', 'Uniform', 'UniformSum', 'VonMises', 'Wald', 'Weibull', 'WignerSemicircle'] +@is_random.register(MatrixBase) +def _(x) -> bool: + ... + +def rv(symbol, cls, args, **kwargs) -> RandomSymbol: + ... + +class ContinuousDistributionHandmade(SingleContinuousDistribution): + _argnames = ... + def __new__(cls, pdf, set=...) -> Self: + ... + + @property + def set(self) -> Basic: + ... + + @staticmethod + def check(pdf, set) -> None: + ... + + + +def ContinuousRV(symbol, density, set=..., **kwargs) -> RandomSymbol: + ... + +class ArcsinDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + def pdf(self, x): + ... + + + +def Arcsin(name, a=..., b=...) -> RandomSymbol: + ... + +class BeniniDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(alpha, beta, sigma) -> None: + ... + + @property + def set(self) -> FiniteSet | Interval: + ... + + def pdf(self, x): + ... + + + +def Benini(name, alpha, beta, sigma) -> RandomSymbol: + ... + +class BetaDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(alpha, beta) -> None: + ... + + def pdf(self, x): + ... + + + +def Beta(name, alpha, beta) -> RandomSymbol: + ... + +class BetaNoncentralDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(alpha, beta, lamda) -> None: + ... + + def pdf(self, x) -> Equality | Relational | Ne | Sum: + ... + + + +def BetaNoncentral(name, alpha, beta, lamda) -> RandomSymbol: + ... + +class BetaPrimeDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(alpha, beta) -> None: + ... + + set = ... + def pdf(self, x): + ... + + + +def BetaPrime(name, alpha, beta) -> RandomSymbol: + ... + +class BoundedParetoDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(alpha, left, right) -> None: + ... + + def pdf(self, x): + ... + + + +def BoundedPareto(name, alpha, left, right) -> RandomSymbol: + ... + +class CauchyDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(x0, gamma) -> None: + ... + + def pdf(self, x): + ... + + + +def Cauchy(name, x0, gamma) -> RandomSymbol: + ... + +class ChiDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(k) -> None: + ... + + set = ... + def pdf(self, x): + ... + + + +def Chi(name, k) -> RandomSymbol: + ... + +class ChiNoncentralDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(k, l) -> None: + ... + + set = ... + def pdf(self, x): + ... + + + +def ChiNoncentral(name, k, l) -> RandomSymbol: + ... + +class ChiSquaredDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(k) -> None: + ... + + set = ... + def pdf(self, x): + ... + + + +def ChiSquared(name, k) -> RandomSymbol: + ... + +class DagumDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(p, a, b) -> None: + ... + + def pdf(self, x): + ... + + + +def Dagum(name, p, a, b) -> RandomSymbol: + ... + +def Erlang(name, k, l) -> RandomSymbol: + ... + +class ExGaussianDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mean, std, rate) -> None: + ... + + def pdf(self, x): + ... + + + +def ExGaussian(name, mean, std, rate) -> RandomSymbol: + ... + +class ExponentialDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(rate) -> None: + ... + + def pdf(self, x): + ... + + + +def Exponential(name, rate) -> RandomSymbol: + ... + +class ExponentialPowerDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu, alpha, beta) -> None: + ... + + def pdf(self, x): + ... + + + +def ExponentialPower(name, mu, alpha, beta) -> RandomSymbol: + ... + +class FDistributionDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(d1, d2) -> None: + ... + + def pdf(self, x): + ... + + + +def FDistribution(name, d1, d2) -> RandomSymbol: + ... + +class FisherZDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(d1, d2) -> None: + ... + + def pdf(self, x): + ... + + + +def FisherZ(name, d1, d2) -> RandomSymbol: + ... + +class FrechetDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(a, s, m) -> None: + ... + + def __new__(cls, a, s=..., m=...) -> Self: + ... + + def pdf(self, x): + ... + + + +def Frechet(name, a, s=..., m=...) -> RandomSymbol: + ... + +class GammaDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(k, theta) -> None: + ... + + def pdf(self, x): + ... + + + +def Gamma(name, k, theta) -> RandomSymbol: + ... + +class GammaInverseDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(a, b) -> None: + ... + + def pdf(self, x): + ... + + + +def GammaInverse(name, a, b) -> RandomSymbol: + ... + +class GumbelDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(beta, mu, minimum) -> None: + ... + + def pdf(self, x) -> Piecewise: + ... + + + +def Gumbel(name, beta, mu, minimum=...) -> RandomSymbol: + ... + +class GompertzDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(b, eta) -> None: + ... + + def pdf(self, x): + ... + + + +def Gompertz(name, b, eta) -> RandomSymbol: + ... + +class KumaraswamyDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(a, b) -> None: + ... + + def pdf(self, x): + ... + + + +def Kumaraswamy(name, a, b) -> RandomSymbol: + ... + +class LaplaceDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu, b) -> None: + ... + + def pdf(self, x): + ... + + + +def Laplace(name, mu, b) -> RandomSymbol | JointRandomSymbol: + ... + +class LevyDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(mu, c) -> None: + ... + + def pdf(self, x): + ... + + + +def Levy(name, mu, c) -> RandomSymbol: + ... + +class LogCauchyDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu, sigma) -> None: + ... + + def pdf(self, x): + ... + + + +def LogCauchy(name, mu, sigma) -> RandomSymbol: + ... + +class LogisticDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu, s) -> None: + ... + + def pdf(self, x): + ... + + + +def Logistic(name, mu, s) -> RandomSymbol: + ... + +class LogLogisticDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(alpha, beta) -> None: + ... + + def pdf(self, x): + ... + + def expectation(self, expr, var, **kwargs) -> Piecewise: + ... + + + +def LogLogistic(name, alpha, beta) -> RandomSymbol: + ... + +class LogitNormalDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu, s) -> None: + ... + + def pdf(self, x): + ... + + + +def LogitNormal(name, mu, s) -> RandomSymbol: + ... + +class LogNormalDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mean, std) -> None: + ... + + def pdf(self, x): + ... + + + +def LogNormal(name, mean, std) -> RandomSymbol: + ... + +class LomaxDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(alpha, lamda) -> None: + ... + + def pdf(self, x): + ... + + + +def Lomax(name, alpha, lamda) -> RandomSymbol: + ... + +class MaxwellDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(a) -> None: + ... + + def pdf(self, x): + ... + + + +def Maxwell(name, a) -> RandomSymbol: + ... + +class MoyalDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(mu, sigma) -> None: + ... + + def pdf(self, x): + ... + + + +def Moyal(name, mu, sigma) -> RandomSymbol: + ... + +class NakagamiDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu, omega) -> None: + ... + + def pdf(self, x): + ... + + + +def Nakagami(name, mu, omega) -> RandomSymbol: + ... + +class NormalDistribution(SingleContinuousDistribution): + _argnames = ... + @staticmethod + def check(mean, std) -> None: + ... + + def pdf(self, x): + ... + + + +def Normal(name, mean, std) -> RandomSymbol | JointRandomSymbol: + ... + +class GaussianInverseDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(mean, shape) -> None: + ... + + def pdf(self, x): + ... + + + +def GaussianInverse(name, mean, shape) -> RandomSymbol: + ... + +Wald = ... +class ParetoDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(xm, alpha) -> None: + ... + + def pdf(self, x): + ... + + + +def Pareto(name, xm, alpha) -> RandomSymbol: + ... + +class PowerFunctionDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(alpha, a, b) -> None: + ... + + def pdf(self, x): + ... + + + +def PowerFunction(name, alpha, a, b) -> RandomSymbol: + ... + +class QuadraticUDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(a, b) -> None: + ... + + def pdf(self, x) -> Piecewise: + ... + + + +def QuadraticU(name, a, b) -> RandomSymbol: + ... + +class RaisedCosineDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(mu, s) -> None: + ... + + def pdf(self, x) -> Piecewise: + ... + + + +def RaisedCosine(name, mu, s) -> RandomSymbol: + ... + +class RayleighDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(sigma) -> None: + ... + + def pdf(self, x): + ... + + + +def Rayleigh(name, sigma) -> RandomSymbol: + ... + +class ReciprocalDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(a, b) -> None: + ... + + def pdf(self, x): + ... + + + +def Reciprocal(name, a, b) -> RandomSymbol: + ... + +class ShiftedGompertzDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(b, eta) -> None: + ... + + def pdf(self, x): + ... + + + +def ShiftedGompertz(name, b, eta) -> RandomSymbol: + ... + +class StudentTDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(nu) -> None: + ... + + def pdf(self, x): + ... + + + +def StudentT(name, nu) -> RandomSymbol: + ... + +class TrapezoidalDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(a, b, c, d) -> None: + ... + + def pdf(self, x) -> Piecewise: + ... + + + +def Trapezoidal(name, a, b, c, d) -> RandomSymbol: + ... + +class TriangularDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(a, b, c) -> None: + ... + + def pdf(self, x) -> Piecewise: + ... + + + +def Triangular(name, a, b, c) -> RandomSymbol: + ... + +class UniformDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(left, right) -> None: + ... + + def pdf(self, x) -> Piecewise: + ... + + def expectation(self, expr, var, **kwargs) -> Equality | Basic | Relational | Ne | Integral | Any: + ... + + + +def Uniform(name, left, right) -> RandomSymbol: + ... + +class UniformSumDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(n) -> None: + ... + + def pdf(self, x): + ... + + + +def UniformSum(name, n) -> RandomSymbol: + ... + +class VonMisesDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu, k) -> None: + ... + + def pdf(self, x): + ... + + + +def VonMises(name, mu, k) -> RandomSymbol: + ... + +class WeibullDistribution(SingleContinuousDistribution): + _argnames = ... + set = ... + @staticmethod + def check(alpha, beta) -> None: + ... + + def pdf(self, x): + ... + + + +def Weibull(name, alpha, beta) -> RandomSymbol: + ... + +class WignerSemicircleDistribution(SingleContinuousDistribution): + _argnames = ... + @property + def set(self) -> FiniteSet | Interval: + ... + + @staticmethod + def check(R) -> None: + ... + + def pdf(self, x): + ... + + + +def WignerSemicircle(name, R) -> RandomSymbol: + ... + diff --git a/stubs/sympy-stubs/stats/drv.pyi b/stubs/sympy-stubs/stats/drv.pyi new file mode 100644 index 00000000..4262ec60 --- /dev/null +++ b/stubs/sympy-stubs/stats/drv.pyi @@ -0,0 +1,140 @@ +from typing import Any, Literal, Self +from sympy import Basic, Contains, Equality, FiniteSet, Intersection, Ne, Piecewise, Sum +from sympy.core.cache import cacheit +from sympy.core.function import Lambda +from sympy.core.logic import And +from sympy.core.relational import Relational +from sympy.logic.boolalg import Boolean +from sympy.series.order import Order +from sympy.sets.sets import Complement, Union +from sympy.stats.rv import ConditionalDomain, Distribution, NamedArgsMixin, PSpace, ProductDomain, RandomDomain, RandomSymbol, SingleDomain, SinglePSpace +from sympy.stats.symbolic_probability import Probability + +class DiscreteDistribution(Distribution): + def __call__(self, *args): + ... + + + +class SingleDiscreteDistribution(DiscreteDistribution, NamedArgsMixin): + set = ... + def __new__(cls, *args) -> Self: + ... + + @staticmethod + def check(*args) -> None: + ... + + @cacheit + def compute_cdf(self, **kwargs) -> Lambda: + ... + + def cdf(self, x, **kwargs) -> Basic: + ... + + @cacheit + def compute_characteristic_function(self, **kwargs) -> Lambda: + ... + + def characteristic_function(self, t, **kwargs) -> Basic: + ... + + @cacheit + def compute_moment_generating_function(self, **kwargs) -> Lambda: + ... + + def moment_generating_function(self, t, **kwargs) -> Basic: + ... + + @cacheit + def compute_quantile(self, **kwargs) -> Lambda: + ... + + def quantile(self, x, **kwargs) -> Basic: + ... + + def expectation(self, expr, var, evaluate=..., **kwargs) -> Any | Equality | Relational | Ne | Sum | Literal[0]: + ... + + def __call__(self, *args): + ... + + + +class DiscreteDomain(RandomDomain): + is_Discrete = ... + + +class SingleDiscreteDomain(DiscreteDomain, SingleDomain): + def as_boolean(self) -> Contains: + ... + + + +class ConditionalDiscreteDomain(DiscreteDomain, ConditionalDomain): + @property + def set(self) -> FiniteSet | Intersection | Union | Complement: + ... + + + +class DiscretePSpace(PSpace): + is_real = ... + is_Discrete = ... + @property + def pdf(self): + ... + + def where(self, condition) -> SingleDiscreteDomain: + ... + + def probability(self, condition) -> Probability | Equality | Relational | Ne | int: + ... + + def eval_prob(self, _domain) -> Equality | Relational | Ne | int | None: + ... + + def conditional_space(self, condition) -> DiscretePSpace: + ... + + + +class ProductDiscreteDomain(ProductDomain, DiscreteDomain): + def as_boolean(self) -> And: + ... + + + +class SingleDiscretePSpace(DiscretePSpace, SinglePSpace): + is_real = ... + @property + def set(self): + ... + + @property + def domain(self) -> SingleDiscreteDomain: + ... + + def sample(self, size=..., library=..., seed=...) -> dict[RandomSymbol, Any]: + ... + + def compute_expectation(self, expr, rvs=..., evaluate=..., **kwargs) -> Equality | Relational | Ne | Sum: + ... + + def compute_cdf(self, expr, **kwargs) -> Lambda: + ... + + def compute_density(self, expr, **kwargs) -> Basic: + ... + + def compute_characteristic_function(self, expr, **kwargs) -> Lambda: + ... + + def compute_moment_generating_function(self, expr, **kwargs) -> Lambda: + ... + + def compute_quantile(self, expr, **kwargs) -> Lambda: + ... + + + diff --git a/stubs/sympy-stubs/stats/drv_types.pyi b/stubs/sympy-stubs/stats/drv_types.pyi new file mode 100644 index 00000000..a8d571dd --- /dev/null +++ b/stubs/sympy-stubs/stats/drv_types.pyi @@ -0,0 +1,162 @@ +from typing import Self +from sympy import Basic +from sympy.stats.drv import SingleDiscreteDistribution +from sympy.stats.rv import RandomSymbol + +__all__ = ['FlorySchulz', 'Geometric', 'Hermite', 'Logarithmic', 'NegativeBinomial', 'Poisson', 'Skellam', 'YuleSimon', 'Zeta'] +def rv(symbol, cls, *args, **kwargs) -> RandomSymbol: + ... + +class DiscreteDistributionHandmade(SingleDiscreteDistribution): + _argnames = ... + def __new__(cls, pdf, set=...) -> Self: + ... + + @property + def set(self) -> Basic: + ... + + @staticmethod + def check(pdf, set) -> None: + ... + + + +def DiscreteRV(symbol, density, set=..., **kwargs) -> RandomSymbol: + ... + +class FlorySchulzDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(a) -> None: + ... + + def pdf(self, k): + ... + + + +def FlorySchulz(name, a) -> RandomSymbol: + ... + +class GeometricDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(p) -> None: + ... + + def pdf(self, k): + ... + + + +def Geometric(name, p) -> RandomSymbol: + ... + +class HermiteDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(a1, a2) -> None: + ... + + def pdf(self, k): + ... + + + +def Hermite(name, a1, a2) -> RandomSymbol: + ... + +class LogarithmicDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(p) -> None: + ... + + def pdf(self, k): + ... + + + +def Logarithmic(name, p) -> RandomSymbol: + ... + +class NegativeBinomialDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(r, p) -> None: + ... + + def pdf(self, k): + ... + + + +def NegativeBinomial(name, r, p) -> RandomSymbol: + ... + +class PoissonDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(lamda) -> None: + ... + + def pdf(self, k): + ... + + + +def Poisson(name, lamda) -> RandomSymbol: + ... + +class SkellamDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(mu1, mu2) -> None: + ... + + def pdf(self, k): + ... + + + +def Skellam(name, mu1, mu2) -> RandomSymbol: + ... + +class YuleSimonDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(rho) -> None: + ... + + def pdf(self, k): + ... + + + +def YuleSimon(name, rho) -> RandomSymbol: + ... + +class ZetaDistribution(SingleDiscreteDistribution): + _argnames = ... + set = ... + @staticmethod + def check(s) -> None: + ... + + def pdf(self, k): + ... + + + +def Zeta(name, s) -> RandomSymbol: + ... + diff --git a/stubs/sympy-stubs/stats/frv.pyi b/stubs/sympy-stubs/stats/frv.pyi new file mode 100644 index 00000000..4ec74177 --- /dev/null +++ b/stubs/sympy-stubs/stats/frv.pyi @@ -0,0 +1,241 @@ +from typing import Any, Dict, Generator, Literal, Self +from sympy import Basic, Equality, FiniteSet, Ne, Piecewise, Sum +from sympy.core.cache import cacheit +from sympy.core.function import Lambda +from sympy.core.logic import Or +from sympy.core.relational import Relational +from sympy.series.order import Order +from sympy.stats.crv import ProductContinuousDomain +from sympy.stats.drv import ProductDiscreteDomain +from sympy.stats.rv import ConditionalDomain, Density, Distribution, IndependentProductPSpace, NamedArgsMixin, PSpace, ProductDomain, RandomDomain, SinglePSpace + +class FiniteDensity(dict): + def __call__(self, item) -> Literal[0]: + ... + + @property + def dict(self) -> dict[Any, Any]: + ... + + + +class FiniteDomain(RandomDomain): + is_Finite = ... + @property + def symbols(self) -> FiniteSet: + ... + + @property + def elements(self) -> Basic: + ... + + @property + def dict(self) -> FiniteSet: + ... + + def __contains__(self, other) -> bool: + ... + + def __iter__(self): + ... + + def as_boolean(self) -> Or: + ... + + + +class SingleFiniteDomain(FiniteDomain): + def __new__(cls, symbol, set) -> Self: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def symbols(self) -> FiniteSet: + ... + + @property + def set(self) -> Basic: + ... + + @property + def elements(self) -> FiniteSet: + ... + + def __iter__(self) -> Generator[frozenset[tuple[Basic, Any]], None, None]: + ... + + def __contains__(self, other) -> bool: + ... + + + +class ProductFiniteDomain(ProductDomain, FiniteDomain): + def __iter__(self) -> Generator[frozenset[Any], None, None]: + ... + + @property + def elements(self) -> FiniteSet: + ... + + + +class ConditionalFiniteDomain(ConditionalDomain, ProductFiniteDomain): + def __new__(cls, domain, condition) -> Self: + ... + + def __contains__(self, other) -> Basic | Literal[False]: + ... + + def __iter__(self) -> Generator[Any, None, None]: + ... + + @property + def set(self) -> FiniteSet: + ... + + def as_boolean(self) -> Or: + ... + + + +class SingleFiniteDistribution(Distribution, NamedArgsMixin): + def __new__(cls, *args) -> Self: + ... + + @staticmethod + def check(*args) -> None: + ... + + @property + @cacheit + def dict(self) -> Density | dict[Any, Any]: + ... + + def pmf(self, *args): + ... + + @property + def set(self): + ... + + values = ... + items = ... + is_symbolic = ... + __iter__ = ... + __getitem__ = ... + def __call__(self, *args): + ... + + def __contains__(self, other) -> bool: + ... + + + +class FinitePSpace(PSpace): + is_Finite = ... + def __new__(cls, domain, density) -> Self: + ... + + def prob_of(self, elem): + ... + + def where(self, condition) -> ConditionalFiniteDomain: + ... + + def compute_density(self, expr) -> FiniteDensity: + ... + + @cacheit + def compute_cdf(self, expr) -> dict[Any, Any]: + ... + + @cacheit + def sorted_cdf(self, expr, python_float=...) -> list[tuple[Any, float]] | list[tuple[Any, Any]]: + ... + + @cacheit + def compute_characteristic_function(self, expr) -> Lambda: + ... + + @cacheit + def compute_moment_generating_function(self, expr) -> Lambda: + ... + + def compute_expectation(self, expr, rvs=..., **kwargs): + ... + + def compute_quantile(self, expr) -> Lambda: + ... + + def probability(self, condition): + ... + + def conditional_space(self, condition) -> FinitePSpace: + ... + + def sample(self, size=..., library=..., seed=...) -> dict[Any, Any]: + ... + + + +class SingleFinitePSpace(SinglePSpace, FinitePSpace): + @property + def domain(self) -> SingleFiniteDomain: + ... + + @property + def distribution(self) -> Basic: + ... + + def pmf(self, expr): + ... + + @cacheit + def compute_characteristic_function(self, expr) -> Lambda: + ... + + @cacheit + def compute_moment_generating_function(self, expr) -> Lambda: + ... + + def compute_quantile(self, expr) -> Lambda: + ... + + def compute_density(self, expr) -> Lambda | FiniteDensity: + ... + + def compute_cdf(self, expr) -> Lambda | dict[Any, Any]: + ... + + def compute_expectation(self, expr, rvs=..., **kwargs) -> tuple[Any, ...] | Sum | Order | Any | Piecewise | Basic | Equality | Relational | Ne | None: + ... + + def probability(self, condition): + ... + + def conditional_space(self, condition) -> FinitePSpace: + ... + + + +class ProductFinitePSpace(IndependentProductPSpace, FinitePSpace): + @property + def domain(self) -> ProductDiscreteDomain | ProductContinuousDomain | ProductFiniteDomain: + ... + + @property + @cacheit + def density(self) -> Dict: + ... + + def probability(self, condition): + ... + + def compute_density(self, expr) -> FiniteDensity: + ... + + + diff --git a/stubs/sympy-stubs/stats/frv_types.pyi b/stubs/sympy-stubs/stats/frv_types.pyi new file mode 100644 index 00000000..d0816253 --- /dev/null +++ b/stubs/sympy-stubs/stats/frv_types.pyi @@ -0,0 +1,289 @@ +from typing import Any +from sympy import Basic, FiniteSet, Intersection, Piecewise +from sympy.core.cache import cacheit +from sympy.core.function import Lambda +from sympy.core.numbers import Integer, Rational +from sympy.sets.sets import Complement, Union +from sympy.stats.frv import SingleFiniteDistribution +from sympy.stats.rv import Density, RandomSymbol + +__all__ = ['FiniteRV', 'DiscreteUniform', 'Die', 'Bernoulli', 'Coin', 'Binomial', 'BetaBinomial', 'Hypergeometric', 'Rademacher', 'IdealSoliton', 'RobustSoliton'] +def rv(name, cls, *args, **kwargs) -> RandomSymbol: + ... + +class FiniteDistributionHandmade(SingleFiniteDistribution): + @property + def dict(self) -> Basic: + ... + + def pmf(self, x) -> Lambda: + ... + + @property + def set(self) -> set[Any]: + ... + + @staticmethod + def check(density) -> None: + ... + + + +def FiniteRV(name, density, **kwargs) -> RandomSymbol: + ... + +class DiscreteUniformDistribution(SingleFiniteDistribution): + @staticmethod + def check(*args) -> None: + ... + + @property + def p(self) -> Rational | Integer: + ... + + @property + @cacheit + def dict(self) -> dict[Basic, Rational | Any | Integer]: + ... + + @property + def set(self) -> set[Basic]: + ... + + def pmf(self, x) -> Rational | Integer: + ... + + + +def DiscreteUniform(name, items) -> RandomSymbol: + ... + +class DieDistribution(SingleFiniteDistribution): + _argnames = ... + @staticmethod + def check(sides) -> None: + ... + + @property + def is_symbolic(self) -> bool: + ... + + @property + def high(self): + ... + + @property + def low(self): + ... + + @property + def set(self) -> FiniteSet | Intersection | Union | Complement | set[Any | Integer]: + ... + + def pmf(self, x) -> Piecewise: + ... + + + +def Die(name, sides=...) -> RandomSymbol: + ... + +class BernoulliDistribution(SingleFiniteDistribution): + _argnames = ... + @staticmethod + def check(p, succ, fail) -> None: + ... + + @property + def set(self) -> set[Any]: + ... + + def pmf(self, x) -> Piecewise: + ... + + + +def Bernoulli(name, p, succ=..., fail=...) -> RandomSymbol: + ... + +def Coin(name, p=...) -> RandomSymbol: + ... + +class BinomialDistribution(SingleFiniteDistribution): + _argnames = ... + @staticmethod + def check(n, p, succ, fail) -> None: + ... + + @property + def high(self): + ... + + @property + def low(self): + ... + + @property + def is_symbolic(self) -> bool: + ... + + @property + def set(self) -> FiniteSet | Intersection | Union | Complement | set[Any]: + ... + + def pmf(self, x) -> Piecewise: + ... + + @property + @cacheit + def dict(self) -> Density | dict[Any, Any | Piecewise]: + ... + + + +def Binomial(name, n, p, succ=..., fail=...) -> RandomSymbol: + ... + +class BetaBinomialDistribution(SingleFiniteDistribution): + _argnames = ... + @staticmethod + def check(n, alpha, beta) -> None: + ... + + @property + def high(self): + ... + + @property + def low(self): + ... + + @property + def is_symbolic(self) -> bool: + ... + + @property + def set(self) -> FiniteSet | Intersection | Union | Complement | set[Any | Integer]: + ... + + def pmf(self, k): + ... + + + +def BetaBinomial(name, n, alpha, beta) -> RandomSymbol: + ... + +class HypergeometricDistribution(SingleFiniteDistribution): + _argnames = ... + @staticmethod + def check(n, N, m) -> None: + ... + + @property + def is_symbolic(self) -> bool: + ... + + @property + def high(self) -> Piecewise: + ... + + @property + def low(self) -> Piecewise: + ... + + @property + def set(self) -> FiniteSet | Intersection | Union | Complement | set[int]: + ... + + def pmf(self, k): + ... + + + +def Hypergeometric(name, N, m, n) -> RandomSymbol: + ... + +class RademacherDistribution(SingleFiniteDistribution): + @property + def set(self) -> set[int]: + ... + + @property + def pmf(self) -> Lambda: + ... + + + +def Rademacher(name) -> RandomSymbol: + ... + +class IdealSolitonDistribution(SingleFiniteDistribution): + _argnames = ... + @staticmethod + def check(k) -> None: + ... + + @property + def low(self): + ... + + @property + def high(self): + ... + + @property + def set(self) -> set[Any | Integer]: + ... + + @property + @cacheit + def dict(self) -> Density | dict[int, Rational | Any | Integer]: + ... + + def pmf(self, x) -> Piecewise: + ... + + + +def IdealSoliton(name, k) -> RandomSymbol: + ... + +class RobustSolitonDistribution(SingleFiniteDistribution): + _argnames = ... + @staticmethod + def check(k, delta, c) -> None: + ... + + @property + def R(self): + ... + + @property + def Z(self): + ... + + @property + def low(self): + ... + + @property + def high(self): + ... + + @property + def set(self) -> set[Any | Integer]: + ... + + @property + def is_symbolic(self) -> bool: + ... + + def pmf(self, x): + ... + + + +def RobustSoliton(name, k, delta, c) -> RandomSymbol: + ... + diff --git a/stubs/sympy-stubs/stats/joint_rv.pyi b/stubs/sympy-stubs/stats/joint_rv.pyi new file mode 100644 index 00000000..fa6b1bbd --- /dev/null +++ b/stubs/sympy-stubs/stats/joint_rv.pyi @@ -0,0 +1,143 @@ +from typing import Any, Self +from sympy import Basic, Equality, FiniteSet, Indexed, Integral, Ne, ProductSet, Sum +from sympy.core.expr import Expr +from sympy.core.function import Lambda +from sympy.core.relational import Relational +from sympy.stats.crv import ProductContinuousDomain, SingleContinuousPSpace +from sympy.stats.drv import ProductDiscreteDomain, SingleDiscretePSpace +from sympy.stats.frv import ProductFiniteDomain +from sympy.stats.rv import Distribution, NamedArgsMixin, ProductDomain, ProductPSpace, RandomSymbol, SingleDomain + +class JointPSpace(ProductPSpace): + def __new__(cls, sym, dist) -> SingleContinuousPSpace | SingleDiscretePSpace | Self: + ... + + @property + def set(self) -> Basic | FiniteSet | ProductSet: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def distribution(self) -> Basic: + ... + + @property + def value(self) -> RandomSymbol | JointRandomSymbol: + ... + + @property + def component_count(self) -> Expr: + ... + + @property + def pdf(self): + ... + + @property + def domain(self) -> SingleDomain | ProductDiscreteDomain | ProductContinuousDomain | ProductFiniteDomain | ProductDomain: + ... + + def component_domain(self, index): + ... + + def marginal_distribution(self, *indices) -> Lambda: + ... + + def compute_expectation(self, expr, rvs=..., evaluate=..., **kwargs) -> Equality | Relational | Ne | Integral: + ... + + def where(self, condition): + ... + + def compute_density(self, expr): + ... + + def sample(self, size=..., library=..., seed=...) -> dict[RandomSymbol, Any]: + ... + + def probability(self, condition): + ... + + + +class SampleJointScipy: + def __new__(cls, dist, size, seed=...) -> None: + ... + + + +class SampleJointNumpy: + def __new__(cls, dist, size, seed=...) -> None: + ... + + + +class SampleJointPymc: + def __new__(cls, dist, size, seed=...) -> None: + ... + + + +_get_sample_class_jrv = ... +class JointDistribution(Distribution, NamedArgsMixin): + _argnames = ... + def __new__(cls, *args) -> Self: + ... + + @property + def domain(self) -> ProductDiscreteDomain | ProductContinuousDomain | ProductFiniteDomain | ProductDomain: + ... + + @property + def pdf(self): + ... + + def cdf(self, other) -> Equality | Relational | Ne | Integral | Sum: + ... + + def sample(self, size=..., library=..., seed=...): + ... + + def __call__(self, *args): + ... + + + +class JointRandomSymbol(RandomSymbol): + def __getitem__(self, key) -> Indexed | None: + ... + + + +class MarginalDistribution(Distribution): + def __new__(cls, dist, *rvs) -> Self: + ... + + def check(self) -> None: + ... + + @property + def set(self) -> FiniteSet | ProductSet: + ... + + @property + def symbols(self) -> set[Any]: + ... + + def pdf(self, *x) -> Basic: + ... + + def compute_pdf(self, expr, rvs) -> Equality | Relational | Ne | Integral | Sum: + ... + + def marginalise_out(self, expr, rv) -> Equality | Relational | Ne | Integral | Sum: + ... + + def __call__(self, *args) -> Basic: + ... + + + diff --git a/stubs/sympy-stubs/stats/joint_rv_types.pyi b/stubs/sympy-stubs/stats/joint_rv_types.pyi new file mode 100644 index 00000000..c9993cdc --- /dev/null +++ b/stubs/sympy-stubs/stats/joint_rv_types.pyi @@ -0,0 +1,202 @@ +from sympy import Basic, Equality, Ne, Piecewise, Product +from sympy.core.relational import Relational +from sympy.matrices.expressions.matexpr import MatrixElement +from sympy.stats.joint_rv import JointDistribution, JointRandomSymbol +from sympy.stats.rv import RandomSymbol + +__all__ = ['JointRV', 'MultivariateNormal', 'MultivariateLaplace', 'Dirichlet', 'GeneralizedMultivariateLogGamma', 'GeneralizedMultivariateLogGammaOmega', 'Multinomial', 'MultivariateBeta', 'MultivariateEwens', 'MultivariateT', 'NegativeMultinomial', 'NormalGamma'] +def multivariate_rv(cls, sym, *args) -> RandomSymbol | JointRandomSymbol: + ... + +def marginal_distribution(rv, *indices): + ... + +class JointDistributionHandmade(JointDistribution): + _argnames = ... + is_Continuous = ... + @property + def set(self) -> Basic: + ... + + + +def JointRV(symbol, pdf, _set=...) -> RandomSymbol | JointRandomSymbol: + ... + +class MultivariateNormalDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + @property + def set(self): + ... + + @staticmethod + def check(mu, sigma) -> None: + ... + + def pdf(self, *args) -> MatrixElement: + ... + + + +def MultivariateNormal(name, mu, sigma) -> RandomSymbol | JointRandomSymbol: + ... + +class MultivariateLaplaceDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + @property + def set(self): + ... + + @staticmethod + def check(mu, sigma) -> None: + ... + + def pdf(self, *args): + ... + + + +def MultivariateLaplace(name, mu, sigma) -> RandomSymbol | JointRandomSymbol: + ... + +class MultivariateTDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + @property + def set(self): + ... + + @staticmethod + def check(mu, sigma, v) -> None: + ... + + def pdf(self, *args): + ... + + + +def MultivariateT(syms, mu, sigma, v) -> RandomSymbol | JointRandomSymbol: + ... + +class NormalGammaDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + @staticmethod + def check(mu, lamda, alpha, beta) -> None: + ... + + @property + def set(self): + ... + + def pdf(self, x, tau): + ... + + + +def NormalGamma(sym, mu, lamda, alpha, beta) -> RandomSymbol | JointRandomSymbol: + ... + +class MultivariateBetaDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + @staticmethod + def check(alpha) -> None: + ... + + @property + def set(self): + ... + + def pdf(self, *syms): + ... + + + +def MultivariateBeta(syms, *alpha) -> RandomSymbol | JointRandomSymbol: + ... + +Dirichlet = ... +class MultivariateEwensDistribution(JointDistribution): + _argnames = ... + is_Discrete = ... + is_Continuous = ... + @staticmethod + def check(n, theta) -> None: + ... + + @property + def set(self) -> Equality | Relational | Ne | Product: + ... + + def pdf(self, *syms) -> Piecewise: + ... + + + +def MultivariateEwens(syms, n, theta) -> RandomSymbol | JointRandomSymbol: + ... + +class GeneralizedMultivariateLogGammaDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + def check(self, delta, v, l, mu) -> None: + ... + + @property + def set(self): + ... + + def pdf(self, *y): + ... + + + +def GeneralizedMultivariateLogGamma(syms, delta, v, lamda, mu) -> RandomSymbol | JointRandomSymbol: + ... + +def GeneralizedMultivariateLogGammaOmega(syms, omega, v, lamda, mu) -> RandomSymbol | JointRandomSymbol: + ... + +class MultinomialDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + is_Discrete = ... + @staticmethod + def check(n, p) -> None: + ... + + @property + def set(self): + ... + + def pdf(self, *x) -> Piecewise: + ... + + + +def Multinomial(syms, n, *p) -> RandomSymbol | JointRandomSymbol: + ... + +class NegativeMultinomialDistribution(JointDistribution): + _argnames = ... + is_Continuous = ... + is_Discrete = ... + @staticmethod + def check(k0, p) -> None: + ... + + @property + def set(self): + ... + + def pdf(self, *k): + ... + + + +def NegativeMultinomial(syms, k0, *p) -> RandomSymbol | JointRandomSymbol: + ... + diff --git a/stubs/sympy-stubs/stats/matrix_distributions.pyi b/stubs/sympy-stubs/stats/matrix_distributions.pyi new file mode 100644 index 00000000..0b2db137 --- /dev/null +++ b/stubs/sympy-stubs/stats/matrix_distributions.pyi @@ -0,0 +1,156 @@ +from typing import Any, Self +from sympy.matrices.expressions.sets import MatrixSet +from sympy.stats.rv import Distribution, MatrixDomain, NamedArgsMixin, PSpace, RandomMatrixSymbol + +class MatrixPSpace(PSpace): + def __new__(cls, sym, distribution, dim_n, dim_m) -> Self: + ... + + distribution = ... + symbol = ... + @property + def domain(self) -> MatrixDomain: + ... + + @property + def value(self) -> RandomMatrixSymbol: + ... + + @property + def values(self) -> set[RandomMatrixSymbol]: + ... + + def compute_density(self, expr, *args) -> Any: + ... + + def sample(self, size=..., library=..., seed=...) -> dict[RandomMatrixSymbol, Any]: + ... + + + +def rv(symbol, cls, args) -> RandomMatrixSymbol: + ... + +class SampleMatrixScipy: + def __new__(cls, dist, size, seed=...) -> None: + ... + + + +class SampleMatrixNumpy: + def __new__(cls, dist, size, seed=...) -> None: + ... + + + +class SampleMatrixPymc: + def __new__(cls, dist, size, seed=...) -> None: + ... + + + +_get_sample_class_matrixrv = ... +class MatrixDistribution(Distribution, NamedArgsMixin): + def __new__(cls, *args) -> Self: + ... + + @staticmethod + def check(*args) -> None: + ... + + def __call__(self, expr): + ... + + def sample(self, size=..., library=..., seed=...): + ... + + + +class MatrixGammaDistribution(MatrixDistribution): + _argnames = ... + @staticmethod + def check(alpha, beta, scale_matrix) -> None: + ... + + @property + def set(self) -> MatrixSet: + ... + + @property + def dimension(self): + ... + + def pdf(self, x): + ... + + + +def MatrixGamma(symbol, alpha, beta, scale_matrix) -> RandomMatrixSymbol: + ... + +class WishartDistribution(MatrixDistribution): + _argnames = ... + @staticmethod + def check(n, scale_matrix) -> None: + ... + + @property + def set(self) -> MatrixSet: + ... + + @property + def dimension(self): + ... + + def pdf(self, x): + ... + + + +def Wishart(symbol, n, scale_matrix) -> RandomMatrixSymbol: + ... + +class MatrixNormalDistribution(MatrixDistribution): + _argnames = ... + @staticmethod + def check(location_matrix, scale_matrix_1, scale_matrix_2) -> None: + ... + + @property + def set(self) -> MatrixSet: + ... + + @property + def dimension(self): + ... + + def pdf(self, x): + ... + + + +def MatrixNormal(symbol, location_matrix, scale_matrix_1, scale_matrix_2) -> RandomMatrixSymbol: + ... + +class MatrixStudentTDistribution(MatrixDistribution): + _argnames = ... + @staticmethod + def check(nu, location_matrix, scale_matrix_1, scale_matrix_2) -> None: + ... + + @property + def set(self) -> MatrixSet: + ... + + @property + def dimension(self): + ... + + def pdf(self, x): + ... + + + +def MatrixStudentT(symbol, nu, location_matrix, scale_matrix_1, scale_matrix_2) -> RandomMatrixSymbol: + ... + diff --git a/stubs/sympy-stubs/stats/random_matrix.pyi b/stubs/sympy-stubs/stats/random_matrix.pyi new file mode 100644 index 00000000..a6464445 --- /dev/null +++ b/stubs/sympy-stubs/stats/random_matrix.pyi @@ -0,0 +1,17 @@ +from typing import Self +from sympy import Basic +from sympy.stats.rv import PSpace + +class RandomMatrixPSpace(PSpace): + def __new__(cls, sym, model=...) -> Self: + ... + + @property + def model(self) -> Basic | None: + ... + + def compute_density(self, expr, *args): + ... + + + diff --git a/stubs/sympy-stubs/stats/random_matrix_models.pyi b/stubs/sympy-stubs/stats/random_matrix_models.pyi new file mode 100644 index 00000000..b4fc373d --- /dev/null +++ b/stubs/sympy-stubs/stats/random_matrix_models.pyi @@ -0,0 +1,136 @@ +from typing import Any, Literal, Self +from sympy import Equality, Integral, Ne +from sympy.core.basic import Basic +from sympy.core.function import Lambda +from sympy.core.relational import Relational +from sympy.stats.joint_rv_types import JointDistributionHandmade +from sympy.stats.rv import Density, RandomMatrixSymbol, is_random + +__all__ = ['CircularEnsemble', 'CircularUnitaryEnsemble', 'CircularOrthogonalEnsemble', 'CircularSymplecticEnsemble', 'GaussianEnsemble', 'GaussianUnitaryEnsemble', 'GaussianOrthogonalEnsemble', 'GaussianSymplecticEnsemble', 'joint_eigen_distribution', 'JointEigenDistribution', 'level_spacing_distribution'] +@is_random.register(RandomMatrixSymbol) +def _(x) -> Literal[True]: + ... + +class RandomMatrixEnsembleModel(Basic): + def __new__(cls, sym, dim=...) -> Self: + ... + + symbol = ... + dimension = ... + def density(self, expr) -> Density: + ... + + def __call__(self, expr) -> Density: + ... + + + +class GaussianEnsembleModel(RandomMatrixEnsembleModel): + ... + + +class GaussianUnitaryEnsembleModel(GaussianEnsembleModel): + @property + def normalization_constant(self): + ... + + def density(self, expr) -> Basic: + ... + + def joint_eigen_distribution(self) -> Lambda: + ... + + def level_spacing_distribution(self) -> Lambda: + ... + + + +class GaussianOrthogonalEnsembleModel(GaussianEnsembleModel): + @property + def normalization_constant(self) -> Equality | Relational | Ne | Integral: + ... + + def density(self, expr) -> Basic: + ... + + def joint_eigen_distribution(self) -> Lambda: + ... + + def level_spacing_distribution(self) -> Lambda: + ... + + + +class GaussianSymplecticEnsembleModel(GaussianEnsembleModel): + @property + def normalization_constant(self) -> Equality | Relational | Ne | Integral: + ... + + def density(self, expr) -> Basic: + ... + + def joint_eigen_distribution(self) -> Lambda: + ... + + def level_spacing_distribution(self) -> Lambda: + ... + + + +def GaussianEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +def GaussianUnitaryEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +def GaussianOrthogonalEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +def GaussianSymplecticEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +class CircularEnsembleModel(RandomMatrixEnsembleModel): + def density(self, expr): + ... + + + +class CircularUnitaryEnsembleModel(CircularEnsembleModel): + def joint_eigen_distribution(self) -> Lambda: + ... + + + +class CircularOrthogonalEnsembleModel(CircularEnsembleModel): + def joint_eigen_distribution(self) -> Lambda: + ... + + + +class CircularSymplecticEnsembleModel(CircularEnsembleModel): + def joint_eigen_distribution(self) -> Lambda: + ... + + + +def CircularEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +def CircularUnitaryEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +def CircularOrthogonalEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +def CircularSymplecticEnsemble(sym, dim) -> RandomMatrixSymbol: + ... + +def joint_eigen_distribution(mat) -> Any: + ... + +def JointEigenDistribution(mat) -> JointDistributionHandmade: + ... + +def level_spacing_distribution(mat): + ... + diff --git a/stubs/sympy-stubs/stats/rv.pyi b/stubs/sympy-stubs/stats/rv.pyi new file mode 100644 index 00000000..f2137d64 --- /dev/null +++ b/stubs/sympy-stubs/stats/rv.pyi @@ -0,0 +1,407 @@ +from functools import singledispatch +from typing import Any, Generator, Literal, Self +from sympy import Equality, FiniteSet, Integral, Ne, Piecewise, ProductSet, Sum +from sympy.core.basic import Basic +from sympy.core.expr import Expr +from sympy.core.function import Lambda +from sympy.core.logic import And +from sympy.core.relational import Relational +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.series.order import Order +from sympy.stats.compound_rv import CompoundPSpace +from sympy.stats.crv import ContinuousPSpace, ProductContinuousDomain +from sympy.stats.drv import DiscretePSpace, ProductDiscreteDomain +from sympy.stats.frv import ConditionalFiniteDomain, FiniteDensity, FinitePSpace, ProductFiniteDomain, ProductFinitePSpace +from sympy.stats.frv_types import BernoulliDistribution +from sympy.stats.joint_rv import JointRandomSymbol +from sympy.stats.stochastic_process import StochasticPSpace +from sympy.stats.symbolic_multivariate_probability import ExpectationMatrix +from sympy.stats.symbolic_probability import Expectation, Probability +from sympy.utilities.decorator import doctest_depends_on + +x = ... +@singledispatch +def is_random(x) -> bool: + ... + +@is_random.register(Basic) +def _(x) -> bool: + ... + +class RandomDomain(Basic): + is_ProductDomain = ... + is_Finite = ... + is_Continuous = ... + is_Discrete = ... + def __new__(cls, symbols, *args) -> Self: + ... + + @property + def symbols(self) -> Basic: + ... + + @property + def set(self) -> Basic: + ... + + def __contains__(self, other): + ... + + def compute_expectation(self, expr): + ... + + + +class SingleDomain(RandomDomain): + def __new__(cls, symbol, set) -> Self: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def symbols(self) -> FiniteSet: + ... + + def __contains__(self, other) -> bool: + ... + + + +class MatrixDomain(RandomDomain): + def __new__(cls, symbol, set) -> Self: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def symbols(self) -> FiniteSet: + ... + + + +class ConditionalDomain(RandomDomain): + def __new__(cls, fulldomain, condition) -> Self: + ... + + @property + def symbols(self): + ... + + @property + def fulldomain(self) -> Basic: + ... + + @property + def condition(self) -> Basic: + ... + + @property + def set(self): + ... + + def as_boolean(self) -> And: + ... + + + +class PSpace(Basic): + is_Finite: bool = ... + is_Continuous: bool = ... + is_Discrete: bool = ... + is_real: bool = ... + @property + def domain(self) -> Basic: + ... + + @property + def density(self) -> Basic: + ... + + @property + def values(self) -> frozenset[RandomSymbol]: + ... + + @property + def symbols(self): + ... + + def where(self, condition): + ... + + def compute_density(self, expr): + ... + + def sample(self, size=..., library=..., seed=...): + ... + + def probability(self, condition): + ... + + def compute_expectation(self, expr): + ... + + + +class SinglePSpace(PSpace): + def __new__(cls, s, distribution) -> Self: + ... + + @property + def value(self) -> RandomSymbol: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def distribution(self) -> Basic: + ... + + @property + def pdf(self): + ... + + + +class RandomSymbol(Expr): + def __new__(cls, symbol, pspace=...) -> RandomSymbol | Self: + ... + + is_finite = ... + is_symbol = ... + is_Atom = ... + _diff_wrt = ... + pspace = ... + symbol = ... + name = ... + @property + def is_commutative(self) -> Any: + ... + + @property + def free_symbols(self) -> set[Self]: + ... + + + +class RandomIndexedSymbol(RandomSymbol): + def __new__(cls, idx_obj, pspace=...) -> Self: + ... + + symbol = ... + name = ... + @property + def key(self) -> Basic | None: + ... + + @property + def free_symbols(self) -> set[Basic] | set[Self]: + ... + + @property + def pspace(self) -> Basic: + ... + + + +class RandomMatrixSymbol(RandomSymbol, MatrixSymbol): + def __new__(cls, symbol, n, m, pspace=...) -> Self: + ... + + symbol = ... + pspace = ... + + +class ProductPSpace(PSpace): + ... + + +class IndependentProductPSpace(ProductPSpace): + def __new__(cls, *spaces) -> ProductFinitePSpace | Self: + ... + + @property + def pdf(self) -> Order | Basic: + ... + + @property + def rs_space_dict(self) -> dict[Any, Any]: + ... + + @property + def symbols(self) -> FiniteSet: + ... + + @property + def spaces(self) -> FiniteSet: + ... + + @property + def values(self) -> frozenset[Any]: + ... + + def compute_expectation(self, expr, rvs=..., evaluate=..., **kwargs): + ... + + @property + def domain(self) -> ProductDiscreteDomain | ProductContinuousDomain | ProductFiniteDomain | ProductDomain: + ... + + @property + def density(self): + ... + + def sample(self, size=..., library=..., seed=...) -> dict[Any, Any]: + ... + + def probability(self, condition, **kwargs) -> Order | Lambda | Probability | Equality | Relational | Ne | int: + ... + + def compute_density(self, expr, **kwargs) -> Lambda: + ... + + def compute_cdf(self, expr, **kwargs): + ... + + def conditional_space(self, condition, normalize=..., **kwargs) -> FinitePSpace | ContinuousPSpace | DiscretePSpace: + ... + + + +class ProductDomain(RandomDomain): + is_ProductDomain = ... + def __new__(cls, *domains) -> ProductDiscreteDomain | ProductContinuousDomain | ProductFiniteDomain | Self: + ... + + @property + def sym_domain_dict(self) -> dict[Any, Basic]: + ... + + @property + def symbols(self) -> FiniteSet: + ... + + @property + def domains(self) -> tuple[Basic, ...]: + ... + + @property + def set(self) -> FiniteSet | ProductSet: + ... + + def __contains__(self, other) -> bool: + ... + + def as_boolean(self) -> And: + ... + + + +def random_symbols(expr) -> list[Any]: + ... + +def pspace(expr) -> Any | CompoundPSpace | StochasticPSpace | ProductFinitePSpace | IndependentProductPSpace: + ... + +def sumsets(sets) -> frozenset[Any]: + ... + +def rs_swap(a, b) -> dict[Any, Any]: + ... + +def given(expr, condition=..., **kwargs) -> Relational | Basic | bool: + ... + +def expectation(expr, condition=..., numsamples=..., evaluate=..., **kwargs) -> Basic | Expectation | tuple[Any, ...] | Sum | Order | Any | Piecewise | Equality | Relational | Ne | Integral | ExpectationMatrix | None: + ... + +def probability(condition, given_condition=..., numsamples=..., evaluate=..., **kwargs) -> Any | BernoulliDistribution | Probability | Equality | Lambda | Order | Relational | Ne | int: + ... + +class Density(Basic): + expr = ... + def __new__(cls, expr, condition=...) -> Self: + ... + + @property + def condition(self) -> Basic | None: + ... + + def doit(self, evaluate=..., **kwargs) -> Density | dict[Any, Any] | Lambda | Basic | Any | FiniteDensity | None: + ... + + + +def density(expr, condition=..., evaluate=..., numsamples=..., **kwargs) -> dict[Any, Any] | Density | Lambda | Basic | Any | FiniteDensity | None: + ... + +def cdf(expr, condition=..., evaluate=..., **kwargs) -> Lambda | Any | dict[Any, Any]: + ... + +def characteristic_function(expr, condition=..., evaluate=..., **kwargs) -> Lambda | Any: + ... + +def moment_generating_function(expr, condition=..., evaluate=..., **kwargs) -> Lambda | Any: + ... + +def where(condition, given_condition=..., **kwargs) -> ConditionalFiniteDomain | Any: + ... + +@doctest_depends_on(modules=('scipy', )) +def sample(expr, condition=..., size=..., library=..., numsamples=..., seed=..., **kwargs) -> list[Any | JointRandomSymbol | Basic] | JointRandomSymbol | Basic: + ... + +def quantile(expr, evaluate=..., **kwargs) -> Lambda | Any: + ... + +def sample_iter(expr, condition=..., size=..., library=..., numsamples=..., seed=..., **kwargs) -> Generator[Any, Any, None] | Generator[Any | JointRandomSymbol | Basic, Any, None]: + ... + +def sample_iter_lambdify(expr, condition=..., size=..., numsamples=..., seed=..., **kwargs) -> Generator[Any, Any, None] | Generator[Any | JointRandomSymbol | Basic, Any, None]: + ... + +def sample_iter_subs(expr, condition=..., size=..., numsamples=..., seed=..., **kwargs) -> Generator[Any, Any, None] | Generator[Any | JointRandomSymbol | Basic, Any, None]: + ... + +def sampling_P(condition, given_condition=..., library=..., numsamples=..., evalf=..., seed=..., **kwargs): + ... + +def sampling_E(expr, given_condition=..., library=..., numsamples=..., evalf=..., seed=..., **kwargs): + ... + +def sampling_density(expr, given_condition=..., library=..., numsamples=..., seed=..., **kwargs) -> dict[Any, Any]: + ... + +def dependent(a, b) -> Any | bool: + ... + +def independent(a, b) -> bool: + ... + +def pspace_independent(a, b) -> bool | None: + ... + +def rv_subs(expr, symbols=...): + ... + +class NamedArgsMixin: + _argnames: tuple[str, ...] = ... + def __getattr__(self, attr): + ... + + + +class Distribution(Basic): + def sample(self, size=..., library=..., seed=...): + ... + + + +def sample_stochastic_process(process): + ... + diff --git a/stubs/sympy-stubs/stats/rv_interface.pyi b/stubs/sympy-stubs/stats/rv_interface.pyi new file mode 100644 index 00000000..42c5e069 --- /dev/null +++ b/stubs/sympy-stubs/stats/rv_interface.pyi @@ -0,0 +1,61 @@ +from typing import Any +from sympy import Equality, Integral, Piecewise +from sympy.concrete.summations import Sum +from sympy.core.basic import Basic +from sympy.core.function import UndefinedFunction +from sympy.core.mul import Mul +from sympy.core.power import Pow +from sympy.core.relational import Ne, Relational +from sympy.series.order import Order +from sympy.sets.sets import FiniteSet, Set +from sympy.stats.symbolic_multivariate_probability import CrossCovarianceMatrix, ExpectationMatrix, VarianceMatrix +from sympy.stats.symbolic_probability import CentralMoment, Covariance, Expectation, Moment, Variance +from .rv import (probability, expectation, density, where, given, pspace, cdf, PSpace, + characteristic_function, sample, sample_iter, random_symbols, independent, dependent, + sampling_density, moment_generating_function, quantile, is_random, + sample_stochastic_process) + +__all__ = ['P', 'E', 'H', 'density', 'where', 'given', 'sample', 'cdf', 'characteristic_function', 'pspace', 'sample_iter', 'variance', 'std', 'skewness', 'kurtosis', 'covariance', 'dependent', 'entropy', 'median', 'independent', 'random_symbols', 'correlation', 'factorial_moment', 'moment', 'cmoment', 'sampling_density', 'moment_generating_function', 'smoment', 'quantile', 'sample_stochastic_process'] +def moment(X, n, c=..., condition=..., *, evaluate=..., **kwargs) -> Any | Moment: + ... + +def variance(X, condition=..., **kwargs) -> VarianceMatrix | Variance | Any | CentralMoment: + ... + +def standard_deviation(X, condition=..., **kwargs) -> Pow: + ... + +std = ... +def entropy(expr, condition=..., **kwargs) -> int | Mul | Basic | Expectation | tuple[Any, ...] | Sum | Order | Any | Piecewise | Equality | Relational | Ne | Integral | ExpectationMatrix | None: + ... + +def covariance(X, Y, condition=..., **kwargs) -> CrossCovarianceMatrix | Covariance | Basic | Expectation | tuple[Any, ...] | Sum | Order | Any | Piecewise | Equality | Relational | Ne | Integral | ExpectationMatrix | None: + ... + +def correlation(X, Y, condition=..., **kwargs): + ... + +def cmoment(X, n, condition=..., *, evaluate=..., **kwargs) -> Any | CentralMoment: + ... + +def smoment(X, n, condition=..., **kwargs): + ... + +def skewness(X, condition=..., **kwargs): + ... + +def kurtosis(X, condition=..., **kwargs): + ... + +def factorial_moment(X, n, condition=..., **kwargs) -> type[UndefinedFunction] | Basic | Expectation | tuple[Any, ...] | Sum | Order | Any | Piecewise | Equality | Relational | Ne | Integral | ExpectationMatrix | None: + ... + +def median(X, evaluate=..., **kwargs) -> FiniteSet | Set: + ... + +def coskewness(X, Y, Z, condition=..., **kwargs): + ... + +P = ... +E = ... +H = ... diff --git a/stubs/sympy-stubs/stats/sampling/sample_numpy.pyi b/stubs/sympy-stubs/stats/sampling/sample_numpy.pyi new file mode 100644 index 00000000..0713ac68 --- /dev/null +++ b/stubs/sympy-stubs/stats/sampling/sample_numpy.pyi @@ -0,0 +1,86 @@ +from functools import singledispatch +from sympy.stats.crv_types import BetaDistribution, ChiSquaredDistribution, ExponentialDistribution, FDistributionDistribution, GammaDistribution, GumbelDistribution, LaplaceDistribution, LogNormalDistribution, LogisticDistribution, NormalDistribution, ParetoDistribution, RayleighDistribution, TriangularDistribution, UniformDistribution +from sympy.stats.drv_types import GeometricDistribution, PoissonDistribution, ZetaDistribution +from sympy.stats.frv_types import BinomialDistribution, HypergeometricDistribution + +numpy = ... +@singledispatch +def do_sample_numpy(dist, size, rand_state) -> None: + ... + +@do_sample_numpy.register(BetaDistribution) +def _(dist: BetaDistribution, size, rand_state): + ... + +@do_sample_numpy.register(ChiSquaredDistribution) +def _(dist: ChiSquaredDistribution, size, rand_state): + ... + +@do_sample_numpy.register(ExponentialDistribution) +def _(dist: ExponentialDistribution, size, rand_state): + ... + +@do_sample_numpy.register(FDistributionDistribution) +def _(dist: FDistributionDistribution, size, rand_state): + ... + +@do_sample_numpy.register(GammaDistribution) +def _(dist: GammaDistribution, size, rand_state): + ... + +@do_sample_numpy.register(GumbelDistribution) +def _(dist: GumbelDistribution, size, rand_state): + ... + +@do_sample_numpy.register(LaplaceDistribution) +def _(dist: LaplaceDistribution, size, rand_state): + ... + +@do_sample_numpy.register(LogisticDistribution) +def _(dist: LogisticDistribution, size, rand_state): + ... + +@do_sample_numpy.register(LogNormalDistribution) +def _(dist: LogNormalDistribution, size, rand_state): + ... + +@do_sample_numpy.register(NormalDistribution) +def _(dist: NormalDistribution, size, rand_state): + ... + +@do_sample_numpy.register(RayleighDistribution) +def _(dist: RayleighDistribution, size, rand_state): + ... + +@do_sample_numpy.register(ParetoDistribution) +def _(dist: ParetoDistribution, size, rand_state): + ... + +@do_sample_numpy.register(TriangularDistribution) +def _(dist: TriangularDistribution, size, rand_state): + ... + +@do_sample_numpy.register(UniformDistribution) +def _(dist: UniformDistribution, size, rand_state): + ... + +@do_sample_numpy.register(GeometricDistribution) +def _(dist: GeometricDistribution, size, rand_state): + ... + +@do_sample_numpy.register(PoissonDistribution) +def _(dist: PoissonDistribution, size, rand_state): + ... + +@do_sample_numpy.register(ZetaDistribution) +def _(dist: ZetaDistribution, size, rand_state): + ... + +@do_sample_numpy.register(BinomialDistribution) +def _(dist: BinomialDistribution, size, rand_state): + ... + +@do_sample_numpy.register(HypergeometricDistribution) +def _(dist: HypergeometricDistribution, size, rand_state): + ... + diff --git a/stubs/sympy-stubs/stats/sampling/sample_pymc.pyi b/stubs/sympy-stubs/stats/sampling/sample_pymc.pyi new file mode 100644 index 00000000..7aa08968 --- /dev/null +++ b/stubs/sympy-stubs/stats/sampling/sample_pymc.pyi @@ -0,0 +1,69 @@ +from functools import singledispatch +from sympy.stats.crv_types import BetaDistribution, CauchyDistribution, ChiSquaredDistribution, ExponentialDistribution, GammaDistribution, GaussianInverseDistribution, LogNormalDistribution, NormalDistribution, ParetoDistribution, UniformDistribution +from sympy.stats.drv_types import GeometricDistribution, NegativeBinomialDistribution, PoissonDistribution +from sympy.stats.frv_types import BernoulliDistribution, BinomialDistribution + +@singledispatch +def do_sample_pymc(dist) -> None: + ... + +@do_sample_pymc.register(BetaDistribution) +def _(dist: BetaDistribution): + ... + +@do_sample_pymc.register(CauchyDistribution) +def _(dist: CauchyDistribution): + ... + +@do_sample_pymc.register(ChiSquaredDistribution) +def _(dist: ChiSquaredDistribution): + ... + +@do_sample_pymc.register(ExponentialDistribution) +def _(dist: ExponentialDistribution): + ... + +@do_sample_pymc.register(GammaDistribution) +def _(dist: GammaDistribution): + ... + +@do_sample_pymc.register(LogNormalDistribution) +def _(dist: LogNormalDistribution): + ... + +@do_sample_pymc.register(NormalDistribution) +def _(dist: NormalDistribution): + ... + +@do_sample_pymc.register(GaussianInverseDistribution) +def _(dist: GaussianInverseDistribution): + ... + +@do_sample_pymc.register(ParetoDistribution) +def _(dist: ParetoDistribution): + ... + +@do_sample_pymc.register(UniformDistribution) +def _(dist: UniformDistribution): + ... + +@do_sample_pymc.register(GeometricDistribution) +def _(dist: GeometricDistribution): + ... + +@do_sample_pymc.register(NegativeBinomialDistribution) +def _(dist: NegativeBinomialDistribution): + ... + +@do_sample_pymc.register(PoissonDistribution) +def _(dist: PoissonDistribution): + ... + +@do_sample_pymc.register(BernoulliDistribution) +def _(dist: BernoulliDistribution): + ... + +@do_sample_pymc.register(BinomialDistribution) +def _(dist: BinomialDistribution): + ... + diff --git a/stubs/sympy-stubs/stats/sampling/sample_scipy.pyi b/stubs/sympy-stubs/stats/sampling/sample_scipy.pyi new file mode 100644 index 00000000..e4ef0c86 --- /dev/null +++ b/stubs/sympy-stubs/stats/sampling/sample_scipy.pyi @@ -0,0 +1,98 @@ +from functools import singledispatch +from sympy.stats import DiscreteDistributionHandmade +from sympy.stats.crv import SingleContinuousDistribution +from sympy.stats.crv_types import BetaDistribution, CauchyDistribution, ChiSquaredDistribution, ExponentialDistribution, GammaDistribution, LogNormalDistribution, NormalDistribution, ParetoDistribution, StudentTDistribution, UniformDistribution +from sympy.stats.drv_types import GeometricDistribution, LogarithmicDistribution, NegativeBinomialDistribution, PoissonDistribution, SkellamDistribution, YuleSimonDistribution, ZetaDistribution +from sympy.stats.frv import SingleFiniteDistribution + +scipy = ... +@singledispatch +def do_sample_scipy(dist, size, seed) -> None | int: + ... + +@do_sample_scipy.register(SingleContinuousDistribution) +def _(dist: SingleContinuousDistribution, size, seed) -> int: + class scipy_pdf(scipy.stats.rv_continuous): + ... + + + +@do_sample_scipy.register(ChiSquaredDistribution) +def _(dist: ChiSquaredDistribution, size, seed): + ... + +@do_sample_scipy.register(ExponentialDistribution) +def _(dist: ExponentialDistribution, size, seed): + ... + +@do_sample_scipy.register(GammaDistribution) +def _(dist: GammaDistribution, size, seed): + ... + +@do_sample_scipy.register(LogNormalDistribution) +def _(dist: LogNormalDistribution, size, seed): + ... + +@do_sample_scipy.register(NormalDistribution) +def _(dist: NormalDistribution, size, seed): + ... + +@do_sample_scipy.register(ParetoDistribution) +def _(dist: ParetoDistribution, size, seed): + ... + +@do_sample_scipy.register(StudentTDistribution) +def _(dist: StudentTDistribution, size, seed): + ... + +@do_sample_scipy.register(UniformDistribution) +def _(dist: UniformDistribution, size, seed): + ... + +@do_sample_scipy.register(BetaDistribution) +def _(dist: BetaDistribution, size, seed): + ... + +@do_sample_scipy.register(CauchyDistribution) +def _(dist: CauchyDistribution, size, seed): + ... + +@do_sample_scipy.register(DiscreteDistributionHandmade) +def _(dist: DiscreteDistributionHandmade, size, seed) -> int: + class scipy_pmf(): + ... + + + +@do_sample_scipy.register(GeometricDistribution) +def _(dist: GeometricDistribution, size, seed): + ... + +@do_sample_scipy.register(LogarithmicDistribution) +def _(dist: LogarithmicDistribution, size, seed): + ... + +@do_sample_scipy.register(NegativeBinomialDistribution) +def _(dist: NegativeBinomialDistribution, size, seed): + ... + +@do_sample_scipy.register(PoissonDistribution) +def _(dist: PoissonDistribution, size, seed): + ... + +@do_sample_scipy.register(SkellamDistribution) +def _(dist: SkellamDistribution, size, seed): + ... + +@do_sample_scipy.register(YuleSimonDistribution) +def _(dist: YuleSimonDistribution, size, seed): + ... + +@do_sample_scipy.register(ZetaDistribution) +def _(dist: ZetaDistribution, size, seed): + ... + +@do_sample_scipy.register(SingleFiniteDistribution) +def _(dist: SingleFiniteDistribution, size, seed) -> int: + ... + diff --git a/stubs/sympy-stubs/stats/stochastic_process.pyi b/stubs/sympy-stubs/stats/stochastic_process.pyi new file mode 100644 index 00000000..895a5c43 --- /dev/null +++ b/stubs/sympy-stubs/stats/stochastic_process.pyi @@ -0,0 +1,36 @@ +from typing import Self +from sympy import Basic +from sympy.stats.crv import ProductContinuousDomain +from sympy.stats.drv import ProductDiscreteDomain +from sympy.stats.frv import ProductFiniteDomain +from sympy.stats.joint_rv import ProductPSpace +from sympy.stats.rv import ProductDomain + +class StochasticPSpace(ProductPSpace): + def __new__(cls, sym, process, distribution=...) -> Self: + ... + + @property + def process(self) -> Basic: + ... + + @property + def domain(self) -> ProductDiscreteDomain | ProductContinuousDomain | ProductFiniteDomain | ProductDomain: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def distribution(self) -> Basic: + ... + + def probability(self, condition, given_condition=..., evaluate=..., **kwargs): + ... + + def compute_expectation(self, expr, condition=..., evaluate=..., **kwargs): + ... + + + diff --git a/stubs/sympy-stubs/stats/stochastic_process_types.pyi b/stubs/sympy-stubs/stats/stochastic_process_types.pyi new file mode 100644 index 00000000..645c82f4 --- /dev/null +++ b/stubs/sympy-stubs/stats/stochastic_process_types.pyi @@ -0,0 +1,336 @@ +from typing import Any, Generator, List as tList, Literal, Self, Tuple as tTuple, Union as tUnion +from sympy import Equality, Integral, Ne, Piecewise, Sum +from sympy.core.add import Add +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.core.function import Lambda +from sympy.core.logic import And +from sympy.core.mul import Mul +from sympy.core.numbers import Integer +from sympy.core.relational import Eq, Relational +from sympy.core.symbol import Symbol +from sympy.logic.boolalg import Boolean +from sympy.matrices.immutable import ImmutableMatrix +from sympy.series.order import Order +from sympy.sets.conditionset import ConditionSet +from sympy.sets.fancysets import Range +from sympy.sets.sets import FiniteSet +from sympy.stats.crv_types import GammaDistribution, NormalDistribution +from sympy.stats.drv_types import PoissonDistribution +from sympy.stats.frv_types import BernoulliDistribution +from sympy.stats.joint_rv import JointDistribution, JointRandomSymbol +from sympy.stats.joint_rv_types import JointDistributionHandmade +from sympy.stats.symbolic_multivariate_probability import ExpectationMatrix +from sympy.stats.symbolic_probability import Expectation, Probability +from sympy.tensor.indexed import Indexed +from sympy.stats.rv import Density, Distribution, RandomIndexedSymbol, RandomSymbol, is_random + +EmptySet = ... +__all__ = ['StochasticProcess', 'DiscreteTimeStochasticProcess', 'DiscreteMarkovChain', 'TransitionMatrixOf', 'StochasticStateSpaceOf', 'GeneratorMatrixOf', 'ContinuousMarkovChain', 'BernoulliProcess', 'PoissonProcess', 'WienerProcess', 'GammaProcess'] +@is_random.register(Indexed) +def _(x) -> bool: + ... + +@is_random.register(RandomIndexedSymbol) +def _(x) -> Literal[True]: + ... + +class StochasticProcess(Basic): + index_set = ... + def __new__(cls, sym, state_space=..., **kwargs) -> Self: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def state_space(self) -> tUnion[FiniteSet, Range]: + ... + + def distribution(self, key=...) -> Distribution: + ... + + def density(self, x) -> Density: + ... + + def __call__(self, time): + ... + + def __getitem__(self, time): + ... + + def probability(self, condition): + ... + + def joint_distribution(self, *args) -> JointDistribution | JointDistributionHandmade: + ... + + def expectation(self, condition, given_condition): + ... + + def sample(self): + ... + + + +class DiscreteTimeStochasticProcess(StochasticProcess): + def __getitem__(self, time) -> RandomIndexedSymbol: + ... + + + +class ContinuousTimeStochasticProcess(StochasticProcess): + def __call__(self, time) -> RandomIndexedSymbol: + ... + + + +class TransitionMatrixOf(Boolean): + def __new__(cls, process, matrix) -> Self: + ... + + process = ... + matrix = ... + + +class GeneratorMatrixOf(TransitionMatrixOf): + def __new__(cls, process, matrix) -> Self: + ... + + + +class StochasticStateSpaceOf(Boolean): + def __new__(cls, process, state_space) -> Self: + ... + + process = ... + state_index = ... + + +class MarkovProcess(StochasticProcess): + @property + def number_of_states(self) -> tUnion[Integer, Symbol]: + ... + + def replace_with_index(self, condition) -> Relational | Eq | Ne: + ... + + def probability(self, condition, given_condition=..., evaluate=..., **kwargs): + ... + + def expectation(self, expr, condition=..., evaluate=..., **kwargs) -> ExpectationMatrix | Expectation | int: + ... + + + +class DiscreteMarkovChain(DiscreteTimeStochasticProcess, MarkovProcess): + index_set = ... + def __new__(cls, sym, state_space=..., trans_probs=...) -> Self: + ... + + @property + def transition_probabilities(self) -> Basic: + ... + + def communication_classes(self) -> tList[tTuple[tList[Basic], Boolean, Integer]]: + ... + + def fundamental_matrix(self): + ... + + def absorbing_probabilities(self) -> None: + ... + + def absorbing_probabilites(self) -> None: + ... + + def is_regular(self) -> And: + ... + + def is_ergodic(self): + ... + + def is_absorbing_state(self, state) -> bool | None: + ... + + def is_absorbing_chain(self) -> And: + ... + + def stationary_distribution(self, condition_set=...) -> tUnion[ImmutableMatrix, ConditionSet, Lambda]: + ... + + def fixed_row_vector(self) -> ImmutableMatrix | ConditionSet | Lambda: + ... + + @property + def limiting_distribution(self) -> ImmutableMatrix | ConditionSet | Lambda: + ... + + def decompose(self) -> tTuple[tList[Basic], ImmutableMatrix, ImmutableMatrix, ImmutableMatrix]: + ... + + def canonical_form(self) -> tTuple[tList[Basic], ImmutableMatrix]: + ... + + def sample(self) -> Generator[Basic, Any, None]: + ... + + + +class ContinuousMarkovChain(ContinuousTimeStochasticProcess, MarkovProcess): + index_set = ... + def __new__(cls, sym, state_space=..., gen_mat=...) -> Self: + ... + + @property + def generator_matrix(self) -> Basic: + ... + + @cacheit + def transition_probabilities(self, gen_mat=...) -> Lambda | None: + ... + + def limiting_distribution(self) -> Lambda | ImmutableMatrix | None: + ... + + + +class BernoulliProcess(DiscreteTimeStochasticProcess): + index_set = ... + def __new__(cls, sym, p, success=..., failure=...) -> Self: + ... + + @property + def symbol(self) -> Basic: + ... + + @property + def p(self) -> Basic: + ... + + @property + def success(self) -> Basic: + ... + + @property + def failure(self) -> Basic: + ... + + @property + def state_space(self) -> FiniteSet: + ... + + def distribution(self, key=...) -> BernoulliDistribution: + ... + + def simple_rv(self, rv) -> RandomSymbol: + ... + + def expectation(self, expr, condition=..., evaluate=..., **kwargs) -> Order | tuple[Any, ...] | Sum | Any | Piecewise | Basic | Equality | Relational | Ne | Integral | bool | None: + ... + + def probability(self, condition, given_condition=..., evaluate=..., **kwargs) -> BernoulliDistribution | Probability | Any | Equality | Lambda | Order | Relational | Ne | int: + ... + + def density(self, x) -> Piecewise: + ... + + + +class _SubstituteRV: + ... + + +def get_timerv_swaps(expr, condition) -> tuple[list[Any], dict[Any, Any]]: + ... + +class CountingProcess(ContinuousTimeStochasticProcess): + index_set = ... + @property + def symbol(self) -> Basic: + ... + + def expectation(self, expr, condition=..., evaluate=..., **kwargs) -> Add | ExpectationMatrix | Expectation | Order | tuple[Any, ...] | Sum | Any | Piecewise | Basic | Equality | Relational | Ne | Integral | bool | None: + ... + + def probability(self, condition, given_condition=..., evaluate=..., **kwargs) -> Add | Mul | Probability | BernoulliDistribution | Any | Equality | Lambda | Order | Relational | Ne | int: + ... + + + +class PoissonProcess(CountingProcess): + def __new__(cls, sym, lamda) -> Self: + ... + + @property + def lamda(self) -> Basic: + ... + + @property + def state_space(self): + ... + + def distribution(self, key) -> PoissonDistribution: + ... + + def density(self, x): + ... + + def simple_rv(self, rv) -> RandomSymbol: + ... + + def __add__(self, other) -> PoissonProcess: + ... + + def split(self, l1, l2) -> tuple[PoissonProcess, PoissonProcess]: + ... + + + +class WienerProcess(CountingProcess): + def __new__(cls, sym) -> Self: + ... + + @property + def state_space(self): + ... + + def distribution(self, key) -> NormalDistribution: + ... + + def density(self, x): + ... + + def simple_rv(self, rv) -> RandomSymbol | JointRandomSymbol: + ... + + + +class GammaProcess(CountingProcess): + def __new__(cls, sym, lamda, gamma) -> Self: + ... + + @property + def lamda(self) -> Basic: + ... + + @property + def gamma(self) -> Basic: + ... + + @property + def state_space(self) -> FiniteSet: + ... + + def distribution(self, key) -> GammaDistribution: + ... + + def density(self, x): + ... + + def simple_rv(self, rv) -> RandomSymbol: + ... + + + diff --git a/stubs/sympy-stubs/stats/symbolic_multivariate_probability.pyi b/stubs/sympy-stubs/stats/symbolic_multivariate_probability.pyi new file mode 100644 index 00000000..47493156 --- /dev/null +++ b/stubs/sympy-stubs/stats/symbolic_multivariate_probability.pyi @@ -0,0 +1,46 @@ +from typing import Self +from sympy import Basic +from sympy.core.add import Add +from sympy.matrices.expressions.matexpr import MatrixExpr +from sympy.matrices.expressions.special import ZeroMatrix +from sympy.stats.symbolic_probability import Covariance, Expectation, Variance + +class ExpectationMatrix(Expectation, MatrixExpr): + def __new__(cls, expr, condition=...) -> Self: + ... + + @property + def shape(self): + ... + + def expand(self, **hints) -> Basic | Add | Self: + ... + + + +class VarianceMatrix(Variance, MatrixExpr): + def __new__(cls, arg, condition=...) -> Self: + ... + + @property + def shape(self): + ... + + def expand(self, **hints) -> ZeroMatrix | Self: + ... + + + +class CrossCovarianceMatrix(Covariance, MatrixExpr): + def __new__(cls, arg1, arg2, condition=...) -> Self: + ... + + @property + def shape(self): + ... + + def expand(self, **hints) -> ZeroMatrix | CrossCovarianceMatrix | Add: + ... + + + diff --git a/stubs/sympy-stubs/stats/symbolic_probability.pyi b/stubs/sympy-stubs/stats/symbolic_probability.pyi new file mode 100644 index 00000000..67e346cf --- /dev/null +++ b/stubs/sympy-stubs/stats/symbolic_probability.pyi @@ -0,0 +1,94 @@ +from typing import Any, Literal, Self +from sympy import Basic, Equality, Integral, Ne, Piecewise, Sum +from sympy.core.add import Add +from sympy.core.expr import Expr +from sympy.core.function import Lambda +from sympy.core.relational import Relational +from sympy.series.order import Order +from sympy.stats.frv_types import BernoulliDistribution +from sympy.stats.rv import RandomSymbol, is_random +from sympy.stats.symbolic_multivariate_probability import CrossCovarianceMatrix, ExpectationMatrix, VarianceMatrix + +__all__ = ['Probability', 'Expectation', 'Variance', 'Covariance'] +@is_random.register(Expr) +def _(x) -> bool: + ... + +@is_random.register(RandomSymbol) +def _(x) -> Literal[True]: + ... + +class Probability(Expr): + def __new__(cls, prob, condition=..., **kwargs) -> Self: + ... + + def doit(self, **hints) -> Any | BernoulliDistribution | Probability | Equality | Lambda | Order | Relational | Ne | int: + ... + + _eval_rewrite_as_Sum = ... + def evaluate_integral(self) -> Any | BernoulliDistribution | Probability | Equality | Lambda | Order | Relational | Ne | int: + ... + + + +class Expectation(Expr): + def __new__(cls, expr, condition=..., **kwargs) -> ExpectationMatrix | Self: + ... + + def expand(self, **hints) -> Basic | Add | Self: + ... + + def doit(self, **hints) -> Basic | Expectation | tuple[Any, ...] | Sum | Order | Any | Piecewise | Equality | Relational | Ne | Integral | Self | None: + ... + + _eval_rewrite_as_Sum = ... + def evaluate_integral(self) -> Basic | Expectation | tuple[Any, ...] | Sum | Order | Any | Piecewise | Equality | Relational | Ne | Integral | Self | None: + ... + + evaluate_sum = ... + + +class Variance(Expr): + def __new__(cls, arg, condition=..., **kwargs) -> VarianceMatrix | Self: + ... + + def expand(self, **hints) -> Self: + ... + + _eval_rewrite_as_Sum = ... + def evaluate_integral(self) -> Self | Any: + ... + + + +class Covariance(Expr): + def __new__(cls, arg1, arg2, condition=..., **kwargs) -> CrossCovarianceMatrix | Self: + ... + + def expand(self, **hints) -> CrossCovarianceMatrix | Covariance | Add: + ... + + _eval_rewrite_as_Sum = ... + def evaluate_integral(self) -> Self | Any: + ... + + + +class Moment(Expr): + def __new__(cls, X, n, c=..., condition=..., **kwargs) -> Self: + ... + + def doit(self, **hints) -> Any: + ... + + + +class CentralMoment(Expr): + def __new__(cls, X, n, condition=..., **kwargs) -> Self: + ... + + def doit(self, **hints) -> Any: + ... + + + diff --git a/stubs/sympy-stubs/strategies/__init__.pyi b/stubs/sympy-stubs/strategies/__init__.pyi new file mode 100644 index 00000000..088b4f64 --- /dev/null +++ b/stubs/sympy-stubs/strategies/__init__.pyi @@ -0,0 +1,7 @@ +from sympy.strategies import branch, rl, traverse +from sympy.strategies.rl import distribute, flatten, glom, rebuild, rm_id, sort, unpack +from sympy.strategies.util import new +from sympy.strategies.core import chain, condition, debug, do_one, exhaust, minimize, null_safe, tryit +from sympy.strategies.tools import canon, typed + +__all__ = ['rl', 'traverse', 'rm_id', 'unpack', 'flatten', 'sort', 'glom', 'distribute', 'rebuild', 'new', 'condition', 'debug', 'chain', 'null_safe', 'do_one', 'exhaust', 'minimize', 'tryit', 'canon', 'typed', 'branch'] diff --git a/stubs/sympy-stubs/strategies/branch/__init__.pyi b/stubs/sympy-stubs/strategies/branch/__init__.pyi new file mode 100644 index 00000000..b20ddb08 --- /dev/null +++ b/stubs/sympy-stubs/strategies/branch/__init__.pyi @@ -0,0 +1,5 @@ +from sympy.strategies.branch import traverse +from sympy.strategies.branch.core import chain, condition, debug, do_one, exhaust, identity, multiplex, notempty, onaction, sfilter, yieldify +from sympy.strategies.branch.tools import canon + +__all__ = ['traverse', 'condition', 'debug', 'multiplex', 'exhaust', 'notempty', 'chain', 'onaction', 'sfilter', 'yieldify', 'do_one', 'identity', 'canon'] diff --git a/stubs/sympy-stubs/strategies/branch/core.pyi b/stubs/sympy-stubs/strategies/branch/core.pyi new file mode 100644 index 00000000..ecc0e727 --- /dev/null +++ b/stubs/sympy-stubs/strategies/branch/core.pyi @@ -0,0 +1,35 @@ +from typing import Any, Callable, Generator + +def identity(x) -> Generator[Any, Any, None]: + ... + +def exhaust(brule) -> Callable[..., Generator[Any, Any, None]]: + ... + +def onaction(brule, fn) -> Callable[..., Generator[Any, Any, None]]: + ... + +def debug(brule, file=...) -> Callable[..., Generator[Any, Any, None]]: + ... + +def multiplex(*brules) -> Callable[..., Generator[Any, Any, None]]: + ... + +def condition(cond, brule) -> Callable[..., Generator[Any, Any, None]]: + ... + +def sfilter(pred, brule) -> Callable[..., Generator[Any, Any, None]]: + ... + +def notempty(brule) -> Callable[..., Generator[Any, Any, None]]: + ... + +def do_one(*brules) -> Callable[..., Generator[Any, Any, None]]: + ... + +def chain(*brules) -> Callable[..., Generator[Any, Any, None]]: + ... + +def yieldify(rl) -> Callable[..., Generator[Any, Any, None]]: + ... + diff --git a/stubs/sympy-stubs/strategies/branch/tools.pyi b/stubs/sympy-stubs/strategies/branch/tools.pyi new file mode 100644 index 00000000..92417305 --- /dev/null +++ b/stubs/sympy-stubs/strategies/branch/tools.pyi @@ -0,0 +1,4 @@ +from typing import Any, Callable, Generator +def canon(*rules) -> Callable[..., Generator[Any, Any, None]]: + ... + diff --git a/stubs/sympy-stubs/strategies/branch/traverse.pyi b/stubs/sympy-stubs/strategies/branch/traverse.pyi new file mode 100644 index 00000000..c2117607 --- /dev/null +++ b/stubs/sympy-stubs/strategies/branch/traverse.pyi @@ -0,0 +1,8 @@ +from typing import Any, Callable, Generator + +def top_down(brule, fns=...) -> Callable[..., Generator[Any, Any, None]]: + ... + +def sall(brule, fns=...) -> Callable[..., Generator[Any, Any, None]]: + ... + diff --git a/stubs/sympy-stubs/strategies/core.pyi b/stubs/sympy-stubs/strategies/core.pyi new file mode 100644 index 00000000..c39b710f --- /dev/null +++ b/stubs/sympy-stubs/strategies/core.pyi @@ -0,0 +1,38 @@ +from collections.abc import Callable, Mapping +from typing import Any, TypeVar + +_S = TypeVar('_S') +_T = TypeVar('_T') +def identity(x: _T) -> _T: + ... + +def exhaust(rule: Callable[[_T], _T]) -> Callable[[_T], _T]: + ... + +def memoize(rule: Callable[[_S], _T]) -> Callable[[_S], _T]: + ... + +def condition(cond: Callable[[_T], bool], rule: Callable[[_T], _T]) -> Callable[[_T], _T]: + ... + +def chain(*rules: Callable[[_T], _T]) -> Callable[[_T], _T]: + ... + +def debug(rule, file=...) -> Callable[..., Any]: + ... + +def null_safe(rule: Callable[[_T], _T | None]) -> Callable[[_T], _T]: + ... + +def tryit(rule: Callable[[_T], _T], exception) -> Callable[[_T], _T]: + ... + +def do_one(*rules: Callable[[_T], _T]) -> Callable[[_T], _T]: + ... + +def switch(key: Callable[[_S], _T], ruledict: Mapping[_T, Callable[[_S], _S]]) -> Callable[[_S], _S]: + ... + +def minimize(*rules: Callable[[_S], _T], objective=...) -> Callable[[_S], _T]: + ... + diff --git a/stubs/sympy-stubs/strategies/rl.pyi b/stubs/sympy-stubs/strategies/rl.pyi new file mode 100644 index 00000000..24ada2a5 --- /dev/null +++ b/stubs/sympy-stubs/strategies/rl.pyi @@ -0,0 +1,26 @@ +from typing import Any, Callable + +def rm_id(isid, new=...) -> Callable[..., Any]: + ... + +def glom(key, count, combine) -> Callable[..., Any]: + ... + +def sort(key, new=...) -> Callable[..., Any]: + ... + +def distribute(A, B) -> Callable[..., Any]: + ... + +def subs(a, b) -> Callable[..., Any]: + ... + +def unpack(expr): + ... + +def flatten(expr, new=...): + ... + +def rebuild(expr): + ... + diff --git a/stubs/sympy-stubs/strategies/tools.pyi b/stubs/sympy-stubs/strategies/tools.pyi new file mode 100644 index 00000000..203cbc30 --- /dev/null +++ b/stubs/sympy-stubs/strategies/tools.pyi @@ -0,0 +1,10 @@ +from typing import Any, Callable +def subs(d, **kwargs) -> Callable[[Any], Any] | Callable[..., Any]: + ... + +def canon(*rules, **kwargs) -> Callable[[Any], Any]: + ... + +def typed(ruletypes) -> Callable[[object], object]: + ... + diff --git a/stubs/sympy-stubs/strategies/traverse.pyi b/stubs/sympy-stubs/strategies/traverse.pyi new file mode 100644 index 00000000..1eff7215 --- /dev/null +++ b/stubs/sympy-stubs/strategies/traverse.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable + +def top_down(rule, fns=...) -> Callable[[Any], Any]: + ... + +def bottom_up(rule, fns=...) -> Callable[[Any], Any]: + ... + +def top_down_once(rule, fns=...) -> Callable[[Any], Any]: + ... + +def bottom_up_once(rule, fns=...) -> Callable[[Any], Any]: + ... + +def sall(rule, fns=...) -> Callable[..., Any]: + ... + diff --git a/stubs/sympy-stubs/strategies/tree.pyi b/stubs/sympy-stubs/strategies/tree.pyi new file mode 100644 index 00000000..a2006463 --- /dev/null +++ b/stubs/sympy-stubs/strategies/tree.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable, Generator +def treeapply(tree, join, leaf=...): + ... + +def greedy(tree, objective=..., **kwargs): + ... + +def allresults(tree, leaf=...): + ... + +def brute(tree, objective=..., **kwargs) -> Callable[..., Any]: + ... + diff --git a/stubs/sympy-stubs/tensor/__init__.pyi b/stubs/sympy-stubs/tensor/__init__.pyi new file mode 100644 index 00000000..878ada55 --- /dev/null +++ b/stubs/sympy-stubs/tensor/__init__.pyi @@ -0,0 +1,6 @@ +from sympy.tensor.indexed import Idx, Indexed, IndexedBase +from sympy.tensor.index_methods import get_contraction_structure, get_indices +from sympy.tensor.functions import shape +from sympy.tensor.array import Array, DenseNDimArray, ImmutableDenseNDimArray, ImmutableSparseNDimArray, MutableDenseNDimArray, MutableSparseNDimArray, NDimArray, SparseNDimArray, derive_by_array, permutedims, tensorcontraction, tensordiagonal, tensorproduct + +__all__ = ['IndexedBase', 'Idx', 'Indexed', 'get_contraction_structure', 'get_indices', 'shape', 'MutableDenseNDimArray', 'ImmutableDenseNDimArray', 'MutableSparseNDimArray', 'ImmutableSparseNDimArray', 'NDimArray', 'tensorproduct', 'tensorcontraction', 'tensordiagonal', 'derive_by_array', 'permutedims', 'Array', 'DenseNDimArray', 'SparseNDimArray'] diff --git a/stubs/sympy-stubs/tensor/array/__init__.pyi b/stubs/sympy-stubs/tensor/array/__init__.pyi new file mode 100644 index 00000000..3040031c --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/__init__.pyi @@ -0,0 +1,8 @@ +from sympy.tensor.array.dense_ndim_array import DenseNDimArray, ImmutableDenseNDimArray, MutableDenseNDimArray +from sympy.tensor.array.sparse_ndim_array import ImmutableSparseNDimArray, MutableSparseNDimArray, SparseNDimArray +from sympy.tensor.array.ndim_array import ArrayKind, NDimArray +from sympy.tensor.array.arrayop import derive_by_array, permutedims, tensorcontraction, tensordiagonal, tensorproduct +from sympy.tensor.array.array_comprehension import ArrayComprehension, ArrayComprehensionMap + +Array = ImmutableDenseNDimArray +__all__ = ['MutableDenseNDimArray', 'ImmutableDenseNDimArray', 'DenseNDimArray', 'MutableSparseNDimArray', 'ImmutableSparseNDimArray', 'SparseNDimArray', 'NDimArray', 'ArrayKind', 'tensorproduct', 'tensorcontraction', 'tensordiagonal', 'derive_by_array', 'permutedims', 'ArrayComprehension', 'ArrayComprehensionMap', 'Array'] diff --git a/stubs/sympy-stubs/tensor/array/array_comprehension.pyi b/stubs/sympy-stubs/tensor/array/array_comprehension.pyi new file mode 100644 index 00000000..09c5c3fc --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/array_comprehension.pyi @@ -0,0 +1,70 @@ +from typing import Any, Literal, Self +from sympy import ImmutableDenseNDimArray +from sympy.core import Basic +from sympy.matrices import Matrix + +class ArrayComprehension(Basic): + def __new__(cls, function, *symbols, **assumptions) -> Self: + ... + + @property + def function(self) -> Basic: + ... + + @property + def limits(self): + ... + + @property + def free_symbols(self) -> set[Basic] | set[Basic | Any]: + ... + + @property + def variables(self) -> list[Any]: + ... + + @property + def bound_symbols(self) -> list[Any]: + ... + + @property + def shape(self): + ... + + @property + def is_shape_numeric(self) -> bool: + ... + + def rank(self): + ... + + def __len__(self): + ... + + def doit(self, **hints) -> Self | ImmutableDenseNDimArray: + ... + + def tolist(self) -> list[Any]: + ... + + def tomatrix(self) -> Matrix: + ... + + + +def isLambda(v) -> Literal[False]: + ... + +class ArrayComprehensionMap(ArrayComprehension): + def __new__(cls, function, *symbols, **assumptions) -> Self: + ... + + @property + def func(self) -> type[Any]: + class _(ArrayComprehensionMap): + ... + + + + + diff --git a/stubs/sympy-stubs/tensor/array/array_derivatives.pyi b/stubs/sympy-stubs/tensor/array/array_derivatives.pyi new file mode 100644 index 00000000..d50dee0e --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/array_derivatives.pyi @@ -0,0 +1,13 @@ +from sympy.core.function import Derivative + +class ArrayDerivative(Derivative): + is_scalar = ... + def __new__(cls, expr, *variables, **kwargs) -> ArrayDerivative: + ... + + @property + def shape(self): + ... + + + diff --git a/stubs/sympy-stubs/tensor/array/arrayop.pyi b/stubs/sympy-stubs/tensor/array/arrayop.pyi new file mode 100644 index 00000000..23ad1d32 --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/arrayop.pyi @@ -0,0 +1,36 @@ +from typing import Any, Literal, Self +from sympy import Basic, Derivative, ImmutableDenseNDimArray, ImmutableSparseNDimArray, NDimArray +from sympy.core._print_helpers import Printable +from sympy.tensor.array.array_derivatives import ArrayDerivative +from sympy.tensor.array.expressions.array_expressions import ArrayContraction, ArrayDiagonal, ArrayTensorProduct, PermuteDims, ZeroArray + +def tensorproduct(*args) -> NDimArray | ImmutableDenseNDimArray | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ImmutableSparseNDimArray: + ... + +def tensorcontraction(array, *contraction_axes) -> Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | ImmutableDenseNDimArray | Any: + ... + +def tensordiagonal(array, *diagonal_axes) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayDiagonal | ImmutableDenseNDimArray | Any: + ... + +def derive_by_array(expr, dx) -> ImmutableDenseNDimArray | ImmutableSparseNDimArray | Any | ArrayDerivative | Derivative: + ... + +def permutedims(expr, perm=..., index_order_old=..., index_order_new=...) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + +class Flatten(Printable): + def __init__(self, iterable) -> None: + ... + + def __iter__(self) -> Self: + ... + + def __next__(self) -> Basic | Literal[0]: + ... + + def next(self) -> Basic | Literal[0]: + ... + + + diff --git a/stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi b/stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi new file mode 100644 index 00000000..6e806926 --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/dense_ndim_array.pyi @@ -0,0 +1,59 @@ +from typing import List, Self +from sympy import Indexed +from sympy.core.basic import Basic +from sympy.matrices import Matrix +from sympy.tensor.array.mutable_ndim_array import MutableNDimArray +from sympy.tensor.array.ndim_array import ArrayKind, ImmutableNDimArray, NDimArray + +class DenseNDimArray(NDimArray): + _array: List[Basic] + def __new__(self, *args, **kwargs) -> ImmutableDenseNDimArray: + ... + + @property + def kind(self) -> ArrayKind: + ... + + def __getitem__(self, index) -> Indexed | Self | Basic: + ... + + @classmethod + def zeros(cls, *shape): + ... + + def tomatrix(self) -> Matrix: + ... + + def reshape(self, *newshape) -> Self: + ... + + + +class ImmutableDenseNDimArray(DenseNDimArray, ImmutableNDimArray): + def __new__(cls, iterable, shape=..., **kwargs) -> Self: + ... + + def __setitem__(self, index, value): + ... + + def as_mutable(self) -> MutableDenseNDimArray: + ... + + + +class MutableDenseNDimArray(DenseNDimArray, MutableNDimArray): + def __new__(cls, iterable=..., shape=..., **kwargs) -> Self: + ... + + def __setitem__(self, index, value) -> None: + ... + + def as_immutable(self) -> ImmutableDenseNDimArray: + ... + + @property + def free_symbols(self) -> set[Basic]: + ... + + + diff --git a/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi b/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi new file mode 100644 index 00000000..70c1e765 --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/expressions/array_expressions.pyi @@ -0,0 +1,314 @@ +from ctypes import Array +import typing +from typing import Any, Generator, List, Optional, Self, Tuple as tTuple +from sympy import ImmutableSparseNDimArray, NDimArray +from sympy.core.basic import Basic +from sympy.core.containers import Tuple +from sympy.core.expr import Expr +from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray + +class _ArrayExpr(Expr): + shape: tTuple[Expr, ...] + def __getitem__(self, item) -> ArrayElement: + ... + + + +class ArraySymbol(_ArrayExpr): + def __new__(cls, symbol, shape: typing.Iterable) -> ArraySymbol: + ... + + @property + def name(self) -> Basic: + ... + + @property + def shape(self) -> Basic: + ... + + def as_explicit(self) -> ImmutableDenseNDimArray: + ... + + + +class ArrayElement(Expr): + _diff_wrt = ... + is_symbol = ... + is_commutative = ... + def __new__(cls, name, indices) -> Self: + ... + + @property + def name(self) -> Basic: + ... + + @property + def indices(self) -> Basic: + ... + + + +class ZeroArray(_ArrayExpr): + def __new__(cls, *shape) -> Self: + ... + + @property + def shape(self) -> tuple[Basic, ...]: + ... + + def as_explicit(self): + ... + + + +class OneArray(_ArrayExpr): + def __new__(cls, *shape) -> Self: + ... + + @property + def shape(self) -> tuple[Basic, ...]: + ... + + def as_explicit(self) -> ImmutableDenseNDimArray: + ... + + + +class _CodegenArrayAbstract(Basic): + @property + def subranks(self): + ... + + def subrank(self) -> int: + ... + + @property + def shape(self): + ... + + def doit(self, **hints): + ... + + + +class ArrayTensorProduct(_CodegenArrayAbstract): + def __new__(cls, *args, **kwargs) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | Self: + ... + + def as_explicit(self) -> NDimArray | ImmutableDenseNDimArray | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ImmutableSparseNDimArray: + ... + + + +class ArrayAdd(_CodegenArrayAbstract): + def __new__(cls, *args, **kwargs) -> ZeroArray | Self: + ... + + def as_explicit(self) -> Any: + ... + + + +class PermuteDims(_CodegenArrayAbstract): + def __new__(cls, expr, permutation=..., index_order_old=..., index_order_new=..., **kwargs) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | Self: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def permutation(self) -> Basic: + ... + + def nest_permutation(self) -> Self | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayAdd: + ... + + def as_explicit(self) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + + + +class ArrayDiagonal(_CodegenArrayAbstract): + def __new__(cls, expr, *diagonal_indices, **kwargs) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | Self: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def diagonal_indices(self) -> tuple[Basic, ...]: + ... + + def as_explicit(self) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayDiagonal | ImmutableDenseNDimArray | Any: + ... + + + +class ArrayElementwiseApplyFunc(_CodegenArrayAbstract): + def __new__(cls, function, element) -> Self: + ... + + @property + def function(self) -> Basic: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def shape(self): + ... + + def as_explicit(self): + ... + + + +class ArrayContraction(_CodegenArrayAbstract): + def __new__(cls, expr, *contraction_indices, **kwargs) -> Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | Self: + ... + + def __mul__(self, other) -> Self: + ... + + def __rmul__(self, other) -> Self: + ... + + def split_multiple_contractions(self) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + + def flatten_contraction_of_diagonal(self) -> Self | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims: + ... + + @property + def free_indices(self): + ... + + @property + def free_indices_to_position(self) -> dict[Any, Any]: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def contraction_indices(self) -> tuple[Basic, ...]: + ... + + def sort_args_by_name(self) -> Self | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims: + ... + + def as_explicit(self) -> Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | ImmutableDenseNDimArray | Any: + ... + + + +class Reshape(_CodegenArrayAbstract): + def __new__(cls, expr, shape) -> Self: + ... + + @property + def shape(self): + ... + + @property + def expr(self): + ... + + def doit(self, *args, **kwargs) -> Reshape: + ... + + def as_explicit(self) -> Self | Array: + ... + + + +class _ArgE: + indices: List[Optional[int]] + def __init__(self, element, indices: Optional[List[Optional[int]]] = ...) -> None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + + +class _IndPos: + def __init__(self, arg: int, rel: int) -> None: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + def __iter__(self) -> Generator[int, Any, None]: + ... + + + +class _EditArrayContraction: + def __init__(self, base_array: typing.Union[ArrayContraction, ArrayDiagonal, ArrayTensorProduct]) -> None: + ... + + def insert_after(self, arg: _ArgE, new_arg: _ArgE) -> None: + ... + + def get_new_contraction_index(self) -> int: + ... + + def refresh_indices(self) -> None: + ... + + def merge_scalars(self) -> None: + ... + + def to_array_contraction(self) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + + def get_contraction_indices(self) -> List[List[int]]: + ... + + def get_mapping_for_index(self, ind) -> List[_IndPos]: + ... + + def get_contraction_indices_to_ind_rel_pos(self) -> List[List[_IndPos]]: + ... + + def count_args_with_index(self, index: int) -> int: + ... + + def get_args_with_index(self, index: int) -> List[_ArgE]: + ... + + @property + def number_of_diagonal_indices(self) -> int: + ... + + def track_permutation_start(self) -> None: + ... + + def track_permutation_merge(self, destination: _ArgE, from_element: _ArgE) -> None: + ... + + def get_absolute_free_range(self, arg: _ArgE) -> typing.Tuple[int, int]: + ... + + def get_absolute_range(self, arg: _ArgE) -> typing.Tuple[int, int]: + ... + + + +def get_rank(expr) -> int: + ... + +def get_shape(expr) -> tuple[()]: + ... + +def nest_permutation(expr) -> PermuteDims | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | ArrayAdd: + ... + diff --git a/stubs/sympy-stubs/tensor/array/expressions/arrayexpr_derivatives.pyi b/stubs/sympy-stubs/tensor/array/expressions/arrayexpr_derivatives.pyi new file mode 100644 index 00000000..ef10b2b3 --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/expressions/arrayexpr_derivatives.pyi @@ -0,0 +1,86 @@ +from functools import singledispatch +from sympy import Basic +from sympy.core.expr import Expr +from sympy.matrices.expressions.hadamard import HadamardProduct +from sympy.matrices.expressions.inverse import Inverse +from sympy.matrices.expressions.matexpr import MatrixExpr, MatrixSymbol +from sympy.matrices.expressions.special import Identity, OneMatrix +from sympy.matrices.expressions.transpose import Transpose +from sympy.matrices.expressions.applyfunc import ElementwiseApplyFunction +from sympy.tensor.array.expressions.array_expressions import ArrayAdd, ArrayContraction, ArrayDiagonal, ArrayElementwiseApplyFunc, ArraySymbol, ArrayTensorProduct, PermuteDims, Reshape, _ArrayExpr, ZeroArray + +@singledispatch +def array_derive(expr, x): + ... + +@array_derive.register(Expr) +def _(expr: Expr, x: _ArrayExpr) -> ZeroArray: + ... + +@array_derive.register(ArrayTensorProduct) +def _(expr: ArrayTensorProduct, x: Expr) -> ZeroArray | ArrayAdd: + ... + +@array_derive.register(ArraySymbol) +def _(expr: ArraySymbol, x: _ArrayExpr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + +@array_derive.register(MatrixSymbol) +def _(expr: MatrixSymbol, x: _ArrayExpr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + +@array_derive.register(Identity) +def _(expr: Identity, x: _ArrayExpr) -> ZeroArray: + ... + +@array_derive.register(OneMatrix) +def _(expr: OneMatrix, x: _ArrayExpr) -> ZeroArray: + ... + +@array_derive.register(Transpose) +def _(expr: Transpose, x: Expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + +@array_derive.register(Inverse) +def _(expr: Inverse, x: Expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + +@array_derive.register(ElementwiseApplyFunction) +def _(expr: ElementwiseApplyFunction, x: Expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayDiagonal: + ... + +@array_derive.register(ArrayElementwiseApplyFunc) +def _(expr: ArrayElementwiseApplyFunc, x: Expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayDiagonal: + ... + +@array_derive.register(MatrixExpr) +def _(expr: MatrixExpr, x: Expr): + ... + +@array_derive.register(HadamardProduct) +def _(expr: HadamardProduct, x: Expr): + ... + +@array_derive.register(ArrayContraction) +def _(expr: ArrayContraction, x: Expr) -> Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims: + ... + +@array_derive.register(ArrayDiagonal) +def _(expr: ArrayDiagonal, x: Expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayDiagonal: + ... + +@array_derive.register(ArrayAdd) +def _(expr: ArrayAdd, x: Expr) -> ZeroArray | ArrayAdd: + ... + +@array_derive.register(PermuteDims) +def _(expr: PermuteDims, x: Expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + +@array_derive.register(Reshape) +def _(expr: Reshape, x: Expr) -> Reshape: + ... + +def matrix_derive(expr, x): + ... + diff --git a/stubs/sympy-stubs/tensor/array/expressions/from_array_to_indexed.pyi b/stubs/sympy-stubs/tensor/array/expressions/from_array_to_indexed.pyi new file mode 100644 index 00000000..b954638b --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/expressions/from_array_to_indexed.pyi @@ -0,0 +1,16 @@ +from sympy import Equality, Mul, Ne, Sum +from sympy.core.add import Add +from sympy.core.relational import Relational +from sympy.tensor.array.expressions.array_expressions import ArrayElement +def convert_array_to_indexed(expr, indices) -> Mul | Equality | Relational | Ne | Sum | Add | ArrayElement: + ... + +class _ConvertArrayToIndexed: + def __init__(self) -> None: + ... + + def do_convert(self, expr, indices) -> Mul | Equality | Relational | Ne | Sum | Add | ArrayElement: + ... + + + diff --git a/stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi b/stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi new file mode 100644 index 00000000..ea655d5a --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/expressions/from_array_to_matrix.pyi @@ -0,0 +1,90 @@ +from functools import singledispatch +from trace import Trace +from typing import Any, List, Union as tUnion +from sympy import Basic, MatAdd, MatrixExpr, Mul, Transpose, ZeroMatrix +from sympy.matrices.expressions.applyfunc import ElementwiseApplyFunction +from sympy.matrices.expressions.matexpr import MatrixElement +from sympy.matrices.expressions.special import GenericIdentity, GenericZeroMatrix +from sympy.series.order import Order +from sympy.tensor.array.expressions.array_expressions import ArrayAdd, ArrayContraction, ArrayDiagonal, ArrayElement, ArrayElementwiseApplyFunc, ArrayTensorProduct, PermuteDims, ZeroArray + +@singledispatch +def _array2matrix(expr) -> Any: + ... + +@_array2matrix.register(ZeroArray) +def _(expr: ZeroArray) -> ZeroMatrix | ZeroArray: + ... + +@_array2matrix.register(ArrayTensorProduct) +def _(expr: ArrayTensorProduct) -> Mul | ArrayTensorProduct: + ... + +@_array2matrix.register(ArrayContraction) +def _(expr: ArrayContraction) -> GenericIdentity | Order | object | Mul | ArrayTensorProduct | ZeroArray | ArrayContraction | Basic | PermuteDims | Trace | None: + ... + +@_array2matrix.register(ArrayDiagonal) +def _(expr: ArrayDiagonal) -> ArrayDiagonal: + ... + +@_array2matrix.register(PermuteDims) +def _(expr: PermuteDims) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | Any | Transpose | Mul: + ... + +@_array2matrix.register(ArrayAdd) +def _(expr: ArrayAdd) -> MatAdd | GenericZeroMatrix | ZeroArray | ArrayAdd: + ... + +@_array2matrix.register(ArrayElementwiseApplyFunc) +def _(expr: ArrayElementwiseApplyFunc) -> MatrixExpr | ElementwiseApplyFunction | ArrayElementwiseApplyFunc: + ... + +@_array2matrix.register(ArrayElement) +def _(expr: ArrayElement) -> MatrixElement | ArrayElement: + ... + +@singledispatch +def _remove_trivial_dims(expr) -> Any: + ... + +@_remove_trivial_dims.register(ArrayTensorProduct) +def _(expr: ArrayTensorProduct) -> tuple[ArrayTensorProduct | Mul, List[int] | list[Any]]: + ... + +@_remove_trivial_dims.register(ArrayAdd) +def _(expr: ArrayAdd) -> tuple[ArrayAdd, list[Any]] | tuple[ArrayAdd, Any] | tuple[MatAdd | Any | GenericZeroMatrix | ZeroArray | ArrayAdd, Any]: + ... + +@_remove_trivial_dims.register(PermuteDims) +def _(expr: PermuteDims) -> tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, List[int] | list[Any]]: + ... + +@_remove_trivial_dims.register(ArrayContraction) +def _(expr: ArrayContraction) -> tuple[Any, List[int]] | tuple[Basic | Any | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims, list[int]]: + ... + +@_remove_trivial_dims.register(ArrayDiagonal) +def _(expr: ArrayDiagonal) -> tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, List[int]] | tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, list[Any]]: + ... + +@_remove_trivial_dims.register(ElementwiseApplyFunction) +def _(expr: ElementwiseApplyFunction) -> tuple[Any, list[Any]] | tuple[MatrixExpr | ElementwiseApplyFunction, list[Any]]: + ... + +@_remove_trivial_dims.register(ArrayElementwiseApplyFunc) +def _(expr: ArrayElementwiseApplyFunc) -> tuple[ArrayElementwiseApplyFunc, list[Any]]: + ... + +def convert_array_to_matrix(expr): + ... + +def identify_hadamard_products(expr: tUnion[ArrayContraction, ArrayDiagonal]) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + +def identify_removable_identity_matrices(expr) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims: + ... + +def remove_identity_matrices(expr: ArrayContraction) -> tuple[Any | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims, list[int]]: + ... + diff --git a/stubs/sympy-stubs/tensor/array/expressions/from_indexed_to_array.pyi b/stubs/sympy-stubs/tensor/array/expressions/from_indexed_to_array.pyi new file mode 100644 index 00000000..3d3476aa --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/expressions/from_indexed_to_array.pyi @@ -0,0 +1,6 @@ +from sympy import Basic, Pow +from sympy.functions.special.tensor_functions import KroneckerDelta +from sympy.tensor.array.expressions.array_expressions import ArrayAdd, ArrayContraction, ArrayDiagonal, ArrayElement, ArrayElementwiseApplyFunc, ArrayTensorProduct, PermuteDims, ZeroArray +def convert_indexed_to_array(expr, first_indices=...) -> ArrayElement | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | ArrayDiagonal | KroneckerDelta | ArrayAdd | ArrayElementwiseApplyFunc | Pow: + ... + diff --git a/stubs/sympy-stubs/tensor/array/mutable_ndim_array.pyi b/stubs/sympy-stubs/tensor/array/mutable_ndim_array.pyi new file mode 100644 index 00000000..7bd142be --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/mutable_ndim_array.pyi @@ -0,0 +1,12 @@ +from typing import Self +from sympy.tensor.array.ndim_array import NDimArray + +class MutableNDimArray(NDimArray): + def as_immutable(self): + ... + + def as_mutable(self) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/tensor/array/ndim_array.pyi b/stubs/sympy-stubs/tensor/array/ndim_array.pyi new file mode 100644 index 00000000..5d006289 --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/ndim_array.pyi @@ -0,0 +1,101 @@ +from types import NotImplementedType +from typing import Any, Generator, Self +from sympy import ImmutableDenseNDimArray, ImmutableSparseNDimArray +from sympy.core.basic import Basic +from sympy.core.function import UndefinedFunction +from sympy.core.kind import Kind +from sympy.printing.defaults import Printable +from sympy.tensor.array.array_derivatives import ArrayDerivative +from sympy.tensor.array.expressions.array_expressions import ArrayContraction, ArrayTensorProduct, PermuteDims, ZeroArray + +class ArrayKind(Kind): + def __new__(cls, element_kind=...) -> Self: + ... + + def __repr__(self): + ... + + + +class NDimArray(Printable): + _diff_wrt = ... + is_scalar = ... + def __new__(cls, iterable, shape=..., **kwargs) -> ImmutableDenseNDimArray: + ... + + def __getitem__(self, index): + ... + + def __len__(self): + ... + + @property + def shape(self): + ... + + def rank(self): + ... + + def diff(self, *args, **kwargs) -> ArrayDerivative: + ... + + def applyfunc(self, f) -> ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + + def tolist(self) -> list[Any]: + ... + + def __add__(self, other) -> NotImplementedType | Self: + ... + + def __sub__(self, other) -> NotImplementedType | Self: + ... + + def __mul__(self, other) -> ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + + def __rmul__(self, other) -> ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + + def __truediv__(self, other) -> ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + + def __rtruediv__(self, other): + ... + + def __neg__(self) -> ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + + def __iter__(self) -> Generator[Any, Any, None]: + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + def transpose(self) -> ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ImmutableSparseNDimArray | ImmutableDenseNDimArray: + ... + + def conjugate(self): + ... + + def adjoint(self) -> type[UndefinedFunction]: + ... + + + +class ImmutableNDimArray(NDimArray, Basic): + _op_priority = ... + def __hash__(self) -> int: + ... + + def as_immutable(self) -> Self: + ... + + def as_mutable(self): + ... + + + diff --git a/stubs/sympy-stubs/tensor/array/sparse_ndim_array.pyi b/stubs/sympy-stubs/tensor/array/sparse_ndim_array.pyi new file mode 100644 index 00000000..0174f7e4 --- /dev/null +++ b/stubs/sympy-stubs/tensor/array/sparse_ndim_array.pyi @@ -0,0 +1,53 @@ +from typing import Any, Self +from sympy import Indexed +from sympy.matrices import SparseMatrix +from sympy.tensor.array.mutable_ndim_array import MutableNDimArray +from sympy.tensor.array.ndim_array import ImmutableNDimArray, NDimArray + +class SparseNDimArray(NDimArray): + def __new__(self, *args, **kwargs) -> ImmutableSparseNDimArray: + ... + + def __getitem__(self, index) -> Indexed | Self: + ... + + @classmethod + def zeros(cls, *shape) -> Self: + ... + + def tomatrix(self) -> SparseMatrix: + ... + + def reshape(self, *newshape) -> Self: + ... + + + +class ImmutableSparseNDimArray(SparseNDimArray, ImmutableNDimArray): + def __new__(cls, iterable=..., shape=..., **kwargs) -> Self: + ... + + def __setitem__(self, index, value): + ... + + def as_mutable(self) -> MutableSparseNDimArray: + ... + + + +class MutableSparseNDimArray(MutableNDimArray, SparseNDimArray): + def __new__(cls, iterable=..., shape=..., **kwargs) -> Self: + ... + + def __setitem__(self, index, value) -> None: + ... + + def as_immutable(self) -> ImmutableSparseNDimArray: + ... + + @property + def free_symbols(self) -> set[Any]: + ... + + + diff --git a/stubs/sympy-stubs/tensor/functions.pyi b/stubs/sympy-stubs/tensor/functions.pyi new file mode 100644 index 00000000..6c18698f --- /dev/null +++ b/stubs/sympy-stubs/tensor/functions.pyi @@ -0,0 +1,30 @@ +from functools import singledispatch +from typing import Self +from sympy import Mul +from sympy.core.expr import Expr + +class TensorProduct(Expr): + is_number = ... + def __new__(cls, *args, **kwargs) -> Self: + ... + + def rank(self) -> int: + ... + + @property + def shape(self) -> tuple[()]: + ... + + def __getitem__(self, index) -> Mul: + ... + + + +@singledispatch +def shape(expr): + ... + +class NoShapeError(Exception): + ... + + diff --git a/stubs/sympy-stubs/tensor/index_methods.pyi b/stubs/sympy-stubs/tensor/index_methods.pyi new file mode 100644 index 00000000..a9f18a27 --- /dev/null +++ b/stubs/sympy-stubs/tensor/index_methods.pyi @@ -0,0 +1,15 @@ +from typing import Any +from sympy import Idx, Indexed, Piecewise +from sympy.core.function import Function +from sympy.functions.elementary.exponential import exp + +class IndexConformanceException(Exception): + ... + + +def get_indices(expr) -> tuple[set[Any], dict[Any, Any]] | tuple[set[Idx], dict[Any, Any]] | tuple[set[Any], dict[Any, Any], tuple[Any, ...]] | tuple[Any, Any | dict[Any, Any]] | tuple[Any, dict[Any, Any]] | tuple[set[Any] | Any, Any]: + ... + +def get_contraction_structure(expr) -> dict[tuple[Any, ...] | None, set[Indexed]] | dict[None, set[Any]] | dict[tuple[Any, ...] | None, set[Any]] | dict[None, set[Any | exp]] | dict[Any, Any] | dict[None, Piecewise] | dict[None, set[Function]]: + ... + diff --git a/stubs/sympy-stubs/tensor/indexed.pyi b/stubs/sympy-stubs/tensor/indexed.pyi new file mode 100644 index 00000000..8c963434 --- /dev/null +++ b/stubs/sympy-stubs/tensor/indexed.pyi @@ -0,0 +1,123 @@ +from typing import Any, Self, Tuple +from sympy import Basic, MatrixBase, NDimArray +from sympy.core import Expr +from sympy.utilities.iterables import NotIterable + +class IndexException(Exception): + ... + + +class Indexed(Expr): + is_commutative = ... + is_Indexed = ... + is_symbol = ... + is_Atom = ... + def __new__(cls, base, *args, **kw_args) -> Self: + ... + + @property + def name(self) -> str: + ... + + @property + def assumptions0(self) -> dict[Any, Any]: + ... + + @property + def base(self) -> Basic: + ... + + @property + def indices(self) -> tuple[Basic, ...]: + ... + + @property + def rank(self) -> int: + ... + + @property + def shape(self) -> Tuple: + ... + + @property + def ranges(self) -> list[Any]: + ... + + @property + def free_symbols(self) -> set[Self | Basic] | set[Basic]: + ... + + @property + def expr_free_symbols(self) -> set[Self]: + ... + + + +class IndexedBase(Expr, NotIterable): + is_commutative = ... + is_symbol = ... + is_Atom = ... + def __new__(cls, label, shape=..., *, offset=..., strides=..., **kw_args) -> MatrixBase | NDimArray | Self: + ... + + @property + def name(self): + ... + + @property + def assumptions0(self) -> dict[Any, Any]: + ... + + def __getitem__(self, indices, **kw_args) -> Indexed: + ... + + @property + def shape(self): + ... + + @property + def strides(self): + ... + + @property + def offset(self): + ... + + @property + def label(self) -> Basic: + ... + + + +class Idx(Expr): + is_integer = ... + is_finite = ... + is_real = ... + is_symbol = ... + is_Atom = ... + _diff_wrt = ... + def __new__(cls, label, range=..., **kw_args) -> Self: + ... + + @property + def label(self) -> Basic: + ... + + @property + def lower(self) -> None: + ... + + @property + def upper(self) -> None: + ... + + @property + def name(self) -> str: + ... + + @property + def free_symbols(self) -> set[Self]: + ... + + + diff --git a/stubs/sympy-stubs/tensor/tensor.pyi b/stubs/sympy-stubs/tensor/tensor.pyi new file mode 100644 index 00000000..76ee480e --- /dev/null +++ b/stubs/sympy-stubs/tensor/tensor.pyi @@ -0,0 +1,869 @@ +from types import NotImplementedType +from typing import Any, Callable, Generator, Literal, LiteralString, Self +from abc import ABC, abstractmethod +from sympy import ImmutableDenseNDimArray, ImmutableSparseNDimArray, Indexed, MutableDenseNDimArray +from sympy.combinatorics.permutations import Perm +from sympy.core import Basic, Expr +from sympy.core.containers import Tuple +from sympy.core.sympify import CantSympify +from sympy.core.operations import AssocOp +from sympy.matrices import Matrix +from sympy.tensor.array.expressions.array_expressions import ArrayContraction, ArrayElement, ArrayTensorProduct, PermuteDims, ZeroArray +from sympy.utilities.decorator import deprecated, memoize_property + +def deprecate_data() -> None: + ... + +def deprecate_fun_eval() -> None: + ... + +def deprecate_call() -> None: + ... + +class _IndexStructure(CantSympify): + def __init__(self, free, dum, index_types, indices, canon_bp=...) -> None: + ... + + @staticmethod + def from_indices(*indices) -> _IndexStructure: + ... + + @staticmethod + def from_components_free_dum(components, free, dum) -> _IndexStructure: + ... + + def get_indices(self): + ... + + @staticmethod + def generate_indices_from_free_dum_index_types(free, dum, index_types) -> list[Any]: + ... + + def get_free_indices(self) -> list[TensorIndex]: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> LiteralString: + ... + + def perm2tensor(self, g, is_canon_bp=...) -> _IndexStructure: + ... + + def indices_canon_args(self) -> tuple[Perm, list[Any], list[Any]]: + ... + + + +def components_canon_args(components) -> list[Any]: + ... + +class _TensorDataLazyEvaluator(CantSympify): + _substitutions_dict: dict[Any, Any] = ... + _substitutions_dict_tensmul: dict[Any, Any] = ... + def __getitem__(self, key) -> Any | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | Indexed | ImmutableDenseNDimArray | None: + ... + + @staticmethod + def data_contract_dum(ndarray_list, dum, ext_rank) -> Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | ImmutableDenseNDimArray | Any: + ... + + def data_tensorhead_from_tensmul(self, data, tensmul, tensorhead) -> Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | ImmutableDenseNDimArray | Any | None: + ... + + def data_from_tensor(self, tensor) -> Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | ImmutableDenseNDimArray | Any | None: + ... + + def __setitem__(self, key, value) -> None: + ... + + def __delitem__(self, key) -> None: + ... + + def __contains__(self, key) -> bool: + ... + + def add_metric_data(self, metric, data) -> None: + ... + + @staticmethod + def inverse_matrix(ndarray) -> MutableDenseNDimArray: + ... + + @staticmethod + def inverse_transpose_matrix(ndarray) -> MutableDenseNDimArray: + ... + + @staticmethod + def add_rearrange_tensmul_parts(new_tensmul, old_tensmul) -> None: + ... + + @staticmethod + def parse_data(data) -> MutableDenseNDimArray: + ... + + + +_tensor_data_substitution_dict = ... +class _TensorManager: + def __init__(self) -> None: + ... + + @property + def comm(self) -> list[dict[Any, Any]]: + ... + + def comm_symbols2i(self, i) -> int: + ... + + def comm_i2symbol(self, i) -> int: + ... + + def set_comm(self, i, j, c) -> None: + ... + + def set_comms(self, *args) -> None: + ... + + def get_comm(self, i, j): + ... + + def clear(self) -> None: + ... + + + +TensorManager = ... +class TensorIndexType(Basic): + def __new__(cls, name, dummy_name=..., dim=..., eps_dim=..., metric_symmetry=..., metric_name=..., **kwargs) -> Self: + ... + + @property + def name(self): + ... + + @property + def dummy_name(self): + ... + + @property + def dim(self) -> Basic: + ... + + @property + def eps_dim(self) -> Basic: + ... + + @memoize_property + def metric(self) -> TensorHead | None: + ... + + @memoize_property + def delta(self) -> TensorHead: + ... + + @memoize_property + def epsilon(self) -> TensorHead | None: + ... + + def set_metric(self, tensor) -> None: + ... + + def __lt__(self, other) -> bool: + ... + + def __str__(self) -> str: + ... + + __repr__ = ... + @property + def data(self) -> Any | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | Indexed | ImmutableDenseNDimArray | None: + ... + + @data.setter + def data(self, data) -> None: + ... + + @data.deleter + def data(self) -> None: + ... + + def get_kronecker_delta(self) -> TensorHead: + ... + + def get_epsilon(self) -> TensorHead | None: + ... + + + +class TensorIndex(Basic): + def __new__(cls, name, tensor_index_type, is_up=...) -> Self: + ... + + @property + def name(self): + ... + + @property + def tensor_index_type(self) -> Basic: + ... + + @property + def is_up(self) -> Basic: + ... + + def __lt__(self, other) -> bool: + ... + + def __neg__(self) -> TensorIndex: + ... + + + +def tensor_indices(s, typ) -> TensorIndex | list[TensorIndex]: + ... + +class TensorSymmetry(Basic): + def __new__(cls, *args, **kw_args) -> Self: + ... + + @property + def base(self) -> Basic: + ... + + @property + def generators(self) -> Basic: + ... + + @property + def rank(self): + ... + + @classmethod + def fully_symmetric(cls, rank) -> TensorSymmetry: + ... + + @classmethod + def direct_product(cls, *args) -> TensorSymmetry: + ... + + @classmethod + def riemann(cls) -> TensorSymmetry: + ... + + @classmethod + def no_symmetry(cls, rank) -> TensorSymmetry: + ... + + + +def tensorsymmetry(*args) -> TensorSymmetry: + ... + +@deprecated("TensorType is deprecated. Use tensor_heads() instead.", deprecated_since_version="1.5", active_deprecations_target="deprecated-tensortype") +class TensorType(Basic): + is_commutative = ... + def __new__(cls, index_types, symmetry, **kw_args) -> Self: + ... + + @property + def index_types(self) -> Basic: + ... + + @property + def symmetry(self) -> Basic: + ... + + @property + def types(self): + ... + + def __str__(self) -> str: + ... + + def __call__(self, s, comm=...) -> TensorHead | list[TensorHead]: + ... + + + +def tensorhead(name, typ, sym=..., comm=...) -> TensorHead: + ... + +class TensorHead(Basic): + is_commutative = ... + def __new__(cls, name, index_types, symmetry=..., comm=...) -> Self: + ... + + @property + def name(self): + ... + + @property + def index_types(self) -> list[Any]: + ... + + @property + def symmetry(self) -> Basic: + ... + + @property + def rank(self) -> int: + ... + + def __lt__(self, other) -> bool: + ... + + def commutes_with(self, other): + ... + + def __call__(self, *indices, **kw_args) -> TensExpr: + ... + + def __pow__(self, other): + ... + + @property + def data(self) -> Any | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | Indexed | ImmutableDenseNDimArray | None: + ... + + @data.setter + def data(self, data) -> None: + ... + + @data.deleter + def data(self) -> None: + ... + + def __iter__(self) -> Generator[Any, Any, None] | Any: + ... + + + +def tensor_heads(s, index_types, symmetry=..., comm=...) -> TensorHead | list[TensorHead]: + ... + +class TensExpr(Expr, ABC): + _op_priority = ... + is_commutative = ... + def __neg__(self): + ... + + def __abs__(self): + ... + + def __add__(self, other) -> Basic | TensExpr | TensMul | Expr | TensAdd: + ... + + def __radd__(self, other) -> Basic | TensExpr | TensMul | Expr | TensAdd: + ... + + def __sub__(self, other) -> Basic | TensExpr | TensMul | Expr | TensAdd: + ... + + def __rsub__(self, other) -> Basic | TensExpr | TensMul | Expr | TensAdd: + ... + + def __mul__(self, other) -> TensExpr | TensMul: + ... + + def __rmul__(self, other) -> TensExpr | TensMul: + ... + + def __truediv__(self, other) -> TensExpr | TensMul: + ... + + def __rtruediv__(self, other): + ... + + def __pow__(self, other): + ... + + def __rpow__(self, other): + ... + + @property + @abstractmethod + def nocoeff(self): + ... + + @property + @abstractmethod + def coeff(self): + ... + + @abstractmethod + def get_indices(self): + ... + + @abstractmethod + def get_free_indices(self) -> list[TensorIndex]: + ... + + def fun_eval(self, *index_tuples): + ... + + def get_matrix(self) -> Matrix: + ... + + def expand(self, **hints) -> Self: + ... + + def replace_with_arrays(self, replacement_dict, indices=...) -> ArrayElement | Indexed | ImmutableSparseNDimArray | ImmutableDenseNDimArray | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims: + ... + + + +class TensAdd(TensExpr, AssocOp): + def __new__(cls, *args, **kw_args) -> Self: + ... + + @property + def coeff(self): + ... + + @property + def nocoeff(self) -> Self: + ... + + def get_free_indices(self) -> list[TensorIndex]: + ... + + @memoize_property + def rank(self) -> Literal[0]: + ... + + @memoize_property + def free_args(self) -> list[Any]: + ... + + @memoize_property + def free_indices(self) -> list[TensorIndex] | set[Any]: + ... + + def doit(self, **hints) -> Basic | TensExpr | TensMul | Expr | Self: + ... + + def get_indices(self) -> list[Any]: + ... + + def __call__(self, *indices) -> Self | Basic | TensExpr | TensMul | Expr | TensAdd: + ... + + def canon_bp(self) -> Basic | TensExpr | TensMul | Expr | TensAdd: + ... + + def equals(self, other) -> bool | NotImplementedType: + ... + + def __getitem__(self, item) -> Any | ArrayElement | Indexed | ImmutableDenseNDimArray | Basic: + ... + + def contract_delta(self, delta) -> TensMul | TensExpr | Basic | Expr | TensAdd: + ... + + def contract_metric(self, g) -> TensMul | TensExpr | Basic | Expr | TensAdd: + ... + + def substitute_indices(self, *index_tuples) -> Basic | TensExpr | TensMul | Expr | TensAdd: + ... + + @property + def data(self) -> Any | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | Indexed | ImmutableDenseNDimArray | None: + ... + + @data.setter + def data(self, data) -> None: + ... + + @data.deleter + def data(self) -> None: + ... + + def __iter__(self) -> Any: + ... + + + +class Tensor(TensExpr): + is_commutative = ... + _index_structure: _IndexStructure = ... + args: tuple[TensorHead, Tuple] + def __new__(cls, tensor_head, indices, *, is_canon_bp=..., **kw_args) -> Self: + ... + + @property + def free(self): + ... + + @property + def dum(self): + ... + + @property + def ext_rank(self): + ... + + @property + def coeff(self): + ... + + @property + def nocoeff(self): + ... + + @property + def component(self): + ... + + @property + def components(self): + ... + + @property + def head(self) -> TensorHead: + ... + + @property + def indices(self) -> Tuple: + ... + + @property + def free_indices(self) -> set[TensorIndex]: + ... + + @property + def index_types(self) -> list[Any]: + ... + + @property + def rank(self) -> int: + ... + + def doit(self, **hints) -> TensExpr: + ... + + @property + def free_in_args(self) -> list[tuple[Any, Any, Literal[0]]]: + ... + + @property + def dum_in_args(self) -> list[tuple[Any, Any, Literal[0], Literal[0]]]: + ... + + @property + def free_args(self) -> list[Any]: + ... + + def commutes_with(self, other) -> type[NotImplementedError] | Literal[0]: + ... + + def perm2tensor(self, g, is_canon_bp=...) -> TensExpr: + ... + + def canon_bp(self) -> Self | TensExpr: + ... + + def split(self) -> list[Self]: + ... + + def sorted_components(self) -> Self: + ... + + def get_indices(self) -> list[TensorIndex]: + ... + + def get_free_indices(self) -> list[TensorIndex]: + ... + + def as_base_exp(self) -> tuple[Self, Any]: + ... + + def substitute_indices(self, *index_tuples) -> TensExpr: + ... + + def __call__(self, *indices) -> Self | TensExpr: + ... + + def __iter__(self) -> Generator[Any, Any, None] | Any: + ... + + def __getitem__(self, item) -> Any | ArrayElement | Indexed | ImmutableDenseNDimArray | Basic: + ... + + @property + def data(self) -> Any | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | Indexed | ImmutableDenseNDimArray | None: + ... + + @data.setter + def data(self, data) -> None: + ... + + @data.deleter + def data(self) -> None: + ... + + def equals(self, other) -> bool: + ... + + def contract_metric(self, g) -> Self: + ... + + def contract_delta(self, metric) -> Self: + ... + + + +class TensMul(TensExpr, AssocOp): + identity = ... + _index_structure: _IndexStructure = ... + def __new__(cls, *args, **kw_args) -> Self: + ... + + index_types = ... + free = ... + dum = ... + free_indices = ... + rank = ... + ext_rank = ... + def doit(self, **hints) -> TensExpr | Self: + ... + + @staticmethod + def from_data(coeff, components, free, dum, **kw_args) -> TensExpr | TensMul: + ... + + @property + def free_args(self) -> list[Any]: + ... + + @property + def components(self) -> list[Any]: + ... + + @property + def free_in_args(self) -> list[tuple[Any, Any, Any]]: + ... + + @property + def coeff(self): + ... + + @property + def nocoeff(self) -> TensExpr | Self: + ... + + @property + def dum_in_args(self) -> list[tuple[Any, Any, Any, Any]]: + ... + + def equals(self, other): + ... + + def get_indices(self): + ... + + def get_free_indices(self) -> list[TensorIndex]: + ... + + def split(self) -> list[Self] | list[Any]: + ... + + def __neg__(self) -> TensExpr | TensMul: + ... + + def __getitem__(self, item) -> Any | ArrayElement | Indexed | ImmutableDenseNDimArray | Basic: + ... + + def sorted_components(self) -> TensExpr | TensMul: + ... + + def perm2tensor(self, g, is_canon_bp=...) -> TensExpr | TensMul: + ... + + def canon_bp(self) -> Self | TensMul | TensExpr: + ... + + def contract_delta(self, delta): + ... + + def contract_metric(self, g): + ... + + def substitute_indices(self, *index_tuples) -> TensExpr | TensMul: + ... + + def __call__(self, *indices) -> Self | TensExpr | TensMul: + ... + + @property + def data(self) -> Any | Basic | ZeroArray | ArrayTensorProduct | ArrayContraction | PermuteDims | Indexed | ImmutableDenseNDimArray | None: + ... + + @data.setter + def data(self, data): + ... + + @data.deleter + def data(self): + ... + + def __iter__(self) -> Generator[Any, Any, None] | Any: + ... + + + +class TensorElement(TensExpr): + def __new__(cls, expr, index_map) -> TensExpr | Tensor | Self: + ... + + @property + def free(self) -> list[tuple[Any, int]]: + ... + + @property + def dum(self) -> list[Any]: + ... + + @property + def expr(self) -> Basic: + ... + + @property + def index_map(self) -> Basic: + ... + + @property + def coeff(self): + ... + + @property + def nocoeff(self) -> Self: + ... + + def get_free_indices(self): + ... + + def get_indices(self): + ... + + + +class WildTensorHead(TensorHead): + def __new__(cls, name, index_types=..., symmetry=..., comm=..., unordered_indices=...) -> Self: + ... + + def __call__(self, *indices, **kwargs) -> TensExpr: + ... + + + +class WildTensor(Tensor): + def __new__(cls, tensor_head, indices, **kw_args) -> Tensor | Self: + ... + + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + + +class WildTensorIndex(TensorIndex): + def __new__(cls, name, tensor_index_type, is_up=..., ignore_updown=...) -> Self: + ... + + @property + def ignore_updown(self) -> Basic: + ... + + def __neg__(self) -> WildTensorIndex: + ... + + def matches(self, expr, repl_dict=..., old=...) -> dict[Any, Any] | None: + ... + + + +class _WildTensExpr(Basic): + def __init__(self, expr) -> None: + ... + + def __call__(self, *indices) -> TensExpr: + ... + + def __neg__(self) -> Self: + ... + + def __abs__(self): + ... + + def __add__(self, other) -> Self: + ... + + def __radd__(self, other) -> Self: + ... + + def __sub__(self, other): + ... + + def __rsub__(self, other): + ... + + def __mul__(self, other): + ... + + def __rmul__(self, other): + ... + + def __truediv__(self, other): + ... + + def __rtruediv__(self, other): + ... + + def __pow__(self, other): + ... + + def __rpow__(self, other): + ... + + + +def canon_bp(p): + ... + +def tensor_mul(*a) -> TensExpr | TensMul: + ... + +def riemann_cyclic_replace(t_r): + ... + +def riemann_cyclic(t2) -> TensMul | TensExpr | Basic | Expr | TensAdd: + ... + +def get_lines(ex, index_type) -> tuple[list[Any], list[Any], list[int]]: + ... + +def get_free_indices(t) -> tuple[()] | list[TensorIndex]: + ... + +def get_indices(t) -> tuple[()]: + ... + +def get_dummy_indices(t) -> tuple[()] | list[Any]: + ... + +def get_index_structure(t) -> _IndexStructure: + ... + +def get_coeff(t): + ... + +def contract_metric(t, g): + ... + +def perm2tensor(t, g, is_canon_bp=...) -> TensExpr | TensMul: + ... + +def substitute_indices(t, *index_tuples): + ... + diff --git a/stubs/sympy-stubs/testing/__init__.pyi b/stubs/sympy-stubs/testing/__init__.pyi new file mode 100644 index 00000000..0c77e3e5 --- /dev/null +++ b/stubs/sympy-stubs/testing/__init__.pyi @@ -0,0 +1,3 @@ +from sympy.testing.runtests import doctest + +__all__ = ['doctest'] diff --git a/stubs/sympy-stubs/testing/runtests.pyi b/stubs/sympy-stubs/testing/runtests.pyi new file mode 100644 index 00000000..b945c2d1 --- /dev/null +++ b/stubs/sympy-stubs/testing/runtests.pyi @@ -0,0 +1,174 @@ +import doctest as pdoctest +from doctest import DocTestFinder, DocTestRunner +from contextlib import contextmanager +from typing import Any, Generator, Literal + +IS_WINDOWS = ... +ON_CI = ... +SPLIT_DENSITY = ... +SPLIT_DENSITY_SLOW = ... +class Skipped(Exception): + ... + + +class TimeOutError(Exception): + ... + + +class DependencyError(Exception): + ... + + +if IS_WINDOWS: + ... +def convert_to_native_paths(lst) -> list[Any]: + ... + +def get_sympy_dir() -> str: + ... + +def setup_pprint() -> bool: + ... + +@contextmanager +def raise_on_deprecated() -> Generator[None, Any, None]: + ... + +def run_in_subprocess_with_hash_randomization(function, function_args=..., function_kwargs=..., command=..., module=..., force=...) -> int | Any | Literal[False]: + ... + +def run_all_tests(test_args=..., test_kwargs=..., doctest_args=..., doctest_kwargs=..., examples_args=..., examples_kwargs=...) -> None: + ... + +def test(*paths, subprocess=..., rerun=..., **kwargs) -> bool | None: + ... + +def doctest(*paths, subprocess=..., rerun=..., **kwargs) -> bool | None: + ... + +sp = ... +def split_list(l, split, density=...): + ... + +SymPyTestResults = ... +def sympytestfile(filename, module_relative=..., name=..., package=..., globs=..., verbose=..., report=..., optionflags=..., extraglobs=..., raise_on_error=..., parser=..., encoding=...) -> SymPyTestResults: + ... + +class SymPyTests: + def __init__(self, reporter, kw=..., post_mortem=..., seed=..., fast_threshold=..., slow_threshold=...) -> None: + ... + + def test(self, sort=..., timeout=..., slow=..., enhance_asserts=..., fail_on_timeout=...): + ... + + def test_file(self, filename, sort=..., timeout=..., slow=..., enhance_asserts=..., fail_on_timeout=...): + ... + + def matches(self, x) -> bool: + ... + + def get_test_files(self, dir, pat=...) -> list[Any]: + ... + + + +class SymPyDocTests: + def __init__(self, reporter, normal) -> None: + ... + + def test(self): + ... + + def test_file(self, filename) -> None: + ... + + def get_test_files(self, dir, pat=..., init_only=...) -> list[Any]: + ... + + + +class SymPyDocTestFinder(DocTestFinder): + ... + + +class SymPyDocTestRunner(DocTestRunner): + def run(self, test, compileflags=..., out=..., clear_globs=...): + ... + + + +monkeypatched_methods = ... +class SymPyOutputChecker(pdoctest.OutputChecker): + def __init__(self) -> None: + ... + + def check_output(self, want, got, optionflags) -> bool: + ... + + + +class Reporter: + ... + + +class PyTestReporter(Reporter): + def __init__(self, verbose=..., tb=..., colors=..., force_colors=..., split=...) -> None: + ... + + def root_dir(self, dir) -> None: + ... + + @property + def terminal_width(self) -> Any | int: + ... + + def write(self, text, color=..., align=..., width=..., force_colors=...) -> None: + ... + + def write_center(self, text, delim=...) -> None: + ... + + def write_exception(self, e, val, tb) -> None: + ... + + def start(self, seed=..., msg=...) -> None: + ... + + def finish(self) -> bool: + ... + + def entering_filename(self, filename, n) -> None: + ... + + def leaving_filename(self) -> None: + ... + + def entering_test(self, f) -> None: + ... + + def test_xfail(self) -> None: + ... + + def test_xpass(self, v) -> None: + ... + + def test_fail(self, exc_info) -> None: + ... + + def doctest_fail(self, name, error_msg) -> None: + ... + + def test_pass(self, char=...) -> None: + ... + + def test_skip(self, v=...) -> None: + ... + + def test_exception(self, exc_info) -> None: + ... + + def import_error(self, filename, exc_info) -> None: + ... + + + diff --git a/stubs/sympy-stubs/unify/__init__.pyi b/stubs/sympy-stubs/unify/__init__.pyi new file mode 100644 index 00000000..8dbee174 --- /dev/null +++ b/stubs/sympy-stubs/unify/__init__.pyi @@ -0,0 +1,4 @@ +from sympy.unify.usympy import rebuild, unify +from sympy.unify.rewrite import rewriterule + +__all__ = ['unify', 'rebuild', 'rewriterule'] diff --git a/stubs/sympy-stubs/unify/core.pyi b/stubs/sympy-stubs/unify/core.pyi new file mode 100644 index 00000000..a5eeea6b --- /dev/null +++ b/stubs/sympy-stubs/unify/core.pyi @@ -0,0 +1,74 @@ +from typing import Any, Generator + +class Compound: + def __init__(self, op, args) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __str__(self) -> str: + ... + + + +class Variable: + def __init__(self, arg) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __str__(self) -> str: + ... + + + +class CondVariable: + def __init__(self, arg, valid) -> None: + ... + + def __eq__(self, other) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __str__(self) -> str: + ... + + + +def unify(x, y, s=..., **fns) -> Generator[Any | dict[Any, Any], Any, None]: + ... + +def unify_var(var, x, s, **fns) -> Generator[Any, Any, None]: + ... + +def occur_check(var, x) -> bool: + ... + +def assoc(d, key, val): + ... + +def is_args(x) -> bool: + ... + +def unpack(x) -> Compound: + ... + +def allcombinations(A, B, ordered) -> Generator[tuple[tuple[tuple[Any], ...], Any] | tuple[Any, tuple[tuple[Any], ...]], Any, None]: + ... + +def partition(it, part) -> Any: + ... + +def index(it, ind) -> Any: + ... + diff --git a/stubs/sympy-stubs/unify/rewrite.pyi b/stubs/sympy-stubs/unify/rewrite.pyi new file mode 100644 index 00000000..a134e5c3 --- /dev/null +++ b/stubs/sympy-stubs/unify/rewrite.pyi @@ -0,0 +1,6 @@ +from typing import Any, Callable, Generator +from sympy import Basic + +def rewriterule(source, target, variables=..., condition=..., assume=...) -> Callable[..., Generator[Any | Basic, Any, None]]: + ... + diff --git a/stubs/sympy-stubs/unify/usympy.pyi b/stubs/sympy-stubs/unify/usympy.pyi new file mode 100644 index 00000000..6f82f0c7 --- /dev/null +++ b/stubs/sympy-stubs/unify/usympy.pyi @@ -0,0 +1,34 @@ +from typing import Any, Callable, Generator +from sympy import Basic +from sympy.unify.core import Compound, CondVariable, Variable + +basic_new_legal = ... +eval_false_legal = ... +illegal = ... +def sympy_associative(op) -> bool: + ... + +def sympy_commutative(op) -> bool: + ... + +def is_associative(x) -> bool: + ... + +def is_commutative(x) -> bool | None: + ... + +def mk_matchtype(typ) -> Callable[..., bool]: + ... + +def deconstruct(s, variables=...) -> Variable | CondVariable | Basic | Compound: + ... + +def construct(t) -> Any: + ... + +def rebuild(s) -> Any | Basic: + ... + +def unify(x, y, s=..., variables=..., **kwargs) -> Generator[dict[Any, Any], Any, None]: + ... + diff --git a/stubs/sympy-stubs/utilities/__init__.pyi b/stubs/sympy-stubs/utilities/__init__.pyi new file mode 100644 index 00000000..6b0a9329 --- /dev/null +++ b/stubs/sympy-stubs/utilities/__init__.pyi @@ -0,0 +1,7 @@ +from sympy.utilities.iterables import capture, dict_merge, flatten, group, has_dups, has_variety, numbered_symbols, postfixes, prefixes, reshape, rotations, sift, subsets, take, topological_sort, unflatten, variations, cartes +from sympy.utilities.misc import filldedent +from sympy.utilities.lambdify import lambdify +from sympy.utilities.decorator import memoize_property, public, threaded, xthreaded +from sympy.utilities.timeutils import timed + +__all__ = ['flatten', 'group', 'take', 'subsets', 'variations', 'numbered_symbols', 'cartes', 'capture', 'dict_merge', 'prefixes', 'postfixes', 'sift', 'topological_sort', 'unflatten', 'has_dups', 'has_variety', 'reshape', 'rotations', 'filldedent', 'lambdify', 'threaded', 'xthreaded', 'public', 'memoize_property', 'timed'] diff --git a/stubs/sympy-stubs/utilities/decorator.pyi b/stubs/sympy-stubs/utilities/decorator.pyi new file mode 100644 index 00000000..d0b0c4b8 --- /dev/null +++ b/stubs/sympy-stubs/utilities/decorator.pyi @@ -0,0 +1,37 @@ +from functools import _Wrapped +from types import FunctionType +from typing import Any, Callable + +def threaded_factory(func, use_add) -> _Wrapped[..., Any, ..., Any]: + ... + +def threaded(func) -> _Wrapped[..., Any, ..., Any]: + ... + +def xthreaded(func) -> _Wrapped[..., Any, ..., Any]: + ... + +def conserve_mpmath_dps(func) -> Callable[..., Any]: + ... + +class no_attrs_in_subclass: + def __init__(self, cls, f) -> None: + ... + + def __get__(self, instance, owner=...) -> Any: + ... + + + +def doctest_depends_on(exe=..., modules=..., disable_viewers=..., python_version=...) -> Callable[..., type[Any] | Any]: + ... + +def public(obj) -> type: + ... + +def memoize_property(propfunc) -> property: + ... + +def deprecated(message, *, deprecated_since_version, active_deprecations_target, stacklevel=...) -> Callable[..., Any | _Wrapped[..., Any, ..., Any]]: + ... + diff --git a/stubs/sympy-stubs/utilities/enumerative.pyi b/stubs/sympy-stubs/utilities/enumerative.pyi new file mode 100644 index 00000000..ca32a565 --- /dev/null +++ b/stubs/sympy-stubs/utilities/enumerative.pyi @@ -0,0 +1,76 @@ +from typing import Any, Generator + +class PartComponent: + __slots__ = ... + def __init__(self) -> None: + ... + + def __repr__(self) -> str: + "for debug/algorithm animation purposes" + ... + + def __eq__(self, other) -> bool: + ... + + def __ne__(self, other) -> bool: + ... + + + +def multiset_partitions_taocp(multiplicities) -> Generator[list[Any], Any, None]: + ... + +def factoring_visitor(state, primes) -> list[Any]: + ... + +def list_visitor(state, components) -> list[Any]: + ... + +class MultisetPartitionTraverser: + def __init__(self) -> None: + ... + + def db_trace(self, msg) -> None: + ... + + def decrement_part(self, part) -> bool: + ... + + def decrement_part_small(self, part, ub) -> bool: + ... + + def decrement_part_large(self, part, amt, lb) -> bool | None: + ... + + def decrement_part_range(self, part, lb, ub) -> bool | None: + ... + + def spread_part_multiplicity(self) -> bool: + ... + + def top_part(self) -> list[PartComponent]: + ... + + def enum_all(self, multiplicities) -> Generator[list[Any], Any, None]: + ... + + def enum_small(self, multiplicities, ub) -> Generator[list[Any], Any, None]: + ... + + def enum_large(self, multiplicities, lb) -> Generator[list[Any], Any, None]: + ... + + def enum_range(self, multiplicities, lb, ub) -> Generator[list[Any], Any, None]: + ... + + def count_partitions_slow(self, multiplicities) -> int: + ... + + def count_partitions(self, multiplicities) -> int: + ... + + + +def part_key(part) -> tuple[Any, ...]: + ... + diff --git a/stubs/sympy-stubs/utilities/exceptions.pyi b/stubs/sympy-stubs/utilities/exceptions.pyi new file mode 100644 index 00000000..6a2343b0 --- /dev/null +++ b/stubs/sympy-stubs/utilities/exceptions.pyi @@ -0,0 +1,28 @@ +import contextlib +from typing import Any, Callable, Generator, Self + +class SymPyDeprecationWarning(DeprecationWarning): + def __init__(self, message, *, deprecated_since_version, active_deprecations_target) -> None: + ... + + def __str__(self) -> str: + ... + + def __repr__(self) -> str: + ... + + def __eq__(self, other) -> bool: + ... + + def __reduce__(self) -> tuple[Callable[..., Self], tuple[Any, str, Any]]: + ... + + + +def sympy_deprecation_warning(message, *, deprecated_since_version, active_deprecations_target, stacklevel=...) -> None: + ... + +@contextlib.contextmanager +def ignore_warnings(warningcls) -> Generator[None, Any, None]: + ... + diff --git a/stubs/sympy-stubs/utilities/iterables.pyi b/stubs/sympy-stubs/utilities/iterables.pyi new file mode 100644 index 00000000..7d23819e --- /dev/null +++ b/stubs/sympy-stubs/utilities/iterables.pyi @@ -0,0 +1,185 @@ +from collections import defaultdict +from itertools import chain, combinations, combinations_with_replacement, permutations, product +from typing import Any, Generator, Iterator, Literal, Never, NoReturn +from sympy import Basic, Symbol +from sympy.utilities.decorator import deprecated +from itertools import product as cartes # noqa: F401 + +def is_palindromic(s, i=..., j=...) -> bool: + ... + +def flatten(iterable, levels=..., cls=...) -> list[Any]: + ... + +def unflatten(iter, n=...) -> list[Any]: + ... + +def reshape(seq, how) -> Any: + ... + +def group(seq, multiple=...) -> list[list[Any]] | list[tuple[Any, int]]: + ... + +def iproduct(*iterables) -> Generator[tuple[()] | tuple[Any] | tuple[Any, Any] | Any, Any, None]: + ... + +def multiset(seq) -> dict[Any, int]: + ... + +def ibin(n, bits=..., str=...) -> list[int] | Iterator[Never] | permutations[Any] | Iterator[tuple[()]] | product[tuple[Any, ...]] | str | Generator[str, None, None]: + ... + +def variations(seq, n, repetition=...) -> Iterator[Never] | permutations[Any] | Iterator[tuple[()]] | product[tuple[Any, ...]]: + ... + +def subsets(seq, k=..., repetition=...) -> chain[tuple[Any, ...]] | combinations[Any] | combinations_with_replacement[Any]: + ... + +def filter_symbols(iterator, exclude) -> Generator[Any, Any, None]: + ... + +def numbered_symbols(prefix=..., cls=..., start=..., exclude=..., *args, **assumptions) -> Generator[Symbol | Any, Any, NoReturn]: + ... + +def capture(func) -> str: + ... + +def sift(seq, keyfunc, binary=...) -> defaultdict[Any, list[Any]] | tuple[list[Any], list[Any]]: + ... + +def take(iter, n) -> list[Any]: + ... + +def dict_merge(*dicts) -> dict[Any, Any]: + ... + +def common_prefix(*seqs) -> list[Any]: + ... + +def common_suffix(*seqs) -> list[Any]: + ... + +def prefixes(seq) -> Generator[Any, Any, None]: + ... + +def postfixes(seq) -> Generator[Any, Any, None]: + ... + +def topological_sort(graph, key=...) -> list[Any]: + ... + +def strongly_connected_components(G) -> list[Any]: + ... + +def connected_components(G) -> list[Any]: + ... + +def rotate_left(x, y) -> list[Any]: + ... + +def rotate_right(x, y) -> list[Any]: + ... + +def least_rotation(x, key=...) -> int: + ... + +def multiset_combinations(m, n, g=...) -> Generator[Any | list[Any], Any, None]: + ... + +def multiset_permutations(m, size=..., g=...) -> Generator[list[Any | int] | Any, Any, None]: + ... + +def multiset_partitions(multiset, m=...) -> Generator[list[list[int]] | list[list[Any]] | list[list[str] | Any] | list[Any], Any, None]: + ... + +def partitions(n, m=..., k=..., size=...) -> Generator[tuple[Literal[0], dict[Any, Any]] | tuple[int, dict[int, int]] | dict[int, int], Any, None]: + ... + +def ordered_partitions(n, m=..., sort=...) -> Generator[Any | list[Any], Any, None]: + ... + +def binary_partitions(n) -> Generator[Any | list[Any], Any, None]: + ... + +def has_dups(seq) -> bool: + ... + +def has_variety(seq) -> bool: + ... + +def uniq(seq, result=...) -> Generator[Any, Any, None]: + ... + +def generate_bell(n) -> Generator[tuple[Literal[0]] | tuple[Literal[0], Literal[1]] | tuple[Literal[1], Literal[0]] | Any | tuple[int, ...], Any, None]: + ... + +def generate_involutions(n) -> Generator[tuple[int, ...], Any, None]: + ... + +def multiset_derangements(s) -> Generator[list[Any] | list[None] | Any, Any, None]: + ... + +def random_derangement(t, choice=..., strict=...) -> str | list[None] | list[Any]: + ... + +def generate_derangements(s) -> Generator[list[Any] | list[None], Any, None]: + ... + +def necklaces(n, k, free=...) -> Generator[tuple[Any, ...], Any, None]: + ... + +def bracelets(n, k) -> Generator[tuple[Any, ...], Any, None]: + ... + +def generate_oriented_forest(n) -> Generator[list[int], Any, None]: + ... + +def minlex(seq, directed=..., key=...) -> tuple[Any, ...] | list[Any]: + ... + +def runs(seq, op=...) -> list[Any]: + ... + +def sequence_partitions(l, n, /) -> Generator[list[Any] | Any, Any, None]: + ... + +def sequence_partitions_empty(l, n, /) -> Generator[list[Any] | Any, Any, None]: + ... + +def kbins(l, k, ordered=...) -> Generator[list[Any] | Any | list[list[int]] | list[list[Any]] | list[list[str] | Any], Any, None]: + ... + +def permute_signs(t) -> Generator[Any, Any, None]: + ... + +def signed_permutations(t) -> Generator[Any, None, None]: + ... + +def rotations(s, dir=...) -> Generator[list[Any] | Any, Any, None]: + ... + +def roundrobin(*iterables) -> Generator[Any, Any, None]: + ... + +class NotIterable: + ... + + +def iterable(i, exclude=...) -> bool: + ... + +def is_sequence(i, include=...) -> bool: + ... + +def postorder_traversal(node, keys=...) -> Generator[Any | Basic, Any, None]: + ... + +def interactive_traversal(expr) -> Basic: + ... + +def default_sort_key(*args, **kwargs) -> tuple[tuple[Literal[5], Literal[0], str], tuple[int, tuple[Any, ...]], Any, Any] | tuple[tuple[Literal[10, 0], Literal[0], str | Any], tuple[int, tuple[Any, ...]] | tuple[Literal[1], tuple[str]], Any, Any]: + ... + +def ordered(*args, **kwargs) -> Generator[Any, Any, None]: + ... + diff --git a/stubs/sympy-stubs/utilities/lambdify.pyi b/stubs/sympy-stubs/utilities/lambdify.pyi new file mode 100644 index 00000000..f00c5807 --- /dev/null +++ b/stubs/sympy-stubs/utilities/lambdify.pyi @@ -0,0 +1,56 @@ +from typing import Any +from sympy.core.function import UndefinedFunction +from sympy.utilities.decorator import doctest_depends_on + +__doctest_requires__ = ... +MATH_DEFAULT: dict[str, Any] = ... +MPMATH_DEFAULT: dict[str, Any] = ... +NUMPY_DEFAULT: dict[str, Any] = ... +SCIPY_DEFAULT: dict[str, Any] = ... +CUPY_DEFAULT: dict[str, Any] = ... +JAX_DEFAULT: dict[str, Any] = ... +TENSORFLOW_DEFAULT: dict[str, Any] = ... +SYMPY_DEFAULT: dict[str, Any] = ... +NUMEXPR_DEFAULT: dict[str, Any] = ... +MATH = ... +MPMATH = ... +NUMPY = ... +SCIPY = ... +CUPY = ... +JAX = ... +TENSORFLOW = ... +SYMPY = ... +NUMEXPR = ... +MATH_TRANSLATIONS = ... +MPMATH_TRANSLATIONS = ... +NUMPY_TRANSLATIONS: dict[str, str] = ... +SCIPY_TRANSLATIONS: dict[str, str] = ... +CUPY_TRANSLATIONS: dict[str, str] = ... +JAX_TRANSLATIONS: dict[str, str] = ... +TENSORFLOW_TRANSLATIONS: dict[str, str] = ... +NUMEXPR_TRANSLATIONS: dict[str, str] = ... +MODULES = ... +_lambdify_generated_counter = ... +@doctest_depends_on(modules=('numpy', 'scipy', 'tensorflow'), python_version=(3, )) +def lambdify(args, expr, modules=..., printer=..., use_imps=..., dummify=..., cse=..., docstring_limit=...): + ... + +def lambdastr(args, expr, printer=..., dummify=...) -> str: + ... + +class _EvaluatorPrinter: + def __init__(self, printer=..., dummify=...) -> None: + ... + + def doprint(self, funcname, args, expr, *, cses=...) -> str: + ... + + + +class _TensorflowEvaluatorPrinter(_EvaluatorPrinter): + ... + + +def implemented_function(symfunc, implementation) -> type[UndefinedFunction] | UndefinedFunction: + ... + diff --git a/stubs/sympy-stubs/utilities/magic.pyi b/stubs/sympy-stubs/utilities/magic.pyi new file mode 100644 index 00000000..f9ee237d --- /dev/null +++ b/stubs/sympy-stubs/utilities/magic.pyi @@ -0,0 +1,4 @@ + +def pollute(names, objects) -> None: + ... + diff --git a/stubs/sympy-stubs/utilities/mathml/__init__.pyi b/stubs/sympy-stubs/utilities/mathml/__init__.pyi new file mode 100644 index 00000000..10b6f271 --- /dev/null +++ b/stubs/sympy-stubs/utilities/mathml/__init__.pyi @@ -0,0 +1,15 @@ +from pathlib import Path +from sympy.utilities.decorator import doctest_depends_on + +__doctest_requires__ = ... +def add_mathml_headers(s): + ... + +@doctest_depends_on(modules=('lxml', )) +def apply_xsl(mml, xsl) -> str: + ... + +@doctest_depends_on(modules=('lxml', )) +def c2p(mml, simple=...) -> str: + ... + diff --git a/stubs/sympy-stubs/utilities/memoization.pyi b/stubs/sympy-stubs/utilities/memoization.pyi new file mode 100644 index 00000000..ac0c8bb7 --- /dev/null +++ b/stubs/sympy-stubs/utilities/memoization.pyi @@ -0,0 +1,8 @@ +from functools import _Wrapped +from typing import Any, Callable +def recurrence_memo(initial) -> Callable[..., _Wrapped[..., Any, ..., Any]]: + ... + +def assoc_recurrence_memo(base_seq) -> Callable[..., _Wrapped[..., Any, ..., Any]]: + ... + diff --git a/stubs/sympy-stubs/utilities/misc.pyi b/stubs/sympy-stubs/utilities/misc.pyi new file mode 100644 index 00000000..7736a397 --- /dev/null +++ b/stubs/sympy-stubs/utilities/misc.pyi @@ -0,0 +1,46 @@ +from typing import Any, Callable, LiteralString + +class Undecidable(ValueError): + ... + + +def filldedent(s, w=..., **kwargs) -> str: + ... + +def strlines(s, c=..., short=...) -> str | LiteralString: + ... + +def rawlines(s) -> str | LiteralString: + ... + +ARCH = ... +HASH_RANDOMIZATION = ... +_debug_tmp: list[str] = ... +_debug_iter = ... +def debug_decorator(func) -> Callable[..., Any]: + ... + +def debug(*args) -> None: + ... + +def debugf(string, args) -> None: + ... + +def find_executable(executable, path=...) -> str | None: + ... + +def func_name(x, short=...) -> str | Any: + ... + +def replace(string, *reps) -> str: + ... + +def translate(s, a, b=..., c=...) -> str: + ... + +def ordinal(num) -> str: + ... + +def as_int(n, strict=...) -> int: + ... + diff --git a/stubs/sympy-stubs/utilities/source.pyi b/stubs/sympy-stubs/utilities/source.pyi new file mode 100644 index 00000000..1241b47a --- /dev/null +++ b/stubs/sympy-stubs/utilities/source.pyi @@ -0,0 +1,8 @@ +from typing import Any, Literal + +def get_class(lookup_view) -> Any | str: + ... + +def get_mod_func(callback) -> tuple[Any, Literal['']] | tuple[Any, Any]: + ... + diff --git a/stubs/sympy-stubs/utilities/timeutils.pyi b/stubs/sympy-stubs/utilities/timeutils.pyi new file mode 100644 index 00000000..40fe85e2 --- /dev/null +++ b/stubs/sympy-stubs/utilities/timeutils.pyi @@ -0,0 +1,12 @@ +from typing import Any, Callable + +_scales = ... +_units = ... +def timed(func, setup=..., limit=...) -> tuple[int, float, float, str]: + ... + +_do_timings = ... +_timestack = ... +def timethis(name) -> Callable[..., Any | Callable[..., Any]]: + ... + diff --git a/stubs/sympy-stubs/vector/basisdependent.pyi b/stubs/sympy-stubs/vector/basisdependent.pyi new file mode 100644 index 00000000..cf82c981 --- /dev/null +++ b/stubs/sympy-stubs/vector/basisdependent.pyi @@ -0,0 +1,129 @@ +from typing import TYPE_CHECKING, Any, Literal, Self +from sympy.core.decorators import _sympifyit, call_highest_priority +from sympy.core import Add, Mul +from sympy.core.expr import Expr +from sympy.series.order import Order +from sympy.vector.vector import BaseVector + +if TYPE_CHECKING: + ... +class BasisDependent(Expr): + zero: BasisDependentZero + @call_highest_priority('__radd__') + def __add__(self, other): + ... + + @call_highest_priority('__add__') + def __radd__(self, other): + ... + + @call_highest_priority('__rsub__') + def __sub__(self, other): + ... + + @call_highest_priority('__sub__') + def __rsub__(self, other): + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rmul__') + def __mul__(self, other): + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__mul__') + def __rmul__(self, other): + ... + + def __neg__(self): + ... + + @_sympifyit('other', NotImplemented) + @call_highest_priority('__rtruediv__') + def __truediv__(self, other): + ... + + @call_highest_priority('__truediv__') + def __rtruediv__(self, other) -> TypeError: + ... + + def evalf(self, n=..., subs=..., maxn=..., chop=..., strict=..., quad=..., verbose=...) -> BasisDependentZero: + ... + + n = ... + def simplify(self, **kwargs): + ... + + def trigsimp(self, **opts): + ... + + def as_numer_denom(self) -> tuple[Self, Any]: + ... + + def factor(self, *args, **kwargs): + ... + + def as_coeff_Mul(self, rational=...) -> tuple[Any, Self]: + ... + + def as_coeff_add(self, *deps) -> tuple[Literal[0], tuple[Any, ...]]: + ... + + def diff(self, *args, **kwargs): + ... + + def doit(self, **hints): + ... + + + +class BasisDependentAdd(BasisDependent, Add): + def __new__(cls, *args, **options) -> BasisDependentZero | Order: + ... + + + +class BasisDependentMul(BasisDependent, Mul): + def __new__(cls, *args, **options) -> Order | BasisDependentZero: + ... + + + +class BasisDependentZero(BasisDependent): + components: dict[BaseVector, Expr] = ... + _latex_form: str + def __new__(cls) -> Self: + ... + + def __hash__(self) -> int: + ... + + @call_highest_priority('__req__') + def __eq__(self, other) -> bool: + ... + + __req__ = ... + @call_highest_priority('__radd__') + def __add__(self, other): + ... + + @call_highest_priority('__add__') + def __radd__(self, other): + ... + + @call_highest_priority('__rsub__') + def __sub__(self, other): + ... + + @call_highest_priority('__sub__') + def __rsub__(self, other): + ... + + def __neg__(self) -> Self: + ... + + def normalize(self) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/vector/coordsysrect.pyi b/stubs/sympy-stubs/vector/coordsysrect.pyi new file mode 100644 index 00000000..ef5d1694 --- /dev/null +++ b/stubs/sympy-stubs/vector/coordsysrect.pyi @@ -0,0 +1,69 @@ +from typing import Any, Callable +from sympy.core.basic import Basic +from sympy.core.cache import cacheit + +class CoordSys3D(Basic): + def __new__(cls, name, transformation=..., parent=..., location=..., rotation_matrix=..., vector_names=..., variable_names=...): + ... + + def __iter__(self): + ... + + @property + def origin(self): + ... + + def base_vectors(self): + ... + + def base_scalars(self): + ... + + def lame_coefficients(self): + ... + + def transformation_to_parent(self): + ... + + def transformation_from_parent(self) -> tuple[Any, ...]: + ... + + def transformation_from_parent_function(self) -> Callable[..., tuple[Any, ...]]: + ... + + def rotation_matrix(self, other): + ... + + @cacheit + def position_wrt(self, other): + ... + + def scalar_map(self, other) -> dict[Any, Any]: + ... + + def locate_new(self, name, position, vector_names=..., variable_names=...) -> CoordSys3D: + ... + + def orient_new(self, name, orienters, location=..., vector_names=..., variable_names=...) -> CoordSys3D: + ... + + def orient_new_axis(self, name, angle, axis, location=..., vector_names=..., variable_names=...) -> CoordSys3D: + ... + + def orient_new_body(self, name, angle1, angle2, angle3, rotation_order, location=..., vector_names=..., variable_names=...) -> CoordSys3D: + ... + + def orient_new_space(self, name, angle1, angle2, angle3, rotation_order, location=..., vector_names=..., variable_names=...) -> CoordSys3D: + ... + + def orient_new_quaternion(self, name, q0, q1, q2, q3, location=..., vector_names=..., variable_names=...) -> CoordSys3D: + ... + + def create_new(self, name, transformation, variable_names=..., vector_names=...) -> CoordSys3D: + ... + + def __init__(self, name, location=..., rotation_matrix=..., parent=..., vector_names=..., variable_names=..., latex_vects=..., pretty_vects=..., latex_scalars=..., pretty_scalars=..., transformation=...) -> None: + ... + + + diff --git a/stubs/sympy-stubs/vector/deloperator.pyi b/stubs/sympy-stubs/vector/deloperator.pyi new file mode 100644 index 00000000..6e1ebc7c --- /dev/null +++ b/stubs/sympy-stubs/vector/deloperator.pyi @@ -0,0 +1,24 @@ +from typing import Self +from sympy.core import Basic +from sympy.core.add import Add +from sympy.vector.operators import Curl, Divergence, Gradient +from sympy.vector.vector import VectorAdd, VectorZero + +class Del(Basic): + def __new__(cls) -> Self: + ... + + def gradient(self, scalar_field, doit=...) -> VectorZero | VectorAdd | Gradient: + ... + + __call__ = ... + def dot(self, vect, doit=...) -> Divergence | Add: + ... + + __and__ = ... + def cross(self, vect, doit=...) -> VectorZero | VectorAdd | Curl: + ... + + __xor__ = ... + + diff --git a/stubs/sympy-stubs/vector/dyadic.pyi b/stubs/sympy-stubs/vector/dyadic.pyi new file mode 100644 index 00000000..7a7ec930 --- /dev/null +++ b/stubs/sympy-stubs/vector/dyadic.pyi @@ -0,0 +1,70 @@ +from typing import Self +from sympy.series.order import Order +from sympy.vector.basisdependent import BasisDependent, BasisDependentAdd, BasisDependentMul, BasisDependentZero +from sympy.core.expr import AtomicExpr +from sympy.vector.vector import VectorZero + +class Dyadic(BasisDependent): + _op_priority = ... + _expr_type: type[Dyadic] + _mul_func: type[Dyadic] + _add_func: type[Dyadic] + _zero_func: type[Dyadic] + _base_func: type[Dyadic] + zero: DyadicZero + @property + def components(self): + ... + + def dot(self, other) -> VectorZero | DyadicZero: + ... + + def __and__(self, other) -> VectorZero | DyadicZero: + ... + + def cross(self, other) -> DyadicZero: + ... + + def __xor__(self, other) -> DyadicZero: + ... + + def to_matrix(self, system, second_system=...): + ... + + + +class BaseDyadic(Dyadic, AtomicExpr): + def __new__(cls, vector1, vector2) -> DyadicZero | Self: + ... + + + +class DyadicMul(BasisDependentMul, Dyadic): + def __new__(cls, *args, **options) -> Order | BasisDependentZero: + ... + + @property + def base_dyadic(self): + ... + + @property + def measure_number(self): + ... + + + +class DyadicAdd(BasisDependentAdd, Dyadic): + def __new__(cls, *args, **options) -> BasisDependentZero | Order: + ... + + + +class DyadicZero(BasisDependentZero, Dyadic): + _op_priority = ... + _pretty_form = ... + _latex_form = ... + def __new__(cls) -> Self: + ... + + + diff --git a/stubs/sympy-stubs/vector/functions.pyi b/stubs/sympy-stubs/vector/functions.pyi new file mode 100644 index 00000000..7407d1b3 --- /dev/null +++ b/stubs/sympy-stubs/vector/functions.pyi @@ -0,0 +1,34 @@ +from typing import Any, Literal +from sympy import Equality, Ne +from sympy.core.add import Add +from sympy.core.relational import Relational +from sympy.vector.dyadic import DyadicZero +from sympy.vector.operators import Divergence +from sympy.vector.vector import VectorZero +def express(expr, system, system2=..., variables=...) -> VectorZero | DyadicZero: + ... + +def directional_derivative(field, direction_vector) -> VectorZero | Literal[0]: + ... + +def laplacian(expr) -> Divergence | Add: + ... + +def is_conservative(field) -> Literal[True]: + ... + +def is_solenoidal(field) -> bool: + ... + +def scalar_potential(field, coord_sys) -> Equality | Relational | Ne: + ... + +def scalar_potential_difference(field, coord_sys, point1, point2): + ... + +def matrix_to_vector(matrix, system) -> VectorZero: + ... + +def orthogonalize(*vlist, orthonormal=...) -> list[Any]: + ... + diff --git a/stubs/sympy-stubs/vector/implicitregion.pyi b/stubs/sympy-stubs/vector/implicitregion.pyi new file mode 100644 index 00000000..9455947d --- /dev/null +++ b/stubs/sympy-stubs/vector/implicitregion.pyi @@ -0,0 +1,38 @@ +from typing import Any, Self +from sympy import Complement, ConditionSet, FiniteSet, Intersection +from sympy.core import Basic +from sympy.sets.sets import Set, Union + +class ImplicitRegion(Basic): + def __new__(cls, variables, equation) -> Self: + ... + + @property + def variables(self) -> Basic: + ... + + @property + def equation(self) -> Basic: + ... + + @property + def degree(self) -> Any: + ... + + def regular_point(self) -> tuple[Any] | tuple[Any, Any] | tuple[int, int, Any] | type[list[Any]]: + ... + + def singular_points(self) -> FiniteSet | Set | Intersection | Union | Complement | ConditionSet: + ... + + def multiplicity(self, point) -> Any: + ... + + def rational_parametrization(self, parameters=..., reg_point=...) -> tuple[Basic] | tuple[Any, Any] | tuple[Any, Any, Any]: + ... + + + +def conic_coeff(variables, equation) -> tuple[Any, Any, Any, Any, Any, Any]: + ... + diff --git a/stubs/sympy-stubs/vector/integrals.pyi b/stubs/sympy-stubs/vector/integrals.pyi new file mode 100644 index 00000000..89cadf66 --- /dev/null +++ b/stubs/sympy-stubs/vector/integrals.pyi @@ -0,0 +1,22 @@ +from typing import Literal, Self +from sympy import Equality, Ne +from sympy.core import Basic +from sympy.core.relational import Relational + +class ParametricIntegral(Basic): + def __new__(cls, field, parametricregion) -> Equality | Relational | Ne | Self: + ... + + @property + def field(self) -> Basic: + ... + + @property + def parametricregion(self) -> Basic: + ... + + + +def vector_integrate(field, *region) -> Equality | Relational | Ne | ParametricIntegral | Literal[0]: + ... + diff --git a/stubs/sympy-stubs/vector/operators.pyi b/stubs/sympy-stubs/vector/operators.pyi new file mode 100644 index 00000000..b5b6721f --- /dev/null +++ b/stubs/sympy-stubs/vector/operators.pyi @@ -0,0 +1,50 @@ +from typing import Self +from sympy.core.add import Add +from sympy.core.expr import Expr +from sympy.vector.vector import VectorAdd, VectorZero + +class Gradient(Expr): + def __new__(cls, expr) -> Self: + ... + + def doit(self, **hints) -> VectorZero | VectorAdd | Gradient: + ... + + + +class Divergence(Expr): + def __new__(cls, expr) -> Self: + ... + + def doit(self, **hints) -> Divergence | Add: + ... + + + +class Curl(Expr): + def __new__(cls, expr) -> Self: + ... + + def doit(self, **hints) -> VectorZero | VectorAdd | Curl: + ... + + + +def curl(vect, doit=...) -> VectorZero | VectorAdd | Curl: + ... + +def divergence(vect, doit=...) -> Divergence | Add: + ... + +def gradient(scalar_field, doit=...) -> VectorZero | VectorAdd | Gradient: + ... + +class Laplacian(Expr): + def __new__(cls, expr) -> Self: + ... + + def doit(self, **hints) -> Divergence | Add: + ... + + + diff --git a/stubs/sympy-stubs/vector/orienters.pyi b/stubs/sympy-stubs/vector/orienters.pyi new file mode 100644 index 00000000..82ead278 --- /dev/null +++ b/stubs/sympy-stubs/vector/orienters.pyi @@ -0,0 +1,98 @@ +from typing import Self +from sympy.core.basic import Basic +from sympy.core.cache import cacheit + +class Orienter(Basic): + def rotation_matrix(self): + ... + + + +class AxisOrienter(Orienter): + def __new__(cls, angle, axis) -> Self: + ... + + def __init__(self, angle, axis) -> None: + ... + + @cacheit + def rotation_matrix(self, system): + ... + + @property + def angle(self): + ... + + @property + def axis(self): + ... + + + +class ThreeAngleOrienter(Orienter): + def __new__(cls, angle1, angle2, angle3, rot_order) -> Self: + ... + + @property + def angle1(self): + ... + + @property + def angle2(self): + ... + + @property + def angle3(self): + ... + + @property + def rot_order(self): + ... + + + +class BodyOrienter(ThreeAngleOrienter): + _in_order = ... + def __new__(cls, angle1, angle2, angle3, rot_order) -> Self: + ... + + def __init__(self, angle1, angle2, angle3, rot_order) -> None: + ... + + + +class SpaceOrienter(ThreeAngleOrienter): + _in_order = ... + def __new__(cls, angle1, angle2, angle3, rot_order) -> Self: + ... + + def __init__(self, angle1, angle2, angle3, rot_order) -> None: + ... + + + +class QuaternionOrienter(Orienter): + def __new__(cls, q0, q1, q2, q3) -> Self: + ... + + def __init__(self, angle1, angle2, angle3, rot_order) -> None: + ... + + @property + def q0(self): + ... + + @property + def q1(self): + ... + + @property + def q2(self): + ... + + @property + def q3(self): + ... + + + diff --git a/stubs/sympy-stubs/vector/parametricregion.pyi b/stubs/sympy-stubs/vector/parametricregion.pyi new file mode 100644 index 00000000..9d3b462e --- /dev/null +++ b/stubs/sympy-stubs/vector/parametricregion.pyi @@ -0,0 +1,56 @@ +from functools import singledispatch +from typing import Any, Self +from sympy.core import Basic +from sympy.geometry import Curve, Ellipse, Point, Polygon, Segment +from sympy.vector import ImplicitRegion + +class ParametricRegion(Basic): + def __new__(cls, definition, *bounds) -> Self: + ... + + @property + def definition(self) -> Basic: + ... + + @property + def limits(self): + ... + + @property + def parameters(self): + ... + + @property + def dimensions(self) -> int: + ... + + + +@singledispatch +def parametric_region_list(reg): + ... + +@parametric_region_list.register(Point) +def _(obj) -> list[ParametricRegion]: + ... + +@parametric_region_list.register(Curve) +def _(obj) -> list[ParametricRegion]: + ... + +@parametric_region_list.register(Ellipse) +def _(obj, parameter=...) -> list[ParametricRegion]: + ... + +@parametric_region_list.register(Segment) +def _(obj, parameter=...) -> list[ParametricRegion]: + ... + +@parametric_region_list.register(Polygon) +def _(obj, parameter=...) -> list[Any]: + ... + +@parametric_region_list.register(ImplicitRegion) +def _(obj, parameters=...) -> list[ParametricRegion]: + ... + diff --git a/stubs/sympy-stubs/vector/point.pyi b/stubs/sympy-stubs/vector/point.pyi new file mode 100644 index 00000000..b5090c85 --- /dev/null +++ b/stubs/sympy-stubs/vector/point.pyi @@ -0,0 +1,21 @@ +from typing import Any, Self +from sympy.core.basic import Basic +from sympy.core.cache import cacheit +from sympy.vector.vector import VectorZero + +class Point(Basic): + def __new__(cls, name, position=..., parent_point=...) -> Self: + ... + + @cacheit + def position_wrt(self, other) -> VectorZero: + ... + + def locate_new(self, name, position) -> Point: + ... + + def express_coordinates(self, coordinate_system) -> tuple[Any, ...]: + ... + + + diff --git a/stubs/sympy-stubs/vector/scalar.pyi b/stubs/sympy-stubs/vector/scalar.pyi new file mode 100644 index 00000000..51744621 --- /dev/null +++ b/stubs/sympy-stubs/vector/scalar.pyi @@ -0,0 +1,21 @@ +from typing import Self +from sympy.core import AtomicExpr + +class BaseScalar(AtomicExpr): + def __new__(cls, index, system, pretty_str=..., latex_str=...) -> Self: + ... + + is_commutative = ... + is_symbol = ... + @property + def free_symbols(self) -> set[Self]: + ... + + _diff_wrt = ... + precedence = ... + @property + def system(self): + ... + + + diff --git a/stubs/sympy-stubs/vector/vector.pyi b/stubs/sympy-stubs/vector/vector.pyi new file mode 100644 index 00000000..24597ff9 --- /dev/null +++ b/stubs/sympy-stubs/vector/vector.pyi @@ -0,0 +1,124 @@ +from typing import Any, Callable, Literal, Self +from sympy import ImmutableDenseMatrix, Pow +from sympy.core.add import Add +from sympy.core.expr import AtomicExpr, Expr +from sympy.series.order import Order +from sympy.vector.basisdependent import BasisDependent, BasisDependentAdd, BasisDependentMul, BasisDependentZero +from sympy.vector.dyadic import DyadicZero + +class Vector(BasisDependent): + is_scalar = ... + is_Vector = ... + _op_priority = ... + _expr_type: type[Vector] + _mul_func: type[Vector] + _add_func: type[Vector] + _zero_func: type[Vector] + _base_func: type[Vector] + zero: VectorZero + @property + def components(self): + ... + + def magnitude(self) -> Pow: + ... + + def normalize(self): + ... + + def dot(self, other) -> VectorZero | Callable[..., VectorZero | Any | Literal[0]] | Add | Dot: + ... + + def __and__(self, other) -> VectorZero | Callable[..., VectorZero | Any | Literal[0]] | Add | Dot: + ... + + def cross(self, other) -> DyadicZero | VectorAdd | VectorZero | Cross: + ... + + def __xor__(self, other) -> DyadicZero | VectorAdd | VectorZero | Cross: + ... + + def outer(self, other) -> DyadicZero | BasisDependentZero | Order: + ... + + def projection(self, other, scalar=...) -> VectorZero: + ... + + def __or__(self, other) -> DyadicZero | BasisDependentZero | Order: + ... + + def to_matrix(self, system) -> ImmutableDenseMatrix: + ... + + def separate(self) -> dict[Any, Any]: + ... + + + +class BaseVector(Vector, AtomicExpr): + def __new__(cls, index, system, pretty_str=..., latex_str=...) -> Self: + ... + + @property + def system(self): + ... + + @property + def free_symbols(self) -> set[Self]: + ... + + + +class VectorAdd(BasisDependentAdd, Vector): + def __new__(cls, *args, **options) -> BasisDependentZero | Order: + ... + + + +class VectorMul(BasisDependentMul, Vector): + def __new__(cls, *args, **options) -> Order | BasisDependentZero: + ... + + @property + def base_vector(self): + ... + + @property + def measure_number(self): + ... + + + +class VectorZero(BasisDependentZero, Vector): + _op_priority = ... + _pretty_form = ... + _latex_form = ... + def __new__(cls) -> Self: + ... + + + +class Cross(Vector): + def __new__(cls, expr1, expr2) -> Self: + ... + + def doit(self, **hints) -> VectorAdd | VectorZero | Cross: + ... + + + +class Dot(Expr): + def __new__(cls, expr1, expr2) -> Self: + ... + + def doit(self, **hints) -> Add | Dot: + ... + + + +def cross(vect1, vect2) -> VectorAdd | VectorZero | Cross: + ... + +def dot(vect1, vect2) -> Add | Dot: + ... +