Qi Men Dun Jia
Chinese military-divinatory art; classical form in the Yan Bo Diao Sou Ge and Ming–Qing compendia
Qi Men Dun Jia ('Mysterious Gates Escaping Technique') casts a nine-palace chart for each double-hour from the sexagenary calendar and the solar terms, rotating the nine stars, eight gates and eight deities over a fixed earth plate. Legend attributes it to military strategists; its classical mechanics are preserved in mnemonic verses and the Ming–Qing compendia. The schools genuinely disagree on how to determine the ju in edge periods — this engine computes the chai-bu (split-and-patch) method and says so.
What it measures
For one double-hour: the ju number (1–9, from the solar term in effect and the day's fu-tou), the earth plate of six ceremonial stems and three nobles, and the heaven, human and deity plates rotated so the duty star and duty gate follow the hour — pure calendar arithmetic once the school is fixed.
Where practitioners disagree
- How is the ju determined?
Chai-bu (split-and-patch, ours), zhi-run (intercalation — with genuinely disputed edge timing), or the Maoshan cusp method that discards the fu-tou
Real software disagrees in edge half-years; naming the school is the only honest posture.
This engine: Chai-bu, labelled on every chart; the alternatives are named and not silently mixed.
Still open
Rotating-plate details in the yin half-year vary between lineages, and the substitute conventions for the centre palace differ — the chart states its own conventions rather than claiming universality.
Sources
- Classical tradition, 煙波釣叟歌 (Song of the Old Fisherman of the Misty Waves)
- Ming–Qing compendia, 奇門遁甲統宗