This is a guest post by Elaine Lai. See bio at the end of this post.
Those of us working with early textual materials, especially in Buddhist studies, reconstruct a story of the past by tracing a text’s reception in yet another group of texts. This usually involves searching for instances of explicit and implicit intertextuality between a base text and a corpus of other texts. This is exactly what I did for my dissertation, which I completed at Stanford University in 2024. In this post, I provide a brief background of the textual corpora I worked with and the digital heatmap I created to trace its reception. I end with an analysis of the results and some thoughts on the benefits and shortcomings of using intertextual heatmaps.
Background
The Tantra of the Sun is an important religious scripture that is believed to have inspired a new tradition in Tibetan Buddhism, one that focuses on feminine deities (dakinis). This new tradition was called Heart Essence of the Ḍākinīs.
Importantly, the Tantra of the Sun is connected to a famous figure named Padmasambhava (8th cent.), who is considered almost equal in importance to Buddha Shakyamuni. Padmasambhava is believed to have hidden the Tantra of the Sun, along with the Heart Essence of the Ḍākinīs in the 8th century. Padmasambhava predicted the rediscovery of all these texts the future, when the time was right. In the 14th century, a yogi and scholar named Longchenpa (1308–1364) combined Padmasambhava’s texts into one collection and added in his own commentaries to it.
The story of the Tantra of the Sun becomes more complex, given that there are several completely different versions of the tantra available on BDRC (Buddhist Digital Resource Center) of varying chapter lengths. Given the existence of several versions, the following question arose: which Tantra of the Sun was the basis for this tradition? For this heatmap, I used the 113-chapter version of the tantra, because in my initial manual searches for intertextuality, this appeared to be the version that was cited throughout the Heart Essence of the Ḍākinīs and Longchenpa’s 14th century commentary (henceforth LS5-8). I quickly realized that manual searches in word documents were not the best way to go about proving that the 113-chapter tantra most closely approximated the tantra used as a source text for LS5-8. I began to wonder if there was a digital method to display this intertextuality.
Method
Inspired by heatmaps that document the weather or population density, I sought to apply the concept of a heatmap to textual studies; specifically, I wanted to visually show what passages in the Tantra of the Sun were being quoted in LS5-8, and to illuminate patterns through color schemes. I also wanted to provide a tool where researchers in my subfield could click on the highlighted passages and immediately see in what context the quote appears both in LS5-8 and in the Tantra of the Sun.
I initially attempted a digital tool called BuddhaNexus, which uses fuzzy search parameters to locate textual matches across Buddhist corpora. However, there were two main issues with this approach:
- My reception corpus, LS5-8, is not included in the corpora of texts that one can search through on BuddhaNexus
- Even if I could search through my reception corpus, I would not be able to locate every instance of explicit intertextuality.
What do I mean by this? Using fuzzy search parameters would only pick up on implicit intertextuality, some of which is not so useful—for example, in the case of repeated lists of ideas which frequently occurs in Buddhist texts. More importantly however, as my heatmap will show, there are many instances where LS5-8 claims to be explicitly quoting from the Tantra of the Sun, but there is no corresponding quotation match to the 113-chapter version of the tantra. In these instances, fuzzy search parameters would not be helpful since these explicit quotations contain no textual matches with my base text.
After consulting several specialists at Stanford’s Center for Spatial and Textual Analysis (CESTA), I was advised to build the heatmap from scratch. With the help of Simon Wiles and my partner Aftab Hafeez, we built the backend and frontend of the heatmap. I focused on all the data cleaning.

Here is a YouTube tutorial on how to use the heatmap. Please refer to the video for a step-by-step tutorial on how to use the heatmap.
Workflow
In the left-hand container the user will find the base text, the Tantra of the Sun, i.e., the 113-chapter version of the tantra. In the right-hand container, the user will find Longchenpa’s Collected Works (LS) volumes 5-8. Each volume in LS5-8 contains many different texts and not all of the texts cite from the Tantra of the Sun. I documented these finding in a separate chart in my dissertation. The scroll bar on the left-hand side corresponds chronologically to the chapters in the Tantra of the Sun, and the texts found in volumes 5-8, from the first text in volume 5 to the last text in volume 8.
In the left-hand container of the Tantra of the Sun, the different highlighted sections in the scrollbar and the body of the tantra represent passages in the tantra that are quoted somewhere in LS5-8. The darker the orange highlight color, the more that particular line or segment is quoted. If the user hovers the mouse over the highlighted quotations and clicks, a window will emerge to indicate where the line is quoted.

If the user clicks on either of the above entries, the Longchenpa’s Collected Works view will scroll to the target line and highlight it in green for you to see. Images below are the corresponding click-to-scroll passages.


