coordinate-system 5.2.1__cp313-cp313-win_amd64.whl → 6.0.0__cp313-cp313-win_amd64.whl
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.
- coordinate_system/__init__.py +112 -144
- coordinate_system/coordinate_system.cp313-win_amd64.pyd +0 -0
- coordinate_system/differential_geometry.py +618 -298
- coordinate_system/fourier_spectral.py +110 -361
- coordinate_system/qframes.py +792 -0
- coordinate_system/test_quantum_upgrade.py +383 -0
- coordinate_system/visualization.py +695 -292
- coordinate_system-6.0.0.dist-info/METADATA +783 -0
- coordinate_system-6.0.0.dist-info/RECORD +14 -0
- coordinate_system/__pycache__/__init__.cpython-313.pyc +0 -0
- coordinate_system/__pycache__/curvature.cpython-313.pyc +0 -0
- coordinate_system/__pycache__/curve_interpolation.cpython-313.pyc +0 -0
- coordinate_system/__pycache__/differential_geometry.cpython-313.pyc +0 -0
- coordinate_system/__pycache__/fourier_spectral.cpython-313.pyc +0 -0
- coordinate_system/__pycache__/visualization.cpython-313.pyc +0 -0
- coordinate_system/fourier_frames.py +0 -530
- coordinate_system-5.2.1.dist-info/METADATA +0 -807
- coordinate_system-5.2.1.dist-info/RECORD +0 -19
- {coordinate_system-5.2.1.dist-info → coordinate_system-6.0.0.dist-info}/LICENSE +0 -0
- {coordinate_system-5.2.1.dist-info → coordinate_system-6.0.0.dist-info}/WHEEL +0 -0
- {coordinate_system-5.2.1.dist-info → coordinate_system-6.0.0.dist-info}/top_level.txt +0 -0
coordinate_system/__init__.py
CHANGED
|
@@ -1,49 +1,60 @@
|
|
|
1
1
|
# coordinate_system/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
Coordinate System Package
|
|
4
|
+
=========================
|
|
5
|
+
|
|
6
|
+
A comprehensive 3D coordinate system library with differential geometry support.
|
|
7
|
+
|
|
8
|
+
Core Components:
|
|
9
|
+
- vec3, vec2: Vector types
|
|
10
|
+
- quat: Quaternion for rotations
|
|
11
|
+
- coord3: 3D coordinate frame
|
|
12
|
+
|
|
13
|
+
Modules:
|
|
14
|
+
- differential_geometry: Surface curvature computation
|
|
15
|
+
- qframes: Quantum frame algebra
|
|
16
|
+
- visualization: Coordinate system visualization
|
|
17
|
+
- curve_interpolation: Curve and frame interpolation
|
|
18
|
+
"""
|
|
2
19
|
|
|
3
20
|
from .coordinate_system import vec3, vec2
|
|
4
21
|
from .coordinate_system import quat
|
|
5
22
|
from .coordinate_system import coord3
|
|
6
23
|
|
|
7
|
-
|
|
8
|
-
# Coordinate system handedness control (v5.2.1+)
|
|
9
|
-
from .coordinate_system import (
|
|
10
|
-
set_handedness,
|
|
11
|
-
get_handedness,
|
|
12
|
-
is_left_handed,
|
|
13
|
-
is_right_handed
|
|
14
|
-
)
|
|
15
|
-
# Differential geometry module (v3.3.0+)
|
|
24
|
+
# Differential geometry module (merged from differential_geometry.py and curvature.py)
|
|
16
25
|
from .differential_geometry import (
|
|
17
|
-
#
|
|
26
|
+
# Surface classes
|
|
18
27
|
Surface,
|
|
19
28
|
Sphere,
|
|
20
29
|
Torus,
|
|
30
|
+
|
|
31
|
+
# Core classes
|
|
21
32
|
MetricTensor,
|
|
33
|
+
GradientResult,
|
|
22
34
|
IntrinsicGradientOperator,
|
|
23
35
|
IntrinsicGradientCurvatureCalculator,
|
|
36
|
+
CurvatureCalculator,
|
|
24
37
|
|
|
25
|
-
#
|
|
26
|
-
compute_intrinsic_gradient,
|
|
38
|
+
# Intrinsic gradient method functions (default)
|
|
27
39
|
compute_gaussian_curvature,
|
|
28
40
|
compute_mean_curvature,
|
|
29
41
|
compute_riemann_curvature,
|
|
30
42
|
compute_all_curvatures,
|
|
31
|
-
|
|
43
|
+
compute_intrinsic_gradient,
|
|
32
44
|
|
|
33
|
-
#
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
# Classical method functions
|
|
46
|
+
gaussian_curvature_classical,
|
|
47
|
+
mean_curvature_classical,
|
|
48
|
+
principal_curvatures_classical,
|
|
49
|
+
all_curvatures_classical,
|
|
50
|
+
|
|
51
|
+
# Backward compatibility aliases
|
|
37
52
|
gaussian_curvature,
|
|
38
53
|
mean_curvature,
|
|
39
54
|
principal_curvatures,
|
|
40
55
|
all_curvatures,
|
|
41
56
|
|
|
42
|
-
#
|
|
43
|
-
intrinsic_gradient_gaussian_curvature,
|
|
44
|
-
intrinsic_gradient_mean_curvature,
|
|
45
|
-
intrinsic_gradient_principal_curvatures,
|
|
46
|
-
intrinsic_gradient_all_curvatures,
|
|
57
|
+
# Method comparison
|
|
47
58
|
compare_methods,
|
|
48
59
|
|
|
49
60
|
# Utility functions
|
|
@@ -52,105 +63,93 @@ from .curvature import (
|
|
|
52
63
|
richardson_extrapolation,
|
|
53
64
|
)
|
|
54
65
|
|
|
55
|
-
#
|
|
56
|
-
from .
|
|
57
|
-
# Core
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
# Quantum frame module (QFrame spectral analysis)
|
|
67
|
+
from .qframes import (
|
|
68
|
+
# Core classes
|
|
69
|
+
QFrame,
|
|
70
|
+
QuantumState,
|
|
71
|
+
PathIntegral,
|
|
72
|
+
QFrameSpectrum,
|
|
61
73
|
|
|
62
|
-
#
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
# Dirac notation export
|
|
75
|
+
DiracBra,
|
|
76
|
+
DiracKet,
|
|
77
|
+
bra,
|
|
78
|
+
ket,
|
|
65
79
|
|
|
66
|
-
#
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
berry_phase_calculator,
|
|
70
|
-
topological_invariant_analyzer,
|
|
80
|
+
# Convenience functions
|
|
81
|
+
spectral_transform,
|
|
82
|
+
inverse_spectral_transform,
|
|
71
83
|
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
compute_spectral_density,
|
|
76
|
-
radial_spectrum_average,
|
|
84
|
+
# Constants
|
|
85
|
+
HBAR,
|
|
86
|
+
GPU_AVAILABLE,
|
|
77
87
|
)
|
|
78
88
|
|
|
79
|
-
# Visualization module
|
|
89
|
+
# Visualization module
|
|
80
90
|
from .visualization import (
|
|
81
|
-
# Visualizer classes
|
|
82
91
|
CoordinateSystemVisualizer,
|
|
83
92
|
CurveVisualizer,
|
|
84
93
|
ParametricCurve,
|
|
85
|
-
|
|
86
|
-
# Convenience functions
|
|
87
94
|
visualize_coord_system,
|
|
88
95
|
visualize_curve,
|
|
89
96
|
)
|
|
90
97
|
|
|
91
|
-
# Curve interpolation module
|
|
98
|
+
# Curve interpolation module
|
|
92
99
|
from .curve_interpolation import (
|
|
93
|
-
# Main class
|
|
94
100
|
InterpolatedCurve,
|
|
95
|
-
|
|
96
|
-
# Functions
|
|
97
101
|
generate_frenet_frames,
|
|
98
102
|
frame_field_spline,
|
|
99
103
|
frame_field_spline_c2,
|
|
100
104
|
reconstruct_curve_from_polygon,
|
|
101
105
|
compute_curvature_profile,
|
|
102
|
-
|
|
103
|
-
# Utility functions
|
|
104
106
|
catmull_rom,
|
|
105
107
|
squad_interp,
|
|
106
108
|
)
|
|
107
109
|
|
|
108
110
|
__all__ = [
|
|
109
111
|
# Constants
|
|
110
|
-
'ZERO3','UNITX','UNITY','UNITZ','ONE3','ONE4','ONEC',
|
|
112
|
+
'ZERO3', 'UNITX', 'UNITY', 'UNITZ', 'ONE3', 'ONE4', 'ONEC',
|
|
111
113
|
|
|
112
114
|
# Core types
|
|
113
115
|
'vec3', 'vec2', 'quat', 'coord3', 'lerp',
|
|
114
116
|
|
|
115
|
-
# Differential geometry classes
|
|
117
|
+
# Differential geometry - Surface classes
|
|
116
118
|
'Surface', 'Sphere', 'Torus',
|
|
117
|
-
'MetricTensor', 'IntrinsicGradientOperator', 'IntrinsicGradientCurvatureCalculator',
|
|
118
119
|
|
|
119
|
-
# Differential geometry
|
|
120
|
+
# Differential geometry - Core classes
|
|
121
|
+
'MetricTensor', 'GradientResult',
|
|
122
|
+
'IntrinsicGradientOperator', 'IntrinsicGradientCurvatureCalculator',
|
|
123
|
+
'CurvatureCalculator',
|
|
124
|
+
|
|
125
|
+
# Differential geometry - Intrinsic gradient method (default)
|
|
126
|
+
'compute_gaussian_curvature', 'compute_mean_curvature',
|
|
127
|
+
'compute_riemann_curvature', 'compute_all_curvatures',
|
|
120
128
|
'compute_intrinsic_gradient',
|
|
121
|
-
'compute_gaussian_curvature',
|
|
122
|
-
'compute_mean_curvature',
|
|
123
|
-
'compute_riemann_curvature',
|
|
124
|
-
'compute_all_curvatures',
|
|
125
129
|
|
|
126
|
-
#
|
|
127
|
-
'
|
|
130
|
+
# Differential geometry - Classical method
|
|
131
|
+
'gaussian_curvature_classical', 'mean_curvature_classical',
|
|
132
|
+
'principal_curvatures_classical', 'all_curvatures_classical',
|
|
133
|
+
|
|
134
|
+
# Differential geometry - Backward compatibility
|
|
128
135
|
'gaussian_curvature', 'mean_curvature',
|
|
129
136
|
'principal_curvatures', 'all_curvatures',
|
|
130
137
|
|
|
131
|
-
#
|
|
132
|
-
'intrinsic_gradient_gaussian_curvature',
|
|
133
|
-
'intrinsic_gradient_mean_curvature',
|
|
134
|
-
'intrinsic_gradient_principal_curvatures',
|
|
135
|
-
'intrinsic_gradient_all_curvatures',
|
|
138
|
+
# Differential geometry - Comparison and utilities
|
|
136
139
|
'compare_methods',
|
|
137
|
-
|
|
138
|
-
# Utility functions
|
|
139
140
|
'derivative_5pt', 'derivative_2nd_5pt', 'richardson_extrapolation',
|
|
140
141
|
|
|
141
|
-
#
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
146
|
-
'fft2_coord_field', 'ifft2_spectrum',
|
|
147
|
-
'compute_spectral_density', 'radial_spectrum_average',
|
|
142
|
+
# Quantum frame module
|
|
143
|
+
'QFrame', 'QuantumState', 'PathIntegral', 'QFrameSpectrum',
|
|
144
|
+
'DiracBra', 'DiracKet', 'bra', 'ket',
|
|
145
|
+
'spectral_transform', 'inverse_spectral_transform',
|
|
146
|
+
'HBAR', 'GPU_AVAILABLE',
|
|
148
147
|
|
|
149
|
-
# Visualization
|
|
148
|
+
# Visualization
|
|
150
149
|
'CoordinateSystemVisualizer', 'CurveVisualizer', 'ParametricCurve',
|
|
151
150
|
'visualize_coord_system', 'visualize_curve',
|
|
152
151
|
|
|
153
|
-
# Curve interpolation
|
|
152
|
+
# Curve interpolation
|
|
154
153
|
'InterpolatedCurve', 'generate_frenet_frames', 'frame_field_spline',
|
|
155
154
|
'frame_field_spline_c2', 'reconstruct_curve_from_polygon', 'compute_curvature_profile',
|
|
156
155
|
'catmull_rom', 'squad_interp',
|
|
@@ -158,7 +157,7 @@ __all__ = [
|
|
|
158
157
|
|
|
159
158
|
# Constants for unit vectors and zero point
|
|
160
159
|
ZERO3 = vec3(0.0, 0.0, 0.0) # Zero vector (origin point)
|
|
161
|
-
UNITX = vec3(1.0, 0.0, 0.0) # Unit vector in X direction
|
|
160
|
+
UNITX = vec3(1.0, 0.0, 0.0) # Unit vector in X direction
|
|
162
161
|
UNITY = vec3(0.0, 1.0, 0.0) # Unit vector in Y direction
|
|
163
162
|
UNITZ = vec3(0.0, 0.0, 1.0) # Unit vector in Z direction
|
|
164
163
|
ONE3 = vec3(1.0, 1.0, 1.0) # Unit scale vector (1,1,1)
|
|
@@ -169,125 +168,93 @@ ONE4 = quat(1.0, 0.0, 0.0, 0.0)
|
|
|
169
168
|
# World coordinate system (the fundamental unit one in 3D space)
|
|
170
169
|
ONEC = coord3(ZERO3, ONE4, ONE3)
|
|
171
170
|
|
|
171
|
+
|
|
172
172
|
def lerp(a: vec3, b: vec3, t: float) -> vec3:
|
|
173
173
|
"""
|
|
174
|
-
Linear interpolation between two points in 3D space
|
|
175
|
-
|
|
176
|
-
The concept of interpolation embodies the metaphysical principle of
|
|
177
|
-
continuum - the smooth transition between states that preserves
|
|
178
|
-
the fundamental unity of spatial relationships
|
|
179
|
-
|
|
174
|
+
Linear interpolation between two points in 3D space.
|
|
175
|
+
|
|
180
176
|
Args:
|
|
181
|
-
a: Starting point
|
|
182
|
-
b: End point
|
|
183
|
-
t: Interpolation ratio [0,1]
|
|
184
|
-
|
|
177
|
+
a: Starting point
|
|
178
|
+
b: End point
|
|
179
|
+
t: Interpolation ratio [0, 1]
|
|
180
|
+
|
|
185
181
|
Returns:
|
|
186
|
-
|
|
182
|
+
Interpolated point: a + (b - a) * t
|
|
187
183
|
"""
|
|
188
184
|
return a + (b - a) * t
|
|
189
185
|
|
|
186
|
+
|
|
190
187
|
class CoordTuple(tuple):
|
|
191
188
|
"""
|
|
192
|
-
Custom tuple subclass that supports operations with coord3 objects
|
|
193
|
-
|
|
194
|
-
This class represents the metaphysical concept of 'potentiality' -
|
|
195
|
-
the tuple as pure mathematical form that can interact with the
|
|
196
|
-
actualized coordinate system (coord3) to produce new actualities
|
|
189
|
+
Custom tuple subclass that supports operations with coord3 objects.
|
|
197
190
|
"""
|
|
198
|
-
|
|
191
|
+
|
|
199
192
|
def __mul__(self, other):
|
|
200
|
-
"""Multiplication operation supporting coord3 interaction"""
|
|
193
|
+
"""Multiplication operation supporting coord3 interaction."""
|
|
201
194
|
if isinstance(other, coord3):
|
|
202
195
|
return self._mul_coord3(other)
|
|
203
196
|
return super().__mul__(other)
|
|
204
|
-
|
|
197
|
+
|
|
205
198
|
def __rmul__(self, other):
|
|
206
|
-
"""Right multiplication operation supporting coord3 interaction"""
|
|
199
|
+
"""Right multiplication operation supporting coord3 interaction."""
|
|
207
200
|
if isinstance(other, coord3):
|
|
208
201
|
return self._mul_coord3(other)
|
|
209
202
|
return super().__rmul__(other)
|
|
210
|
-
|
|
203
|
+
|
|
211
204
|
def __truediv__(self, other):
|
|
212
|
-
"""Division operation supporting coord3 interaction"""
|
|
205
|
+
"""Division operation supporting coord3 interaction."""
|
|
213
206
|
if isinstance(other, coord3):
|
|
214
207
|
return self._div_coord3(other)
|
|
215
208
|
return super().__truediv__(other)
|
|
216
|
-
|
|
209
|
+
|
|
217
210
|
def _mul_coord3(self, coord: coord3) -> tuple:
|
|
218
|
-
"""
|
|
219
|
-
Tuple multiplication with coordinate system
|
|
220
|
-
|
|
221
|
-
Represents the metaphysical operation where mathematical forms
|
|
222
|
-
(tuple) interact with actualized space (coord3) to produce
|
|
223
|
-
new spatial relationships
|
|
224
|
-
"""
|
|
211
|
+
"""Tuple multiplication with coordinate system."""
|
|
225
212
|
if len(self) != 3:
|
|
226
213
|
raise ValueError("Tuple must have exactly 3 elements for spatial operations")
|
|
227
|
-
|
|
214
|
+
|
|
228
215
|
x, y, z = self
|
|
229
216
|
scale_vec = vec3(x, y, z)
|
|
230
217
|
result = scale_vec * coord
|
|
231
218
|
return (result.x, result.y, result.z)
|
|
232
|
-
|
|
219
|
+
|
|
233
220
|
def _div_coord3(self, coord: coord3) -> tuple:
|
|
234
|
-
"""
|
|
235
|
-
Tuple division with coordinate system
|
|
236
|
-
|
|
237
|
-
The inverse operation of multiplication, representing the
|
|
238
|
-
decomposition of spatial relationships into their mathematical
|
|
239
|
-
components
|
|
240
|
-
"""
|
|
221
|
+
"""Tuple division with coordinate system."""
|
|
241
222
|
if len(self) != 3:
|
|
242
223
|
raise ValueError("Tuple must have exactly 3 elements for spatial operations")
|
|
243
|
-
|
|
224
|
+
|
|
244
225
|
x, y, z = self
|
|
245
|
-
# Check for division by zero (preservation of metaphysical integrity)
|
|
246
226
|
if x == 0 or y == 0 or z == 0:
|
|
247
|
-
raise ZeroDivisionError("Division by zero
|
|
248
|
-
|
|
227
|
+
raise ZeroDivisionError("Division by zero")
|
|
228
|
+
|
|
249
229
|
scale_vec = vec3(x, y, z)
|
|
250
230
|
result = scale_vec / coord
|
|
251
231
|
return (result.x, result.y, result.z)
|
|
252
232
|
|
|
253
|
-
|
|
233
|
+
|
|
234
|
+
# Store original coord3 operators
|
|
254
235
|
_original_coord3_mul = coord3.__mul__
|
|
255
236
|
_original_coord3_rmul = coord3.__rmul__
|
|
256
237
|
_original_coord3_truediv = getattr(coord3, '__truediv__', None)
|
|
257
238
|
|
|
239
|
+
|
|
258
240
|
def _new_coord3_mul(self, other):
|
|
259
|
-
"""
|
|
260
|
-
Enhanced multiplication operator for coord3
|
|
261
|
-
|
|
262
|
-
Enables interaction between actualized coordinate systems (coord3)
|
|
263
|
-
and mathematical forms (tuples), embodying the Aristotelian concept
|
|
264
|
-
of actuality interacting with potentiality
|
|
265
|
-
"""
|
|
241
|
+
"""Enhanced multiplication operator for coord3."""
|
|
266
242
|
if isinstance(other, tuple):
|
|
267
|
-
# Transform pure form (tuple) into operational entity (CoordTuple)
|
|
268
243
|
other = CoordTuple(other)
|
|
269
244
|
return other * self
|
|
270
245
|
return _original_coord3_mul(self, other)
|
|
271
246
|
|
|
247
|
+
|
|
272
248
|
def _new_coord3_rmul(self, other):
|
|
273
|
-
"""
|
|
274
|
-
Enhanced right multiplication operator for coord3
|
|
275
|
-
|
|
276
|
-
The commutative property in spatial operations reflects the
|
|
277
|
-
metaphysical principle of reciprocity in relationships
|
|
278
|
-
"""
|
|
249
|
+
"""Enhanced right multiplication operator for coord3."""
|
|
279
250
|
if isinstance(other, tuple):
|
|
280
251
|
other = CoordTuple(other)
|
|
281
252
|
return other * self
|
|
282
253
|
return _original_coord3_rmul(self, other)
|
|
283
254
|
|
|
255
|
+
|
|
284
256
|
def _new_coord3_truediv(self, other):
|
|
285
|
-
"""
|
|
286
|
-
Enhanced division operator for coord3
|
|
287
|
-
|
|
288
|
-
Division represents the analytical decomposition of spatial
|
|
289
|
-
relationships, revealing the underlying mathematical structure
|
|
290
|
-
"""
|
|
257
|
+
"""Enhanced division operator for coord3."""
|
|
291
258
|
if isinstance(other, tuple):
|
|
292
259
|
other = CoordTuple(other)
|
|
293
260
|
return other / self
|
|
@@ -295,7 +262,8 @@ def _new_coord3_truediv(self, other):
|
|
|
295
262
|
return _original_coord3_truediv(self, other)
|
|
296
263
|
raise TypeError(f"unsupported operand type(s) for /: 'coord3' and {type(other).__name__}")
|
|
297
264
|
|
|
298
|
-
|
|
265
|
+
|
|
266
|
+
# Apply enhancements to coord3 operators
|
|
299
267
|
coord3.__mul__ = _new_coord3_mul
|
|
300
268
|
coord3.__rmul__ = _new_coord3_rmul
|
|
301
|
-
coord3.__truediv__ = _new_coord3_truediv
|
|
269
|
+
coord3.__truediv__ = _new_coord3_truediv
|
|
Binary file
|