cy-database / tdf /README.md
aschachner's picture
Update tdf/README.md
55c580f verified
|
Raw
History Blame Contribute Delete
11.3 kB
metadata
license: gpl-3.0
task_categories:
  - other
pretty_name: TDF  Trilayer, Double Favourable Calabi–Yau database
tags:
  - physics
  - string-theory
  - flux-compactifications
  - calabi-yau
  - mathematics
  - toric-geometry
  - kreuzer-skarke
size_categories:
  - 1M<n<10M
configs:
  - config_name: tdf
    data_files:
      - split: catalog
        path: tdf/catalog.parquet
      - split: conifold_catalog
        path: tdf/conifold_catalog.parquet

TDF — Trilayer, Double Favourable Calabi–Yau database

Toric Calabi–Yau threefold hypersurfaces from the Kreuzer–Skarke list, precomputed for use with stringforge and jaxvacua.

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.

Scope

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]. Each model is uniquely identified by

  • ks_id — the Kreuzer–Skarke 4D reflexive-polytope identifier;
  • triang_id — the triangulation identifier within that polytope (different triangulations generally give rise to different Calabi–Yau geometries).

For each model the dataset provides (when computed):

  • 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.
  • Gopakumar–Vafa invariants $n_q^0$ (and Gromov–Witten data where available).
  • Conifold data: conifold curves, GV invariants of shrinking cycles, integer basis-change matrices.
  • Polytope data: lattice points of the reflexive polytope.
  • Extra properties: the D3 tadpole $\chi/24$ and miscellaneous precomputed fields.

Hodge ranges span $h^{1,1},, h^{2,1} \in {1,, \dots,, \sim 500}$.

Quick start

pip install stringforge

Pure I/O (no JAXVacua)

from stringforge import TDFDatabase

db = TDFDatabase()                              # downloads catalogue only (~10 MB)
df = db.query(h11=2, has_conifolds=True)        # catalogue-level filter, no shard I/O

# Inspect a single polytope's lattice points without loading the geometry
poly = db.get_polytope(ks_id=int(df.iloc[0]["ks_id"]), h11=2)

Model loading in mirror convention (recommended for JAXVacua)

from stringforge import LCSDatabase

lcs = LCSDatabase(dataset="tdf")                # mirror-convention wrapper
df = lcs.query(h12=2, has_conifolds=True)       # h12 in mirror convention

tree = lcs.load(
    ks_id    = int(df.iloc[0]["ks_id"]),
    triang_id= int(df.iloc[0]["triang_id"]),
    h11      = int(df.iloc[0]["h11"]),          # mirror h11
    h12      = int(df.iloc[0]["h12"]),          # mirror h12
    include_gv        = True,
    include_conifolds = True,
)

# Or construct a fully initialised FluxVacuaFinder directly
finder = lcs.load_model(
    ks_id    = int(df.iloc[0]["ks_id"]),
    triang_id= int(df.iloc[0]["triang_id"]),
    include_gv        = True,
    include_conifolds = True,
    maximum_degree    = 2,
)

Streaming batches without local-disk accumulation

from stringforge import LCSDatabase

lcs_lean = LCSDatabase(dataset="tdf", cache_mode="none")
for tree in lcs_lean.iter_batch(h11=2, include_gv=True):
    ...

A full walkthrough — including offline mode, batched loading, and vacua persistence — is in the stringforge documentation.

Sub-dataset layout

tdf/
    README.md                       ← this file
    catalog.parquet                 ← main index, ~10 MB
    conifold_catalog.parquet        ← per-conifold sub-catalogue
    schema.json                     ← schema version + description
    manifest.json                   ← incremental-build manifest

    lcs_data/h11_{N}/               ← geometry data, sharded by h^{1,1}
        data-00000.parquet
        data-00001.parquet
        ...
    gv/h11_{N}/                     ← Gopakumar–Vafa invariants, sharded by h^{1,1}
        data-00000.parquet
        ...
    conifolds/h11_{N}/              ← conifold-limit data, sharded by h^{1,1}
        data-00000.parquet
        ...
    polytope/                       ← reflexive polytope data (one row per ks_id)
        data-00000.parquet
        ...
    extra/                          ← miscellaneous precomputed fields
        data-00000.parquet
        ...

Why $h^{1,1}$-bucketed?

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.

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.

