omnibias-fields 0.1.0__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.
Files changed (85) hide show
  1. omnibias_fields-0.1.0/LICENSE +214 -0
  2. omnibias_fields-0.1.0/PKG-INFO +135 -0
  3. omnibias_fields-0.1.0/README.md +85 -0
  4. omnibias_fields-0.1.0/pyproject.toml +65 -0
  5. omnibias_fields-0.1.0/setup.cfg +4 -0
  6. omnibias_fields-0.1.0/src/omnibias/fields/__init__.py +108 -0
  7. omnibias_fields-0.1.0/src/omnibias/fields/_core/__init__.py +64 -0
  8. omnibias_fields-0.1.0/src/omnibias/fields/_core/catalog.py +220 -0
  9. omnibias_fields-0.1.0/src/omnibias/fields/_core/components.py +177 -0
  10. omnibias_fields-0.1.0/src/omnibias/fields/_core/coords.py +202 -0
  11. omnibias_fields-0.1.0/src/omnibias/fields/_core/field_base.py +78 -0
  12. omnibias_fields-0.1.0/src/omnibias/fields/_core/ops_registry.py +78 -0
  13. omnibias_fields-0.1.0/src/omnibias/fields/_core/quadrature.py +312 -0
  14. omnibias_fields-0.1.0/src/omnibias/fields/_core/sigma_cache.py +137 -0
  15. omnibias_fields-0.1.0/src/omnibias/fields/_core/state.py +201 -0
  16. omnibias_fields-0.1.0/src/omnibias/fields/_core/view.py +548 -0
  17. omnibias_fields-0.1.0/src/omnibias/fields/jax/__init__.py +14 -0
  18. omnibias_fields-0.1.0/src/omnibias/fields/jax/_ops_dispatch.py +761 -0
  19. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/__init__.py +256 -0
  20. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/basic.py +235 -0
  21. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/chemistry.py +179 -0
  22. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/complex.py +55 -0
  23. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/conservation.py +193 -0
  24. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/electromagnetism.py +162 -0
  25. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/finite_strain.py +238 -0
  26. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/high_order.py +167 -0
  27. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/integral.py +95 -0
  28. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/kinetic.py +183 -0
  29. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/mechanics.py +175 -0
  30. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/mhd.py +190 -0
  31. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/nonlinear.py +138 -0
  32. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/norms.py +92 -0
  33. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/registry.py +9 -0
  34. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/tensor.py +138 -0
  35. omnibias_fields-0.1.0/src/omnibias/fields/jax/ops/vector.py +155 -0
  36. omnibias_fields-0.1.0/src/omnibias/fields/locus/__init__.py +55 -0
  37. omnibias_fields-0.1.0/src/omnibias/fields/locus/jax.py +141 -0
  38. omnibias_fields-0.1.0/src/omnibias/fields/locus/torch.py +268 -0
  39. omnibias_fields-0.1.0/src/omnibias/fields/py.typed +0 -0
  40. omnibias_fields-0.1.0/src/omnibias/fields/scale.py +136 -0
  41. omnibias_fields-0.1.0/src/omnibias/fields/singularity.py +30 -0
  42. omnibias_fields-0.1.0/src/omnibias/fields/torch/__init__.py +14 -0
  43. omnibias_fields-0.1.0/src/omnibias/fields/torch/_ops_dispatch.py +797 -0
  44. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/__init__.py +267 -0
  45. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/basic.py +294 -0
  46. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/chemistry.py +178 -0
  47. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/complex.py +65 -0
  48. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/conservation.py +191 -0
  49. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/electromagnetism.py +162 -0
  50. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/finite_strain.py +298 -0
  51. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/high_order.py +199 -0
  52. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/integral.py +137 -0
  53. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/kinetic.py +213 -0
  54. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/mechanics.py +175 -0
  55. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/mhd.py +207 -0
  56. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/nonlinear.py +180 -0
  57. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/norms.py +118 -0
  58. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/registry.py +9 -0
  59. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/tensor.py +152 -0
  60. omnibias_fields-0.1.0/src/omnibias/fields/torch/ops/vector.py +180 -0
  61. omnibias_fields-0.1.0/src/omnibias/fields/weak/__init__.py +28 -0
  62. omnibias_fields-0.1.0/src/omnibias/fields/weak/_core.py +223 -0
  63. omnibias_fields-0.1.0/src/omnibias/fields/weak/jax.py +151 -0
  64. omnibias_fields-0.1.0/src/omnibias/fields/weak/torch.py +188 -0
  65. omnibias_fields-0.1.0/src/omnibias_fields.egg-info/PKG-INFO +135 -0
  66. omnibias_fields-0.1.0/src/omnibias_fields.egg-info/SOURCES.txt +83 -0
  67. omnibias_fields-0.1.0/src/omnibias_fields.egg-info/dependency_links.txt +1 -0
  68. omnibias_fields-0.1.0/src/omnibias_fields.egg-info/requires.txt +27 -0
  69. omnibias_fields-0.1.0/src/omnibias_fields.egg-info/top_level.txt +1 -0
  70. omnibias_fields-0.1.0/tests/test_catalog.py +100 -0
  71. omnibias_fields-0.1.0/tests/test_chemistry.py +297 -0
  72. omnibias_fields-0.1.0/tests/test_electromagnetism.py +270 -0
  73. omnibias_fields-0.1.0/tests/test_finite_strain.py +303 -0
  74. omnibias_fields-0.1.0/tests/test_integration_norms.py +185 -0
  75. omnibias_fields-0.1.0/tests/test_kinetic.py +280 -0
  76. omnibias_fields-0.1.0/tests/test_line_integral.py +162 -0
  77. omnibias_fields-0.1.0/tests/test_locus.py +56 -0
  78. omnibias_fields-0.1.0/tests/test_locus_layer.py +73 -0
  79. omnibias_fields-0.1.0/tests/test_mechanics.py +255 -0
  80. omnibias_fields-0.1.0/tests/test_mhd.py +334 -0
  81. omnibias_fields-0.1.0/tests/test_scale.py +68 -0
  82. omnibias_fields-0.1.0/tests/test_singularity.py +30 -0
  83. omnibias_fields-0.1.0/tests/test_vector_calculus.py +419 -0
  84. omnibias_fields-0.1.0/tests/test_weak.py +136 -0
  85. omnibias_fields-0.1.0/tests/test_wirtinger.py +102 -0
