pygeoinf 1.1.7__tar.gz → 1.1.8__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.7 → pygeoinf-1.1.8}/PKG-INFO +1 -1
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/symmetric_space/circle.py +7 -4
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/symmetric_space/sphere.py +15 -4
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/symmetric_space/symmetric_space.py +46 -6
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pyproject.toml +1 -1
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/LICENSE +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/README.md +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/__init__.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/direct_sum.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/forward_problem.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/gaussian_measure.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/hilbert_space.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/inversion.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/linear_bayesian.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/linear_forms.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/linear_optimisation.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/linear_solvers.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/operators.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/random_matrix.py +0 -0
- {pygeoinf-1.1.7 → pygeoinf-1.1.8}/pygeoinf/symmetric_space/__init__.py +0 -0
|
@@ -336,18 +336,21 @@ class Lebesgue(CircleHelper, HilbertModule, AbstractInvariantLebesgueSpace):
|
|
|
336
336
|
|
|
337
337
|
return self.kmax == other.kmax and self.radius == other.radius
|
|
338
338
|
|
|
339
|
-
def
|
|
339
|
+
def invariant_automorphism_from_index_function(self, g: Callable[[int], float]):
|
|
340
340
|
"""
|
|
341
341
|
Implements an invariant automorphism of the form f(Δ) using Fourier
|
|
342
342
|
expansions on a circle.
|
|
343
343
|
|
|
344
|
+
For this method, the function f is given implicitly in terms of a
|
|
345
|
+
function, g, of the eigenvalue indices for the space. Letting k(λ) be
|
|
346
|
+
the index for eigenvalue λ, we then have f(λ) = g(k(λ)).
|
|
347
|
+
|
|
344
348
|
Args:
|
|
345
|
-
|
|
346
|
-
of the Laplacian, Δ.
|
|
349
|
+
g: A real-valued function of the eigenvalue index.
|
|
347
350
|
"""
|
|
348
351
|
|
|
349
352
|
values = np.fromiter(
|
|
350
|
-
(
|
|
353
|
+
(g(k) for k in range(self.kmax + 1)),
|
|
351
354
|
dtype=float,
|
|
352
355
|
)
|
|
353
356
|
matrix = diags([values], [0])
|
|
@@ -160,6 +160,17 @@ class SphereHelper:
|
|
|
160
160
|
l = k[0]
|
|
161
161
|
return l * (l + 1) / self.radius**2
|
|
162
162
|
|
|
163
|
+
def degree_from_laplacian_eigenvalue(self, eig: float) -> float:
|
|
164
|
+
"""
|
|
165
|
+
Returns the degree corresponding to a given eigenvalue.
|
|
166
|
+
|
|
167
|
+
Note that the value is returned as a float
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
eig: The eigenvalue.
|
|
171
|
+
"""
|
|
172
|
+
return np.sqrt(self.radius**2 * eig + 0.25)
|
|
173
|
+
|
|
163
174
|
def trace_of_invariant_automorphism(self, f: Callable[[float], float]) -> float:
|
|
164
175
|
"""
|
|
165
176
|
Returns the trace of the automorphism of the form f(Δ) with f a function
|
|
@@ -444,10 +455,10 @@ class Lebesgue(SphereHelper, HilbertModule, AbstractInvariantLebesgueSpace):
|
|
|
444
455
|
dtype=float,
|
|
445
456
|
)
|
|
446
457
|
|
|
447
|
-
def
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
)
|
|
458
|
+
def invariant_automorphism_from_index_function(
|
|
459
|
+
self, g: Callable[[(int, int)], float]
|
|
460
|
+
) -> LinearOperator:
|
|
461
|
+
values = self._degree_dependent_scaling_values(lambda l: g((l, 0)))
|
|
451
462
|
matrix = diags([values], [0])
|
|
452
463
|
|
|
453
464
|
def mapping(u):
|
|
@@ -30,6 +30,8 @@ AbstractInvariantSobolevSpace
|
|
|
30
30
|
from __future__ import annotations
|
|
31
31
|
from abc import ABC, abstractmethod
|
|
32
32
|
from typing import Callable, Any, List
|
|
33
|
+
|
|
34
|
+
|
|
33
35
|
import numpy as np
|
|
34
36
|
from scipy.sparse import diags
|
|
35
37
|
|
|
@@ -98,6 +100,26 @@ class AbstractInvariantLebesgueSpace(ABC):
|
|
|
98
100
|
"""Returns a list of the norms of the eigenfunctions."""
|
|
99
101
|
|
|
100
102
|
@abstractmethod
|
|
103
|
+
def invariant_automorphism_from_index_function(
|
|
104
|
+
self, g: Callable[[int | tuple[int, ...]], float]
|
|
105
|
+
) -> LinearOperator:
|
|
106
|
+
"""
|
|
107
|
+
Returns an automorphism of the form f(Δ) with f a function
|
|
108
|
+
that is well-defined on the spectrum of the Laplacian, Δ.
|
|
109
|
+
|
|
110
|
+
In order to be well-defined, the function must have appropriate
|
|
111
|
+
growth properties. For example, in an L² space we need f to be bounded.
|
|
112
|
+
In Sobolev spaces Hˢ a more complex condition holds depending on the
|
|
113
|
+
Sobolev order. These conditions on the function are not checked.
|
|
114
|
+
|
|
115
|
+
For this method, the function f is given implicitly in terms of a
|
|
116
|
+
function, g, of the eigenvalue indices for the space. Letting k(λ) be
|
|
117
|
+
the index for eigenvalue λ, we then have f(λ) = g(k(λ)).
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
g: A function that takes an eigenvalue index and returns a real value.
|
|
121
|
+
"""
|
|
122
|
+
|
|
101
123
|
def invariant_automorphism(self, f: Callable[[float], float]) -> LinearOperator:
|
|
102
124
|
"""
|
|
103
125
|
Returns an automorphism of the form f(Δ) with f a function
|
|
@@ -111,7 +133,15 @@ class AbstractInvariantLebesgueSpace(ABC):
|
|
|
111
133
|
Args:
|
|
112
134
|
f: A real-valued function that is well-defined on the spectrum
|
|
113
135
|
of the Laplacian.
|
|
136
|
+
|
|
137
|
+
Notes:
|
|
138
|
+
This method is a convenience wrapper for the more general
|
|
139
|
+
`invariant_automorphism_from_index_function`. It could be
|
|
140
|
+
overriden if computationally advantageous.
|
|
114
141
|
"""
|
|
142
|
+
return self.invariant_automorphism_from_index_function(
|
|
143
|
+
lambda k: f(self.laplacian_eigenvalue(k))
|
|
144
|
+
)
|
|
115
145
|
|
|
116
146
|
@abstractmethod
|
|
117
147
|
def trace_of_invariant_automorphism(self, f: Callable[[float], float]) -> float:
|
|
@@ -351,16 +381,26 @@ class AbstractInvariantSobolevSpace(AbstractInvariantLebesgueSpace):
|
|
|
351
381
|
self, EuclideanSpace(dim), matrix, galerkin=True
|
|
352
382
|
)
|
|
353
383
|
|
|
354
|
-
def
|
|
384
|
+
def invariant_automorphism_from_index_function(
|
|
385
|
+
self, g: Callable[[int | tuple[int, ...]], float]
|
|
386
|
+
):
|
|
355
387
|
"""
|
|
356
|
-
Returns an
|
|
357
|
-
|
|
388
|
+
Returns an automorphism of the form f(Δ) with f a function
|
|
389
|
+
that is well-defined on the spectrum of the Laplacian, Δ.
|
|
390
|
+
|
|
391
|
+
In order to be well-defined, the function must have appropriate
|
|
392
|
+
growth properties. For example, in an L² space we need f to be bounded.
|
|
393
|
+
In Sobolev spaces Hˢ a more complex condition holds depending on the
|
|
394
|
+
Sobolev order. These conditions on the function are not checked.
|
|
395
|
+
|
|
396
|
+
For this method, the function f is given implicitly in terms of a
|
|
397
|
+
function, g, of the eigenvalue indices for the space. Letting k(λ) be
|
|
398
|
+
the index for eigenvalue λ, we then have f(λ) = g(k(λ)).
|
|
358
399
|
|
|
359
400
|
Args:
|
|
360
|
-
|
|
361
|
-
of the Laplacian, Δ.
|
|
401
|
+
g: A function that takes an eigenvalue index and returns a real value.
|
|
362
402
|
"""
|
|
363
|
-
A = self.underlying_space.
|
|
403
|
+
A = self.underlying_space.invariant_automorphism_from_index_function(g)
|
|
364
404
|
return LinearOperator.from_formally_self_adjoint(self, A)
|
|
365
405
|
|
|
366
406
|
def point_value_scaled_invariant_gaussian_measure(
|
|
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
|