claudemath 0.1__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.
- claudemath-0.1/LICENSE +21 -0
- claudemath-0.1/PKG-INFO +171 -0
- claudemath-0.1/README.md +139 -0
- claudemath-0.1/claudemath/__init__.py +54 -0
- claudemath-0.1/claudemath/algebra.py +890 -0
- claudemath-0.1/claudemath/arithmetic.py +752 -0
- claudemath-0.1/claudemath/calculus.py +1003 -0
- claudemath-0.1/claudemath/cli.py +823 -0
- claudemath-0.1/claudemath/combinatorics.py +857 -0
- claudemath-0.1/claudemath/complex_numbers.py +483 -0
- claudemath-0.1/claudemath/coordinate_systems.py +552 -0
- claudemath-0.1/claudemath/differential_equations.py +534 -0
- claudemath-0.1/claudemath/discrete_mathematics.py +565 -0
- claudemath-0.1/claudemath/fourier_analysis.py +604 -0
- claudemath-0.1/claudemath/geometry.py +635 -0
- claudemath-0.1/claudemath/graph_theory.py +976 -0
- claudemath-0.1/claudemath/linear_algebra.py +869 -0
- claudemath-0.1/claudemath/matrix_operations.py +710 -0
- claudemath-0.1/claudemath/number_theory.py +1245 -0
- claudemath-0.1/claudemath/numerical_analysis.py +1042 -0
- claudemath-0.1/claudemath/polynomial_operations.py +781 -0
- claudemath-0.1/claudemath/probability.py +539 -0
- claudemath-0.1/claudemath/statistics.py +872 -0
- claudemath-0.1/claudemath/trigonometry.py +1067 -0
- claudemath-0.1/claudemath/vector_operations.py +554 -0
- claudemath-0.1/claudemath.egg-info/PKG-INFO +171 -0
- claudemath-0.1/claudemath.egg-info/SOURCES.txt +31 -0
- claudemath-0.1/claudemath.egg-info/dependency_links.txt +1 -0
- claudemath-0.1/claudemath.egg-info/entry_points.txt +2 -0
- claudemath-0.1/claudemath.egg-info/top_level.txt +1 -0
- claudemath-0.1/pyproject.toml +67 -0
- claudemath-0.1/setup.cfg +4 -0
- claudemath-0.1/setup.py +18 -0
claudemath-0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dan Studios
|
|
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.
|
claudemath-0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: claudemath
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: A comprehensive, advanced pure-Python mathematics library featuring 1,400+ mathematical algorithms across 20 mathematical domains.
|
|
5
|
+
Author: claudemath contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jangalacharansaisri963-eng/claudemath
|
|
8
|
+
Project-URL: Repository, https://github.com/jangalacharansaisri963-eng/claudemath
|
|
9
|
+
Project-URL: Issues, https://github.com/jangalacharansaisri963-eng/claudemath/issues
|
|
10
|
+
Keywords: math,mathematics,pure-python,calculus,algebra,trigonometry,linear-algebra,matrix,statistics,probability,number-theory,geometry,combinatorics,differential-equations,fourier-analysis,graph-theory,numerical-analysis,polynomial,vectors
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Education
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
26
|
+
Classifier: Topic :: Education
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-python
|
|
32
|
+
|
|
33
|
+
# claudemath
|
|
34
|
+
|
|
35
|
+
**claudemath** is an advanced, comprehensive, zero-dependency pure-Python mathematics library designed for PyPI. It features **1,490+ mathematical algorithms** across **20 specialized mathematical domains**.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Key Highlights
|
|
40
|
+
|
|
41
|
+
- **Pure Python Standard Library**: Absolutely zero external dependencies (no NumPy or SciPy required). Runs anywhere Python 3.8+ runs.
|
|
42
|
+
- **20 Comprehensive Domains**: 1,490+ verified algorithms, numerical routines, symbolic helpers, and mathematical transforms.
|
|
43
|
+
- **Deterministic & High-Precision**: Built with precision, type annotations (`typing`), robust numerical stability, and comprehensive edge-case handling.
|
|
44
|
+
- **Educational & Production Ready**: Clear mathematical docstrings citing formulas and theorems.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Domain Overview
|
|
49
|
+
|
|
50
|
+
| Module | Description | Function Count |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `claudemath.arithmetic` | GCD/LCM, modular arithmetic, factorials, binomials, means, ratios, rounding | 72 |
|
|
53
|
+
| `claudemath.algebra` | Linear/quadratic/cubic/quartic solvers, inequalities, systems, sequences | 80 |
|
|
54
|
+
| `claudemath.trigonometry` | Standard & hyperbolic functions, inverse hyperbolic, angle conversions, identities | 140 |
|
|
55
|
+
| `claudemath.calculus` | Numerical derivatives, single & multivariable integrals, Taylor series, limits | 114 |
|
|
56
|
+
| `claudemath.linear_algebra` | Vectors, dot/cross products, norms, angles, projections, Gram-Schmidt | 84 |
|
|
57
|
+
| `claudemath.matrix_operations` | Matrix addition, multiplication, determinants, inverses, rank, LU, QR, Cholesky | 63 |
|
|
58
|
+
| `claudemath.statistics` | Central tendency, dispersion, skewness, kurtosis, covariance, correlation, regression | 86 |
|
|
59
|
+
| `claudemath.probability` | PMF/PDF/CDF for binomial, Poisson, normal, exponential, beta, gamma distributions | 72 |
|
|
60
|
+
| `claudemath.combinatorics` | Permutations, combinations, partitions, Bell numbers, Stirling numbers, derangements | 73 |
|
|
61
|
+
| `claudemath.geometry` | 2D/3D shapes, Euclidean geometry, polygons, polyhedra, intersection tests | 87 |
|
|
62
|
+
| `claudemath.number_theory` | Primality tests (Miller-Rabin), sieve of Eratosthenes, totient, Mobius, Chinese remainder | 102 |
|
|
63
|
+
| `claudemath.complex_numbers` | Arithmetic, polar/rectangular conversions, complex roots, exponential/log/trig | 65 |
|
|
64
|
+
| `claudemath.polynomial_operations` | Polynomial arithmetic, roots (Durand-Kerner), Horner's method, Chebyshev, Legendre | 62 |
|
|
65
|
+
| `claudemath.discrete_mathematics` | Logic, truth tables, boolean algebra, recurrence relations, posets, lattices | 56 |
|
|
66
|
+
| `claudemath.numerical_analysis` | Root finding (Newton, Halley, Brent), interpolation (Lagrange, spline), Romberg | 66 |
|
|
67
|
+
| `claudemath.vector_operations` | 2D/3D/nD vector operations, coordinate transforms, angle between vectors, distance metrics | 60 |
|
|
68
|
+
| `claudemath.coordinate_systems` | Cartesian, Polar, Cylindrical, Spherical, Toroidal, Parabolic conversions | 56 |
|
|
69
|
+
| `claudemath.fourier_analysis` | FFT (Cooley-Tukey), IFFT, DFT, DCT-I..IV, DST-I..IV, FWHT, STFT, spectral analysis | 51 |
|
|
70
|
+
| `claudemath.differential_equations`| Euler, Heun, RK4, RKF45, Adams-Bashforth/Moulton, Lorenz, Lotka-Volterra, PDEs | 51 |
|
|
71
|
+
| `claudemath.graph_theory` | BFS, DFS, Dijkstra, Bellman-Ford, Floyd-Warshall, A*, Kruskal, Prim, PageRank, Tarjan | 56 |
|
|
72
|
+
|
|
73
|
+
**Total: 1,496 functions across 20 modules.**
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install claudemath
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Or clone and install in development mode:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
git clone https://github.com/claudemath/claudemath.git
|
|
87
|
+
cd claudemath
|
|
88
|
+
pip install -e .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Quickstart Examples
|
|
94
|
+
|
|
95
|
+
### 1. Arithmetic & Number Theory
|
|
96
|
+
```python
|
|
97
|
+
from claudemath import arithmetic, number_theory
|
|
98
|
+
|
|
99
|
+
# Extended Euclidean Algorithm
|
|
100
|
+
gcd, x, y = number_theory.extended_gcd(240, 46)
|
|
101
|
+
print(f"gcd(240, 46) = {gcd}, x = {x}, y = {y}")
|
|
102
|
+
|
|
103
|
+
# Fast Miller-Rabin Primality Test
|
|
104
|
+
print("Is 104729 prime?", number_theory.is_prime_miller_rabin(104729))
|
|
105
|
+
|
|
106
|
+
# Modular Inverse
|
|
107
|
+
print("Mod inverse of 3 mod 11:", number_theory.modular_inverse(3, 11))
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 2. Calculus & Numerical Analysis
|
|
111
|
+
```python
|
|
112
|
+
from claudemath import calculus, numerical_analysis
|
|
113
|
+
import math
|
|
114
|
+
|
|
115
|
+
# Adaptive Simpson's rule integration
|
|
116
|
+
f = lambda x: math.sin(x) / (x + 1.0)
|
|
117
|
+
integral = calculus.integral_simpson(f, 0.0, math.pi, n_intervals=100)
|
|
118
|
+
print("Integral:", integral)
|
|
119
|
+
|
|
120
|
+
# Brent's method root finding
|
|
121
|
+
root = numerical_analysis.brent_root(lambda x: x**3 - 2*x - 5, 2.0, 3.0)
|
|
122
|
+
print("Root of x^3 - 2x - 5 = 0:", root)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 3. Differential Equations & Chaos
|
|
126
|
+
```python
|
|
127
|
+
from claudemath import differential_equations
|
|
128
|
+
|
|
129
|
+
# Solve Lorenz chaotic attractor with classical RK4
|
|
130
|
+
ts, states = differential_equations.ode_system_solve_rk4(
|
|
131
|
+
differential_equations.lorenz_system_derivative,
|
|
132
|
+
t0=0.0,
|
|
133
|
+
y0=[1.0, 1.0, 1.0],
|
|
134
|
+
t_end=10.0,
|
|
135
|
+
n_steps=1000
|
|
136
|
+
)
|
|
137
|
+
print(f"Computed {len(states)} time steps. Final state: {states[-1]}")
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 4. Graph Theory
|
|
141
|
+
```python
|
|
142
|
+
from claudemath import graph_theory
|
|
143
|
+
|
|
144
|
+
# Shortest paths via Dijkstra
|
|
145
|
+
adj = {
|
|
146
|
+
0: [(1, 4.0), (2, 2.0)],
|
|
147
|
+
1: [(2, 1.0), (3, 5.0)],
|
|
148
|
+
2: [(3, 8.0), (4, 10.0)],
|
|
149
|
+
3: [(4, 2.0)],
|
|
150
|
+
4: []
|
|
151
|
+
}
|
|
152
|
+
dist, prev = graph_theory.dijkstra_shortest_paths(adj, start=0)
|
|
153
|
+
print("Distances from node 0:", dist)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### 5. Fourier Analysis
|
|
157
|
+
```python
|
|
158
|
+
from claudemath import fourier_analysis
|
|
159
|
+
import math
|
|
160
|
+
|
|
161
|
+
# Compute Cooley-Tukey Radix-2 FFT
|
|
162
|
+
signal = [math.sin(2 * math.pi * 5 * i / 64) for i in range(64)]
|
|
163
|
+
fft_result = fourier_analysis.fft_cooley_tukey([complex(x, 0.0) for x in signal])
|
|
164
|
+
print(f"FFT bin 5 magnitude: {abs(fft_result[5]):.4f}")
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT License. Copyright (c) 2026 claudemath contributors.
|
claudemath-0.1/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# claudemath
|
|
2
|
+
|
|
3
|
+
**claudemath** is an advanced, comprehensive, zero-dependency pure-Python mathematics library designed for PyPI. It features **1,490+ mathematical algorithms** across **20 specialized mathematical domains**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Key Highlights
|
|
8
|
+
|
|
9
|
+
- **Pure Python Standard Library**: Absolutely zero external dependencies (no NumPy or SciPy required). Runs anywhere Python 3.8+ runs.
|
|
10
|
+
- **20 Comprehensive Domains**: 1,490+ verified algorithms, numerical routines, symbolic helpers, and mathematical transforms.
|
|
11
|
+
- **Deterministic & High-Precision**: Built with precision, type annotations (`typing`), robust numerical stability, and comprehensive edge-case handling.
|
|
12
|
+
- **Educational & Production Ready**: Clear mathematical docstrings citing formulas and theorems.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Domain Overview
|
|
17
|
+
|
|
18
|
+
| Module | Description | Function Count |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `claudemath.arithmetic` | GCD/LCM, modular arithmetic, factorials, binomials, means, ratios, rounding | 72 |
|
|
21
|
+
| `claudemath.algebra` | Linear/quadratic/cubic/quartic solvers, inequalities, systems, sequences | 80 |
|
|
22
|
+
| `claudemath.trigonometry` | Standard & hyperbolic functions, inverse hyperbolic, angle conversions, identities | 140 |
|
|
23
|
+
| `claudemath.calculus` | Numerical derivatives, single & multivariable integrals, Taylor series, limits | 114 |
|
|
24
|
+
| `claudemath.linear_algebra` | Vectors, dot/cross products, norms, angles, projections, Gram-Schmidt | 84 |
|
|
25
|
+
| `claudemath.matrix_operations` | Matrix addition, multiplication, determinants, inverses, rank, LU, QR, Cholesky | 63 |
|
|
26
|
+
| `claudemath.statistics` | Central tendency, dispersion, skewness, kurtosis, covariance, correlation, regression | 86 |
|
|
27
|
+
| `claudemath.probability` | PMF/PDF/CDF for binomial, Poisson, normal, exponential, beta, gamma distributions | 72 |
|
|
28
|
+
| `claudemath.combinatorics` | Permutations, combinations, partitions, Bell numbers, Stirling numbers, derangements | 73 |
|
|
29
|
+
| `claudemath.geometry` | 2D/3D shapes, Euclidean geometry, polygons, polyhedra, intersection tests | 87 |
|
|
30
|
+
| `claudemath.number_theory` | Primality tests (Miller-Rabin), sieve of Eratosthenes, totient, Mobius, Chinese remainder | 102 |
|
|
31
|
+
| `claudemath.complex_numbers` | Arithmetic, polar/rectangular conversions, complex roots, exponential/log/trig | 65 |
|
|
32
|
+
| `claudemath.polynomial_operations` | Polynomial arithmetic, roots (Durand-Kerner), Horner's method, Chebyshev, Legendre | 62 |
|
|
33
|
+
| `claudemath.discrete_mathematics` | Logic, truth tables, boolean algebra, recurrence relations, posets, lattices | 56 |
|
|
34
|
+
| `claudemath.numerical_analysis` | Root finding (Newton, Halley, Brent), interpolation (Lagrange, spline), Romberg | 66 |
|
|
35
|
+
| `claudemath.vector_operations` | 2D/3D/nD vector operations, coordinate transforms, angle between vectors, distance metrics | 60 |
|
|
36
|
+
| `claudemath.coordinate_systems` | Cartesian, Polar, Cylindrical, Spherical, Toroidal, Parabolic conversions | 56 |
|
|
37
|
+
| `claudemath.fourier_analysis` | FFT (Cooley-Tukey), IFFT, DFT, DCT-I..IV, DST-I..IV, FWHT, STFT, spectral analysis | 51 |
|
|
38
|
+
| `claudemath.differential_equations`| Euler, Heun, RK4, RKF45, Adams-Bashforth/Moulton, Lorenz, Lotka-Volterra, PDEs | 51 |
|
|
39
|
+
| `claudemath.graph_theory` | BFS, DFS, Dijkstra, Bellman-Ford, Floyd-Warshall, A*, Kruskal, Prim, PageRank, Tarjan | 56 |
|
|
40
|
+
|
|
41
|
+
**Total: 1,496 functions across 20 modules.**
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install claudemath
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or clone and install in development mode:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/claudemath/claudemath.git
|
|
55
|
+
cd claudemath
|
|
56
|
+
pip install -e .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quickstart Examples
|
|
62
|
+
|
|
63
|
+
### 1. Arithmetic & Number Theory
|
|
64
|
+
```python
|
|
65
|
+
from claudemath import arithmetic, number_theory
|
|
66
|
+
|
|
67
|
+
# Extended Euclidean Algorithm
|
|
68
|
+
gcd, x, y = number_theory.extended_gcd(240, 46)
|
|
69
|
+
print(f"gcd(240, 46) = {gcd}, x = {x}, y = {y}")
|
|
70
|
+
|
|
71
|
+
# Fast Miller-Rabin Primality Test
|
|
72
|
+
print("Is 104729 prime?", number_theory.is_prime_miller_rabin(104729))
|
|
73
|
+
|
|
74
|
+
# Modular Inverse
|
|
75
|
+
print("Mod inverse of 3 mod 11:", number_theory.modular_inverse(3, 11))
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 2. Calculus & Numerical Analysis
|
|
79
|
+
```python
|
|
80
|
+
from claudemath import calculus, numerical_analysis
|
|
81
|
+
import math
|
|
82
|
+
|
|
83
|
+
# Adaptive Simpson's rule integration
|
|
84
|
+
f = lambda x: math.sin(x) / (x + 1.0)
|
|
85
|
+
integral = calculus.integral_simpson(f, 0.0, math.pi, n_intervals=100)
|
|
86
|
+
print("Integral:", integral)
|
|
87
|
+
|
|
88
|
+
# Brent's method root finding
|
|
89
|
+
root = numerical_analysis.brent_root(lambda x: x**3 - 2*x - 5, 2.0, 3.0)
|
|
90
|
+
print("Root of x^3 - 2x - 5 = 0:", root)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3. Differential Equations & Chaos
|
|
94
|
+
```python
|
|
95
|
+
from claudemath import differential_equations
|
|
96
|
+
|
|
97
|
+
# Solve Lorenz chaotic attractor with classical RK4
|
|
98
|
+
ts, states = differential_equations.ode_system_solve_rk4(
|
|
99
|
+
differential_equations.lorenz_system_derivative,
|
|
100
|
+
t0=0.0,
|
|
101
|
+
y0=[1.0, 1.0, 1.0],
|
|
102
|
+
t_end=10.0,
|
|
103
|
+
n_steps=1000
|
|
104
|
+
)
|
|
105
|
+
print(f"Computed {len(states)} time steps. Final state: {states[-1]}")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 4. Graph Theory
|
|
109
|
+
```python
|
|
110
|
+
from claudemath import graph_theory
|
|
111
|
+
|
|
112
|
+
# Shortest paths via Dijkstra
|
|
113
|
+
adj = {
|
|
114
|
+
0: [(1, 4.0), (2, 2.0)],
|
|
115
|
+
1: [(2, 1.0), (3, 5.0)],
|
|
116
|
+
2: [(3, 8.0), (4, 10.0)],
|
|
117
|
+
3: [(4, 2.0)],
|
|
118
|
+
4: []
|
|
119
|
+
}
|
|
120
|
+
dist, prev = graph_theory.dijkstra_shortest_paths(adj, start=0)
|
|
121
|
+
print("Distances from node 0:", dist)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 5. Fourier Analysis
|
|
125
|
+
```python
|
|
126
|
+
from claudemath import fourier_analysis
|
|
127
|
+
import math
|
|
128
|
+
|
|
129
|
+
# Compute Cooley-Tukey Radix-2 FFT
|
|
130
|
+
signal = [math.sin(2 * math.pi * 5 * i / 64) for i in range(64)]
|
|
131
|
+
fft_result = fourier_analysis.fft_cooley_tukey([complex(x, 0.0) for x in signal])
|
|
132
|
+
print(f"FFT bin 5 magnitude: {abs(fft_result[5]):.4f}")
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT License. Copyright (c) 2026 claudemath contributors.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""claudemath: Advanced Pure-Python Mathematics Library.
|
|
2
|
+
|
|
3
|
+
A complete, zero-dependency pure-Python mathematics library featuring 1,400+ mathematical
|
|
4
|
+
algorithms across 20 specialized domains.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from . import (
|
|
8
|
+
algebra,
|
|
9
|
+
arithmetic,
|
|
10
|
+
calculus,
|
|
11
|
+
combinatorics,
|
|
12
|
+
complex_numbers,
|
|
13
|
+
coordinate_systems,
|
|
14
|
+
differential_equations,
|
|
15
|
+
discrete_mathematics,
|
|
16
|
+
fourier_analysis,
|
|
17
|
+
geometry,
|
|
18
|
+
graph_theory,
|
|
19
|
+
linear_algebra,
|
|
20
|
+
matrix_operations,
|
|
21
|
+
number_theory,
|
|
22
|
+
numerical_analysis,
|
|
23
|
+
polynomial_operations,
|
|
24
|
+
probability,
|
|
25
|
+
statistics,
|
|
26
|
+
trigonometry,
|
|
27
|
+
vector_operations,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
__version__ = "1.0.0"
|
|
31
|
+
__author__ = "claudemath developers"
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
"algebra",
|
|
35
|
+
"arithmetic",
|
|
36
|
+
"calculus",
|
|
37
|
+
"combinatorics",
|
|
38
|
+
"complex_numbers",
|
|
39
|
+
"coordinate_systems",
|
|
40
|
+
"differential_equations",
|
|
41
|
+
"discrete_mathematics",
|
|
42
|
+
"fourier_analysis",
|
|
43
|
+
"geometry",
|
|
44
|
+
"graph_theory",
|
|
45
|
+
"linear_algebra",
|
|
46
|
+
"matrix_operations",
|
|
47
|
+
"number_theory",
|
|
48
|
+
"numerical_analysis",
|
|
49
|
+
"polynomial_operations",
|
|
50
|
+
"probability",
|
|
51
|
+
"statistics",
|
|
52
|
+
"trigonometry",
|
|
53
|
+
"vector_operations",
|
|
54
|
+
]
|