@@ -0,0 +1,214 @@
1
+ omnibias -- permissive tier
2
+ ===========================
3
+
4
+ SPDX-License-Identifier: Apache-2.0
5
+ Copyright (C) 2026 Derivon
6
+
7
+ This package is licensed under the Apache License, Version 2.0, reproduced in
8
+ full below. You do not need a commercial license to use it. See LICENSING.md in
9
+ the repository root for the tier split and for the copyleft tier's terms.
10
+
11
+ --------------------------------------------------------------------------------
12
+
13
+
14
+ Apache License
15
+ Version 2.0, January 2004
16
+ http://www.apache.org/licenses/
17
+
18
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
19
+
20
+ 1. Definitions.
21
+
22
+ "License" shall mean the terms and conditions for use, reproduction,
23
+ and distribution as defined by Sections 1 through 9 of this document.
24
+
25
+ "Licensor" shall mean the copyright owner or entity authorized by
26
+ the copyright owner that is granting the License.
27
+
28
+ "Legal Entity" shall mean the union of the acting entity and all
29
+ other entities that control, are controlled by, or are under common
30
+ control with that entity. For the purposes of this definition,
31
+ "control" means (i) the power, direct or indirect, to cause the
32
+ direction or management of such entity, whether by contract or
33
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
34
+ outstanding shares, or (iii) beneficial ownership of such entity.
35
+
36
+ "You" (or "Your") shall mean an individual or Legal Entity
37
+ exercising permissions granted by this License.
38
+
39
+ "Source" form shall mean the preferred form for making modifications,
40
+ including but not limited to software source code, documentation
41
+ source, and configuration files.
42
+
43
+ "Object" form shall mean any form resulting from mechanical
44
+ transformation or translation of a Source form, including but
45
+ not limited to compiled object code, generated documentation,
46
+ and conversions to other media types.
47
+
48
+ "Work" shall mean the work of authorship, whether in Source or
49
+ Object form, made available under the License, as indicated by a
50
+ copyright notice that is included in or attached to the work
51
+ (an example is provided in the Appendix below).
52
+
53
+ "Derivative Works" shall mean any work, whether in Source or Object
54
+ form, that is based on (or derived from) the Work and for which the
55
+ editorial revisions, annotations, elaborations, or other modifications
56
+ represent, as a whole, an original work of authorship. For the purposes
57
+ of this License, Derivative Works shall not include works that remain
58
+ separable from, or merely link (or bind by name) to the interfaces of,
59
+ the Work and Derivative Works thereof.
60
+
61
+ "Contribution" shall mean any work of authorship, including
62
+ the original version of the Work and any modifications or additions
63
+ to that Work or Derivative Works thereof, that is intentionally
64
+ submitted to Licensor for inclusion in the Work by the copyright owner
65
+ or by an individual or Legal Entity authorized to submit on behalf of
66
+ the copyright owner. For the purposes of this definition, "submitted"
67
+ means any form of electronic, verbal, or written communication sent
68
+ to the Licensor or its representatives, including but not limited to
69
+ communication on electronic mailing lists, source code control systems,
70
+ and issue tracking systems that are managed by, or on behalf of, the
71
+ Licensor for the purpose of discussing and improving the Work, but
72
+ excluding communication that is conspicuously marked or otherwise
73
+ designated in writing by the copyright owner as "Not a Contribution."
74
+
75
+ "Contributor" shall mean Licensor and any individual or Legal Entity
76
+ on behalf of whom a Contribution has been received by Licensor and
77
+ subsequently incorporated within the Work.
78
+
79
+ 2. Grant of Copyright License. Subject to the terms and conditions of
80
+ this License, each Contributor hereby grants to You a perpetual,
81
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
82
+ copyright license to reproduce, prepare Derivative Works of,
83
+ publicly display, publicly perform, sublicense, and distribute the
84
+ Work and such Derivative Works in Source or Object form.
85
+
86
+ 3. Grant of Patent License. Subject to the terms and conditions of
87
+ this License, each Contributor hereby grants to You a perpetual,
88
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
89
+ (except as stated in this section) patent license to make, have made,
90
+ use, offer to sell, sell, import, and otherwise transfer the Work,
91
+ where such license applies only to those patent claims licensable
92
+ by such Contributor that are necessarily infringed by their
93
+ Contribution(s) alone or by combination of their Contribution(s)
94
+ with the Work to which such Contribution(s) was submitted. If You
95
+ institute patent litigation against any entity (including a
96
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
97
+ or a Contribution incorporated within the Work constitutes direct
98
+ or contributory patent infringement, then any patent licenses
99
+ granted to You under this License for that Work shall terminate
100
+ as of the date such litigation is filed.
101
+
102
+ 4. Redistribution. You may reproduce and distribute copies of the
103
+ Work or Derivative Works thereof in any medium, with or without
104
+ modifications, and in Source or Object form, provided that You
105
+ meet the following conditions:
106
+
107
+ (a) You must give any other recipients of the Work or
108
+ Derivative Works a copy of this License; and
109
+
110
+ (b) You must cause any modified files to carry prominent notices
111
+ stating that You changed the files; and
112
+
113
+ (c) You must retain, in the Source form of any Derivative Works
114
+ that You distribute, all copyright, patent, trademark, and
115
+ attribution notices from the Source form of the Work,
116
+ excluding those notices that do not pertain to any part of
117
+ the Derivative Works; and
118
+
119
+ (d) If the Work includes a "NOTICE" text file as part of its
120
+ distribution, then any Derivative Works that You distribute must
121
+ include a readable copy of the attribution notices contained
122
+ within such NOTICE file, excluding those notices that do not
123
+ pertain to any part of the Derivative Works, in at least one
124
+ of the following places: within a NOTICE text file distributed
125
+ as part of the Derivative Works; within the Source form or
126
+ documentation, if provided along with the Derivative Works; or,
127
+ within a display generated by the Derivative Works, if and
128
+ wherever such third-party notices normally appear. The contents
129
+ of the NOTICE file are for informational purposes only and
130
+ do not modify the License. You may add Your own attribution
131
+ notices within Derivative Works that You distribute, alongside
132
+ or as an addendum to the NOTICE text from the Work, provided
133
+ that such additional attribution notices cannot be construed
134
+ as modifying the License.
135
+
136
+ You may add Your own copyright statement to Your modifications and
137
+ may provide additional or different license terms and conditions
138
+ for use, reproduction, or distribution of Your modifications, or
139
+ for any such Derivative Works as a whole, provided Your use,
140
+ reproduction, and distribution of the Work otherwise complies with
141
+ the conditions stated in this License.
142
+
143
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
144
+ any Contribution intentionally submitted for inclusion in the Work
145
+ by You to the Licensor shall be under the terms and conditions of
146
+ this License, without any additional terms or conditions.
147
+ Notwithstanding the above, nothing herein shall supersede or modify
148
+ the terms of any separate license agreement you may have executed
149
+ with Licensor regarding such Contributions.
150
+
151
+ 6. Trademarks. This License does not grant permission to use the trade
152
+ names, trademarks, service marks, or product names of the Licensor,
153
+ except as required for reasonable and customary use in describing the
154
+ origin of the Work and reproducing the content of the NOTICE file.
155
+
156
+ 7. Disclaimer of Warranty. Unless required by applicable law or
157
+ agreed to in writing, Licensor provides the Work (and each
158
+ Contributor provides its Contributions) on an "AS IS" BASIS,
159
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
160
+ implied, including, without limitation, any warranties or conditions
161
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
162
+ PARTICULAR PURPOSE. You are solely responsible for determining the
163
+ appropriateness of using or redistributing the Work and assume any
164
+ risks associated with Your exercise of permissions under this License.
165
+
166
+ 8. Limitation of Liability. In no event and under no legal theory,
167
+ whether in tort (including negligence), contract, or otherwise,
168
+ unless required by applicable law (such as deliberate and grossly
169
+ negligent acts) or agreed to in writing, shall any Contributor be
170
+ liable to You for damages, including any direct, indirect, special,
171
+ incidental, or consequential damages of any character arising as a
172
+ result of this License or out of the use or inability to use the
173
+ Work (including but not limited to damages for loss of goodwill,
174
+ work stoppage, computer failure or malfunction, or any and all
175
+ other commercial damages or losses), even if such Contributor
176
+ has been advised of the possibility of such damages.
177
+
178
+ 9. Accepting Warranty or Additional Liability. While redistributing
179
+ the Work or Derivative Works thereof, You may choose to offer,
180
+ and charge a fee for, acceptance of support, warranty, indemnity,
181
+ or other liability obligations and/or rights consistent with this
182
+ License. However, in accepting such obligations, You may act only
183
+ on Your own behalf and on Your sole responsibility, not on behalf
184
+ of any other Contributor, and only if You agree to indemnify,
185
+ defend, and hold each Contributor harmless for any liability
186
+ incurred by, or claims asserted against, such Contributor by reason
187
+ of your accepting any such warranty or additional liability.
188
+
189
+ END OF TERMS AND CONDITIONS
190
+
191
+ APPENDIX: How to apply the Apache License to your work.
192
+
193
+ To apply the Apache License to your work, attach the following
194
+ boilerplate notice, with the fields enclosed by brackets "[]"
195
+ replaced with your own identifying information. (Don't include
196
+ the brackets!) The text should be enclosed in the appropriate
197
+ comment syntax for the file format. We also recommend that a
198
+ file or class name and description of purpose be included on the
199
+ same "printed page" as the copyright notice for easier
200
+ identification within third-party archives.
201
+
202
+ Copyright [yyyy] [name of copyright owner]
203
+
204
+ Licensed under the Apache License, Version 2.0 (the "License");
205
+ you may not use this file except in compliance with the License.
206
+ You may obtain a copy of the License at
207
+
208
+ http://www.apache.org/licenses/LICENSE-2.0
209
+
210
+ Unless required by applicable law or agreed to in writing, software
211
+ distributed under the License is distributed on an "AS IS" BASIS,
212
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
213
+ See the License for the specific language governing permissions and
214
+ limitations under the License.
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: omnibias-fields
3
+ Version: 0.1.0
4
+ Summary: Backend-agnostic field substrate for omnibias: the FieldState value object, the attribute-DSL views, the lazy sigma^(n) cache, and the cross-backend (torch + jax) closed-form differential-operator surface (gradient, divergence, curl, laplacian, hessian, jacobian, integration, inner products, Sobolev norms, tensor divergence, Wirtinger).
5
+ Author-email: Vardan Grigoryants <vardan@derivon.ai>
6
+ Maintainer-email: Derivon <info@derivon.ai>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/derivon-ai/omnibias
9
+ Project-URL: Documentation, https://omnibias.ai/
10
+ Project-URL: Source, https://github.com/derivon-ai/omnibias
11
+ Project-URL: Issues, https://github.com/derivon-ai/omnibias/issues
12
+ Project-URL: Changelog, https://github.com/derivon-ai/omnibias/blob/main/CHANGELOG.md
13
+ Keywords: scientific-machine-learning,differential-operators,closed-form-derivatives,quadrature,field-operators
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: omnibias-core>=0.2.0
29
+ Requires-Dist: numpy>=1.24
30
+ Provides-Extra: torch
31
+ Requires-Dist: omnibias-torch>=0.2.0; extra == "torch"
32
+ Requires-Dist: torch>=2.0; extra == "torch"
33
+ Provides-Extra: jax
34
+ Requires-Dist: omnibias-jax>=0.2.0; extra == "jax"
35
+ Requires-Dist: jax>=0.4.30; extra == "jax"
36
+ Requires-Dist: jaxlib>=0.4.30; extra == "jax"
37
+ Provides-Extra: all
38
+ Requires-Dist: omnibias-fields[jax,torch]; extra == "all"
39
+ Provides-Extra: difference
40
+ Requires-Dist: omnibias-difference>=0.1.0a1; extra == "difference"
41
+ Provides-Extra: test
42
+ Requires-Dist: pytest>=7.0; extra == "test"
43
+ Requires-Dist: pytest-cov>=4.0; extra == "test"
44
+ Requires-Dist: numpy>=1.24; extra == "test"
45
+ Provides-Extra: dev
46
+ Requires-Dist: omnibias-fields[all,test]; extra == "dev"
47
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
48
+ Requires-Dist: mypy>=1.5; extra == "dev"
49
+ Dynamic: license-file
50
+
51
+ # omnibias-fields
52
+
53
+ **Status: Beta (v0.1.0).**
54
+
55
+ The backend-agnostic **field substrate** for omnibias: the `FieldState` value
56
+ object, the attribute-DSL views (`state.u.grad`, `state.velocity.div`, ...), the
57
+ lazy `sigma^(n)(z)` cache, the op-extension registry, and the cross-backend
58
+ (torch + jax) closed-form differential-operator surface.
59
+
60
+ ## Why this is the substrate
61
+
62
+ - **One forward pass per derivative order** — the `SigmaCache` evaluates
63
+ `sigma^(n)(z)` exactly once per `(layer, order)` pair and feeds every
64
+ downstream op (`grad`, `div`, `curl`, `laplacian`, `hessian`, `jacobian`,
65
+ Sobolev norms, tensor divergence, Wirtinger).
66
+ - **Cross-backend bit-identity** — the torch and JAX op surfaces are
67
+ arithmetic twins over the sigma tower the caller supplies, and that tower
68
+ comes from the one shared `omnibias.core.polynomials` recurrence via
69
+ `omnibias.torch` / `omnibias.jax`. A Laplacian on torch is therefore
70
+ ULP-equal to the same Laplacian on JAX in float64.
71
+ - **One extension surface** — `omnibias-pinn`, `omnibias-geometry`,
72
+ `omnibias-score` (and any external package that registers ops through
73
+ `ops_registry`) all share one `FieldState`. The same `state.u.grad` syntax
74
+ works everywhere.
75
+
76
+ This package was extracted from `omnibias-pinn` so that every field-based
77
+ extension can build on one shared, bit-identical substrate. `omnibias-pinn`
78
+ re-exports the moved symbols through back-compat shims, so existing
79
+ `omnibias.pinn._core` and `omnibias.pinn.<backend>.ops` imports keep working
80
+ unchanged.
81
+
82
+ ## Install
83
+
84
+ ```bash
85
+ pip install "omnibias-fields[torch]" # or [jax], or [all]
86
+ ```
87
+
88
+ ## What's here
89
+
90
+ | Layer | Module | Contents |
91
+ |---|---|---|
92
+ | Schemas (pure Python) | `omnibias.fields._core` | `FieldState`, `ComponentSpec`, `CoordinateSpec`, `ComponentView`, `VectorView`, `SigmaCache`, `FieldBase`, `ops_registry`, `quadrature` |
93
+ | Torch ops | `omnibias.fields.torch.ops` | `value`, `derivative`, `gradient`, `divergence`, `laplacian`, `hessian`, `jacobian`, `curl`, `integrate`, `inner_product`, `l2_norm`, `sobolev_norm`, `tensor_divergence`, `dz`, `dzbar`, ... |
94
+ | JAX ops | `omnibias.fields.jax.ops` | the bit-identical twin of the torch surface |
95
+ | Weak form (shipped 02-04) | `omnibias.fields.weak` | `TestFunctionSpace`, `exact_moment`, `weak_residual`; exact integrals only for polynomial coeffs on boxes; boundary bound on by default |
96
+ | Equality locus (shipped 01-09 / 02-12) | `omnibias.fields.locus` | `EqualityLocusLayer` / `LocusOutput`; constraint manifold, not a general PDE solver; always `branch` / `condition` / `converged` |
97
+
98
+ ## Building on top of this
99
+
100
+ A *field* is any object implementing the `FieldBase` protocol that, when called
101
+ on a `(B, D)` coordinate tensor, returns a `FieldState`. To make the closed-form
102
+ ops dispatch correctly, set the class attribute named by
103
+ `omnibias.fields._core.DISPATCH_ATTR` (default `"_omnibias_dispatch"`) to one of
104
+ the dispatch tags: `"one_layer"` selects the closed-form sigma-tower reduction;
105
+ any other tag selects the state-method path (the field implements
106
+ `value_component`, `derivative`, `mixed_partial` taking the `FieldState`).
107
+
108
+ To add a new op without modifying this package, register it:
109
+
110
+ ```python
111
+ from omnibias.fields import ops_registry
112
+
113
+ @ops_registry.register("symmetric_laplacian")
114
+ def symmetric_laplacian(state, name):
115
+ ...
116
+ # now available as state.u.symmetric_laplacian
117
+ ```
118
+
119
+ See [`FIELDS_DERIVATIONS.md`](FIELDS_DERIVATIONS.md) for the math behind each op
120
+ and the numerical-stability notes.
121
+
122
+ ## Invariants
123
+
124
+ - **Pure-Python core.** `omnibias.fields._core` imports no torch / jax / numpy.
125
+ - **Cross-backend bit-identity.** The torch and jax ops are arithmetic twins
126
+ over the same pure-Python schemas; the sigma tower they consume comes from the
127
+ shared `omnibias-core` polynomial coefficients. They agree to
128
+ `rtol=1e-12, atol=1e-12` on the parity tests.
129
+ - **One sigma evaluation per `(order, axis)`.** The `SigmaCache` is filled
130
+ lazily and reused across all ops in a residual.
131
+
132
+ ## License
133
+
134
+ Apache-2.0. See [`LICENSE`](LICENSE) and [`../../LICENSING.md`](../../LICENSING.md).
135
+ You never need a commercial licence for this package.
@@ -0,0 +1,85 @@
1
+ # omnibias-fields
2
+
3
+ **Status: Beta (v0.1.0).**
4
+
5
+ The backend-agnostic **field substrate** for omnibias: the `FieldState` value
6
+ object, the attribute-DSL views (`state.u.grad`, `state.velocity.div`, ...), the
7
+ lazy `sigma^(n)(z)` cache, the op-extension registry, and the cross-backend
8
+ (torch + jax) closed-form differential-operator surface.
9
+
10
+ ## Why this is the substrate
11
+
12
+ - **One forward pass per derivative order** — the `SigmaCache` evaluates
13
+ `sigma^(n)(z)` exactly once per `(layer, order)` pair and feeds every
14
+ downstream op (`grad`, `div`, `curl`, `laplacian`, `hessian`, `jacobian`,
15
+ Sobolev norms, tensor divergence, Wirtinger).
16
+ - **Cross-backend bit-identity** — the torch and JAX op surfaces are
17
+ arithmetic twins over the sigma tower the caller supplies, and that tower
18
+ comes from the one shared `omnibias.core.polynomials` recurrence via
19
+ `omnibias.torch` / `omnibias.jax`. A Laplacian on torch is therefore
20
+ ULP-equal to the same Laplacian on JAX in float64.
21
+ - **One extension surface** — `omnibias-pinn`, `omnibias-geometry`,
22
+ `omnibias-score` (and any external package that registers ops through
23
+ `ops_registry`) all share one `FieldState`. The same `state.u.grad` syntax
24
+ works everywhere.
25
+
26
+ This package was extracted from `omnibias-pinn` so that every field-based
27
+ extension can build on one shared, bit-identical substrate. `omnibias-pinn`
28
+ re-exports the moved symbols through back-compat shims, so existing
29
+ `omnibias.pinn._core` and `omnibias.pinn.<backend>.ops` imports keep working
30
+ unchanged.
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ pip install "omnibias-fields[torch]" # or [jax], or [all]
36
+ ```
37
+
38
+ ## What's here
39
+
40
+ | Layer | Module | Contents |
41
+ |---|---|---|
42
+ | Schemas (pure Python) | `omnibias.fields._core` | `FieldState`, `ComponentSpec`, `CoordinateSpec`, `ComponentView`, `VectorView`, `SigmaCache`, `FieldBase`, `ops_registry`, `quadrature` |
43
+ | Torch ops | `omnibias.fields.torch.ops` | `value`, `derivative`, `gradient`, `divergence`, `laplacian`, `hessian`, `jacobian`, `curl`, `integrate`, `inner_product`, `l2_norm`, `sobolev_norm`, `tensor_divergence`, `dz`, `dzbar`, ... |
44
+ | JAX ops | `omnibias.fields.jax.ops` | the bit-identical twin of the torch surface |
45
+ | Weak form (shipped 02-04) | `omnibias.fields.weak` | `TestFunctionSpace`, `exact_moment`, `weak_residual`; exact integrals only for polynomial coeffs on boxes; boundary bound on by default |
46
+ | Equality locus (shipped 01-09 / 02-12) | `omnibias.fields.locus` | `EqualityLocusLayer` / `LocusOutput`; constraint manifold, not a general PDE solver; always `branch` / `condition` / `converged` |
47
+
48
+ ## Building on top of this
49
+
50
+ A *field* is any object implementing the `FieldBase` protocol that, when called
51
+ on a `(B, D)` coordinate tensor, returns a `FieldState`. To make the closed-form
52
+ ops dispatch correctly, set the class attribute named by
53
+ `omnibias.fields._core.DISPATCH_ATTR` (default `"_omnibias_dispatch"`) to one of
54
+ the dispatch tags: `"one_layer"` selects the closed-form sigma-tower reduction;
55
+ any other tag selects the state-method path (the field implements
56
+ `value_component`, `derivative`, `mixed_partial` taking the `FieldState`).
57
+
58
+ To add a new op without modifying this package, register it:
59
+
60
+ ```python
61
+ from omnibias.fields import ops_registry
62
+
63
+ @ops_registry.register("symmetric_laplacian")
64
+ def symmetric_laplacian(state, name):
65
+ ...
66
+ # now available as state.u.symmetric_laplacian
67
+ ```
68
+
69
+ See [`FIELDS_DERIVATIONS.md`](FIELDS_DERIVATIONS.md) for the math behind each op
70
+ and the numerical-stability notes.
71
+
72
+ ## Invariants
73
+
74
+ - **Pure-Python core.** `omnibias.fields._core` imports no torch / jax / numpy.
75
+ - **Cross-backend bit-identity.** The torch and jax ops are arithmetic twins
76
+ over the same pure-Python schemas; the sigma tower they consume comes from the
77
+ shared `omnibias-core` polynomial coefficients. They agree to
78
+ `rtol=1e-12, atol=1e-12` on the parity tests.
79
+ - **One sigma evaluation per `(order, axis)`.** The `SigmaCache` is filled
80
+ lazily and reused across all ops in a residual.
81
+
82
+ ## License
83
+
84
+ Apache-2.0. See [`LICENSE`](LICENSE) and [`../../LICENSING.md`](../../LICENSING.md).
85
+ You never need a commercial licence for this package.
@@ -0,0 +1,65 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "omnibias-fields"
7
+ version = "0.1.0"
8
+ description = "Backend-agnostic field substrate for omnibias: the FieldState value object, the attribute-DSL views, the lazy sigma^(n) cache, and the cross-backend (torch + jax) closed-form differential-operator surface (gradient, divergence, curl, laplacian, hessian, jacobian, integration, inner products, Sobolev norms, tensor divergence, Wirtinger)."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Vardan Grigoryants", email = "vardan@derivon.ai" }]
14
+ maintainers = [{ name = "Derivon", email = "info@derivon.ai" }]
15
+ keywords = [
16
+ "scientific-machine-learning",
17
+ "differential-operators",
18
+ "closed-form-derivatives",
19
+ "quadrature",
20
+ "field-operators",
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 4 - Beta",
24
+ "Intended Audience :: Science/Research",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3 :: Only",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Programming Language :: Python :: 3.14",
32
+ "Topic :: Scientific/Engineering :: Mathematics",
33
+ "Typing :: Typed",
34
+ ]
35
+ dependencies = ["omnibias-core>=0.2.0", "numpy>=1.24"]
36
+
37
+ [project.optional-dependencies]
38
+ torch = ["omnibias-torch>=0.2.0", "torch>=2.0"]
39
+ jax = ["omnibias-jax>=0.2.0", "jax>=0.4.30", "jaxlib>=0.4.30"]
40
+ all = ["omnibias-fields[torch,jax]"]
41
+ difference = ["omnibias-difference>=0.1.0a1"]
42
+ test = [
43
+ "pytest>=7.0",
44
+ "pytest-cov>=4.0",
45
+ "numpy>=1.24",
46
+ ]
47
+ dev = [
48
+ "omnibias-fields[all,test]",
49
+ "ruff>=0.1.0",
50
+ "mypy>=1.5",
51
+ ]
52
+
53
+ [project.urls]
54
+ Homepage = "https://github.com/derivon-ai/omnibias"
55
+ Documentation = "https://omnibias.ai/"
56
+ Source = "https://github.com/derivon-ai/omnibias"
57
+ Issues = "https://github.com/derivon-ai/omnibias/issues"
58
+ Changelog = "https://github.com/derivon-ai/omnibias/blob/main/CHANGELOG.md"
59
+
60
+ [tool.setuptools.packages.find]
61
+ where = ["src"]
62
+ include = ["omnibias.*"]
63
+
64
+ [tool.setuptools.package-data]
65
+ "omnibias.fields" = ["py.typed"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,108 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2026 Derivon
3
+ """omnibias-fields: the backend-agnostic field substrate.
4
+
5
+ ``omnibias-fields`` hosts the :class:`FieldState` value object, the
6
+ attribute-DSL views, the lazy ``sigma^(n)(z)`` cache, the op-extension
7
+ registry, and the cross-backend (torch + jax) closed-form differential
8
+ operator surface (gradient, divergence, curl, laplacian, hessian,
9
+ jacobian, ...), plus the quadrature / inner-product / norm / tensor-divergence
10
+ and Wirtinger ops.
11
+
12
+ The pure-Python schemas live in :mod:`omnibias.fields._core`; the backend
13
+ kernels live in ``omnibias.fields.torch`` and ``omnibias.fields.jax`` and are
14
+ imported lazily (importing :mod:`omnibias.fields` does not pull in torch or
15
+ jax).
16
+
17
+ Downstream packages (``omnibias-pinn``, ``omnibias-geometry``,
18
+ ``omnibias-score``) build on this substrate; ``omnibias-pinn`` additionally
19
+ re-exports the moved symbols through back-compat shims at
20
+ ``omnibias.pinn._core`` and ``omnibias.pinn.<backend>.ops``.
21
+
22
+ .. important::
23
+
24
+ **Bit-parity with the PyTorch twin requires 64-bit JAX** --
25
+ ``jax.config.update("jax_enable_x64", True)`` before the first JAX array is
26
+ created (or ``JAX_ENABLE_X64=1``). JAX otherwise truncates to ``float32``
27
+ while PyTorch uses ``float64``, so the twins stay internally consistent but
28
+ agree only to ``float32`` tolerance. Where a value feeds a threshold, a
29
+ rounding step or an ``argmax``, that is enough to change the decision rather
30
+ than just the last digits. See :mod:`omnibias.jax.precision`.
31
+ """
32
+
33
+ from __future__ import annotations
34
+
35
+ from importlib.metadata import PackageNotFoundError as _PkgNotFound
36
+ from importlib.metadata import version as _pkg_version
37
+
38
+ from omnibias.fields._core import (
39
+ DISPATCH_ATTR,
40
+ DOMAINS,
41
+ READOUT_INDEPENDENT_ATTR,
42
+ ComponentSpec,
43
+ ComponentView,
44
+ CoordinateSpec,
45
+ FieldBase,
46
+ FieldState,
47
+ OperatorInfo,
48
+ SigmaCache,
49
+ VectorView,
50
+ did_you_mean,
51
+ get_operator,
52
+ list_operators,
53
+ operator_names,
54
+ ops_registry,
55
+ )
56
+ from omnibias.fields.locus import (
57
+ AffineSet,
58
+ EqualitySystem,
59
+ NewtonResult,
60
+ UnitTerm,
61
+ affine_locus,
62
+ certify_locus_point,
63
+ )
64
+ from omnibias.fields.weak import (
65
+ TestFunctionSpace,
66
+ WeakForm,
67
+ boundary_bound,
68
+ exact_moment,
69
+ )
70
+
71
+ try:
72
+ __version__ = _pkg_version("omnibias-fields")
73
+ except _PkgNotFound: # pragma: no cover - bare source checkout
74
+ __version__ = "0.0.0+unknown"
75
+
76
+ # Founding-idea lineage (see docs/theory.md "Two senses of collapse").
77
+ __lineage__ = "bias collapse"
78
+
79
+ __all__ = [
80
+ "AffineSet",
81
+ "ComponentSpec",
82
+ "ComponentView",
83
+ "CoordinateSpec",
84
+ "DISPATCH_ATTR",
85
+ "DOMAINS",
86
+ "EqualitySystem",
87
+ "FieldBase",
88
+ "FieldState",
89
+ "NewtonResult",
90
+ "OperatorInfo",
91
+ "READOUT_INDEPENDENT_ATTR",
92
+ "SigmaCache",
93
+ "TestFunctionSpace",
94
+ "UnitTerm",
95
+ "VectorView",
96
+ "WeakForm",
97
+ "__lineage__",
98
+ "__version__",
99
+ "affine_locus",
100
+ "boundary_bound",
101
+ "certify_locus_point",
102
+ "did_you_mean",
103
+ "exact_moment",
104
+ "get_operator",
105
+ "list_operators",
106
+ "operator_names",
107
+ "ops_registry",
108
+ ]
@@ -0,0 +1,64 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2026 Derivon
3
+ """Backend-agnostic field substrate (pure Python: no torch / jax / numpy).
4
+
5
+ This is the foundational schema layer shared by every omnibias field
6
+ package (``omnibias-pinn``, ``omnibias-geometry``, ``omnibias-score``, ...).
7
+ The torch and jax backends consume the schemas defined here so that
8
+ cross-backend parity is structural by construction.
9
+
10
+ Public surface:
11
+
12
+ - :class:`CoordinateSpec` -- the input-axis spec.
13
+ - :class:`ComponentSpec` -- the output-channel spec (with named groups).
14
+ - :class:`FieldState` -- the value object produced by ``field(coords)``.
15
+ - :class:`ComponentView`, :class:`VectorView` -- the attribute-DSL views
16
+ that delegate into the backend ops.
17
+ - :class:`SigmaCache` -- the lazy ``sigma^(n)(z)`` cache.
18
+ - :class:`FieldBase` -- the structural protocol every typed field obeys.
19
+ - :mod:`ops_registry` -- third-party op extension point.
20
+ - :data:`DISPATCH_ATTR` -- the field marker attribute name used by the
21
+ backend ops to pick the closed-form reduction path.
22
+ - :data:`READOUT_INDEPENDENT_ATTR` -- the field marker declaring that
23
+ per-state caches are independent of the readout parameters.
24
+ """
25
+
26
+ from __future__ import annotations
27
+
28
+ from omnibias.fields._core import ops_registry
29
+ from omnibias.fields._core.catalog import (
30
+ DOMAINS,
31
+ OperatorInfo,
32
+ get_operator,
33
+ list_operators,
34
+ operator_names,
35
+ )
36
+ from omnibias.fields._core.components import ComponentSpec
37
+ from omnibias.fields._core.coords import CoordinateSpec
38
+ from omnibias.fields._core.field_base import (
39
+ DISPATCH_ATTR,
40
+ READOUT_INDEPENDENT_ATTR,
41
+ FieldBase,
42
+ )
43
+ from omnibias.fields._core.sigma_cache import SigmaCache
44
+ from omnibias.fields._core.state import FieldState
45
+ from omnibias.fields._core.view import ComponentView, VectorView, did_you_mean
46
+
47
+ __all__ = [
48
+ "ComponentSpec",
49
+ "ComponentView",
50
+ "CoordinateSpec",
51
+ "DISPATCH_ATTR",
52
+ "DOMAINS",
53
+ "FieldBase",
54
+ "FieldState",
55
+ "OperatorInfo",
56
+ "READOUT_INDEPENDENT_ATTR",
57
+ "SigmaCache",
58
+ "VectorView",
59
+ "did_you_mean",
60
+ "get_operator",
61
+ "list_operators",
62
+ "operator_names",
63
+ "ops_registry",
64
+ ]