pygeoinf 1.1.5__tar.gz → 1.1.6__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.
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/PKG-INFO +1 -1
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/hilbert_space.py +42 -15
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/operators.py +0 -2
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/symmetric_space/sphere.py +20 -2
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pyproject.toml +1 -1
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/LICENSE +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/README.md +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/__init__.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/direct_sum.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/forward_problem.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/gaussian_measure.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/inversion.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/linear_bayesian.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/linear_forms.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/linear_optimisation.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/linear_solvers.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/random_matrix.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/symmetric_space/__init__.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/symmetric_space/circle.py +0 -0
- {pygeoinf-1.1.5 → pygeoinf-1.1.6}/pygeoinf/symmetric_space/symmetric_space.py +0 -0
|
@@ -118,6 +118,16 @@ class HilbertSpace(ABC):
|
|
|
118
118
|
The corresponding vector in the space.
|
|
119
119
|
"""
|
|
120
120
|
|
|
121
|
+
@abstractmethod
|
|
122
|
+
def __eq__(self, other: object) -> bool:
|
|
123
|
+
"""
|
|
124
|
+
Defines equality between two HilbertSpace instances.
|
|
125
|
+
|
|
126
|
+
This is an abstract method, requiring all concrete subclasses to
|
|
127
|
+
implement a meaningful comparison. This ensures that equality is
|
|
128
|
+
defined by mathematical equivalence rather than object identity.
|
|
129
|
+
"""
|
|
130
|
+
|
|
121
131
|
# ------------------------------------------------------------------- #
|
|
122
132
|
# Default implementations that can be overridden #
|
|
123
133
|
# ------------------------------------------------------------------- #
|
|
@@ -209,21 +219,6 @@ class HilbertSpace(ABC):
|
|
|
209
219
|
"""
|
|
210
220
|
return self.from_components(np.random.randn(self.dim))
|
|
211
221
|
|
|
212
|
-
def __eq__(self, other: object) -> bool:
|
|
213
|
-
"""
|
|
214
|
-
Defines equality between Hilbert spaces.
|
|
215
|
-
|
|
216
|
-
For dual spaces, equality is determined by the equality of their
|
|
217
|
-
underlying primal spaces. For non-dual spaces, this is not implemented,
|
|
218
|
-
requiring concrete subclasses to define a meaningful comparison.
|
|
219
|
-
"""
|
|
220
|
-
if isinstance(self, DualHilbertSpace):
|
|
221
|
-
return (
|
|
222
|
-
isinstance(other, DualHilbertSpace)
|
|
223
|
-
and self.underlying_space == other.underlying_space
|
|
224
|
-
)
|
|
225
|
-
return NotImplemented
|
|
226
|
-
|
|
227
222
|
# ------------------------------------------------------------------- #
|
|
228
223
|
# Final (Non-Overridable) Methods #
|
|
229
224
|
# ------------------------------------------------------------------- #
|
|
@@ -498,6 +493,17 @@ class DualHilbertSpace(HilbertSpace):
|
|
|
498
493
|
|
|
499
494
|
return LinearForm(self._underlying_space, components=c)
|
|
500
495
|
|
|
496
|
+
def __eq__(self, other: object) -> bool:
|
|
497
|
+
"""
|
|
498
|
+
Checks for equality with another dual space.
|
|
499
|
+
|
|
500
|
+
Two dual spaces are considered equal if and only if their underlying
|
|
501
|
+
primal spaces are equal.
|
|
502
|
+
"""
|
|
503
|
+
if not isinstance(other, DualHilbertSpace):
|
|
504
|
+
return NotImplemented
|
|
505
|
+
return self.underlying_space == other.underlying_space
|
|
506
|
+
|
|
501
507
|
@final
|
|
502
508
|
def duality_product(self, xp: LinearForm, x: Vector) -> float:
|
|
503
509
|
"""
|
|
@@ -572,6 +578,11 @@ class EuclideanSpace(HilbertSpace):
|
|
|
572
578
|
"""Maps a `LinearForm` back to a vector via its components."""
|
|
573
579
|
return self.dual.to_components(xp)
|
|
574
580
|
|
|
581
|
+
def __eq__(self, other: object):
|
|
582
|
+
if not isinstance(other, EuclideanSpace):
|
|
583
|
+
return NotImplemented
|
|
584
|
+
return self.dim == other.dim
|
|
585
|
+
|
|
575
586
|
|
|
576
587
|
class MassWeightedHilbertSpace(HilbertSpace):
|
|
577
588
|
"""
|
|
@@ -651,6 +662,22 @@ class MassWeightedHilbertSpace(HilbertSpace):
|
|
|
651
662
|
x = self.underlying_space.from_dual(xp)
|
|
652
663
|
return self._inverse_mass_operator(x)
|
|
653
664
|
|
|
665
|
+
def __eq__(self, other: object) -> bool:
|
|
666
|
+
"""
|
|
667
|
+
Checks for equality with another MassWeightedHilbertSpace.
|
|
668
|
+
|
|
669
|
+
Two mass-weighted spaces are considered equal if they share an equal
|
|
670
|
+
underlying space and their mass operators are also equal.
|
|
671
|
+
"""
|
|
672
|
+
if not isinstance(other, MassWeightedHilbertSpace):
|
|
673
|
+
return NotImplemented
|
|
674
|
+
|
|
675
|
+
return (
|
|
676
|
+
self.underlying_space == other.underlying_space
|
|
677
|
+
and (self.mass_operator == other.mass_operator)
|
|
678
|
+
and (self.inverse_mass_operator == other.inverse_mass_operator)
|
|
679
|
+
)
|
|
680
|
+
|
|
654
681
|
|
|
655
682
|
class MassWeightedHilbertModule(MassWeightedHilbertSpace, HilbertModule):
|
|
656
683
|
"""
|
|
@@ -458,8 +458,14 @@ class Lebesgue(SphereHelper, HilbertModule, AbstractInvariantLebesgueSpace):
|
|
|
458
458
|
return LinearOperator.self_adjoint(self, mapping)
|
|
459
459
|
|
|
460
460
|
def __str__(self) -> str:
|
|
461
|
-
"""Returns
|
|
462
|
-
return
|
|
461
|
+
"""Returns a human-readable string summary of the space."""
|
|
462
|
+
return (
|
|
463
|
+
f"Lebesgue space on sphere:\n"
|
|
464
|
+
f"lmax={self.lmax}\n"
|
|
465
|
+
f"radius={self.radius}\n"
|
|
466
|
+
f"grid={self.grid}\n"
|
|
467
|
+
f"extend={self.extend}"
|
|
468
|
+
)
|
|
463
469
|
|
|
464
470
|
|
|
465
471
|
class Sobolev(SphereHelper, MassWeightedHilbertModule, AbstractInvariantSobolevSpace):
|
|
@@ -610,3 +616,15 @@ class Sobolev(SphereHelper, MassWeightedHilbertModule, AbstractInvariantSobolevS
|
|
|
610
616
|
|
|
611
617
|
c = self._coefficient_to_component(ulm)
|
|
612
618
|
return self.dual.from_components(c)
|
|
619
|
+
|
|
620
|
+
def __str__(self) -> str:
|
|
621
|
+
"""Returns a human-readable string summary of the space."""
|
|
622
|
+
return (
|
|
623
|
+
f"Lebesgue space on sphere:\n"
|
|
624
|
+
f"lmax={self.lmax}\n"
|
|
625
|
+
f"order={self.order}\n"
|
|
626
|
+
f"scale={self.scale}\n"
|
|
627
|
+
f"radius={self.radius}\n"
|
|
628
|
+
f"grid={self.grid}\n"
|
|
629
|
+
f"extend={self.extend}"
|
|
630
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|