mathematicskit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mathematicskit-0.1.0/LICENSE +21 -0
- mathematicskit-0.1.0/PKG-INFO +201 -0
- mathematicskit-0.1.0/README.md +151 -0
- mathematicskit-0.1.0/mathematicskit.egg-info/PKG-INFO +201 -0
- mathematicskit-0.1.0/mathematicskit.egg-info/SOURCES.txt +308 -0
- mathematicskit-0.1.0/mathematicskit.egg-info/dependency_links.txt +1 -0
- mathematicskit-0.1.0/mathematicskit.egg-info/requires.txt +27 -0
- mathematicskit-0.1.0/mathematicskit.egg-info/top_level.txt +1 -0
- mathematicskit-0.1.0/mathkit/__init__.py +50 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/__init__.py +43 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/core/base.py +253 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/systems/__init__.py +23 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/systems/finite_fields.py +201 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/systems/groups.py +162 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/systems/polynomial_ring.py +132 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/systems/subgroups.py +144 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/tests/test_finite_fields.py +71 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/tests/test_groups.py +84 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/tests/test_polynomial_ring.py +79 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/tests/test_subgroups.py +59 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/tests/test_visualizers.py +15 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/utils/checks.py +35 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/abstract_algebra/visualizers/plots.py +31 -0
- mathematicskit-0.1.0/mathkit/calculus/__init__.py +48 -0
- mathematicskit-0.1.0/mathkit/calculus/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/calculus/core/base.py +80 -0
- mathematicskit-0.1.0/mathkit/calculus/systems/__init__.py +27 -0
- mathematicskit-0.1.0/mathkit/calculus/systems/autodiff.py +160 -0
- mathematicskit-0.1.0/mathkit/calculus/systems/dual_numbers.py +132 -0
- mathematicskit-0.1.0/mathkit/calculus/systems/finite_differences.py +141 -0
- mathematicskit-0.1.0/mathkit/calculus/systems/quadrature.py +184 -0
- mathematicskit-0.1.0/mathkit/calculus/systems/taylor_series.py +180 -0
- mathematicskit-0.1.0/mathkit/calculus/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/calculus/tests/test_autodiff.py +51 -0
- mathematicskit-0.1.0/mathkit/calculus/tests/test_dual_numbers.py +48 -0
- mathematicskit-0.1.0/mathkit/calculus/tests/test_finite_differences.py +47 -0
- mathematicskit-0.1.0/mathkit/calculus/tests/test_quadrature.py +61 -0
- mathematicskit-0.1.0/mathkit/calculus/tests/test_taylor_series.py +53 -0
- mathematicskit-0.1.0/mathkit/calculus/tests/test_visualizers.py +23 -0
- mathematicskit-0.1.0/mathkit/calculus/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/calculus/utils/series_utils.py +64 -0
- mathematicskit-0.1.0/mathkit/calculus/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/calculus/visualizers/plots.py +77 -0
- mathematicskit-0.1.0/mathkit/combinatorics/__init__.py +43 -0
- mathematicskit-0.1.0/mathkit/combinatorics/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/combinatorics/core/base.py +85 -0
- mathematicskit-0.1.0/mathkit/combinatorics/systems/__init__.py +23 -0
- mathematicskit-0.1.0/mathkit/combinatorics/systems/counting.py +153 -0
- mathematicskit-0.1.0/mathkit/combinatorics/systems/inclusion_exclusion.py +97 -0
- mathematicskit-0.1.0/mathkit/combinatorics/systems/partitions.py +109 -0
- mathematicskit-0.1.0/mathkit/combinatorics/systems/pascals_triangle.py +47 -0
- mathematicskit-0.1.0/mathkit/combinatorics/systems/special_numbers.py +130 -0
- mathematicskit-0.1.0/mathkit/combinatorics/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/combinatorics/tests/test_counting.py +50 -0
- mathematicskit-0.1.0/mathkit/combinatorics/tests/test_inclusion_exclusion.py +44 -0
- mathematicskit-0.1.0/mathkit/combinatorics/tests/test_partitions.py +46 -0
- mathematicskit-0.1.0/mathkit/combinatorics/tests/test_pascals_triangle.py +24 -0
- mathematicskit-0.1.0/mathkit/combinatorics/tests/test_special_numbers.py +56 -0
- mathematicskit-0.1.0/mathkit/combinatorics/tests/test_visualizers.py +26 -0
- mathematicskit-0.1.0/mathkit/combinatorics/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/combinatorics/utils/bell_number.py +35 -0
- mathematicskit-0.1.0/mathkit/combinatorics/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/combinatorics/visualizers/plots.py +91 -0
- mathematicskit-0.1.0/mathkit/constants.py +55 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/__init__.py +41 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/core/base.py +103 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/systems/__init__.py +20 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/systems/box_counting.py +85 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/systems/cellular_automata.py +135 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/systems/ifs.py +106 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/systems/lyapunov.py +125 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/systems/mandelbrot_julia.py +138 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/tests/test_box_counting.py +56 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/tests/test_cellular_automata.py +74 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/tests/test_ifs.py +54 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/tests/test_lyapunov.py +42 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/tests/test_mandelbrot_julia.py +62 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/tests/test_visualizers.py +41 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/utils/ifs_utils.py +64 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/fractals_chaos/visualizers/plots.py +115 -0
- mathematicskit-0.1.0/mathkit/geometry/__init__.py +42 -0
- mathematicskit-0.1.0/mathkit/geometry/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/geometry/core/base.py +94 -0
- mathematicskit-0.1.0/mathkit/geometry/systems/__init__.py +19 -0
- mathematicskit-0.1.0/mathkit/geometry/systems/convex_hull.py +115 -0
- mathematicskit-0.1.0/mathkit/geometry/systems/curves.py +91 -0
- mathematicskit-0.1.0/mathkit/geometry/systems/intersections.py +103 -0
- mathematicskit-0.1.0/mathkit/geometry/systems/polygon.py +73 -0
- mathematicskit-0.1.0/mathkit/geometry/systems/triangulation.py +77 -0
- mathematicskit-0.1.0/mathkit/geometry/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/geometry/tests/test_convex_hull.py +48 -0
- mathematicskit-0.1.0/mathkit/geometry/tests/test_curves.py +55 -0
- mathematicskit-0.1.0/mathkit/geometry/tests/test_intersections.py +48 -0
- mathematicskit-0.1.0/mathkit/geometry/tests/test_polygon.py +46 -0
- mathematicskit-0.1.0/mathkit/geometry/tests/test_triangulation.py +44 -0
- mathematicskit-0.1.0/mathkit/geometry/tests/test_visualizers.py +38 -0
- mathematicskit-0.1.0/mathkit/geometry/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/geometry/utils/curves_library.py +80 -0
- mathematicskit-0.1.0/mathkit/geometry/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/geometry/visualizers/plots.py +114 -0
- mathematicskit-0.1.0/mathkit/graph_theory/__init__.py +47 -0
- mathematicskit-0.1.0/mathkit/graph_theory/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/graph_theory/core/base.py +166 -0
- mathematicskit-0.1.0/mathkit/graph_theory/systems/__init__.py +19 -0
- mathematicskit-0.1.0/mathkit/graph_theory/systems/coloring.py +123 -0
- mathematicskit-0.1.0/mathkit/graph_theory/systems/max_flow.py +77 -0
- mathematicskit-0.1.0/mathkit/graph_theory/systems/shortest_paths.py +112 -0
- mathematicskit-0.1.0/mathkit/graph_theory/systems/spanning_tree.py +112 -0
- mathematicskit-0.1.0/mathkit/graph_theory/systems/spectral.py +68 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_coloring.py +49 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_generators.py +34 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_graph.py +54 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_max_flow.py +64 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_shortest_paths.py +56 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_spanning_tree.py +46 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_spectral.py +50 -0
- mathematicskit-0.1.0/mathkit/graph_theory/tests/test_visualizers.py +37 -0
- mathematicskit-0.1.0/mathkit/graph_theory/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/graph_theory/utils/generators.py +111 -0
- mathematicskit-0.1.0/mathkit/graph_theory/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/graph_theory/visualizers/plots.py +98 -0
- mathematicskit-0.1.0/mathkit/integrators/__init__.py +52 -0
- mathematicskit-0.1.0/mathkit/integrators/adaptive.py +199 -0
- mathematicskit-0.1.0/mathkit/integrators/fixed_step.py +349 -0
- mathematicskit-0.1.0/mathkit/integrators/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/integrators/tests/test_integrators.py +115 -0
- mathematicskit-0.1.0/mathkit/linalg/__init__.py +78 -0
- mathematicskit-0.1.0/mathkit/linalg/core/__init__.py +23 -0
- mathematicskit-0.1.0/mathkit/linalg/core/base.py +185 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/__init__.py +35 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/cholesky.py +117 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/eigen.py +199 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/iterative.py +136 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/lu.py +169 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/qr.py +154 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/stability.py +177 -0
- mathematicskit-0.1.0/mathkit/linalg/systems/svd.py +51 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_cholesky.py +50 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_eigen.py +59 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_iterative.py +67 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_lu.py +46 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_qr.py +54 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_stability.py +46 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_svd.py +42 -0
- mathematicskit-0.1.0/mathkit/linalg/tests/test_visualizers.py +30 -0
- mathematicskit-0.1.0/mathkit/linalg/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/linalg/utils/matrix_utils.py +88 -0
- mathematicskit-0.1.0/mathkit/linalg/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/linalg/visualizers/plots.py +90 -0
- mathematicskit-0.1.0/mathkit/number_theory/__init__.py +48 -0
- mathematicskit-0.1.0/mathkit/number_theory/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/number_theory/core/base.py +89 -0
- mathematicskit-0.1.0/mathkit/number_theory/systems/__init__.py +26 -0
- mathematicskit-0.1.0/mathkit/number_theory/systems/continued_fractions.py +107 -0
- mathematicskit-0.1.0/mathkit/number_theory/systems/crt.py +62 -0
- mathematicskit-0.1.0/mathkit/number_theory/systems/diophantine.py +111 -0
- mathematicskit-0.1.0/mathkit/number_theory/systems/modular_arithmetic.py +128 -0
- mathematicskit-0.1.0/mathkit/number_theory/systems/primality.py +150 -0
- mathematicskit-0.1.0/mathkit/number_theory/systems/totient.py +143 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_continued_fractions.py +43 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_crt.py +35 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_diophantine.py +43 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_gcd_lcm.py +35 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_modular_arithmetic.py +53 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_primality.py +50 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_totient.py +54 -0
- mathematicskit-0.1.0/mathkit/number_theory/tests/test_visualizers.py +21 -0
- mathematicskit-0.1.0/mathkit/number_theory/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/number_theory/utils/gcd_lcm.py +60 -0
- mathematicskit-0.1.0/mathkit/number_theory/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/number_theory/visualizers/plots.py +66 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/__init__.py +48 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/core/__init__.py +15 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/core/base.py +154 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/systems/__init__.py +22 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/systems/chebyshev.py +173 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/systems/interpolation.py +131 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/systems/regression.py +121 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/systems/root_finding.py +241 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/systems/splines.py +95 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/test_chebyshev.py +37 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/test_error_analysis.py +40 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/test_interpolation.py +77 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/test_regression.py +52 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/test_root_finding.py +88 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/test_splines.py +61 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/tests/test_visualizers.py +38 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/utils/__init__.py +9 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/utils/error_analysis.py +154 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/visualizers/__init__.py +13 -0
- mathematicskit-0.1.0/mathkit/numerical_analysis/visualizers/plots.py +102 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/__init__.py +44 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/core/base.py +122 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/systems/__init__.py +30 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/systems/bifurcations.py +124 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/systems/limit_cycles.py +99 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/systems/logistic_map.py +157 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/systems/phase_portrait.py +152 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/systems/poincare.py +114 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/systems/stability.py +178 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/test_bifurcations.py +50 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/test_limit_cycles.py +38 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/test_logistic_map.py +45 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/test_phase_portrait.py +39 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/test_poincare.py +43 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/test_stability.py +83 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/tests/test_visualizers.py +41 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/utils/period_estimation.py +50 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/ode_dynamics/visualizers/plots.py +107 -0
- mathematicskit-0.1.0/mathkit/optimization/__init__.py +49 -0
- mathematicskit-0.1.0/mathkit/optimization/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/optimization/core/base.py +157 -0
- mathematicskit-0.1.0/mathkit/optimization/systems/__init__.py +19 -0
- mathematicskit-0.1.0/mathkit/optimization/systems/conjugate_gradient.py +105 -0
- mathematicskit-0.1.0/mathkit/optimization/systems/constrained.py +285 -0
- mathematicskit-0.1.0/mathkit/optimization/systems/gradient_descent.py +135 -0
- mathematicskit-0.1.0/mathkit/optimization/systems/linear_programming.py +67 -0
- mathematicskit-0.1.0/mathkit/optimization/systems/newton_quasi_newton.py +141 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/test_comparison.py +36 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/test_conjugate_gradient.py +50 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/test_constrained.py +77 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/test_gradient_descent.py +63 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/test_linear_programming.py +37 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/test_newton_quasi_newton.py +47 -0
- mathematicskit-0.1.0/mathkit/optimization/tests/test_visualizers.py +27 -0
- mathematicskit-0.1.0/mathkit/optimization/utils/__init__.py +17 -0
- mathematicskit-0.1.0/mathkit/optimization/utils/comparison.py +76 -0
- mathematicskit-0.1.0/mathkit/optimization/utils/line_search.py +86 -0
- mathematicskit-0.1.0/mathkit/optimization/utils/test_functions.py +172 -0
- mathematicskit-0.1.0/mathkit/optimization/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/optimization/visualizers/plots.py +84 -0
- mathematicskit-0.1.0/mathkit/probability/__init__.py +43 -0
- mathematicskit-0.1.0/mathkit/probability/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/probability/core/base.py +142 -0
- mathematicskit-0.1.0/mathkit/probability/systems/__init__.py +24 -0
- mathematicskit-0.1.0/mathkit/probability/systems/continuous.py +159 -0
- mathematicskit-0.1.0/mathkit/probability/systems/discrete.py +116 -0
- mathematicskit-0.1.0/mathkit/probability/systems/limit_theorems.py +87 -0
- mathematicskit-0.1.0/mathkit/probability/systems/markov_chain.py +194 -0
- mathematicskit-0.1.0/mathkit/probability/systems/monte_carlo.py +165 -0
- mathematicskit-0.1.0/mathkit/probability/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/probability/tests/test_continuous.py +74 -0
- mathematicskit-0.1.0/mathkit/probability/tests/test_discrete.py +66 -0
- mathematicskit-0.1.0/mathkit/probability/tests/test_limit_theorems.py +37 -0
- mathematicskit-0.1.0/mathkit/probability/tests/test_markov_chain.py +68 -0
- mathematicskit-0.1.0/mathkit/probability/tests/test_monte_carlo.py +45 -0
- mathematicskit-0.1.0/mathkit/probability/tests/test_visualizers.py +36 -0
- mathematicskit-0.1.0/mathkit/probability/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/probability/utils/diagnostics.py +43 -0
- mathematicskit-0.1.0/mathkit/probability/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/probability/visualizers/plots.py +99 -0
- mathematicskit-0.1.0/mathkit/special_functions/__init__.py +39 -0
- mathematicskit-0.1.0/mathkit/special_functions/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/special_functions/core/base.py +38 -0
- mathematicskit-0.1.0/mathkit/special_functions/systems/__init__.py +22 -0
- mathematicskit-0.1.0/mathkit/special_functions/systems/bessel.py +67 -0
- mathematicskit-0.1.0/mathkit/special_functions/systems/fourier_transform.py +179 -0
- mathematicskit-0.1.0/mathkit/special_functions/systems/gamma_beta.py +87 -0
- mathematicskit-0.1.0/mathkit/special_functions/systems/orthogonal_polynomials.py +133 -0
- mathematicskit-0.1.0/mathkit/special_functions/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/special_functions/tests/test_bessel.py +43 -0
- mathematicskit-0.1.0/mathkit/special_functions/tests/test_fourier_transform.py +54 -0
- mathematicskit-0.1.0/mathkit/special_functions/tests/test_gamma_beta.py +42 -0
- mathematicskit-0.1.0/mathkit/special_functions/tests/test_orthogonal_polynomials.py +60 -0
- mathematicskit-0.1.0/mathkit/special_functions/tests/test_visualizers.py +20 -0
- mathematicskit-0.1.0/mathkit/special_functions/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/special_functions/utils/orthogonality.py +48 -0
- mathematicskit-0.1.0/mathkit/special_functions/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/special_functions/visualizers/plots.py +73 -0
- mathematicskit-0.1.0/mathkit/statistics/__init__.py +54 -0
- mathematicskit-0.1.0/mathkit/statistics/core/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/statistics/core/base.py +151 -0
- mathematicskit-0.1.0/mathkit/statistics/systems/__init__.py +33 -0
- mathematicskit-0.1.0/mathkit/statistics/systems/bootstrap.py +78 -0
- mathematicskit-0.1.0/mathkit/statistics/systems/confidence_intervals.py +141 -0
- mathematicskit-0.1.0/mathkit/statistics/systems/descriptive.py +86 -0
- mathematicskit-0.1.0/mathkit/statistics/systems/hypothesis_tests.py +312 -0
- mathematicskit-0.1.0/mathkit/statistics/systems/regression.py +96 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/test_bootstrap.py +41 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/test_confidence_intervals.py +63 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/test_descriptive.py +43 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/test_effect_size.py +23 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/test_hypothesis_tests.py +99 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/test_regression.py +57 -0
- mathematicskit-0.1.0/mathkit/statistics/tests/test_visualizers.py +32 -0
- mathematicskit-0.1.0/mathkit/statistics/utils/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/statistics/utils/effect_size.py +47 -0
- mathematicskit-0.1.0/mathkit/statistics/visualizers/__init__.py +5 -0
- mathematicskit-0.1.0/mathkit/statistics/visualizers/plots.py +91 -0
- mathematicskit-0.1.0/mathkit/tests/__init__.py +0 -0
- mathematicskit-0.1.0/mathkit/tests/test_package.py +33 -0
- mathematicskit-0.1.0/pyproject.toml +122 -0
- mathematicskit-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mathkit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mathematicskit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Unified computational mathematics toolkit: numerical analysis, linear algebra, calculus, dynamical systems, optimization, probability, statistics, number theory, combinatorics, graph theory, abstract algebra, geometry, special functions, and fractals/chaos -- all hand-rolled from first principles.
|
|
5
|
+
Author-email: Charles Poli <cpoli374@gmail.com>
|
|
6
|
+
Maintainer-email: Charles Poli <cpoli374@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/cpoli/mathkit
|
|
9
|
+
Project-URL: Issues, https://github.com/cpoli/mathkit/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/cpoli/mathkit/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Documentation, https://cpoli.github.io/mathkit/
|
|
12
|
+
Keywords: mathematics,numerical-analysis,linear-algebra,computational-mathematics,optimization,graph-theory,number-theory,probability,statistics
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy>=1.24
|
|
26
|
+
Requires-Dist: scipy>=1.10
|
|
27
|
+
Requires-Dist: matplotlib>=3.6
|
|
28
|
+
Requires-Dist: numba>=0.58
|
|
29
|
+
Requires-Dist: plotly>=5.15
|
|
30
|
+
Requires-Dist: sympy>=1.11
|
|
31
|
+
Requires-Dist: tqdm>=4.65
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
35
|
+
Requires-Dist: hypothesis>=6.90; extra == "test"
|
|
36
|
+
Requires-Dist: pillow>=9.0; extra == "test"
|
|
37
|
+
Provides-Extra: docs
|
|
38
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
39
|
+
Requires-Dist: pydata-sphinx-theme>=0.15; extra == "docs"
|
|
40
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.25; extra == "docs"
|
|
41
|
+
Requires-Dist: myst-parser>=2.0; extra == "docs"
|
|
42
|
+
Requires-Dist: sphinx-gallery>=0.15; extra == "docs"
|
|
43
|
+
Requires-Dist: sphinx-design>=0.6; extra == "docs"
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: mathematicskit[docs,test]; extra == "dev"
|
|
46
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
48
|
+
Requires-Dist: pre-commit>=3.7; extra == "dev"
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
# mathkit
|
|
52
|
+
|
|
53
|
+
| | |
|
|
54
|
+
|:--|:-:|
|
|
55
|
+
| Package | [](https://pypi.org/project/mathematicskit/) [](https://pypi.org/project/mathematicskit/) |
|
|
56
|
+
| Quality | [](https://github.com/cpoli/mathkit/blob/main/LICENSE) [](https://github.com/cpoli/mathkit/actions/workflows/ci.yml) [](https://codecov.io/gh/cpoli/mathkit) [](#coverage) |
|
|
57
|
+
| Documentation | [](https://cpoli.github.io/mathkit/) |
|
|
58
|
+
| Code style | [](https://github.com/astral-sh/ruff) |
|
|
59
|
+
| Downloads | [](https://pepy.tech/project/mathematicskit) [](https://pepy.tech/project/mathematicskit) |
|
|
60
|
+
| Community | [](https://github.com/cpoli/mathkit) [](https://github.com/cpoli/mathkit) [](https://github.com/cpoli/mathkit/graphs/contributors) [](https://github.com/cpoli/mathkit/commits/main) |
|
|
61
|
+
|
|
62
|
+
A unified toolkit for computational mathematics, spanning the field end
|
|
63
|
+
to end: Newton's method chasing roots and Poincare sections of the
|
|
64
|
+
driven Duffing oscillator, Mandelbrot sets and the Feigenbaum route to
|
|
65
|
+
chaos, Dijkstra's shortest paths and finite-field arithmetic, the
|
|
66
|
+
Central Limit Theorem in action and Bessel functions in closed form --
|
|
67
|
+
with each domain's docs tracing the field's own foundational
|
|
68
|
+
breakthroughs in chronological, pedagogical order, every historical
|
|
69
|
+
milestone linked directly to the runnable code that reproduces it. 14
|
|
70
|
+
domain subpackages, one consistent NumPy-based API -- built directly on
|
|
71
|
+
`numpy`/`scipy` for anything they already implement (decompositions,
|
|
72
|
+
eigensolvers, quadrature, statistical distributions, optimization
|
|
73
|
+
routines, and more), hand-rolling an algorithm from scratch only where
|
|
74
|
+
no `numpy`/`scipy` equivalent exists (e.g. graph algorithms, the simplex
|
|
75
|
+
method, modular arithmetic) or where the algorithm's own iterate
|
|
76
|
+
behavior is the pedagogical subject (e.g. root-finder convergence
|
|
77
|
+
history, autodiff). No hard dependency on `networkx`, `cvxpy`, or
|
|
78
|
+
SageMath. Sharing common ODE integrators throughout. Conventionally
|
|
79
|
+
imported as `mk`.
|
|
80
|
+
|
|
81
|
+
All 14 domains from `mathkit-spec.md`'s build plan are implemented --
|
|
82
|
+
see [Subpackages](#subpackages) for the full list, or browse the docs at
|
|
83
|
+
<https://mathkit.readthedocs.io>.
|
|
84
|
+
|
|
85
|
+
## Install
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python -m venv .venv && source .venv/bin/activate
|
|
89
|
+
pip install -e ".[dev]"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Published on PyPI as `mathematicskit` (the name `mathkit` was already
|
|
93
|
+
taken by an unrelated package) -- `pip install mathematicskit`, then
|
|
94
|
+
`import mathkit as mk` as usual.
|
|
95
|
+
|
|
96
|
+
## Quick start
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import mathkit as mk
|
|
100
|
+
|
|
101
|
+
spline = mk.numerical_analysis.CubicSpline(x=[0, 1, 2, 3], y=[0, 1, 0, 1], boundary="natural")
|
|
102
|
+
print(spline.evaluate(1.5))
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Subpackages
|
|
106
|
+
|
|
107
|
+
Domain subpackages, each with runnable examples linked below:
|
|
108
|
+
|
|
109
|
+
- [`mathkit.numerical_analysis`](https://mathkit.readthedocs.io/en/latest/examples/numerical_analysis.html) -- root finding (bisection, Newton-Raphson, secant, fixed-point, hand-rolled for their convergence history), Lagrange/Newton (hand-rolled) plus scipy-backed cubic-spline interpolation, numpy-backed Chebyshev nodes, `numpy.linalg.lstsq`-based polynomial regression, and `numpy.linalg.cond`-based error/condition-number analysis.
|
|
110
|
+
- [`mathkit.linalg`](https://mathkit.readthedocs.io/en/latest/examples/linalg.html) -- LU/QR/Cholesky decompositions and eigenvalue computation via `scipy.linalg`/`numpy.linalg`, power/inverse iteration (hand-rolled), SVD, conjugate gradient and GMRES via `scipy.sparse.linalg`, and least-squares stability (normal equations vs. QR vs. `numpy.linalg.lstsq`).
|
|
111
|
+
- [`mathkit.calculus`](https://mathkit.readthedocs.io/en/latest/examples/calculus.html) -- finite-difference derivatives with Richardson extrapolation (hand-rolled), `scipy.integrate`-backed trapezoidal/Simpson/Gauss-Legendre/adaptive quadrature, forward-mode (dual numbers) and reverse-mode (backpropagation) automatic differentiation (hand-rolled), and Taylor/Maclaurin series.
|
|
112
|
+
- [`mathkit.ode_dynamics`](https://mathkit.readthedocs.io/en/latest/examples/ode_dynamics.html) -- Jacobian-linearization fixed-point stability (node/saddle/spiral/center), phase portraits, the logistic map's Feigenbaum route to chaos, saddle-node/pitchfork/Hopf bifurcation normal forms, the Van der Pol limit cycle, and Poincare sections of the driven Duffing oscillator.
|
|
113
|
+
- [`mathkit.fractals_chaos`](https://mathkit.readthedocs.io/en/latest/examples/fractals_chaos.html) -- Lyapunov exponent estimation, box-counting fractal dimension, Numba-accelerated Mandelbrot/Julia set generation, iterated function systems (Barnsley fern, Sierpinski triangle/carpet), and cellular automata (Wolfram rules, Conway's Game of Life).
|
|
114
|
+
- [`mathkit.optimization`](https://mathkit.readthedocs.io/en/latest/examples/optimization.html) -- gradient descent and nonlinear conjugate gradient (hand-rolled, iterate-path-exposing), Newton's method and BFGS via `scipy.optimize.minimize`, Lagrange multipliers and KKT-condition verification, a quadratic-penalty method, and linear programming via `scipy.optimize.linprog`.
|
|
115
|
+
- [`mathkit.probability`](https://mathkit.readthedocs.io/en/latest/examples/probability.html) -- binomial/Poisson/geometric/uniform/exponential/normal/gamma distributions via `scipy.stats` (plus mathkit's own MGFs), Monte Carlo integration with variance reduction (importance sampling, control variates), Law of Large Numbers/Central Limit Theorem simulation, and discrete-time Markov chains.
|
|
116
|
+
- [`mathkit.statistics`](https://mathkit.readthedocs.io/en/latest/examples/statistics.html) -- descriptive statistics, z/t/chi-square hypothesis tests and one-way ANOVA, confidence intervals for means/proportions/variances, OLS linear regression with residual diagnostics, and bootstrap resampling via `scipy.stats.bootstrap`.
|
|
117
|
+
- [`mathkit.number_theory`](https://mathkit.readthedocs.io/en/latest/examples/number_theory.html) -- the extended Euclidean algorithm and modular inverses, fast modular exponentiation, primality testing (trial division, Miller-Rabin) and prime generation, the Chinese Remainder Theorem, continued fractions and best rational approximations, Euler's totient/Mobius/divisor-sum functions, and linear/Pell Diophantine equation solvers (hand-rolled -- exact-integer number theory has no `numpy`/`scipy` equivalent).
|
|
118
|
+
- [`mathkit.combinatorics`](https://mathkit.readthedocs.io/en/latest/examples/combinatorics.html) -- permutation/combination counting via `scipy.special.perm`/`comb` (sequence generation via `itertools`), a hand-rolled Pascal's triangle, integer partitions and Young/Ferrers diagrams, the inclusion-exclusion principle and derangements, and Stirling/Catalan/Bell numbers (hand-rolled -- no scipy/numpy equivalent).
|
|
119
|
+
- [`mathkit.graph_theory`](https://mathkit.readthedocs.io/en/latest/examples/graph_theory.html) -- a lightweight own graph container (no `networkx`); shortest paths (Dijkstra/Bellman-Ford/Floyd-Warshall) and minimum spanning tree (Kruskal) via `scipy.sparse.csgraph`, with a hand-rolled Prim's kept for comparison; maximum flow/minimum cut via `scipy.sparse.csgraph.maximum_flow`; hand-rolled graph coloring (greedy, exact backtracking); and spectral graph theory (Laplacian via scipy, eigendecomposition via `numpy.linalg.eigh`).
|
|
120
|
+
- [`mathkit.abstract_algebra`](https://mathkit.readthedocs.io/en/latest/examples/abstract_algebra.html) -- cyclic and permutation groups with Cayley tables and group-property checks, subgroup/coset enumeration, finite field arithmetic (`GF(p)`/`GF(p^n)` via irreducible polynomials), and polynomial ring arithmetic over Z/Q/finite fields (hand-rolled throughout -- no scipy/numpy equivalent).
|
|
121
|
+
- [`mathkit.geometry`](https://mathkit.readthedocs.io/en/latest/examples/geometry.html) -- convex hull via `scipy.spatial.ConvexHull` (with a hand-rolled Graham scan comparison), Delaunay triangulation/Voronoi diagrams via `scipy.spatial`, hand-rolled segment intersection and point-in-polygon tests, polygon area/centroid via the shoelace formula, and curvature/arc-length/the Frenet-Serret frame for parametric curves.
|
|
122
|
+
- [`mathkit.special_functions`](https://mathkit.readthedocs.io/en/latest/examples/special_functions.html) -- the gamma/beta functions and Bessel functions via `scipy.special`, orthogonal polynomial families (Legendre/Chebyshev/Hermite/Laguerre) via `numpy.polynomial` with numerically-verified orthogonality, and the discrete Fourier transform via `numpy.fft` alongside a hand-rolled naive-DFT-vs-radix-2-FFT pedagogical speed comparison.
|
|
123
|
+
|
|
124
|
+
Shared infrastructure, used across the subpackages above rather than
|
|
125
|
+
standalone toolkits:
|
|
126
|
+
|
|
127
|
+
- `mathkit.constants` -- mathematical constants and default numerical
|
|
128
|
+
tolerances shared across subpackages.
|
|
129
|
+
- `mathkit.integrators` -- shared numerical ODE integrators (RK4,
|
|
130
|
+
leapfrog, Yoshida4, adaptive Dormand-Prince), used by
|
|
131
|
+
`mathkit.ode_dynamics`.
|
|
132
|
+
|
|
133
|
+
## Test
|
|
134
|
+
|
|
135
|
+
Tests live alongside each subpackage, at `mathkit/<name>/tests/`.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pytest # everything
|
|
139
|
+
pytest mathkit/numerical_analysis/tests # a single subpackage
|
|
140
|
+
|
|
141
|
+
# docstring examples, across every subpackage:
|
|
142
|
+
MPLBACKEND=Agg pytest --doctest-modules mathkit --ignore-glob="*/tests/*"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Both commands, plus `ruff check`/`ruff format --check`, run in CI on
|
|
146
|
+
every PR (`.github/workflows/ci.yml`) across Python 3.9-3.12 on Linux and
|
|
147
|
+
macOS. See [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
|
|
148
|
+
|
|
149
|
+
### Coverage
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
MPLBACKEND=Agg pytest -q --cov=mathkit --cov-report=term
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
620 tests, 96% line coverage overall. Per-subpackage coverage:
|
|
156
|
+
|
|
157
|
+
| Subpackage | Coverage | | Subpackage | Coverage |
|
|
158
|
+
|:--|--:|---|:--|--:|
|
|
159
|
+
| `abstract_algebra` | 97% | | `ode_dynamics` | 92% |
|
|
160
|
+
| `calculus` | 95% | | `optimization` | 99% |
|
|
161
|
+
| `combinatorics` | 98% | | `probability` | 98% |
|
|
162
|
+
| `fractals_chaos` | 92% | | `special_functions` | 100% |
|
|
163
|
+
| `geometry` | 100% | | `statistics` | 99% |
|
|
164
|
+
| `graph_theory` | 99% | | `integrators` | 50% |
|
|
165
|
+
| `linalg` | 95% | | `constants` | 100% |
|
|
166
|
+
| `number_theory` | 99% | | | |
|
|
167
|
+
| `numerical_analysis` | 97% | | | |
|
|
168
|
+
|
|
169
|
+
`visualizers/` modules are smoke-tested only (correct return type/shape,
|
|
170
|
+
or that `anim.save()` succeeds) rather than covered line-by-line, per the
|
|
171
|
+
testing convention in [CLAUDE.md](CLAUDE.md). `integrators` sits lower
|
|
172
|
+
because several of its fixed-step/adaptive methods aren't exercised
|
|
173
|
+
directly by its own tests, only indirectly through the two subpackages
|
|
174
|
+
(`ode_dynamics`, `fractals_chaos`) that call into it.
|
|
175
|
+
|
|
176
|
+
## Docs
|
|
177
|
+
|
|
178
|
+
Built docs are hosted at <https://cpoli.github.io/mathkit/>, served from
|
|
179
|
+
the `gh-pages` branch. To build locally:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
pip install -e ".[docs]"
|
|
183
|
+
cd docs && make html
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
See `docs/source/history/` for a chronology of each domain's foundational
|
|
187
|
+
results, linked to the corresponding implementation at each step.
|
|
188
|
+
|
|
189
|
+
## Citation
|
|
190
|
+
|
|
191
|
+
If you use mathkit in your research, please cite it — see
|
|
192
|
+
[CITATION.cff](CITATION.cff).
|
|
193
|
+
|
|
194
|
+
## Contributing
|
|
195
|
+
|
|
196
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Please note that this project
|
|
197
|
+
follows the [Contributor Covenant](CODE_OF_CONDUCT.md).
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT -- see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# mathkit
|
|
2
|
+
|
|
3
|
+
| | |
|
|
4
|
+
|:--|:-:|
|
|
5
|
+
| Package | [](https://pypi.org/project/mathematicskit/) [](https://pypi.org/project/mathematicskit/) |
|
|
6
|
+
| Quality | [](https://github.com/cpoli/mathkit/blob/main/LICENSE) [](https://github.com/cpoli/mathkit/actions/workflows/ci.yml) [](https://codecov.io/gh/cpoli/mathkit) [](#coverage) |
|
|
7
|
+
| Documentation | [](https://cpoli.github.io/mathkit/) |
|
|
8
|
+
| Code style | [](https://github.com/astral-sh/ruff) |
|
|
9
|
+
| Downloads | [](https://pepy.tech/project/mathematicskit) [](https://pepy.tech/project/mathematicskit) |
|
|
10
|
+
| Community | [](https://github.com/cpoli/mathkit) [](https://github.com/cpoli/mathkit) [](https://github.com/cpoli/mathkit/graphs/contributors) [](https://github.com/cpoli/mathkit/commits/main) |
|
|
11
|
+
|
|
12
|
+
A unified toolkit for computational mathematics, spanning the field end
|
|
13
|
+
to end: Newton's method chasing roots and Poincare sections of the
|
|
14
|
+
driven Duffing oscillator, Mandelbrot sets and the Feigenbaum route to
|
|
15
|
+
chaos, Dijkstra's shortest paths and finite-field arithmetic, the
|
|
16
|
+
Central Limit Theorem in action and Bessel functions in closed form --
|
|
17
|
+
with each domain's docs tracing the field's own foundational
|
|
18
|
+
breakthroughs in chronological, pedagogical order, every historical
|
|
19
|
+
milestone linked directly to the runnable code that reproduces it. 14
|
|
20
|
+
domain subpackages, one consistent NumPy-based API -- built directly on
|
|
21
|
+
`numpy`/`scipy` for anything they already implement (decompositions,
|
|
22
|
+
eigensolvers, quadrature, statistical distributions, optimization
|
|
23
|
+
routines, and more), hand-rolling an algorithm from scratch only where
|
|
24
|
+
no `numpy`/`scipy` equivalent exists (e.g. graph algorithms, the simplex
|
|
25
|
+
method, modular arithmetic) or where the algorithm's own iterate
|
|
26
|
+
behavior is the pedagogical subject (e.g. root-finder convergence
|
|
27
|
+
history, autodiff). No hard dependency on `networkx`, `cvxpy`, or
|
|
28
|
+
SageMath. Sharing common ODE integrators throughout. Conventionally
|
|
29
|
+
imported as `mk`.
|
|
30
|
+
|
|
31
|
+
All 14 domains from `mathkit-spec.md`'s build plan are implemented --
|
|
32
|
+
see [Subpackages](#subpackages) for the full list, or browse the docs at
|
|
33
|
+
<https://mathkit.readthedocs.io>.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python -m venv .venv && source .venv/bin/activate
|
|
39
|
+
pip install -e ".[dev]"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Published on PyPI as `mathematicskit` (the name `mathkit` was already
|
|
43
|
+
taken by an unrelated package) -- `pip install mathematicskit`, then
|
|
44
|
+
`import mathkit as mk` as usual.
|
|
45
|
+
|
|
46
|
+
## Quick start
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
import mathkit as mk
|
|
50
|
+
|
|
51
|
+
spline = mk.numerical_analysis.CubicSpline(x=[0, 1, 2, 3], y=[0, 1, 0, 1], boundary="natural")
|
|
52
|
+
print(spline.evaluate(1.5))
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Subpackages
|
|
56
|
+
|
|
57
|
+
Domain subpackages, each with runnable examples linked below:
|
|
58
|
+
|
|
59
|
+
- [`mathkit.numerical_analysis`](https://mathkit.readthedocs.io/en/latest/examples/numerical_analysis.html) -- root finding (bisection, Newton-Raphson, secant, fixed-point, hand-rolled for their convergence history), Lagrange/Newton (hand-rolled) plus scipy-backed cubic-spline interpolation, numpy-backed Chebyshev nodes, `numpy.linalg.lstsq`-based polynomial regression, and `numpy.linalg.cond`-based error/condition-number analysis.
|
|
60
|
+
- [`mathkit.linalg`](https://mathkit.readthedocs.io/en/latest/examples/linalg.html) -- LU/QR/Cholesky decompositions and eigenvalue computation via `scipy.linalg`/`numpy.linalg`, power/inverse iteration (hand-rolled), SVD, conjugate gradient and GMRES via `scipy.sparse.linalg`, and least-squares stability (normal equations vs. QR vs. `numpy.linalg.lstsq`).
|
|
61
|
+
- [`mathkit.calculus`](https://mathkit.readthedocs.io/en/latest/examples/calculus.html) -- finite-difference derivatives with Richardson extrapolation (hand-rolled), `scipy.integrate`-backed trapezoidal/Simpson/Gauss-Legendre/adaptive quadrature, forward-mode (dual numbers) and reverse-mode (backpropagation) automatic differentiation (hand-rolled), and Taylor/Maclaurin series.
|
|
62
|
+
- [`mathkit.ode_dynamics`](https://mathkit.readthedocs.io/en/latest/examples/ode_dynamics.html) -- Jacobian-linearization fixed-point stability (node/saddle/spiral/center), phase portraits, the logistic map's Feigenbaum route to chaos, saddle-node/pitchfork/Hopf bifurcation normal forms, the Van der Pol limit cycle, and Poincare sections of the driven Duffing oscillator.
|
|
63
|
+
- [`mathkit.fractals_chaos`](https://mathkit.readthedocs.io/en/latest/examples/fractals_chaos.html) -- Lyapunov exponent estimation, box-counting fractal dimension, Numba-accelerated Mandelbrot/Julia set generation, iterated function systems (Barnsley fern, Sierpinski triangle/carpet), and cellular automata (Wolfram rules, Conway's Game of Life).
|
|
64
|
+
- [`mathkit.optimization`](https://mathkit.readthedocs.io/en/latest/examples/optimization.html) -- gradient descent and nonlinear conjugate gradient (hand-rolled, iterate-path-exposing), Newton's method and BFGS via `scipy.optimize.minimize`, Lagrange multipliers and KKT-condition verification, a quadratic-penalty method, and linear programming via `scipy.optimize.linprog`.
|
|
65
|
+
- [`mathkit.probability`](https://mathkit.readthedocs.io/en/latest/examples/probability.html) -- binomial/Poisson/geometric/uniform/exponential/normal/gamma distributions via `scipy.stats` (plus mathkit's own MGFs), Monte Carlo integration with variance reduction (importance sampling, control variates), Law of Large Numbers/Central Limit Theorem simulation, and discrete-time Markov chains.
|
|
66
|
+
- [`mathkit.statistics`](https://mathkit.readthedocs.io/en/latest/examples/statistics.html) -- descriptive statistics, z/t/chi-square hypothesis tests and one-way ANOVA, confidence intervals for means/proportions/variances, OLS linear regression with residual diagnostics, and bootstrap resampling via `scipy.stats.bootstrap`.
|
|
67
|
+
- [`mathkit.number_theory`](https://mathkit.readthedocs.io/en/latest/examples/number_theory.html) -- the extended Euclidean algorithm and modular inverses, fast modular exponentiation, primality testing (trial division, Miller-Rabin) and prime generation, the Chinese Remainder Theorem, continued fractions and best rational approximations, Euler's totient/Mobius/divisor-sum functions, and linear/Pell Diophantine equation solvers (hand-rolled -- exact-integer number theory has no `numpy`/`scipy` equivalent).
|
|
68
|
+
- [`mathkit.combinatorics`](https://mathkit.readthedocs.io/en/latest/examples/combinatorics.html) -- permutation/combination counting via `scipy.special.perm`/`comb` (sequence generation via `itertools`), a hand-rolled Pascal's triangle, integer partitions and Young/Ferrers diagrams, the inclusion-exclusion principle and derangements, and Stirling/Catalan/Bell numbers (hand-rolled -- no scipy/numpy equivalent).
|
|
69
|
+
- [`mathkit.graph_theory`](https://mathkit.readthedocs.io/en/latest/examples/graph_theory.html) -- a lightweight own graph container (no `networkx`); shortest paths (Dijkstra/Bellman-Ford/Floyd-Warshall) and minimum spanning tree (Kruskal) via `scipy.sparse.csgraph`, with a hand-rolled Prim's kept for comparison; maximum flow/minimum cut via `scipy.sparse.csgraph.maximum_flow`; hand-rolled graph coloring (greedy, exact backtracking); and spectral graph theory (Laplacian via scipy, eigendecomposition via `numpy.linalg.eigh`).
|
|
70
|
+
- [`mathkit.abstract_algebra`](https://mathkit.readthedocs.io/en/latest/examples/abstract_algebra.html) -- cyclic and permutation groups with Cayley tables and group-property checks, subgroup/coset enumeration, finite field arithmetic (`GF(p)`/`GF(p^n)` via irreducible polynomials), and polynomial ring arithmetic over Z/Q/finite fields (hand-rolled throughout -- no scipy/numpy equivalent).
|
|
71
|
+
- [`mathkit.geometry`](https://mathkit.readthedocs.io/en/latest/examples/geometry.html) -- convex hull via `scipy.spatial.ConvexHull` (with a hand-rolled Graham scan comparison), Delaunay triangulation/Voronoi diagrams via `scipy.spatial`, hand-rolled segment intersection and point-in-polygon tests, polygon area/centroid via the shoelace formula, and curvature/arc-length/the Frenet-Serret frame for parametric curves.
|
|
72
|
+
- [`mathkit.special_functions`](https://mathkit.readthedocs.io/en/latest/examples/special_functions.html) -- the gamma/beta functions and Bessel functions via `scipy.special`, orthogonal polynomial families (Legendre/Chebyshev/Hermite/Laguerre) via `numpy.polynomial` with numerically-verified orthogonality, and the discrete Fourier transform via `numpy.fft` alongside a hand-rolled naive-DFT-vs-radix-2-FFT pedagogical speed comparison.
|
|
73
|
+
|
|
74
|
+
Shared infrastructure, used across the subpackages above rather than
|
|
75
|
+
standalone toolkits:
|
|
76
|
+
|
|
77
|
+
- `mathkit.constants` -- mathematical constants and default numerical
|
|
78
|
+
tolerances shared across subpackages.
|
|
79
|
+
- `mathkit.integrators` -- shared numerical ODE integrators (RK4,
|
|
80
|
+
leapfrog, Yoshida4, adaptive Dormand-Prince), used by
|
|
81
|
+
`mathkit.ode_dynamics`.
|
|
82
|
+
|
|
83
|
+
## Test
|
|
84
|
+
|
|
85
|
+
Tests live alongside each subpackage, at `mathkit/<name>/tests/`.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pytest # everything
|
|
89
|
+
pytest mathkit/numerical_analysis/tests # a single subpackage
|
|
90
|
+
|
|
91
|
+
# docstring examples, across every subpackage:
|
|
92
|
+
MPLBACKEND=Agg pytest --doctest-modules mathkit --ignore-glob="*/tests/*"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Both commands, plus `ruff check`/`ruff format --check`, run in CI on
|
|
96
|
+
every PR (`.github/workflows/ci.yml`) across Python 3.9-3.12 on Linux and
|
|
97
|
+
macOS. See [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
|
|
98
|
+
|
|
99
|
+
### Coverage
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
MPLBACKEND=Agg pytest -q --cov=mathkit --cov-report=term
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
620 tests, 96% line coverage overall. Per-subpackage coverage:
|
|
106
|
+
|
|
107
|
+
| Subpackage | Coverage | | Subpackage | Coverage |
|
|
108
|
+
|:--|--:|---|:--|--:|
|
|
109
|
+
| `abstract_algebra` | 97% | | `ode_dynamics` | 92% |
|
|
110
|
+
| `calculus` | 95% | | `optimization` | 99% |
|
|
111
|
+
| `combinatorics` | 98% | | `probability` | 98% |
|
|
112
|
+
| `fractals_chaos` | 92% | | `special_functions` | 100% |
|
|
113
|
+
| `geometry` | 100% | | `statistics` | 99% |
|
|
114
|
+
| `graph_theory` | 99% | | `integrators` | 50% |
|
|
115
|
+
| `linalg` | 95% | | `constants` | 100% |
|
|
116
|
+
| `number_theory` | 99% | | | |
|
|
117
|
+
| `numerical_analysis` | 97% | | | |
|
|
118
|
+
|
|
119
|
+
`visualizers/` modules are smoke-tested only (correct return type/shape,
|
|
120
|
+
or that `anim.save()` succeeds) rather than covered line-by-line, per the
|
|
121
|
+
testing convention in [CLAUDE.md](CLAUDE.md). `integrators` sits lower
|
|
122
|
+
because several of its fixed-step/adaptive methods aren't exercised
|
|
123
|
+
directly by its own tests, only indirectly through the two subpackages
|
|
124
|
+
(`ode_dynamics`, `fractals_chaos`) that call into it.
|
|
125
|
+
|
|
126
|
+
## Docs
|
|
127
|
+
|
|
128
|
+
Built docs are hosted at <https://cpoli.github.io/mathkit/>, served from
|
|
129
|
+
the `gh-pages` branch. To build locally:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pip install -e ".[docs]"
|
|
133
|
+
cd docs && make html
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
See `docs/source/history/` for a chronology of each domain's foundational
|
|
137
|
+
results, linked to the corresponding implementation at each step.
|
|
138
|
+
|
|
139
|
+
## Citation
|
|
140
|
+
|
|
141
|
+
If you use mathkit in your research, please cite it — see
|
|
142
|
+
[CITATION.cff](CITATION.cff).
|
|
143
|
+
|
|
144
|
+
## Contributing
|
|
145
|
+
|
|
146
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Please note that this project
|
|
147
|
+
follows the [Contributor Covenant](CODE_OF_CONDUCT.md).
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT -- see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mathematicskit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Unified computational mathematics toolkit: numerical analysis, linear algebra, calculus, dynamical systems, optimization, probability, statistics, number theory, combinatorics, graph theory, abstract algebra, geometry, special functions, and fractals/chaos -- all hand-rolled from first principles.
|
|
5
|
+
Author-email: Charles Poli <cpoli374@gmail.com>
|
|
6
|
+
Maintainer-email: Charles Poli <cpoli374@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/cpoli/mathkit
|
|
9
|
+
Project-URL: Issues, https://github.com/cpoli/mathkit/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/cpoli/mathkit/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Documentation, https://cpoli.github.io/mathkit/
|
|
12
|
+
Keywords: mathematics,numerical-analysis,linear-algebra,computational-mathematics,optimization,graph-theory,number-theory,probability,statistics
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy>=1.24
|
|
26
|
+
Requires-Dist: scipy>=1.10
|
|
27
|
+
Requires-Dist: matplotlib>=3.6
|
|
28
|
+
Requires-Dist: numba>=0.58
|
|
29
|
+
Requires-Dist: plotly>=5.15
|
|
30
|
+
Requires-Dist: sympy>=1.11
|
|
31
|
+
Requires-Dist: tqdm>=4.65
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
35
|
+
Requires-Dist: hypothesis>=6.90; extra == "test"
|
|
36
|
+
Requires-Dist: pillow>=9.0; extra == "test"
|
|
37
|
+
Provides-Extra: docs
|
|
38
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
39
|
+
Requires-Dist: pydata-sphinx-theme>=0.15; extra == "docs"
|
|
40
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.25; extra == "docs"
|
|
41
|
+
Requires-Dist: myst-parser>=2.0; extra == "docs"
|
|
42
|
+
Requires-Dist: sphinx-gallery>=0.15; extra == "docs"
|
|
43
|
+
Requires-Dist: sphinx-design>=0.6; extra == "docs"
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: mathematicskit[docs,test]; extra == "dev"
|
|
46
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
48
|
+
Requires-Dist: pre-commit>=3.7; extra == "dev"
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
# mathkit
|
|
52
|
+
|
|
53
|
+
| | |
|
|
54
|
+
|:--|:-:|
|
|
55
|
+
| Package | [](https://pypi.org/project/mathematicskit/) [](https://pypi.org/project/mathematicskit/) |
|
|
56
|
+
| Quality | [](https://github.com/cpoli/mathkit/blob/main/LICENSE) [](https://github.com/cpoli/mathkit/actions/workflows/ci.yml) [](https://codecov.io/gh/cpoli/mathkit) [](#coverage) |
|
|
57
|
+
| Documentation | [](https://cpoli.github.io/mathkit/) |
|
|
58
|
+
| Code style | [](https://github.com/astral-sh/ruff) |
|
|
59
|
+
| Downloads | [](https://pepy.tech/project/mathematicskit) [](https://pepy.tech/project/mathematicskit) |
|
|
60
|
+
| Community | [](https://github.com/cpoli/mathkit) [](https://github.com/cpoli/mathkit) [](https://github.com/cpoli/mathkit/graphs/contributors) [](https://github.com/cpoli/mathkit/commits/main) |
|
|
61
|
+
|
|
62
|
+
A unified toolkit for computational mathematics, spanning the field end
|
|
63
|
+
to end: Newton's method chasing roots and Poincare sections of the
|
|
64
|
+
driven Duffing oscillator, Mandelbrot sets and the Feigenbaum route to
|
|
65
|
+
chaos, Dijkstra's shortest paths and finite-field arithmetic, the
|
|
66
|
+
Central Limit Theorem in action and Bessel functions in closed form --
|
|
67
|
+
with each domain's docs tracing the field's own foundational
|
|
68
|
+
breakthroughs in chronological, pedagogical order, every historical
|
|
69
|
+
milestone linked directly to the runnable code that reproduces it. 14
|
|
70
|
+
domain subpackages, one consistent NumPy-based API -- built directly on
|
|
71
|
+
`numpy`/`scipy` for anything they already implement (decompositions,
|
|
72
|
+
eigensolvers, quadrature, statistical distributions, optimization
|
|
73
|
+
routines, and more), hand-rolling an algorithm from scratch only where
|
|
74
|
+
no `numpy`/`scipy` equivalent exists (e.g. graph algorithms, the simplex
|
|
75
|
+
method, modular arithmetic) or where the algorithm's own iterate
|
|
76
|
+
behavior is the pedagogical subject (e.g. root-finder convergence
|
|
77
|
+
history, autodiff). No hard dependency on `networkx`, `cvxpy`, or
|
|
78
|
+
SageMath. Sharing common ODE integrators throughout. Conventionally
|
|
79
|
+
imported as `mk`.
|
|
80
|
+
|
|
81
|
+
All 14 domains from `mathkit-spec.md`'s build plan are implemented --
|
|
82
|
+
see [Subpackages](#subpackages) for the full list, or browse the docs at
|
|
83
|
+
<https://mathkit.readthedocs.io>.
|
|
84
|
+
|
|
85
|
+
## Install
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python -m venv .venv && source .venv/bin/activate
|
|
89
|
+
pip install -e ".[dev]"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Published on PyPI as `mathematicskit` (the name `mathkit` was already
|
|
93
|
+
taken by an unrelated package) -- `pip install mathematicskit`, then
|
|
94
|
+
`import mathkit as mk` as usual.
|
|
95
|
+
|
|
96
|
+
## Quick start
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import mathkit as mk
|
|
100
|
+
|
|
101
|
+
spline = mk.numerical_analysis.CubicSpline(x=[0, 1, 2, 3], y=[0, 1, 0, 1], boundary="natural")
|
|
102
|
+
print(spline.evaluate(1.5))
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Subpackages
|
|
106
|
+
|
|
107
|
+
Domain subpackages, each with runnable examples linked below:
|
|
108
|
+
|
|
109
|
+
- [`mathkit.numerical_analysis`](https://mathkit.readthedocs.io/en/latest/examples/numerical_analysis.html) -- root finding (bisection, Newton-Raphson, secant, fixed-point, hand-rolled for their convergence history), Lagrange/Newton (hand-rolled) plus scipy-backed cubic-spline interpolation, numpy-backed Chebyshev nodes, `numpy.linalg.lstsq`-based polynomial regression, and `numpy.linalg.cond`-based error/condition-number analysis.
|
|
110
|
+
- [`mathkit.linalg`](https://mathkit.readthedocs.io/en/latest/examples/linalg.html) -- LU/QR/Cholesky decompositions and eigenvalue computation via `scipy.linalg`/`numpy.linalg`, power/inverse iteration (hand-rolled), SVD, conjugate gradient and GMRES via `scipy.sparse.linalg`, and least-squares stability (normal equations vs. QR vs. `numpy.linalg.lstsq`).
|
|
111
|
+
- [`mathkit.calculus`](https://mathkit.readthedocs.io/en/latest/examples/calculus.html) -- finite-difference derivatives with Richardson extrapolation (hand-rolled), `scipy.integrate`-backed trapezoidal/Simpson/Gauss-Legendre/adaptive quadrature, forward-mode (dual numbers) and reverse-mode (backpropagation) automatic differentiation (hand-rolled), and Taylor/Maclaurin series.
|
|
112
|
+
- [`mathkit.ode_dynamics`](https://mathkit.readthedocs.io/en/latest/examples/ode_dynamics.html) -- Jacobian-linearization fixed-point stability (node/saddle/spiral/center), phase portraits, the logistic map's Feigenbaum route to chaos, saddle-node/pitchfork/Hopf bifurcation normal forms, the Van der Pol limit cycle, and Poincare sections of the driven Duffing oscillator.
|
|
113
|
+
- [`mathkit.fractals_chaos`](https://mathkit.readthedocs.io/en/latest/examples/fractals_chaos.html) -- Lyapunov exponent estimation, box-counting fractal dimension, Numba-accelerated Mandelbrot/Julia set generation, iterated function systems (Barnsley fern, Sierpinski triangle/carpet), and cellular automata (Wolfram rules, Conway's Game of Life).
|
|
114
|
+
- [`mathkit.optimization`](https://mathkit.readthedocs.io/en/latest/examples/optimization.html) -- gradient descent and nonlinear conjugate gradient (hand-rolled, iterate-path-exposing), Newton's method and BFGS via `scipy.optimize.minimize`, Lagrange multipliers and KKT-condition verification, a quadratic-penalty method, and linear programming via `scipy.optimize.linprog`.
|
|
115
|
+
- [`mathkit.probability`](https://mathkit.readthedocs.io/en/latest/examples/probability.html) -- binomial/Poisson/geometric/uniform/exponential/normal/gamma distributions via `scipy.stats` (plus mathkit's own MGFs), Monte Carlo integration with variance reduction (importance sampling, control variates), Law of Large Numbers/Central Limit Theorem simulation, and discrete-time Markov chains.
|
|
116
|
+
- [`mathkit.statistics`](https://mathkit.readthedocs.io/en/latest/examples/statistics.html) -- descriptive statistics, z/t/chi-square hypothesis tests and one-way ANOVA, confidence intervals for means/proportions/variances, OLS linear regression with residual diagnostics, and bootstrap resampling via `scipy.stats.bootstrap`.
|
|
117
|
+
- [`mathkit.number_theory`](https://mathkit.readthedocs.io/en/latest/examples/number_theory.html) -- the extended Euclidean algorithm and modular inverses, fast modular exponentiation, primality testing (trial division, Miller-Rabin) and prime generation, the Chinese Remainder Theorem, continued fractions and best rational approximations, Euler's totient/Mobius/divisor-sum functions, and linear/Pell Diophantine equation solvers (hand-rolled -- exact-integer number theory has no `numpy`/`scipy` equivalent).
|
|
118
|
+
- [`mathkit.combinatorics`](https://mathkit.readthedocs.io/en/latest/examples/combinatorics.html) -- permutation/combination counting via `scipy.special.perm`/`comb` (sequence generation via `itertools`), a hand-rolled Pascal's triangle, integer partitions and Young/Ferrers diagrams, the inclusion-exclusion principle and derangements, and Stirling/Catalan/Bell numbers (hand-rolled -- no scipy/numpy equivalent).
|
|
119
|
+
- [`mathkit.graph_theory`](https://mathkit.readthedocs.io/en/latest/examples/graph_theory.html) -- a lightweight own graph container (no `networkx`); shortest paths (Dijkstra/Bellman-Ford/Floyd-Warshall) and minimum spanning tree (Kruskal) via `scipy.sparse.csgraph`, with a hand-rolled Prim's kept for comparison; maximum flow/minimum cut via `scipy.sparse.csgraph.maximum_flow`; hand-rolled graph coloring (greedy, exact backtracking); and spectral graph theory (Laplacian via scipy, eigendecomposition via `numpy.linalg.eigh`).
|
|
120
|
+
- [`mathkit.abstract_algebra`](https://mathkit.readthedocs.io/en/latest/examples/abstract_algebra.html) -- cyclic and permutation groups with Cayley tables and group-property checks, subgroup/coset enumeration, finite field arithmetic (`GF(p)`/`GF(p^n)` via irreducible polynomials), and polynomial ring arithmetic over Z/Q/finite fields (hand-rolled throughout -- no scipy/numpy equivalent).
|
|
121
|
+
- [`mathkit.geometry`](https://mathkit.readthedocs.io/en/latest/examples/geometry.html) -- convex hull via `scipy.spatial.ConvexHull` (with a hand-rolled Graham scan comparison), Delaunay triangulation/Voronoi diagrams via `scipy.spatial`, hand-rolled segment intersection and point-in-polygon tests, polygon area/centroid via the shoelace formula, and curvature/arc-length/the Frenet-Serret frame for parametric curves.
|
|
122
|
+
- [`mathkit.special_functions`](https://mathkit.readthedocs.io/en/latest/examples/special_functions.html) -- the gamma/beta functions and Bessel functions via `scipy.special`, orthogonal polynomial families (Legendre/Chebyshev/Hermite/Laguerre) via `numpy.polynomial` with numerically-verified orthogonality, and the discrete Fourier transform via `numpy.fft` alongside a hand-rolled naive-DFT-vs-radix-2-FFT pedagogical speed comparison.
|
|
123
|
+
|
|
124
|
+
Shared infrastructure, used across the subpackages above rather than
|
|
125
|
+
standalone toolkits:
|
|
126
|
+
|
|
127
|
+
- `mathkit.constants` -- mathematical constants and default numerical
|
|
128
|
+
tolerances shared across subpackages.
|
|
129
|
+
- `mathkit.integrators` -- shared numerical ODE integrators (RK4,
|
|
130
|
+
leapfrog, Yoshida4, adaptive Dormand-Prince), used by
|
|
131
|
+
`mathkit.ode_dynamics`.
|
|
132
|
+
|
|
133
|
+
## Test
|
|
134
|
+
|
|
135
|
+
Tests live alongside each subpackage, at `mathkit/<name>/tests/`.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pytest # everything
|
|
139
|
+
pytest mathkit/numerical_analysis/tests # a single subpackage
|
|
140
|
+
|
|
141
|
+
# docstring examples, across every subpackage:
|
|
142
|
+
MPLBACKEND=Agg pytest --doctest-modules mathkit --ignore-glob="*/tests/*"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Both commands, plus `ruff check`/`ruff format --check`, run in CI on
|
|
146
|
+
every PR (`.github/workflows/ci.yml`) across Python 3.9-3.12 on Linux and
|
|
147
|
+
macOS. See [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
|
|
148
|
+
|
|
149
|
+
### Coverage
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
MPLBACKEND=Agg pytest -q --cov=mathkit --cov-report=term
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
620 tests, 96% line coverage overall. Per-subpackage coverage:
|
|
156
|
+
|
|
157
|
+
| Subpackage | Coverage | | Subpackage | Coverage |
|
|
158
|
+
|:--|--:|---|:--|--:|
|
|
159
|
+
| `abstract_algebra` | 97% | | `ode_dynamics` | 92% |
|
|
160
|
+
| `calculus` | 95% | | `optimization` | 99% |
|
|
161
|
+
| `combinatorics` | 98% | | `probability` | 98% |
|
|
162
|
+
| `fractals_chaos` | 92% | | `special_functions` | 100% |
|
|
163
|
+
| `geometry` | 100% | | `statistics` | 99% |
|
|
164
|
+
| `graph_theory` | 99% | | `integrators` | 50% |
|
|
165
|
+
| `linalg` | 95% | | `constants` | 100% |
|
|
166
|
+
| `number_theory` | 99% | | | |
|
|
167
|
+
| `numerical_analysis` | 97% | | | |
|
|
168
|
+
|
|
169
|
+
`visualizers/` modules are smoke-tested only (correct return type/shape,
|
|
170
|
+
or that `anim.save()` succeeds) rather than covered line-by-line, per the
|
|
171
|
+
testing convention in [CLAUDE.md](CLAUDE.md). `integrators` sits lower
|
|
172
|
+
because several of its fixed-step/adaptive methods aren't exercised
|
|
173
|
+
directly by its own tests, only indirectly through the two subpackages
|
|
174
|
+
(`ode_dynamics`, `fractals_chaos`) that call into it.
|
|
175
|
+
|
|
176
|
+
## Docs
|
|
177
|
+
|
|
178
|
+
Built docs are hosted at <https://cpoli.github.io/mathkit/>, served from
|
|
179
|
+
the `gh-pages` branch. To build locally:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
pip install -e ".[docs]"
|
|
183
|
+
cd docs && make html
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
See `docs/source/history/` for a chronology of each domain's foundational
|
|
187
|
+
results, linked to the corresponding implementation at each step.
|
|
188
|
+
|
|
189
|
+
## Citation
|
|
190
|
+
|
|
191
|
+
If you use mathkit in your research, please cite it — see
|
|
192
|
+
[CITATION.cff](CITATION.cff).
|
|
193
|
+
|
|
194
|
+
## Contributing
|
|
195
|
+
|
|
196
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Please note that this project
|
|
197
|
+
follows the [Contributor Covenant](CODE_OF_CONDUCT.md).
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT -- see [LICENSE](LICENSE).
|