stringforge 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,286 @@
1
+ Metadata-Version: 2.4
2
+ Name: stringforge
3
+ Version: 0.1.0
4
+ Summary: Shared database, model-loading, and vacua-vault infrastructure for string compactifications.
5
+ Home-page: https://github.com/AndreasSchachner/stringforge
6
+ Author: Andreas Schachner
7
+ Author-email: as3475@cornell.edu
8
+ License: GPL-3.0-only
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Topic :: Scientific/Engineering :: Physics
13
+ Requires-Python: >=3.12
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: numpy
17
+ Requires-Dist: jax
18
+ Requires-Dist: jaxlib
19
+ Requires-Dist: pandas
20
+ Requires-Dist: pyarrow
21
+ Requires-Dist: huggingface_hub
22
+ Requires-Dist: jaxpolylog
23
+ Requires-Dist: jaxvacua
24
+ Provides-Extra: sync
25
+ Requires-Dist: huggingface_hub; extra == "sync"
26
+ Provides-Extra: ml
27
+ Requires-Dist: datasets; extra == "ml"
28
+ Dynamic: author
29
+ Dynamic: author-email
30
+ Dynamic: classifier
31
+ Dynamic: description
32
+ Dynamic: description-content-type
33
+ Dynamic: home-page
34
+ Dynamic: license
35
+ Dynamic: license-file
36
+
37
+ # StringForge
38
+
39
+ <p align="center">
40
+ <a href="https://stringforge.readthedocs.io"><img src="https://readthedocs.org/projects/stringforge/badge/?version=latest" alt="Docs"/></a>
41
+ <a href="https://pypi.org/project/stringforge/"><img src="https://img.shields.io/pypi/v/stringforge.svg" alt="StringForge"/></a>
42
+ <a href="https://www.python.org"><img src="https://img.shields.io/badge/python-3.12%2B-blue.svg" alt="Python"/></a>
43
+ <a href="https://github.com/StringJAX/stringforge/actions/workflows/ci.yml"><img src="https://github.com/StringJAX/stringforge/actions/workflows/ci.yml/badge.svg" alt="CI"/></a>
44
+ <a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPLv3-blue.svg" alt="License: GPL v3"/></a>
45
+ </p>
46
+
47
+ **Shared database, model-loading, and vacua-vault infrastructure for string-compactification workflows.**
48
+
49
+ StringForge is the infrastructure layer for the [StringJAX](https://github.com/AndreasSchachner/stringjax) ecosystem of JAX-based string-compactification packages. It provides reproducible access to Calabi-Yau geometry databases, bridges those data into physics engines such as [JAXVacua](https://github.com/AndreasSchachner/jaxvacua), and manages persistent vacuum-solution storage with provenance.
50
+
51
+ The package is intentionally solver-light. It does not replace JAXVacua, KahlerJAX, JAXiverse, or CYTools. Instead, it standardises the shared conventions that those packages and downstream scans need: catalogue queries, lazy downloads, cache/offline workflows, model loading, vault layout, validation, and curation.
52
+
53
+ ## What StringForge owns
54
+
55
+ - **Geometry databases.** Unified access to hosted TDF/Kreuzer-Skarke and CICY datasets through `CYDatabase`, `TDFDatabase`, `CICYDatabase`, and `LCSDatabase`.
56
+ - **Lazy local caching.** Catalogues and parquet shards are downloaded on demand and cached under a configurable data directory, with explicit offline mode for HPC jobs.
57
+ - **Model-loading bridges.** `LCSDatabase` loads database rows as `jaxvacua.lcs.lcs_tree` objects or fully initialised JAXVacua `FluxVacuaFinder` models when JAXVacua is installed.
58
+ - **Vacua vault.** `VacuaWriter` designates, validates, queries, uploads, fetches, retracts, and purges vacuum-solution parquet files in a shared vault layout.
59
+ - **Vault validation tools.** `stringforge.vacuavault` validates parquet submissions, rebuilds catalogues, and supports curation workflows without importing physics solvers.
60
+ - **Advanced curated indices.** `KKLTDatabase` exposes a specialised conifold-class indexed `kklt` subset used for KKLT-style searches, tags, and TDF hand-off.
61
+ - **Production vacuum forging.** `Vulcan` is the cluster-side, append-only counterpart to `VacuaWriter`: workers stage validated parquet shards locally, a head node batches them into one `HfApi.create_commit` call per `max_batch`-sized chunk (default 500 files per commit), the rolling-window budget respects HuggingFace's 100-commit-per-hour cap, and `VulcanReader` / `VulcanMLView` give downstream consumers queryable rows and deterministic, geometry-disjoint train/val/test splits (rows sharing a geometry_id always land in the same split, regardless of process or seed).
62
+
63
+ ## What StringForge does not own
64
+
65
+ - It is not the flux-vacuum solver. Vacuum search, period calculations, ISD sampling, flux bounding, and stability analysis live in JAXVacua.
66
+ - It is not a public release of KahlerJAX or JAXiverse. Those packages remain planned ecosystem consumers until their own releases are ready.
67
+ - It is not the owner of every derived dataset used by collaborators. Public pages distinguish hosted StringForge datasets from collaborator-generated or paper-specific data.
68
+ - It is not a monolithic umbrella package that imports every physics engine on startup. Imports stay lightweight and optional physics packages are loaded only when a workflow needs them.
69
+
70
+ ## Architecture
71
+
72
+ ```text
73
+ CYDatabase -> pure I/O, HuggingFace downloads, cache, catalog queries
74
+ |
75
+ LCSDatabase -> mirror-convention model loading for JAXVacua workflows
76
+ |
77
+ VacuaWriter -> designated vacua, vault catalogues, push/fetch workflows
78
+
79
+ Vulcan -> cluster-side production: stage locally, batch-commit
80
+ via HfApi.create_commit, query/stream as ML dataset
81
+ VulcanReader -> read-side catalogue scan, run / shard fetch
82
+ VulcanMLView -> geometry-disjoint train/val/test splits for ML
83
+ ```
84
+
85
+ `KKLTDatabase` is an advanced `LCSDatabase`-style interface for a curated TDF subset. It does not duplicate the TDF geometry data; it stores logical links, conifold-class provenance, and curation tags. Actual KKLT vacuum records belong in the shared `vacua_vault` infrastructure.
86
+
87
+ `Vulcan` deliberately complements `VacuaWriter` rather than replacing it: `VacuaWriter` *designates* curated low-volume vacua into the paper-aligned `vacua_vault`, while `Vulcan` *forges* high-volume cluster output into a separate production repo with a uniform parquet schema with fixed-shape columns plus pad-to-tensor list columns (`flux`, `moduli_re`, `moduli_im`, `F_terms_*`) and deterministic geometry-disjoint train/val/test splits via `VulcanMLView`. The two share the parquet floor (`flux`, `moduli_re`, `moduli_im`, `tau_re`, `tau_im`), so a future promotion step can lift production runs into the curated vault.
88
+
89
+ ## Ecosystem packages
90
+
91
+ | Package | Role | Release status |
92
+ | --- | --- | --- |
93
+ | **[JAXVacua](https://github.com/AndreasSchachner/jaxvacua)** &mdash; [docs](https://jaxvacua.readthedocs.io) | Type IIB flux vacua, complex-structure/axio-dilaton EFTs, vacuum finding, stability analysis | Public |
94
+ | **[JAXPolyLog](https://github.com/AndreasSchachner/jaxpolylog)** &mdash; [docs](https://jaxpolylog.readthedocs.io) | JAX-compatible polylogarithms with autodiff support | Public |
95
+ | **KahlerJAX** | Kähler-moduli stabilisation for 4D N=1 EFTs | Planned; not a StringForge dependency |
96
+ | **JAXiverse** | Multi-axion EFT spectra, decay constants, and couplings | Planned; not a StringForge dependency |
97
+ | **[CYTools](https://cy.tools)** | External toric Calabi-Yau geometry package | Public external dependency for selected workflows |
98
+
99
+ ## Quick start
100
+
101
+ ```python
102
+ from stringforge import LCSDatabase
103
+
104
+ # Query the hosted TDF catalogue. The constructor itself performs no network I/O;
105
+ # the catalogue is fetched lazily on first query.
106
+ db = LCSDatabase(dataset="tdf", cache_dir=".stringforge_cache")
107
+ models = db.query(h12=2, has_conifolds=True).head(5)
108
+ print(models[["h11", "h12", "ks_id", "triang_id", "n_conifolds"]])
109
+
110
+ # Load one catalogue row as JAXVacua-compatible data.
111
+ row = models.iloc[0]
112
+ tree = db.load(
113
+ h11=int(row["h11"]),
114
+ h12=int(row["h12"]),
115
+ ks_id=int(row["ks_id"]),
116
+ triang_id=int(row["triang_id"]),
117
+ include_gv=False,
118
+ )
119
+
120
+ # Or construct the corresponding JAXVacua FluxVacuaFinder directly.
121
+ finder = db.load_model(
122
+ h11=int(row["h11"]),
123
+ h12=int(row["h12"]),
124
+ ks_id=int(row["ks_id"]),
125
+ triang_id=int(row["triang_id"]),
126
+ include_gv=False,
127
+ )
128
+ ```
129
+
130
+ The returned `finder` is a JAXVacua `FluxVacuaFinder`. Use the [JAXVacua documentation](https://jaxvacua.readthedocs.io) for vacuum-search, flux-sampling, period-calculation, and stability-analysis workflows.
131
+
132
+ ## Vulcan: production vacuum forging
133
+
134
+ For high-volume cluster workloads, use `Vulcan` instead of `VacuaWriter` to publish runs to a separate production repo without tripping over HuggingFace's commit-rate cap.
135
+
136
+ ```python
137
+ from stringforge.vulcan import Vulcan
138
+
139
+ # On a cluster worker: stage a batch locally; no HuggingFace I/O.
140
+ forge = Vulcan.from_env() # reads STRINGFORGE_VULCAN_*
141
+ forge.write(
142
+ vacua_df,
143
+ geometry={"h11": 3, "h12": 2, "ks_id": 384564, "triang_id": 0},
144
+ tadpole_charge=12,
145
+ solver={"name": "newton", "config_hash": "abc123"},
146
+ provenance={"git_sha": "deadbeef", "seed": 42, "wall_clock_s": 3.4},
147
+ )
148
+
149
+ # On the head node (cron, daemon, or manual): drain pending shards
150
+ # into batched commits respecting the 90/hour budget.
151
+ report = forge.sync(max_batch=500) # one create_commit, many files
152
+
153
+ # After sync: query, fetch a specific run, or build an ML view.
154
+ susy = forge.query(h12=2, solver_name="newton", is_susy=True)
155
+ train = forge.ml_view().as_dataframe("train") # deterministic, geometry-disjoint split
156
+ ```
157
+
158
+ CLI: `python -m stringforge.vulcan {status,sync}`. See [`Vulcan cluster runs`](documentation/source/tutorials/database_and_infrastructure/vulcan_cluster_runs.ipynb) for the full cluster best-practice walkthrough.
159
+
160
+ ## Vacua vault workflow
161
+
162
+ ```python
163
+ import pandas as pd
164
+
165
+ vacua = pd.DataFrame({
166
+ "flux": [[1, 0, -2, 3, 0, 1]],
167
+ "moduli_re": [[0.0, 0.0]],
168
+ "moduli_im": [[2.5, 3.0]],
169
+ "tau_re": [0.0],
170
+ "tau_im": [4.0],
171
+ "is_susy": [True],
172
+ })
173
+
174
+ db.designate_vacua(
175
+ vacua,
176
+ label="example_run",
177
+ committed_by="A. Schachner",
178
+ h11=int(row["h11"]),
179
+ h12=int(row["h12"]),
180
+ ks_id=int(row["ks_id"]),
181
+ triang_id=int(row["triang_id"]),
182
+ )
183
+
184
+ designated = db.query_vacua(label="example_run")
185
+ print(designated[["label", "n_vacua", "created"]])
186
+ ```
187
+
188
+ ## Installation
189
+
190
+ **Prerequisites:** Python >= 3.12. If GPU acceleration is needed, install [JAX with CUDA support](https://github.com/jax-ml/jax#installation) first.
191
+
192
+ ```bash
193
+ # Recommended once the package is public on PyPI
194
+ pip install stringforge
195
+
196
+ # Development install from a local clone
197
+ git clone https://github.com/AndreasSchachner/stringforge.git
198
+ cd stringforge
199
+ pip install -e .
200
+ ```
201
+
202
+ > [!CAUTION]
203
+ > StringForge workflows that construct JAX models require `float64` precision. JAX Metal on macOS does not support the required complex `float64` operations; use the CPU backend on Mac.
204
+
205
+ ## Documentation
206
+
207
+ Build the documentation locally with:
208
+
209
+ ```bash
210
+ cd documentation
211
+ pip install -r requirements.txt
212
+ make html
213
+ ```
214
+
215
+ The full JAXVacua API reference is available at [jaxvacua.readthedocs.io](https://jaxvacua.readthedocs.io).
216
+
217
+ ## Requirements
218
+
219
+ Core dependencies installed by `pip`:
220
+
221
+ - NumPy
222
+ - Pandas and PyArrow
223
+ - HuggingFace Hub
224
+ - JAX and jaxlib
225
+ - JAXPolyLog
226
+ - JAXVacua
227
+
228
+ Optional workflow dependencies:
229
+
230
+ - [CYTools](https://cy.tools) for constructing models from Kreuzer-Skarke polytopes.
231
+ - [python-flint](https://github.com/flintlib/python-flint) for exact arithmetic in selected downstream routines.
232
+
233
+ ## Citation
234
+
235
+ If you find this work useful, please cite the companion paper as the **primary** reference and the software release as the secondary reference. When StringForge is used to drive a JAXVacua flux-vacuum search, please additionally cite the JAXVacua framework paper.
236
+
237
+ **Companion paper (preferred, in preparation).** A single-author paper describing the conventions, dataset structure and capabilities of StringForge is in preparation. The arXiv identifier and journal/DOI will be added here at submission; until then, cite the temporary manuscript entry below together with the software release.
238
+
239
+ ```bibtex
240
+ @article{Schachner:2026stringforge,
241
+ author = "Schachner, Andreas",
242
+ title = "{StringForge: shared database and vacuum-storage infrastructure for differentiable type IIB flux-compactification workflows}",
243
+ note = "In preparation; arXiv ID and journal/DOI to be added at submission.",
244
+ year = "2026"
245
+ }
246
+ ```
247
+
248
+ **Software release.**
249
+
250
+ ```bibtex
251
+ @software{schachner_2026_stringforge,
252
+ author = {Schachner, Andreas},
253
+ title = {StringForge: shared infrastructure for string-compactification workflows},
254
+ year = {2026},
255
+ version = {0.1.0},
256
+ url = {https://github.com/AndreasSchachner/stringforge}
257
+ }
258
+ ```
259
+
260
+ **JAXVacua framework (cite when relevant).** The upstream physics engine that StringForge provides infrastructure for was introduced in:
261
+
262
+ ```bibtex
263
+ @article{Dubey:2023dvu,
264
+ author = "Dubey, Abhishek and Krippendorf, Sven and Schachner, Andreas",
265
+ title = "{JAXVacua --- a framework for sampling string vacua}",
266
+ eprint = "2306.06160",
267
+ archivePrefix = "arXiv",
268
+ primaryClass = "hep-th",
269
+ doi = "10.1007/JHEP12(2023)146",
270
+ journal = "JHEP",
271
+ volume = "12",
272
+ pages = "146",
273
+ year = "2023"
274
+ }
275
+ ```
276
+
277
+ ## License
278
+
279
+ StringForge is released under the [GNU General Public License v3.0](LICENSE).
280
+
281
+ ## Contact
282
+
283
+ Andreas Schachner
284
+ - Email: [as3475@cornell.edu](mailto:as3475@cornell.edu)
285
+ - GitHub: [github.com/AndreasSchachner](https://github.com/AndreasSchachner)
286
+ - Website: [andreasschachner.github.io](https://andreasschachner.github.io)
@@ -0,0 +1,30 @@
1
+ stringforge/__init__.py,sha256=6sEZiLHX_3MT2YXwR4izKXr7hYbvUqGQ-QvqTx1OoCk,11255
2
+ stringforge/cy_io.py,sha256=VzL7GBg180f-4bH0YP3TTbzqDpP_zeK1giBaHHIOnV0,68174
3
+ stringforge/kklt_database.py,sha256=cv99VDE7VsxFT4YsO8YzbykmyBr5yXFUFY3U81ZCl0o,114132
4
+ stringforge/lcs_database.py,sha256=sw2euEJRHhhgY_nbY0OuuevLTknDvBXhxE_SFLV7GxU,53247
5
+ stringforge/vacua_writer.py,sha256=kaCi0qJOB2YH7Ab9edk4nXA6OU3jSgiFT_jo365bFy8,125866
6
+ stringforge/vacuavault/__init__.py,sha256=5y5IjgAz6-A_gFVPGnijmCyskoaZ-Fny6SII7UjghH4,2071
7
+ stringforge/vacuavault/__main__.py,sha256=Yt8UVkcPmcC14wEBnzhCgUuyRRQikJf3N4bhdxntlE0,3367
8
+ stringforge/vacuavault/catalog.py,sha256=SnKGVLOhq8aaDLpMngQus4MH5p5cJYss_JbfkvoZjho,7515
9
+ stringforge/vacuavault/ci.py,sha256=xSfd2HX9FOI0brqKonmGbj4CcVsmcnkL5kEzsqCWhag,6677
10
+ stringforge/vacuavault/curate.py,sha256=Sl9CblvU4J385kgLnTVcL7yQ8L7JUbS7I81ar0Mv62Y,3748
11
+ stringforge/vacuavault/schema.py,sha256=T_nG0RDZGTMKwotrImVJ0wpwi5_RmUHTRKJTMpPRlP0,17897
12
+ stringforge/vulcan/__init__.py,sha256=DE-xRK_uJ_FK-UJUlMKAVtGk5pIgMc5Kb0yD7Vsg0nc,22653
13
+ stringforge/vulcan/__main__.py,sha256=0CES9JxhUkPfN_JlQQTOk_Oz-hL4K3uG62qMIEwNDIo,4530
14
+ stringforge/vulcan/certify.py,sha256=VhxsDOPZd9_K9YEp5kbPQDtZ9k9J3Yz3zB5olI4ehNE,20610
15
+ stringforge/vulcan/community.py,sha256=m7VINXElD5rSYV529ba7zE3M3GGL9dKK0l2LQEmYdBk,10479
16
+ stringforge/vulcan/hf_io.py,sha256=3h5gst94hhEVFjsOJ5XCuBbvK1qA6qcr7_kb7qWXeN4,10064
17
+ stringforge/vulcan/ml_view.py,sha256=P9dK-ja77-2XUYZltGZnxROCSijSWu_skKk6-Eqjrko,13320
18
+ stringforge/vulcan/ratelimit.py,sha256=6Lo5l1YRC8jHjPykrI27RSu-km-FDAX21lHXPGusjKY,9638
19
+ stringforge/vulcan/reader.py,sha256=y-g3jtzeq5-5Fg17Ga4TTttz1sPardObkr8HO06lpVo,23252
20
+ stringforge/vulcan/runid.py,sha256=Hx3b3B_EQ6uy69s0IQJoYwKxfFxsnRzGU4hOHuG39XY,9644
21
+ stringforge/vulcan/schema.py,sha256=Qfpks6jtAXW6LldRPDgBFuEnhdRYDESUTUW8E7NLg7I,20481
22
+ stringforge/vulcan/snapshot.py,sha256=onI5DRKfxAPVni2RN7zqrWnDyaKaUuH9szHDOAWd7Ac,17860
23
+ stringforge/vulcan/sync.py,sha256=_uP1zuuu9ZGn9mocQ1pnNKJOOlYeINbBgtM7LOLxAr4,9178
24
+ stringforge/vulcan/verifier.py,sha256=V-77j9dcN20EVjXOGGhzeYquIkkp95DKrjx6X6eKuTk,12135
25
+ stringforge/vulcan/writer.py,sha256=UrgXfrti3kur7N0MPQOFWAC0NgJZdFyBEL_qQTFxvBw,17317
26
+ stringforge-0.1.0.dist-info/licenses/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
27
+ stringforge-0.1.0.dist-info/METADATA,sha256=J3FcEUUAc3kGHd39br2QA7irSBnOrLbfSjdhjjhir4Q,13421
28
+ stringforge-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
29
+ stringforge-0.1.0.dist-info/top_level.txt,sha256=P-bPm5VyhXIqSz2oYEe0ciynwimSwgDZuF8vtWWREWs,12
30
+ stringforge-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+