← Back to archive
Qi Men Dun Jia

A Scheme for Deeply Integrating Neural Networks with Qimen Dunjia (Part One)

The computational complexity of Qimen Dunjia: taking a standard Qimen Dunjia chart, it is divided into nine palaces, and the elements within each palace include gods, stars, gates, heaven-plate stems, earth-plate stems, and the nine palaces. Qimen Dunjia has 1080 configurations in total — that is, 1080 variations overall. However, Qimen Dunjia is also affected by year, month, day, and hour. According to the characteristics of Qimen Dunjia chart-drawing, for each palace the internal variations are also 1080.

The four pillars (year, month, day, hour) each have corresponding heavenly stems, which map to corresponding palace positions — equivalent to a Cartesian product of four palaces with 1080 elements each, producing a total of 1.360489e+12 variations, roughly one hundred and thirty-six billion. This magnitude is obviously too large. Although human affairs change in a thousand ways, in practice such fine-grained subdivision is unnecessary. So how should one reduce the dimensions?

The best approach is of course to incorporate time information directly. It is well known that the standard determination of Qimen Dunjia configurations uses the twenty-four solar terms — but actually the granularity of Qimen configuration-setting is finer: the seventy-two pentads (hou). The twelve months of the year, since month changes also follow solar terms, means that when Qimen Dunjia determines its configuration, the month information is already included, and the subdivision is finer than the month. Using the seventy-two pentads, Qimen's configuration-setting effectively becomes about one configuration per five days — but this determination follows the real seasonal pentads, not rigidly derived from simple solar terms. If one notices that in chart-drawing Jia is always placed on the hour stem, one can联想 to operations in other arts of calculation. For example, Da Liu Ren uses the monthly general added to the hour, and the monthly general is also part of the twenty-four solar terms — divided into twelve portions corresponding to the months.

What is Jia? The Six Jia hide within the Six Yi, and the Six Jia are the xun-heads. A xun is ten days, and we see the unit xun used in Qimen Dunjia. Does the month stem have a corresponding meaning of "xun-head"? This involves a calendrical issue: a Jiazi day begins with the Jiazi hour, yet a Jiazi year begins with the Bingyin month. The year change uses Bing, not Jia — but the xun-head of Bingyin is still Jiazi, corresponding to the Jiazi month of the Guihai year.

Qimen Dunjia actually uses the winter and summer solstices as the dividing line between yin- and yang-dun configurations. So for Qimen Dunjia, when the winter solstice formally changes the configuration, it is still using the previous year's stems and branches — and it would be unreasonable to wait until the Spring Festival to change the year pillar. This is precisely why the concept of "chaojie" (leap-and-connect) becomes so important here: it directly concerns the meaning of changing qi on this Qimen Dunjia model. (This is not important in prediction practice; technical workarounds cancel out the issue.)
If understood as twelve months in a year, they naturally cannot fit into the Nine Palaces. But viewed from another angle it is simple: for Jia and Ji years, Bing is the first; for Yi and Geng years, Wu is the first; and so on. One can clearly see that Bing, Wu, Geng, Ren, Jia — the heavenly stems of the first month of each year — rotate. So even within a single Qimen Dunjia configuration, this information can be regarded as containing five years' worth of variation.
Here one can note that Qimen configurations are directly related to months. A month has roughly three xuns; since one configuration is five days, three xuns correspond in Qimen configuration numbering to essentially six configurations — so each month can correspond to six Qimen configurations, and the month stem circulates through the six configurations. Ten heavenly stems cycling around also comes to exactly sixty.
Five days make one configuration, one configuration is one pentad, three pentads make one jie (solar-term segment), six pentads make one month, and eighteen pentads make one season. The "eighteen pentads make one season" is very important, because Qimen Dunjia has 4320 configurations per year — that is, the 1080 variations repeat four times. If the different information is to be genuinely reflected, the greatest differences manifest in the seasons. This is also why classical divination methods often mention seasonal influence. But there are only four seasons, and if only the five phases of spring, summer, autumn, and winter are considered, there would be no Earth phase. The traditional method sets the last month of each quarter — the ji month — as Earth, and uses Chen, Xu, Chou, and Wei to distinguish them. Chen, Xu, Chou, and Wei, as Earth, besides their own Earth attribute, also serve as the location of the yang tomb of the five phases two positions ahead of the opposite palace.

Written by Master Sanfu on February 25, 2020. Please credit the source if you share.

Translation Notice: This English version was translated with AI assistance. Specialized, historical, religious, or culturally sensitive terms may contain nuances, inaccuracies, or debatable wording. In case of ambiguity or discrepancy, the original Chinese text shall prevail.