patch — CYTools monkey-patching for GV flop tracking

Contents

patch — CYTools monkey-patching for GV flop tracking#

CYTools monkey-patches for cybir integration.

Provides patch_cytools() to add GV flop-tracking methods to the CYTools Invariants class and convenience entry points to CalabiYau and Polytope.

The patches are applied explicitly – never on import – so that cybir can be used for offline analysis without CYTools present.

See arXiv:2303.00757 Section 2 for the GV propagation logic and arXiv:2212.10573 Section 4 for the contraction classification that motivates these methods.

patch_cytools()#

Apply cybir monkey-patches to CYTools classes.

Patches the following onto cytools.calabiyau.Invariants:

  • copy: deep-copy with flop-tracking attributes

  • flop_gvs: clone with updated flop-curve tracking

  • gv_incl_flop: GV lookup with sign flips and basis change

  • gv_series_cybir: extract GV series via gv_incl_flop

  • ensure_nilpotency: recompute GVs to higher degree

  • cone_incl_flop: Mori cone with flop corrections

Also patches entry points:

  • CalabiYau.birational_class(**kwargs)

  • Polytope.birational_class(**kwargs)

This function is idempotent and safe to call multiple times. If CYTools is not importable, a warning is issued and the function returns without error.

Version guards (INTG-04, D-17) check that Invariants has the expected gv method and that __init__ accepts the required parameters before patching.