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 attributesflop_gvs: clone with updated flop-curve trackinggv_incl_flop: GV lookup with sign flips and basis changegv_series_cybir: extract GV series viagv_incl_flopensure_nilpotency: recompute GVs to higher degreecone_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
Invariantshas the expectedgvmethod and that__init__accepts the required parameters before patching.