aschachner commited on
Commit
4613167
·
verified ·
1 Parent(s): 7a849e2

Upload README_TDF.md

Browse files
Files changed (1) hide show
  1. tdf/README_TDF.md +274 -0
tdf/README_TDF.md ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gpl-3.0
3
+ task_categories:
4
+ - other
5
+ pretty_name: TDF — Trilayer, Double Favourable Calabi–Yau database
6
+ tags:
7
+ - physics
8
+ - string-theory
9
+ - flux-compactifications
10
+ - calabi-yau
11
+ - mathematics
12
+ - toric-geometry
13
+ - kreuzer-skarke
14
+ size_categories:
15
+ - 1M<n<10M
16
+ configs:
17
+ - config_name: tdf
18
+ data_files:
19
+ - split: catalog
20
+ path: tdf/catalog.parquet
21
+ - split: conifold_catalog
22
+ path: tdf/conifold_catalog.parquet
23
+ ---
24
+
25
+ # TDF — Trilayer, Double Favourable Calabi–Yau database
26
+
27
+ **Toric Calabi–Yau threefold hypersurfaces from the Kreuzer–Skarke list, precomputed for use with [`stringforge`](https://github.com/AndreasSchachner/stringforge) and [`jaxvacua`](https://github.com/AndreasSchachner/jaxvacua).**
28
+
29
+ This is one sub-dataset of the larger [`cy-database`](../) repository. For shared conventions (lazy access, cache modes, offline mode, schema versioning, mirror convention) see the [umbrella card](../README.md).
30
+
31
+ ## Scope
32
+
33
+ TDF covers Calabi–Yau threefolds $X$ realised as **trilayer, double favourable** anti-canonical hypersurfaces in toric varieties from the Kreuzer–Skarke list~[[arXiv:hep-th/0002240](https://arxiv.org/abs/hep-th/0002240)]. Each model is uniquely identified by
34
+
35
+ - `ks_id` — the Kreuzer–Skarke 4D reflexive-polytope identifier;
36
+ - `triang_id` — the triangulation identifier within that polytope (different triangulations generally give rise to different Calabi–Yau geometries).
37
+
38
+ For each model the dataset provides (when computed):
39
+
40
+ - **Topological data**: triple intersection numbers $\kappa_{ijk}$, second Chern class $c_2$, Euler characteristic $\chi$, Hodge numbers $h^{1,1}$ and $h^{2,1}$, Kähler-cone generators and hyperplanes.
41
+ - **Gopakumar–Vafa invariants** $n_q^0$ (and Gromov–Witten data where available).
42
+ - **Conifold data**: conifold curves, GV invariants of shrinking cycles, integer basis-change matrices.
43
+ - **Polytope data**: lattice points of the reflexive polytope.
44
+ - **Extra properties**: the D3 tadpole $\chi/24$ and miscellaneous precomputed fields.
45
+
46
+ Hodge ranges span $h^{1,1},\, h^{2,1} \in \{1,\, \dots,\, \sim 500\}$.
47
+
48
+ ## Quick start
49
+
50
+ ```bash
51
+ pip install stringforge
52
+ ```
53
+
54
+ ### Pure I/O (no JAXVacua)
55
+
56
+ ```python
57
+ from stringforge import TDFDatabase
58
+
59
+ db = TDFDatabase() # downloads catalogue only (~10 MB)
60
+ df = db.query(h11=2, has_conifolds=True) # catalogue-level filter, no shard I/O
61
+
62
+ # Inspect a single polytope's lattice points without loading the geometry
63
+ poly = db.get_polytope(ks_id=int(df.iloc[0]["ks_id"]), h11=2)
64
+ ```
65
+
66
+ ### Model loading in mirror convention (recommended for JAXVacua)
67
+
68
+ ```python
69
+ from stringforge import LCSDatabase
70
+
71
+ lcs = LCSDatabase(dataset="tdf") # mirror-convention wrapper
72
+ df = lcs.query(h12=2, has_conifolds=True) # h12 in mirror convention
73
+
74
+ tree = lcs.load(
75
+ ks_id = int(df.iloc[0]["ks_id"]),
76
+ triang_id= int(df.iloc[0]["triang_id"]),
77
+ h11 = int(df.iloc[0]["h11"]), # mirror h11
78
+ h12 = int(df.iloc[0]["h12"]), # mirror h12
79
+ include_gv = True,
80
+ include_conifolds = True,
81
+ )
82
+
83
+ # Or construct a fully initialised FluxVacuaFinder directly
84
+ finder = lcs.load_model(
85
+ ks_id = int(df.iloc[0]["ks_id"]),
86
+ triang_id= int(df.iloc[0]["triang_id"]),
87
+ include_gv = True,
88
+ include_conifolds = True,
89
+ maximum_degree = 2,
90
+ )
91
+ ```
92
+
93
+ ### Streaming batches without local-disk accumulation
94
+
95
+ ```python
96
+ from stringforge import LCSDatabase
97
+
98
+ lcs_lean = LCSDatabase(dataset="tdf", cache_mode="none")
99
+ for tree in lcs_lean.iter_batch(h11=2, include_gv=True):
100
+ ...
101
+ ```
102
+
103
+ A full walkthrough — including offline mode, batched loading, and vacua persistence — is in the [`stringforge` documentation](https://github.com/AndreasSchachner/stringforge/tree/main/documentation/source/tutorials).
104
+
105
+ ## Sub-dataset layout
106
+
107
+ ```
108
+ tdf/
109
+ README.md ← this file
110
+ catalog.parquet ← main index, ~10 MB
111
+ conifold_catalog.parquet ← per-conifold sub-catalogue
112
+ schema.json ← schema version + description
113
+ manifest.json ← incremental-build manifest
114
+
115
+ lcs_data/h11_{N}/ ← geometry data, sharded by h^{1,1}
116
+ data-00000.parquet
117
+ data-00001.parquet
118
+ ...
119
+ gv/h11_{N}/ ← Gopakumar–Vafa invariants, sharded by h^{1,1}
120
+ data-00000.parquet
121
+ ...
122
+ conifolds/h11_{N}/ ← conifold-limit data, sharded by h^{1,1}
123
+ data-00000.parquet
124
+ ...
125
+ polytope/ ← reflexive polytope data (one row per ks_id)
126
+ data-00000.parquet
127
+ ...
128
+ extra/ ← miscellaneous precomputed fields
129
+ data-00000.parquet
130
+ ...
131
+ ```
132
+
133
+ ### Why $h^{1,1}$-bucketed?
134
+
135
+ The row size for `lcs_data`, `gv`, and `conifolds` scales strongly with $h^{1,1}$: intersection-number tensors are $O(h^3)$, GV charge vectors have length $h$, conifold curves are $h$-vectors. Placing small- and large-$h^{1,1}$ rows in the same Parquet file would force fixed-width columns sized for the largest entry, wasting space and I/O.
136
+
137
+ Bucketing by $h^{1,1}$ also means a query like `db.load_batch(h11=3)` pulls only the `h11_3` sub-directories — small-$h^{1,1}$ users never need to download large-$h^{1,1}$ shards.
138
+
139
+ The `polytope` and `extra` splits are flat (not $h^{1,1}$-bucketed) because their rows are small and uniform.
140
+
141
+ ### Shard sizing
142
+
143
+ Shard sizes are adaptive per (split, $h^{1,1}$) bucket, targeting ≈ 30 shards per bucket, clamped to $[500,\; 50\,000]$ rows. Without this, `conifolds/h11_{10}/` with millions of rows would explode into thousands of tiny files.
144
+
145
+ ## Catalogue schema
146
+
147
+ The main `catalog.parquet` is the entry point. One row per $(\text{ks\_id},\, \text{triang\_id})$ pair, with shard pointers into the data splits.
148
+
149
+ | Column | Type | Description |
150
+ |---|---|---|
151
+ | `ks_id` | `int64` | Kreuzer–Skarke polytope identifier |
152
+ | `triang_id` | `int64` | Triangulation identifier within the polytope |
153
+ | `h11` | `int64` | Hodge number $h^{1,1}(X)$ (catalogue convention) |
154
+ | `h12` | `int64` | Hodge number $h^{2,1}(X)$ (catalogue convention) |
155
+ | `chi` | `int64` | Euler characteristic $\chi(X) = 2\,(h^{1,1} - h^{2,1})$ |
156
+ | `lcs_shard_id` | `int64` | Shard index in `lcs_data/h11_{h11}/` |
157
+ | `lcs_row_index` | `int64` | Row within that shard |
158
+ | `gv_shard_id` | `Int64` (nullable) | Shard index in `gv/h11_{h11}/` — null if GV data unavailable |
159
+ | `gv_row_index` | `Int64` (nullable) | Row within that shard |
160
+ | `has_gv` | `bool` | Whether GV data is present |
161
+ | `n_conifolds` | `int64` | Number of conifold limits available |
162
+ | `conifold_shard_id` | `Int64` (nullable) | First shard index in `conifolds/h11_{h11}/` — null if `n_conifolds == 0` |
163
+ | `polytope_shard_id` | `int64` | Shard index in `polytope/` (shared across triangulations of the same `ks_id`) |
164
+ | `polytope_row_index` | `int64` | Row within that shard |
165
+ | `D3_tadpole` | `int64` | $\chi/24$ |
166
+
167
+ A smaller `conifold_catalog.parquet` lists one row per $(\text{ks\_id},\, \text{triang\_id},\, \text{conifold\_id})$ triple, with columns `ks_id`, `triang_id`, `conifold_id`, `h11`, `h12`, `ncf`, `conifold_curve`, `conifold_shard_id`, `conifold_row_index`.
168
+
169
+ > **Mirror convention.** The catalogue exposes Hodge numbers in *catalogue convention* (typically small `h11`, large `h12`). Use `stringforge.LCSDatabase(dataset="tdf")` for the *mirror* convention used by `jaxvacua.lcs.lcs_tree`; it swaps the two columns at the boundary.
170
+
171
+ ## Data splits
172
+
173
+ ### `lcs_data/h11_{N}/`
174
+
175
+ One row per model. Contains the topological data needed to build the Kähler cone and the LCS prepotential.
176
+
177
+ | Column | Description |
178
+ |---|---|
179
+ | `ks_id`, `triang_id`, `h11`, `h12`, `chi` | Identity |
180
+ | `intnums` | Triple intersection numbers $\kappa_{ijk}$ of the mirror (dense tensor) |
181
+ | `c2` | Second Chern class $c_{2,i}$ |
182
+ | `generators_kahler_cone` | Kähler-cone generators |
183
+ | `rays_kahler_cone`, `tip_of_stretched_kahler_cone` | Kähler-cone geometry |
184
+ | `hyperplanes` | Hyperplane constraints defining the cone |
185
+
186
+ ### `gv/h11_{N}/`
187
+
188
+ Gopakumar–Vafa invariants, one row per model that has GV data.
189
+
190
+ | Column | Description |
191
+ |---|---|
192
+ | `ks_id`, `triang_id`, `h11`, `h12` | Identity |
193
+ | `GVs`, `GWs` | Dictionaries of GV and GW invariants keyed by effective-curve charge |
194
+ | `grading_vector` | Grading vector used during the computation |
195
+
196
+ ### `conifolds/h11_{N}/`
197
+
198
+ One row per $(\text{ks\_id},\, \text{triang\_id},\, \text{conifold\_id})$ triple.
199
+
200
+ | Column | Description |
201
+ |---|---|
202
+ | `ks_id`, `triang_id`, `h11`, `h12`, `conifold_id` | Identity |
203
+ | `ncf` | GV invariant of the shrinking curve |
204
+ | `conifold_curve` | Charge vector $c \in \mathbb{Z}^{h^{1,1}}$ of the shrinking cycle |
205
+ | `basis_change` | Integer basis rotation matrix placing the conifold modulus first |
206
+
207
+ ### `polytope/`
208
+
209
+ One row per `ks_id` (shared across all triangulations of that polytope).
210
+
211
+ | Column | Description |
212
+ |---|---|
213
+ | `ks_id` | Identity |
214
+ | `polytope_points` | Lattice points of the reflexive polytope (2D integer array) |
215
+
216
+ ### `extra/`
217
+
218
+ Miscellaneous scalar fields that vary per model.
219
+
220
+ | Column | Description |
221
+ |---|---|
222
+ | `ks_id`, `triang_id`, `h11`, `h12` | Identity |
223
+ | `chi` | Euler characteristic |
224
+ | `D3_tadpole` | $\chi/24$ |
225
+ | ... | Additional precomputed properties |
226
+
227
+ ## Loading without `stringforge`
228
+
229
+ Plain Parquet access with `pandas` + `huggingface_hub`:
230
+
231
+ ```python
232
+ import pandas as pd
233
+ from huggingface_hub import hf_hub_download
234
+
235
+ # Download only the catalogue
236
+ catalog_path = hf_hub_download(
237
+ repo_id = "aschachner/cy-database",
238
+ filename = "tdf/catalog.parquet",
239
+ repo_type = "dataset",
240
+ )
241
+ catalog = pd.read_parquet(catalog_path)
242
+
243
+ # Resolve a specific model's geometry shard
244
+ row = catalog.query("ks_id == 716 and triang_id == 1").iloc[0]
245
+ lcs_path = hf_hub_download(
246
+ repo_id = "aschachner/cy-database",
247
+ filename = f"tdf/lcs_data/h11_{int(row['h11'])}/data-{int(row['lcs_shard_id']):05d}.parquet",
248
+ repo_type = "dataset",
249
+ )
250
+ lcs = pd.read_parquet(lcs_path)
251
+ model_row = lcs.iloc[int(row["lcs_row_index"])]
252
+ ```
253
+
254
+ `stringforge.TDFDatabase` (pure I/O) and `stringforge.LCSDatabase(dataset="tdf")` (JAXVacua-compatible model loading) wrap this pattern with a consistent API, caching, mirror-convention handling, and filtering.
255
+
256
+ ## Scope and limitations specific to TDF
257
+
258
+ - Only **trilayer, double favourable** toric hypersurfaces are included. Other toric and non-toric constructions live in separate sub-datasets (e.g. [`cicy/`](../cicy/)).
259
+ - GV invariants are precomputed only for a subset of models — use `has_gv=True` in queries to filter.
260
+ - Conifold data is present only for models with at least one conifold limit — use `has_conifolds=True` in queries.
261
+
262
+ ## Building / updating
263
+
264
+ Produced from a local collection of per-model pickle files by the `build_tdf_database` notebook under [`stringforge/private/database/`](https://github.com/AndreasSchachner/stringforge/tree/main/private/database). Builds are incremental: models already in the manifest (by content hash) are skipped; only new or changed models are appended to the existing shards.
265
+
266
+ ## Additional references
267
+
268
+ Papers that used TDF-class models with `jaxvacua`:
269
+
270
+ - [arXiv:2307.15749](https://arxiv.org/abs/2307.15749) — $W_0$ distributions.
271
+ - [arXiv:2308.15525](https://arxiv.org/abs/2308.15525) — non-SUSY flux vacua.
272
+ - [arXiv:2501.03984](https://arxiv.org/abs/2501.03984) — deep observations of the Type IIB flux landscape.
273
+
274
+ For citation, licence, and contact details, see the [umbrella `cy-database` card](../README.md).