spacecore 0.2.0__tar.gz → 0.3.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.
- spacecore-0.3.1/CHANGELOG.md +306 -0
- spacecore-0.3.1/CONTRIBUTING.md +13 -0
- spacecore-0.3.1/MANIFEST.in +12 -0
- spacecore-0.3.1/PKG-INFO +206 -0
- spacecore-0.3.1/README.md +165 -0
- spacecore-0.3.1/docs/dev/0.3.1-docs-inventory.md +102 -0
- spacecore-0.3.1/docs/dev/0.3.1-docstring-audit.md +48 -0
- spacecore-0.3.1/docs/dev/docstring_style.md +134 -0
- spacecore-0.3.1/docs/source/_static/custom.css +22 -0
- spacecore-0.3.1/docs/source/api/backend.rst +58 -0
- spacecore-0.3.1/docs/source/api/context.rst +42 -0
- spacecore-0.3.1/docs/source/api/functionals.rst +80 -0
- spacecore-0.3.1/docs/source/api/index.rst +15 -0
- spacecore-0.3.1/docs/source/api/linalg.rst +78 -0
- spacecore-0.3.1/docs/source/api/linops.rst +132 -0
- spacecore-0.3.1/docs/source/api/spaces.rst +198 -0
- spacecore-0.3.1/docs/source/conf.py +89 -0
- spacecore-0.3.1/docs/source/design/backend_ops_array_api.rst +57 -0
- spacecore-0.3.1/docs/source/design/batching.rst +45 -0
- spacecore-0.3.1/docs/source/design/capability_dispatch.rst +80 -0
- spacecore-0.3.1/docs/source/design/checking_policy.rst +69 -0
- spacecore-0.3.1/docs/source/design/context_ownership.rst +58 -0
- spacecore-0.3.1/docs/source/design/conversion_policy.rst +57 -0
- spacecore-0.3.1/docs/source/design/dtype_policy.rst +62 -0
- spacecore-0.3.1/docs/source/design/geometry.rst +85 -0
- spacecore-0.3.1/docs/source/design/index.rst +19 -0
- spacecore-0.3.1/docs/source/design/jax_integration.rst +44 -0
- spacecore-0.3.1/docs/source/design/performance.rst +19 -0
- spacecore-0.3.1/docs/source/index.rst +85 -0
- spacecore-0.3.1/docs/source/release_notes.rst +462 -0
- spacecore-0.3.1/docs/source/tutorials/backend_ops.rst +104 -0
- spacecore-0.3.1/docs/source/tutorials/context.rst +103 -0
- spacecore-0.3.1/docs/source/tutorials/conversion_policy.rst +102 -0
- spacecore-0.3.1/docs/source/tutorials/index.rst +88 -0
- spacecore-0.3.1/docs/source/tutorials/linops.rst +139 -0
- spacecore-0.3.1/docs/source/tutorials/regularized_ot.rst +662 -0
- spacecore-0.3.1/docs/source/tutorials/spaces.rst +124 -0
- spacecore-0.3.1/docs/source/tutorials/weighted_tikhonov.rst +194 -0
- spacecore-0.3.1/examples/__init__.py +0 -0
- spacecore-0.3.1/examples/weighted_tikhonov.py +267 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/pyproject.toml +5 -2
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/__init__.py +47 -24
- spacecore-0.3.1/spacecore/_batching.py +18 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/_checks.py +19 -2
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/_contextual/__init__.py +1 -15
- spacecore-0.3.1/spacecore/_contextual/_bound.py +57 -0
- spacecore-0.3.1/spacecore/_contextual/_policies.py +17 -0
- spacecore-0.3.1/spacecore/_contextual/_state.py +389 -0
- spacecore-0.3.1/spacecore/_tree.py +26 -0
- spacecore-0.3.1/spacecore/_version.py +3 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/__init__.py +8 -2
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/_context.py +10 -6
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/_ops.py +62 -53
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/cupy/_ops.py +3 -1
- spacecore-0.3.1/spacecore/backend/jax/__init__.py +14 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/jax/_ops.py +51 -32
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/numpy/_ops.py +41 -32
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/torch/_ops.py +18 -4
- spacecore-0.3.1/spacecore/functional/_base.py +138 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/functional/_linear.py +56 -17
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/functional/_quadratic.py +43 -14
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linalg/_cg.py +29 -14
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linalg/_expm.py +12 -5
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linalg/_lanczos.py +26 -15
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linalg/_lsqr.py +58 -16
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linalg/_power.py +82 -37
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linop/_algebra.py +285 -99
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linop/_base.py +59 -71
- spacecore-0.3.1/spacecore/linop/_dense.py +323 -0
- spacecore-0.3.1/spacecore/linop/_diagonal.py +260 -0
- spacecore-0.3.1/spacecore/linop/_metric.py +120 -0
- spacecore-0.3.1/spacecore/linop/_sparse.py +366 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linop/product/_base.py +13 -9
- spacecore-0.3.1/spacecore/linop/product/_block.py +125 -0
- spacecore-0.3.1/spacecore/linop/product/_from_single.py +186 -0
- spacecore-0.3.1/spacecore/linop/product/_to_single.py +186 -0
- spacecore-0.3.1/spacecore/space/__init__.py +69 -0
- spacecore-0.3.1/spacecore/space/_structure.py +117 -0
- spacecore-0.3.1/spacecore/space/base/__init__.py +24 -0
- spacecore-0.3.1/spacecore/space/base/_coordinate.py +72 -0
- spacecore-0.3.1/spacecore/space/base/_inner_product.py +156 -0
- spacecore-0.3.1/spacecore/space/base/_jordan.py +50 -0
- spacecore-0.3.1/spacecore/space/base/_space.py +49 -0
- spacecore-0.3.1/spacecore/space/base/_star.py +21 -0
- spacecore-0.3.1/spacecore/space/base/_vector.py +33 -0
- {spacecore-0.2.0/spacecore/space → spacecore-0.3.1/spacecore/space/checks}/__init__.py +3 -13
- spacecore-0.2.0/spacecore/space/_checks.py → spacecore-0.3.1/spacecore/space/checks/_base.py +116 -22
- spacecore-0.3.1/spacecore/space/checks/_coordinate.py +3 -0
- spacecore-0.3.1/spacecore/space/checks/_product.py +3 -0
- spacecore-0.3.1/spacecore/space/concrete/__init__.py +16 -0
- spacecore-0.3.1/spacecore/space/concrete/_dense_coordinate.py +102 -0
- spacecore-0.3.1/spacecore/space/concrete/_dense_vector.py +228 -0
- spacecore-0.2.0/spacecore/space/_herm.py → spacecore-0.3.1/spacecore/space/concrete/_hermitian.py +72 -26
- spacecore-0.3.1/spacecore/space/concrete/_product.py +686 -0
- spacecore-0.3.1/spacecore/space/concrete/_stacked.py +399 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/types/_misc.py +1 -1
- spacecore-0.3.1/spacecore.egg-info/PKG-INFO +206 -0
- spacecore-0.3.1/spacecore.egg-info/SOURCES.txt +191 -0
- spacecore-0.3.1/tests/__init__.py +0 -0
- spacecore-0.3.1/tests/_helpers.py +103 -0
- spacecore-0.3.1/tests/backend/__init__.py +0 -0
- spacecore-0.3.1/tests/backend/test_backend_consistency.py +142 -0
- spacecore-0.3.1/tests/backend/test_backend_loops.py +119 -0
- spacecore-0.3.1/tests/backend/test_backend_ops_delegation.py +256 -0
- spacecore-0.3.1/tests/backend/test_backend_registry.py +102 -0
- spacecore-0.3.1/tests/backend/test_cupy_ops.py +66 -0
- spacecore-0.3.1/tests/backend/test_jax_ops.py +43 -0
- spacecore-0.3.1/tests/backend/test_numpy_ops.py +39 -0
- spacecore-0.3.1/tests/backend/test_torch_consistency.py +51 -0
- spacecore-0.3.1/tests/backend/test_torch_ops.py +108 -0
- spacecore-0.3.1/tests/conftest.py +7 -0
- spacecore-0.3.1/tests/context/__init__.py +0 -0
- spacecore-0.3.1/tests/context/test_checked_method.py +133 -0
- spacecore-0.3.1/tests/context/test_context.py +34 -0
- spacecore-0.3.1/tests/context/test_context_manager.py +46 -0
- spacecore-0.3.1/tests/context/test_context_resolution.py +115 -0
- spacecore-0.3.1/tests/context/test_enable_checks.py +126 -0
- spacecore-0.3.1/tests/context/test_errors.py +46 -0
- spacecore-0.3.1/tests/examples/__init__.py +0 -0
- spacecore-0.3.1/tests/examples/test_weighted_tikhonov.py +109 -0
- spacecore-0.3.1/tests/functional/test_functional.py +243 -0
- spacecore-0.3.1/tests/functional/test_metric_gradient.py +242 -0
- spacecore-0.3.1/tests/integration/__init__.py +0 -0
- spacecore-0.3.1/tests/integration/test_imports.py +34 -0
- spacecore-0.3.1/tests/integration/test_public_api.py +122 -0
- spacecore-0.3.1/tests/integration/test_smoke_jax.py +29 -0
- spacecore-0.3.1/tests/integration/test_smoke_numpy.py +22 -0
- spacecore-0.3.1/tests/integration/test_smoke_torch.py +34 -0
- spacecore-0.3.1/tests/linalg/__init__.py +1 -0
- spacecore-0.3.1/tests/linalg/test_expm.py +255 -0
- spacecore-0.3.1/tests/linalg/test_krylov.py +939 -0
- spacecore-0.3.1/tests/linalg/test_metric_solvers.py +68 -0
- spacecore-0.3.1/tests/linops/__init__.py +0 -0
- spacecore-0.3.1/tests/linops/test_adjoint_identity.py +870 -0
- spacecore-0.3.1/tests/linops/test_algebra.py +533 -0
- spacecore-0.3.1/tests/linops/test_algebra_linop.py +242 -0
- spacecore-0.3.1/tests/linops/test_batched_apply.py +79 -0
- spacecore-0.3.1/tests/linops/test_batched_lifting.py +181 -0
- spacecore-0.3.1/tests/linops/test_block_diagonal_linop.py +27 -0
- spacecore-0.3.1/tests/linops/test_conversion_linops.py +62 -0
- spacecore-0.3.1/tests/linops/test_dense_linop.py +322 -0
- spacecore-0.3.1/tests/linops/test_diagonal_linop.py +162 -0
- spacecore-0.3.1/tests/linops/test_linop_jit.py +166 -0
- spacecore-0.3.1/tests/linops/test_product_linop_batching.py +201 -0
- spacecore-0.3.1/tests/linops/test_product_structure.py +231 -0
- spacecore-0.3.1/tests/linops/test_sparse_linop.py +345 -0
- spacecore-0.3.1/tests/linops/test_stacked_linop.py +18 -0
- spacecore-0.3.1/tests/linops/test_sum_to_single_linop.py +18 -0
- spacecore-0.3.1/tests/linops/test_to_dense.py +277 -0
- spacecore-0.3.1/tests/spaces/__init__.py +0 -0
- spacecore-0.3.1/tests/spaces/test_conversion_spaces.py +45 -0
- spacecore-0.3.1/tests/spaces/test_geometry.py +243 -0
- spacecore-0.3.1/tests/spaces/test_hermitian_space.py +54 -0
- spacecore-0.3.1/tests/spaces/test_product_space.py +68 -0
- spacecore-0.3.1/tests/spaces/test_product_structure.py +262 -0
- spacecore-0.3.1/tests/spaces/test_space_apply.py +157 -0
- spacecore-0.3.1/tests/spaces/test_space_checks.py +164 -0
- spacecore-0.3.1/tests/spaces/test_space_hierarchy.py +654 -0
- spacecore-0.3.1/tests/spaces/test_spectrum.py +237 -0
- spacecore-0.3.1/tests/spaces/test_stacked_space.py +142 -0
- spacecore-0.3.1/tests/spaces/test_vector_space.py +55 -0
- spacecore-0.3.1/tests/spaces/test_vectorized_checks.py +145 -0
- spacecore-0.3.1/tutorials/1_BackendOps.ipynb +628 -0
- spacecore-0.3.1/tutorials/2_Context.ipynb +602 -0
- spacecore-0.3.1/tutorials/3_Space.ipynb +821 -0
- spacecore-0.3.1/tutorials/4_LinOp.ipynb +951 -0
- spacecore-0.3.1/tutorials/5_Conversion_Policy.ipynb +208 -0
- spacecore-0.3.1/tutorials/6_Regularized_Opt_Transport.ipynb +789 -0
- spacecore-0.3.1/tutorials/7_Quadratic_Program.ipynb +320 -0
- spacecore-0.3.1/tutorials/8_Linalg_MatrixFree.ipynb +560 -0
- spacecore-0.3.1/tutorials/9_Linalg_Comparison.ipynb +558 -0
- spacecore-0.3.1/tutorials/README.md +33 -0
- spacecore-0.3.1/tutorials/weighted_tikhonov.ipynb +539 -0
- spacecore-0.2.0/PKG-INFO +0 -247
- spacecore-0.2.0/README.md +0 -206
- spacecore-0.2.0/spacecore/_contextual/_bound.py +0 -201
- spacecore-0.2.0/spacecore/_contextual/_manager.py +0 -266
- spacecore-0.2.0/spacecore/_contextual/_policies.py +0 -63
- spacecore-0.2.0/spacecore/_contextual/_state.py +0 -512
- spacecore-0.2.0/spacecore/backend/jax/__init__.py +0 -4
- spacecore-0.2.0/spacecore/functional/_base.py +0 -168
- spacecore-0.2.0/spacecore/linop/_dense.py +0 -280
- spacecore-0.2.0/spacecore/linop/_diagonal.py +0 -163
- spacecore-0.2.0/spacecore/linop/_sparse.py +0 -274
- spacecore-0.2.0/spacecore/linop/product/_block.py +0 -108
- spacecore-0.2.0/spacecore/linop/product/_from_single.py +0 -118
- spacecore-0.2.0/spacecore/linop/product/_to_single.py +0 -118
- spacecore-0.2.0/spacecore/space/_base.py +0 -145
- spacecore-0.2.0/spacecore/space/_batch.py +0 -209
- spacecore-0.2.0/spacecore/space/_product.py +0 -280
- spacecore-0.2.0/spacecore/space/_vector.py +0 -151
- spacecore-0.2.0/spacecore.egg-info/PKG-INFO +0 -247
- spacecore-0.2.0/spacecore.egg-info/SOURCES.txt +0 -63
- {spacecore-0.2.0 → spacecore-0.3.1}/LICENSE +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/setup.cfg +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/_family.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/cupy/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/jax/_pytree.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/numpy/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/backend/torch/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/functional/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/functional/_composed.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linalg/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linalg/_utils.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linop/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/linop/product/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/types/__init__.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/types/_array.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore/types/_dtype.py +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore.egg-info/dependency_links.txt +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore.egg-info/requires.txt +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/spacecore.egg-info/top_level.txt +0 -0
- {spacecore-0.2.0 → spacecore-0.3.1}/tests/test_backend_ops_complex.py +0 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to SpaceCore are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and the project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [0.3.1]
|
|
9
|
+
|
|
10
|
+
SpaceCore 0.3.1 is a release-candidate stabilization release for the `0.3.x`
|
|
11
|
+
API. It focuses on documentation consistency, tutorial execution, release
|
|
12
|
+
artifact checks, and public API audit cleanup. It does not add new solver
|
|
13
|
+
families or SDPLab-specific downstream integration.
|
|
14
|
+
|
|
15
|
+
### Documentation
|
|
16
|
+
|
|
17
|
+
- Reworked API reference landing pages for backend, context, spaces, linear
|
|
18
|
+
operators, functionals, and linalg.
|
|
19
|
+
- Added design notes for context ownership, batching, and capability dispatch.
|
|
20
|
+
- Clarified conversion and dtype policy documentation for explicit target
|
|
21
|
+
contexts.
|
|
22
|
+
- Clarified adjoint documentation to distinguish coordinate transpose,
|
|
23
|
+
Euclidean adjoint, and metric/Riesz-represented adjoint behavior.
|
|
24
|
+
|
|
25
|
+
### Examples and Tutorials
|
|
26
|
+
|
|
27
|
+
- Added a SpaceCore-only weighted Tikhonov worked example demonstrating
|
|
28
|
+
weighted spaces, metric adjoints, lazy operator algebra, CG, and an
|
|
29
|
+
independent dense NumPy reference solve.
|
|
30
|
+
- Integrated the weighted Tikhonov example into tests and documentation.
|
|
31
|
+
|
|
32
|
+
### Testing and CI
|
|
33
|
+
|
|
34
|
+
- Documentation CI now builds Sphinx with warnings as errors.
|
|
35
|
+
- Release-candidate checks include full tests, strict docs build, public API
|
|
36
|
+
audit, artifact build, `twine check`, clean wheel installation, and smoke
|
|
37
|
+
testing.
|
|
38
|
+
|
|
39
|
+
### Known limitations
|
|
40
|
+
|
|
41
|
+
- Optional backend behavior depends on installed optional dependencies. CuPy is
|
|
42
|
+
not required for the core release-candidate gate.
|
|
43
|
+
- The advanced regularized OT tutorial is an illustrative SpaceCore/JAX/Optax
|
|
44
|
+
example, not a claim that SpaceCore ships a production OT solver.
|
|
45
|
+
|
|
46
|
+
## [0.3.0]
|
|
47
|
+
|
|
48
|
+
SpaceCore 0.3.0 is a breaking release for the unstable `0.x` series. Space
|
|
49
|
+
capabilities are now derived from actual structure, dtype, and inner product,
|
|
50
|
+
and conversions rebuild spaces through public factories so stale capabilities
|
|
51
|
+
are not retained.
|
|
52
|
+
|
|
53
|
+
### Migration
|
|
54
|
+
|
|
55
|
+
| 0.2.x | 0.3.0 |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `space.eigh(x)` | `space.spectral_decompose(x)` for eigenvalues and frame |
|
|
58
|
+
| `space.eigh(x)` | `space.spectrum(x)` for eigenvalues only |
|
|
59
|
+
| `sc.VectorSpace((n,))` | `sc.DenseVectorSpace((n,))` |
|
|
60
|
+
| `sc.VectorSpace((d, d))` | `sc.DenseCoordinateSpace((d, d))` |
|
|
61
|
+
| `ProductInnerProductSpace(...)` | `ProductSpace(...)` |
|
|
62
|
+
| `ProductStarSpace(...)` | `ProductSpace(...)` |
|
|
63
|
+
| `ProductJordanAlgebraSpace(...)` | `ProductSpace(...)` |
|
|
64
|
+
| `ProductEuclideanJordanAlgebraSpace(...)` | `ProductSpace(...)` |
|
|
65
|
+
| `StackedInnerProductSpace(...)` | `StackedSpace(...)` |
|
|
66
|
+
| `StackedStarSpace(...)` | `StackedSpace(...)` |
|
|
67
|
+
| `StackedJordanAlgebraSpace(...)` | `StackedSpace(...)` |
|
|
68
|
+
| `StackedEuclideanJordanAlgebraSpace(...)` | `StackedSpace(...)` |
|
|
69
|
+
| `BatchSpace` and `space.batch(...)` | leading-axis batched arrays with `vapply(...)` / `rvapply(...)` |
|
|
70
|
+
| `op.vapply(xs, batch_space=...)` | `op.vapply(xs)` |
|
|
71
|
+
| global context conversion policies | explicit `Context` construction and `obj.convert(ctx)` |
|
|
72
|
+
| global dtype preservation policies | target-context dtype during explicit conversion |
|
|
73
|
+
|
|
74
|
+
Prominent `eigh` replacement:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
space.eigh(x)
|
|
78
|
+
# -> space.spectral_decompose(x) # eigenvalues and frame
|
|
79
|
+
# -> space.spectrum(x) # eigenvalues only
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Added
|
|
83
|
+
|
|
84
|
+
- `spectrum`, `spectral_decompose`, and `from_spectrum` as the public spectral
|
|
85
|
+
contract for Jordan spaces.
|
|
86
|
+
- `ElementwiseJordanSpace` for real or complex elementwise Jordan algebras.
|
|
87
|
+
- `EuclideanElementwiseJordanSpace` for real Euclidean elementwise Jordan
|
|
88
|
+
algebras.
|
|
89
|
+
- Jordan capability hierarchy separating `JordanAlgebraSpace` from
|
|
90
|
+
`EuclideanJordanAlgebraSpace`.
|
|
91
|
+
- `ProductStructure`, `TupleStructure`, `PytreeStructure`, and
|
|
92
|
+
`ProductSpace.from_template` for structured product elements.
|
|
93
|
+
- `ProductSpectralDecomposition` for product spectral data independent of
|
|
94
|
+
product element structure.
|
|
95
|
+
- `StackedSpace` for leading-axis repeated leaf spaces.
|
|
96
|
+
- Vectorizable axis-aware validation checks.
|
|
97
|
+
- `InnerProduct.validate_for(space)` and construction-time validation for
|
|
98
|
+
`WeightedInnerProduct`.
|
|
99
|
+
- `scripts/api_audit.py` for repository and downstream migration audits.
|
|
100
|
+
|
|
101
|
+
### Changed
|
|
102
|
+
|
|
103
|
+
- `VectorSpace` is an abstract linear-capability base.
|
|
104
|
+
- Previous concrete `VectorSpace` use cases moved to `DenseVectorSpace` for
|
|
105
|
+
one-dimensional dense vectors and `DenseCoordinateSpace` for generic dense
|
|
106
|
+
coordinate arrays.
|
|
107
|
+
- `DenseVectorSpace` is now a plain one-dimensional vector space with star and
|
|
108
|
+
no Jordan capability by default.
|
|
109
|
+
- Elementwise Euclidean-Jordan capability is selected only for real dtype with
|
|
110
|
+
`EuclideanInnerProduct`.
|
|
111
|
+
- `ProductSpace(...)` and `StackedSpace(...)` are the only public product and
|
|
112
|
+
stacked constructors; they auto-dispatch to private implementation classes.
|
|
113
|
+
- `convert()` for elementwise, product, and stacked spaces recomputes
|
|
114
|
+
capabilities through public factories.
|
|
115
|
+
- `ProductSpace.spectral_decompose` returns explicit product spectral data
|
|
116
|
+
rather than routing decompositions through element structure adapters.
|
|
117
|
+
|
|
118
|
+
### Removed
|
|
119
|
+
|
|
120
|
+
- Removed `eigh` from spaces. Use `spectral_decompose` when both eigenvalues
|
|
121
|
+
and a reconstruction frame are needed, or `spectrum` for eigenvalues only.
|
|
122
|
+
- Removed public specialized product and stacked constructors from the public
|
|
123
|
+
API.
|
|
124
|
+
- Removed `BatchSpace`, `Space.batch`, and `batch_space=` arguments from public
|
|
125
|
+
batching APIs. Use leading-axis vectorization through `vapply` and `rvapply`.
|
|
126
|
+
- Removed global context-policy and dtype-policy APIs. Conversion now follows
|
|
127
|
+
the requested target `Context` directly.
|
|
128
|
+
|
|
129
|
+
## [0.2.0]
|
|
130
|
+
|
|
131
|
+
SpaceCore 0.2.0 is a major API expansion. The backend layer now sits on the
|
|
132
|
+
Array API standard. Operators gained a lazy algebra with adjoint views,
|
|
133
|
+
composition, sums, and scaling. A new `Functional` hierarchy provides
|
|
134
|
+
scalar-valued maps with gradients and pull-backs. A new `spacecore.linalg`
|
|
135
|
+
module ships four JIT-compatible iterative solvers. Spaces, operators, and
|
|
136
|
+
functionals share a single validation pattern via `checked_method`, and the
|
|
137
|
+
public API is documented to numpydoc standard with doctest coverage.
|
|
138
|
+
|
|
139
|
+
This release introduces breaking changes; see [Migration](#migration-from-01x).
|
|
140
|
+
|
|
141
|
+
### Added
|
|
142
|
+
|
|
143
|
+
#### Backend
|
|
144
|
+
|
|
145
|
+
- Migrated `BackendOps` to the Array API standard via `array-api-compat`.
|
|
146
|
+
- `CuPyOps` and the `cupy` backend family as an optional install
|
|
147
|
+
(`pip install 'spacecore[cupy]'`).
|
|
148
|
+
- `BackendOps.is_complex_dtype` for backend-aware complex detection.
|
|
149
|
+
- `BackendOps.real_dtype` for extracting the real dtype matching a complex one.
|
|
150
|
+
- Broadened backend coverage for array creation, dtype conversion, sparse
|
|
151
|
+
conversion, indexing, reductions, linear algebra, loop primitives
|
|
152
|
+
(`fori_loop`, `while_loop`, `cond`), tree helpers, and vectorized mapping.
|
|
153
|
+
- JAX pytree registration for operator, space, and functional types so they
|
|
154
|
+
pass through `jax.jit`, `jax.vmap`, and `jax.grad` boundaries.
|
|
155
|
+
|
|
156
|
+
#### Context and checking
|
|
157
|
+
|
|
158
|
+
- Public free-function API in `spacecore._contextual`: `set_context`,
|
|
159
|
+
`get_context`, `resolve_context_priority`, `register_ops`, and the
|
|
160
|
+
resolution-policy accessors.
|
|
161
|
+
- Extended `checked_method` to support validation against `self` and multiple
|
|
162
|
+
input argument positions.
|
|
163
|
+
- Reusable space-validation checks: backend, dtype, shape, Hermitian,
|
|
164
|
+
square-matrix, product-structure, and product-component checks. Documented
|
|
165
|
+
at `docs/source/design/checking_policy.rst`.
|
|
166
|
+
|
|
167
|
+
#### Spaces
|
|
168
|
+
|
|
169
|
+
- `BatchSpace` for batched elements with explicit batch shape and batch-axis
|
|
170
|
+
metadata.
|
|
171
|
+
|
|
172
|
+
#### Linear operators
|
|
173
|
+
|
|
174
|
+
- Lazy operator algebra:
|
|
175
|
+
- `A @ B` composes operators.
|
|
176
|
+
- `A + B` sums operators.
|
|
177
|
+
- `alpha * A` scales an operator.
|
|
178
|
+
- `A.H` returns a cached adjoint view satisfying `A.H.H is A`.
|
|
179
|
+
- Algebraic simplification eliminates `I`, `Zero`, `alpha = 0`, `alpha = 1`,
|
|
180
|
+
and flattens nested sums.
|
|
181
|
+
- New operator types: `IdentityLinOp`, `ZeroLinOp`, `MatrixFreeLinOp`,
|
|
182
|
+
`DiagonalLinOp`.
|
|
183
|
+
- Structural `LinOp.is_hermitian()` reporting `True`, `False`, or `None`
|
|
184
|
+
(unknown) without applying incorrect Euclidean assumptions for custom space
|
|
185
|
+
geometries.
|
|
186
|
+
- `LinOp.to_dense()` for materializing operators as backend arrays.
|
|
187
|
+
- Product-structured operators and batched lifting:
|
|
188
|
+
- `ProductLinOp`
|
|
189
|
+
- `BlockDiagonalLinOp`
|
|
190
|
+
- `StackedLinOp`
|
|
191
|
+
- `SumToSingleLinOp`
|
|
192
|
+
- `vapply` / `rvapply` paths for batched operator application.
|
|
193
|
+
|
|
194
|
+
#### Functionals
|
|
195
|
+
|
|
196
|
+
- `Functional` as an abstract base for scalar-valued maps on spaces, with
|
|
197
|
+
`value`, `grad`, `hess_apply`, and batched counterparts.
|
|
198
|
+
- Linear functionals: `LinearFunctional`, `InnerProductFunctional`,
|
|
199
|
+
`MatrixFreeLinearFunctional`.
|
|
200
|
+
- Quadratic forms: `QuadraticForm`, `LinOpQuadraticForm`.
|
|
201
|
+
- `Functional.compose` and `ComposedFunctional` for pull-backs along linear
|
|
202
|
+
operators, with specializations that preserve the concrete functional type
|
|
203
|
+
when possible.
|
|
204
|
+
|
|
205
|
+
#### Linear algebra
|
|
206
|
+
|
|
207
|
+
The `spacecore.linalg` module is new in 0.2.0. It provides JIT-compatible
|
|
208
|
+
iterative solvers and structured result types.
|
|
209
|
+
|
|
210
|
+
- Iterative solvers:
|
|
211
|
+
- `cg` for Hermitian positive-definite systems.
|
|
212
|
+
- `lsqr` for rectangular least-squares problems.
|
|
213
|
+
- `power_iteration` for dominant-eigenpair estimates of a `LinOp` or
|
|
214
|
+
`QuadraticForm`.
|
|
215
|
+
- `lanczos_smallest` for smallest-Ritz-eigenpair estimates of Hermitian
|
|
216
|
+
operators.
|
|
217
|
+
- `expm_multiply` for Krylov matrix-exponential actions `exp(t A) v` on
|
|
218
|
+
Hermitian operators, with complex `t` supported for Schrodinger-type
|
|
219
|
+
evolution.
|
|
220
|
+
- Structured result types `CGResult`, `LSQRResult`, `PowerIterationResult`,
|
|
221
|
+
`LanczosResult`, and `ExpmMultiplyResult`, each carrying convergence
|
|
222
|
+
diagnostics and a compact `__repr__`.
|
|
223
|
+
- Solvers are geometry-aware: norms, inner products, and the default initial
|
|
224
|
+
vector use `Space.inner` and `Space.norm` rather than assuming Euclidean
|
|
225
|
+
geometry. This makes the solvers correct on custom inner products such as
|
|
226
|
+
RKHS or weighted spaces.
|
|
227
|
+
|
|
228
|
+
#### Documentation
|
|
229
|
+
|
|
230
|
+
- Numpydoc-standard public docstrings with runnable doctests for solvers,
|
|
231
|
+
spaces, operators, functionals, backends, and contextual helpers.
|
|
232
|
+
- API reference pages for backend ops, spaces, linear operators, functionals,
|
|
233
|
+
and linear algebra.
|
|
234
|
+
- JAX integration design note at `docs/source/design/jax_integration.rst`
|
|
235
|
+
covering trace-time operator algebra and recommended JIT usage.
|
|
236
|
+
- Tutorials for backend operations, linear operators, and matrix-free linalg
|
|
237
|
+
workflows.
|
|
238
|
+
|
|
239
|
+
#### Tooling
|
|
240
|
+
|
|
241
|
+
- Optional dependency groups: `[jax]`, `[torch]`, `[cupy]`, `[examples]`,
|
|
242
|
+
`[docs]`, `[dev]`.
|
|
243
|
+
- Explicit `__all__` at the top level covering new backends, operators,
|
|
244
|
+
functionals, solvers, result types, validation checks, and contextual
|
|
245
|
+
helpers.
|
|
246
|
+
- CI runs a JIT-traceability audit in `--check` mode and enforces a 70%
|
|
247
|
+
coverage floor via `pytest-cov`.
|
|
248
|
+
- Cross-backend tests covering NumPy, JAX, Torch, and optional CuPy.
|
|
249
|
+
|
|
250
|
+
### Changed
|
|
251
|
+
|
|
252
|
+
- Restructured `_contextual` to hide implementation details while preserving
|
|
253
|
+
the public API via free functions.
|
|
254
|
+
- Replaced manual `if self._enable_checks` guards with `checked_method` across
|
|
255
|
+
`Space`, `LinOp`, and `Functional`. Inline guards are now reserved for
|
|
256
|
+
non-membership checks such as dense-array assertions and custom output-shape
|
|
257
|
+
checks.
|
|
258
|
+
- Improved `VectorSpace`, `HermitianSpace`, and `ProductSpace` conversion
|
|
259
|
+
behavior, validation, batching support, and docstrings.
|
|
260
|
+
- Improved linear-operator equality, representation, conversion, and JAX
|
|
261
|
+
pytree behavior.
|
|
262
|
+
- `spacecore.__version__` now resolves from package metadata via
|
|
263
|
+
`importlib.metadata` instead of a hand-maintained constant.
|
|
264
|
+
- Bumped the package version to `0.2.0`.
|
|
265
|
+
|
|
266
|
+
### Fixed
|
|
267
|
+
|
|
268
|
+
- `LinOp.__eq__` returns `NotImplemented` instead of raising
|
|
269
|
+
`NotImplementedError` on the base class, so `op == None` and
|
|
270
|
+
`op in some_list` no longer raise.
|
|
271
|
+
- `DenseLinOp.is_hermitian` and `SparseLinOp.is_hermitian` return `None` for
|
|
272
|
+
custom space geometries instead of applying an incorrect Euclidean
|
|
273
|
+
matrix-symmetry test.
|
|
274
|
+
|
|
275
|
+
### Migration from 0.1.x
|
|
276
|
+
|
|
277
|
+
- `BackendOps.eps` is now a method `eps(dtype)` rather than a property.
|
|
278
|
+
Callers must pass a dtype, typically `ctx.dtype`.
|
|
279
|
+
- The implementation attribute `DenseLinOp.A` is now a `cached_property`
|
|
280
|
+
backed by `_A`. The public attribute access `op.A` is unchanged.
|
|
281
|
+
- `LinOp.__eq__` returns `NotImplemented` rather than raising; downstream code
|
|
282
|
+
relying on the exception should be updated to handle the new behavior.
|
|
283
|
+
- Several module-internal helpers in `spacecore._contextual` moved to private
|
|
284
|
+
modules. Use the public functions re-exported from `spacecore._contextual`
|
|
285
|
+
(`set_context`, `get_context`, `resolve_context_priority`, `register_ops`,
|
|
286
|
+
`set_resolution_policy`, and the dtype-policy accessors) rather than
|
|
287
|
+
importing from internal modules.
|
|
288
|
+
|
|
289
|
+
### Known limitations
|
|
290
|
+
|
|
291
|
+
- `cg`, `lsqr`, and `power_iteration` do not structurally validate operator
|
|
292
|
+
properties (positive-definiteness, full Hermiticity) and may silently
|
|
293
|
+
produce incorrect results on inputs that violate their preconditions. See
|
|
294
|
+
each function's `Notes` section for details.
|
|
295
|
+
- Operator algebra runs Python-level simplification at construction time. For
|
|
296
|
+
maximum JIT efficiency, assemble operator expressions outside the
|
|
297
|
+
`jax.jit` boundary; see the JAX integration design note.
|
|
298
|
+
- `MatrixFreeLinOp` stores its callables in pytree auxiliary data.
|
|
299
|
+
Constructing one inside a JIT-traced function with a new lambda each call
|
|
300
|
+
triggers retracing. Construct outside the traced region with a stable
|
|
301
|
+
callable reference.
|
|
302
|
+
- The CuPy backend is provided as a preview. Coverage of non-standard
|
|
303
|
+
operations and sparse handling may evolve in a subsequent release.
|
|
304
|
+
|
|
305
|
+
[0.3.0]: https://github.com/Pavlo3P/SpaceCore/releases/tag/v0.3.0
|
|
306
|
+
[0.2.0]: https://github.com/Pavlo3P/SpaceCore/releases/tag/v0.2.0
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Bug reports, feature requests, and pull requests are welcome.
|
|
4
|
+
|
|
5
|
+
For local development:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python -m pip install -e ".[dev,docs]"
|
|
9
|
+
pytest
|
|
10
|
+
ruff check .
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Please include tests or documentation updates for behavior changes.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include CHANGELOG.md
|
|
2
|
+
include CONTRIBUTING.md
|
|
3
|
+
|
|
4
|
+
recursive-include docs/source *.rst *.py *.css
|
|
5
|
+
recursive-include docs/dev *.md
|
|
6
|
+
recursive-include examples *.py
|
|
7
|
+
recursive-include tests *.py
|
|
8
|
+
recursive-include tutorials *.ipynb *.md
|
|
9
|
+
|
|
10
|
+
global-exclude *.py[cod]
|
|
11
|
+
global-exclude __pycache__
|
|
12
|
+
global-exclude .DS_Store
|
spacecore-0.3.1/PKG-INFO
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spacecore
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: Backend-agnostic vector spaces and linear operators.
|
|
5
|
+
Author: Pavlo Pelikh
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Keywords: linear-algebra,jax,pytorch,numpy,operators,spaces
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: array-api-compat>=1.14.0
|
|
18
|
+
Requires-Dist: numpy>=2.0.0
|
|
19
|
+
Requires-Dist: scipy>=1.17
|
|
20
|
+
Provides-Extra: jax
|
|
21
|
+
Requires-Dist: jax>=0.9.1; extra == "jax"
|
|
22
|
+
Provides-Extra: torch
|
|
23
|
+
Requires-Dist: torch>=2.0; extra == "torch"
|
|
24
|
+
Provides-Extra: cupy
|
|
25
|
+
Requires-Dist: cupy>=13.0; extra == "cupy"
|
|
26
|
+
Provides-Extra: examples
|
|
27
|
+
Requires-Dist: matplotlib>=3.8; extra == "examples"
|
|
28
|
+
Requires-Dist: optax>=0.2; extra == "examples"
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
Requires-Dist: sphinx>=8.0; extra == "docs"
|
|
31
|
+
Requires-Dist: pydata-sphinx-theme>=0.16; extra == "docs"
|
|
32
|
+
Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
|
|
33
|
+
Requires-Dist: sphinx-design>=0.6; extra == "docs"
|
|
34
|
+
Requires-Dist: numpydoc>=1.8; extra == "docs"
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
38
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
39
|
+
Requires-Dist: numpydoc>=1.7; extra == "dev"
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# SpaceCore
|
|
43
|
+
|
|
44
|
+
[](https://github.com/Pavlo3P/SpaceCore/actions/workflows/ci.yml)
|
|
45
|
+
[](https://pypi.org/project/spacecore/)
|
|
46
|
+
[](https://pypi.org/project/spacecore/)
|
|
47
|
+
[](LICENSE)
|
|
48
|
+
|
|
49
|
+
SpaceCore provides typed vector spaces, structured elements, linear operators,
|
|
50
|
+
functionals, and small linear-algebra utilities for backend-aware numerical
|
|
51
|
+
code. An operator is a typed map `A : X -> Y` between spaces, not merely an
|
|
52
|
+
array. Spaces carry the rules needed to validate elements, compute inner
|
|
53
|
+
products, flatten structured values, and interpret adjoints.
|
|
54
|
+
|
|
55
|
+
The execution backend is explicit. A `Context` owns the backend operations,
|
|
56
|
+
default dtype, and validation policy used by spaces and operators. NumPy is the
|
|
57
|
+
baseline backend; JAX, Torch, and CuPy are optional backends when their extras
|
|
58
|
+
are installed.
|
|
59
|
+
|
|
60
|
+
SpaceCore's native solvers are intentionally small. They are a correctness
|
|
61
|
+
baseline and substrate layer for space-aware algorithms, not a replacement for
|
|
62
|
+
mature solver ecosystems such as SciPy, PETSc, Krylov.jl, or PyLops. External
|
|
63
|
+
adapters and backend-specific fast paths can be layered on top where breadth or
|
|
64
|
+
performance is required.
|
|
65
|
+
|
|
66
|
+
## Install
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install spacecore
|
|
70
|
+
pip install "spacecore[jax]"
|
|
71
|
+
pip install "spacecore[torch]"
|
|
72
|
+
pip install "spacecore[cupy]"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Python 3.11+ is required.
|
|
76
|
+
|
|
77
|
+
## Quick Start
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import numpy as np
|
|
81
|
+
import spacecore as sc
|
|
82
|
+
|
|
83
|
+
ctx = sc.Context(sc.NumpyOps(), dtype=np.float64)
|
|
84
|
+
X = sc.DenseCoordinateSpace((2,), ctx)
|
|
85
|
+
A = sc.DenseLinOp(ctx.asarray([[2.0, 0.0], [0.0, 3.0]]), X, X, ctx)
|
|
86
|
+
b = ctx.asarray([4.0, 9.0])
|
|
87
|
+
|
|
88
|
+
result = sc.cg(A, b, tol=1e-12, maxiter=10)
|
|
89
|
+
print(result.x)
|
|
90
|
+
print(result.converged)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Expected output:
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
[2. 3.]
|
|
97
|
+
True
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Core Ideas
|
|
101
|
+
|
|
102
|
+
**Spaces.** `DenseCoordinateSpace`, `DenseVectorSpace`,
|
|
103
|
+
`ElementwiseJordanSpace`, `EuclideanElementwiseJordanSpace`, `HermitianSpace`,
|
|
104
|
+
`ProductSpace`, and `StackedSpace` describe element structure and geometry.
|
|
105
|
+
Dense coordinate spaces can use Euclidean or weighted inner products.
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
import numpy as np
|
|
109
|
+
import spacecore as sc
|
|
110
|
+
|
|
111
|
+
ctx = sc.Context(sc.NumpyOps(), dtype=np.float64)
|
|
112
|
+
weights = ctx.asarray([2.0, 5.0])
|
|
113
|
+
X = sc.DenseCoordinateSpace((2,), ctx, geometry=sc.WeightedInnerProduct(weights))
|
|
114
|
+
x = ctx.asarray([1.0, 2.0])
|
|
115
|
+
y = ctx.asarray([3.0, 4.0])
|
|
116
|
+
|
|
117
|
+
print(X.inner(x, y))
|
|
118
|
+
print(X.riesz(x))
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Expected output:
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
46.0
|
|
125
|
+
[ 2. 10.]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Linear operators.** `DenseLinOp`, `SparseLinOp`, `DiagonalLinOp`,
|
|
129
|
+
`MatrixFreeLinOp`, `IdentityLinOp`, `ZeroLinOp`, and the algebraic operators
|
|
130
|
+
represent maps `A : X -> Y`. `apply` computes the forward map. `rapply`
|
|
131
|
+
computes the metric adjoint: the coordinate conjugate transpose only agrees
|
|
132
|
+
with it when both spaces use Euclidean geometry.
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
import numpy as np
|
|
136
|
+
import spacecore as sc
|
|
137
|
+
|
|
138
|
+
ctx = sc.Context(sc.NumpyOps(), dtype=np.float64)
|
|
139
|
+
X = sc.DenseCoordinateSpace((2,), ctx)
|
|
140
|
+
A = sc.DiagonalLinOp(ctx.asarray([2.0, 3.0]), X, ctx)
|
|
141
|
+
|
|
142
|
+
print(A.apply(ctx.asarray([1.0, 2.0])))
|
|
143
|
+
print(A.rapply(ctx.asarray([1.0, 1.0])))
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Expected output:
|
|
147
|
+
|
|
148
|
+
```text
|
|
149
|
+
[2. 6.]
|
|
150
|
+
[2. 3.]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Functionals.** `LinearFunctional`, `InnerProductFunctional`,
|
|
154
|
+
`MatrixFreeLinearFunctional`, `QuadraticForm`, and `LinOpQuadraticForm` model
|
|
155
|
+
scalar-valued maps on spaces. Gradients are represented in the domain geometry.
|
|
156
|
+
|
|
157
|
+
**Linear algebra.** `cg`, `lsqr`, `lanczos_smallest`, `power_iteration`, and
|
|
158
|
+
`expm_multiply` operate on SpaceCore operators and spaces. They document their
|
|
159
|
+
mathematical preconditions; for example `cg` expects a square Hermitian positive
|
|
160
|
+
definite map `A : X -> X` with respect to `X.inner`.
|
|
161
|
+
|
|
162
|
+
**Backends.** `NumpyOps` is always available. `JaxOps`, `TorchOps`, and
|
|
163
|
+
`CuPyOps` are exported only when their optional dependencies are installed.
|
|
164
|
+
Backend portability means SpaceCore uses the same abstract operations and data
|
|
165
|
+
model; it does not erase backend-specific dtype, device, sparse, tracing, or
|
|
166
|
+
autograd behavior.
|
|
167
|
+
|
|
168
|
+
## Batching
|
|
169
|
+
|
|
170
|
+
A space describes one element type. Batched computation is handled by vectorized
|
|
171
|
+
application methods such as `vapply`, `rvapply`, `vvalue`, and backend
|
|
172
|
+
vectorization. Batching does not change the mathematical domain or codomain of
|
|
173
|
+
an operator unless the operator itself is explicitly built over a stacked or
|
|
174
|
+
product space.
|
|
175
|
+
|
|
176
|
+
## Documentation
|
|
177
|
+
|
|
178
|
+
- [Tutorials](https://pavlo3p.github.io/SpaceCore/tutorials/index.html)
|
|
179
|
+
- [Design notes](https://pavlo3p.github.io/SpaceCore/design/index.html)
|
|
180
|
+
- [API reference](https://pavlo3p.github.io/SpaceCore/api/index.html)
|
|
181
|
+
- [Release notes](https://pavlo3p.github.io/SpaceCore/release_notes.html)
|
|
182
|
+
|
|
183
|
+
## Project Status
|
|
184
|
+
|
|
185
|
+
SpaceCore is experimental `0.3.x` software. Core abstractions are usable for
|
|
186
|
+
research and prototyping, but API details may still change before a stable
|
|
187
|
+
release.
|
|
188
|
+
|
|
189
|
+
## Contributing
|
|
190
|
+
|
|
191
|
+
Bug reports, feature requests, and PRs are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
Apache 2.0. See [LICENSE](LICENSE).
|
|
196
|
+
|
|
197
|
+
## Citation
|
|
198
|
+
|
|
199
|
+
```bibtex
|
|
200
|
+
@software{spacecore,
|
|
201
|
+
author = {Pavlo Pelikh},
|
|
202
|
+
title = {SpaceCore: Backend-aware vector spaces and linear operators},
|
|
203
|
+
url = {https://github.com/Pavlo3P/SpaceCore},
|
|
204
|
+
year = {2026},
|
|
205
|
+
}
|
|
206
|
+
```
|