One additional feature available on the heatmap is a search function for the Tantra of the Sun and for LS5-8. In the example below, the user types in their query, for example, “gzhan don” (“for the benefit of others”), in the Tantra of the Sun container. The user can refine their search to one of three choices:
- anywhere
- correspondences, or
- correspondences >1
“Anywhere” searches all matches in the text. “Correspondences” only searches the highlighted portions of the Tantra of the Sun. “Correspondences>1” only searches the highlighted portions of the tantra that have more than one match in the LS corpus, in other words the denser orange sections. After pressing enter, if there is a corresponding match, the text will highlight the match in a small green line on the left-hand scroll-bar so the user can see where the line is in relation to the cited passages in orange, and whether or not it intersects with already cited passages.

In the right-hand container of Longchenpa’s Collected Works, the user can refine their searches according to: 1) anywhere, 2) correspondences (orange highlights), 3) references (blue highlights), or 4) untraced quotations (gray highlights). In the example below, I have inputted the search query for “gzhan don,” and delimited the search to untraced quotations (gray). There is one match that emerged.

Analysis & Conclusion
Through the use of this heatmap, I was able to show that around 70% of the explicit quotations of the Tantra of the Sun found in the reception corpus, LS5-8, correspond to the 113-chapter version of the tantra. The remaining 30% of these explicit quotations that do not match the 113-chapter tantra, suggests another or possible several other cycles of the tantra that were in circulation. I analyze this more in my dissertation (Lai 2024).
Several other patterns emerged. For instance, the majority of explicit citations come from chapter 18 and chapter 101 of the tantra. Chapter 18 is the longest chapter of the tantra, and chapter 101 is a vajra song summarizing the whole tantra. Given that the bulk of citations come from these two chapters, I wondered if they may have circulated separately. The images below show the heatmap density of citations in these two chapters.


There are benefits and shortcomings to using a heatmap visualization for textual studies. The biggest benefit is probably accessibility—the heatmap immediately makes apparent how the Tantra of the Sun is cited throughout LS5-8. Additionally, other researchers can use the website to conduct their own research on these textual collections through the search function.
Of the shortcomings, my three laments are: 1) we lose the materiality of the manuscript tradition; 2) the OCR rendering is not entirely faithful to the manuscripts, and 3) the current layout gives the impression of a static text when in fact, the textual history is very fluid, and a lot of work is still needed.

Overall, the process of creating this heatmap and troubleshooting data errors with Simon and Aftab forced me to engage in a closer reading of my textual materials than before. It also allowed me to contemplate the white spaces—the areas of the tantra that have not been quoted by the Heart Essence tradition—and to wonder why. What makes parts of a text quotable time and time again? Most importantly, with this digital heatmap, I felt for the first time that my particular niche area of research became more legible to a wider audience of humanities scholars, technologists, and also Buddhist practitioners themselves.
References
For the Tantra of the Sun:
Kun tu bzang mo. “Kun tu zang mo klong gsal ’bar ma nyi ma’i rgyud (KM2_113).” In Snga ʼgyur Bkaʼ Ma Shin Tu Rgyas Pa, edited by Tshe ring rgya mtsho, BDRC: MW1PD100944., volume 111 of 133:1–290. Chengdu: Si khron dpe skrun tshogs pa si khron mi rigs dpe skrun khang, 2009. http://purl.bdrc.io/resource/MW1PD100944_A19660
For Longchenpa’s Collected Works:
Klong chen Rab ʼbyams pa Dri med ʼOd zer. Snying thig ya bzhi. In Gsung ʼbum dri med ʼod zer. Dpal brtsegs mes poʼi shul bzhag. Par gzhi dang po par thengs dang po [BDRC:MW1KG4884]. Vol. volume 5-8 of 26. 26 vols. Pe cin: Krung go’i bod rig pa dge skrun khang, 2009. http://purl.bdrc.io/resource/MW1KG4884.
Secondary Sources
Lai, Elaine. 2024. “Heart Essence Literature Through Time: A Close Study of the Secret Tantra of the Sun: Blazing Luminous Matrix of Samantabhadrī.” Stanford, California: Stanford University. https://purl.stanford.edu/kq771cq1455.
About the author
Elaine Lai is a Lecturer for Civic, Liberal, and Global Education (COLLEGE) at Stanford University. Elaine obtained her Doctor of Philosophy in Religious Studies from Stanford University in 2024, with a specialty in Indo-Tibetan Buddhism, focusing on the Great Perfection tradition in Tibet. Elaine’s recent research explores the relationship between Buddhist literature and time, specifically, how form and content interplay to cultivate more compassionate temporal relationalities. Elaine is committed to making the study of Buddhism accessible to a wider audience through technology and the arts. She is particularly interested in leveraging VR to create novel immersive experiences.

2 thoughts on “An Intertextual Heatmap: Tantra of the Sun’s Reception in 14th century Tibet”