The polytope and extra splits are flat (not $h^{1,1}$-bucketed) because their rows are small and uniform.

Shard sizing

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.

Catalogue schema

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.

Column Type Description
ks_id int64 Kreuzer–Skarke polytope identifier
triang_id int64 Triangulation identifier within the polytope
h11 int64 Hodge number $h^{1,1}(X)$ (catalogue convention)
h12 int64 Hodge number $h^{2,1}(X)$ (catalogue convention)
chi int64 Euler characteristic $\chi(X) = 2,(h^{1,1} - h^{2,1})$
lcs_shard_id int64 Shard index in lcs_data/h11_{h11}/
lcs_row_index int64 Row within that shard
gv_shard_id Int64 (nullable) Shard index in gv/h11_{h11}/ — null if GV data unavailable
gv_row_index Int64 (nullable) Row within that shard
has_gv bool Whether GV data is present
n_conifolds int64 Number of conifold limits available
conifold_shard_id Int64 (nullable) First shard index in conifolds/h11_{h11}/ — null if n_conifolds == 0
polytope_shard_id int64 Shard index in polytope/ (shared across triangulations of the same ks_id)
polytope_row_index int64 Row within that shard
D3_tadpole int64 $\chi/24$

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.

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.

Data splits

lcs_data/h11_{N}/

One row per model. Contains the topological data needed to build the Kähler cone and the LCS prepotential.

Column Description
ks_id, triang_id, h11, h12, chi Identity
intnums Triple intersection numbers $\kappa_{ijk}$ of the mirror (dense tensor)
c2 Second Chern class $c_{2,i}$
generators_kahler_cone Kähler-cone generators
rays_kahler_cone, tip_of_stretched_kahler_cone Kähler-cone geometry
hyperplanes Hyperplane constraints defining the cone

gv/h11_{N}/

Gopakumar–Vafa invariants, one row per model that has GV data.

Column Description
ks_id, triang_id, h11, h12 Identity
GVs, GWs Dictionaries of GV and GW invariants keyed by effective-curve charge
grading_vector Grading vector used during the computation

conifolds/h11_{N}/

One row per $(\text{ks_id},, \text{triang_id},, \text{conifold_id})$ triple.

Column Description
ks_id, triang_id, h11, h12, conifold_id Identity
ncf GV invariant of the shrinking curve
conifold_curve Charge vector $c \in \mathbb{Z}^{h^{1,1}}$ of the shrinking cycle
basis_change Integer basis rotation matrix placing the conifold modulus first

polytope/

One row per ks_id (shared across all triangulations of that polytope).

Column Description
ks_id Identity
polytope_points Lattice points of the reflexive polytope (2D integer array)

extra/

Miscellaneous scalar fields that vary per model.

Column Description
ks_id, triang_id, h11, h12 Identity
chi Euler characteristic
D3_tadpole $\chi/24$
... Additional precomputed properties

Loading without stringforge

Plain Parquet access with pandas + huggingface_hub:

import pandas as pd
from huggingface_hub import hf_hub_download

# Download only the catalogue
catalog_path = hf_hub_download(
    repo_id   = "aschachner/cy-database",
    filename  = "tdf/catalog.parquet",
    repo_type = "dataset",
)
catalog = pd.read_parquet(catalog_path)

# Resolve a specific model's geometry shard
row = catalog.query("ks_id == 716 and triang_id == 1").iloc[0]
lcs_path = hf_hub_download(
    repo_id   = "aschachner/cy-database",
    filename  = f"tdf/lcs_data/h11_{int(row['h11'])}/data-{int(row['lcs_shard_id']):05d}.parquet",
    repo_type = "dataset",
)
lcs = pd.read_parquet(lcs_path)
model_row = lcs.iloc[int(row["lcs_row_index"])]

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.

Scope and limitations specific to TDF

  • Only trilayer, double favourable toric hypersurfaces are included. Other toric and non-toric constructions live in separate sub-datasets (e.g. cicy/).
  • GV invariants are precomputed only for a subset of models — use has_gv=True in queries to filter.
  • Conifold data is present only for models with at least one conifold limit — use has_conifolds=True in queries.

Building / updating

Produced from a local collection of per-model pickle files by the build_tdf_database notebook under stringforge/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.

Additional references

For citation, licence, and contact details, see the umbrella cy-database card.