← Latest papers
🔬 materials science

topas-editor and TOPilot: tools for AI-driven analysis of diffraction and total scattering data

This paper introduces topas-editor, a VS Code extension, and TOPilot, an AI-driven automation framework, which together provide a powerful, freely available interface for the TOPAS software suite to enable generative AI-assisted creation, editing, and automated analysis of complex diffraction and total scattering data.

Original authors: John S. O. Evans, Oliver J. Wagstaff, Ivana R. Evans, Arnt Kern, Alan A. Coelho

Published 2026-10-19
📖 6 min read🧠 Deep dive

Original authors: John S. O. Evans, Oliver J. Wagstaff, Ivana R. Evans, Arnt Kern, Alan A. Coelho

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). ✨ This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Scientists who study the arrangement of atoms in materials often rely on a technique called diffraction. Imagine shining a beam of light, such as X-rays or neutrons, through a crystal. The atoms inside the crystal act like a complex filter, scattering the beam into a specific pattern of spots or lines on a detector. This pattern is a unique fingerprint of the material's internal structure. By analyzing how the beam scatters, researchers can reconstruct the exact positions of the atoms, revealing everything from the strength of a new battery material to the history of an ancient pigment. However, turning these scattered patterns into a clear picture of atomic positions is a difficult puzzle. It requires specialized software to test millions of possible arrangements against the data, a process that demands deep expertise and often involves writing complex, custom instructions for the computer to follow.

For years, a powerful software suite known as TOPAS has been the tool of choice for solving these puzzles. It is capable of handling everything from simple crystals to complex, disordered materials, but it operates through text files that look like code. Creating these files requires a steep learning curve, as a single mistake in the syntax can cause the entire analysis to fail. While the software is incredibly fast and robust, the human effort required to set it up has limited its use to specialists. Now, a team of researchers has developed a new way to bridge this gap, combining the raw power of TOPAS with the reasoning abilities of modern artificial intelligence. They have created two linked tools, a smart editor and an AI assistant, that allow the software to be driven by natural language, effectively automating the most difficult parts of the analysis while keeping a human in the loop to verify the results.

The first tool, called topas-editor, is a digital workspace designed to make the complex language of TOPAS easier to read and write. It functions like a specialized notebook that understands the rules of the software. As a user types instructions, the editor highlights keywords, offers instant explanations for technical terms, and automatically checks for common mistakes. It acts as a guide, suggesting the correct way to describe a crystal structure or a specific experimental condition. This interface makes it possible for researchers to interact directly with the software without needing to memorize hundreds of obscure commands. However, the true innovation lies in the second tool, TOPilot, which acts as an intelligent agent that can write these instructions for the user.

TOPilot is built on a set of rules and examples that teach an artificial intelligence how to think like an experienced crystallographer. Instead of simply guessing, the AI consults a curated library of scientific rules and reference documents before making any decisions. When a researcher provides a data file and a simple description of what they want to find, TOPilot takes over. It can automatically identify the type of material, determine the correct mathematical model to use, and generate the complex text file needed to run the analysis. If the AI encounters a problem it cannot solve, such as missing information about the experimental setup, it stops and asks the human user for clarification rather than making a dangerous guess. This approach ensures that the AI handles the repetitive, time-consuming work of testing different models, while the human expert oversees the critical decisions.

The researchers tested this system on a wide variety of real-world challenges to see if it could handle the messiness of actual scientific data. In one test, they gave the AI a simulated pattern of a material called Y2O3 that had been deliberately corrupted with errors, such as a shifted background and distorted peaks. A standard approach would likely fail under these conditions, but the AI successfully navigated the complications. It identified the errors, adjusted its model to account for them, and produced a final result that matched the quality of a manual analysis performed by a human expert. The system did this by testing many different variations of the model, checking which one fit the data best, and then reporting its findings in a clear, interactive format.

In another example, the team asked the AI to solve a complete problem from scratch, starting with a raw data file and ending with a refined atomic structure. The material was a complex compound containing zirconium and tungsten. The AI successfully identified the size of the crystal's repeating unit, determined the correct symmetry of the structure, and then refined the positions of every atom within it. The entire process, from raw data to a finished structural model, took only a few minutes. The system also demonstrated its ability to handle multiple samples at once, analyzing a series of thirty different patterns collected as a material was heated, and automatically plotting how the structure changed with temperature.

Perhaps the most impressive demonstration involved materials with "incommensurate" structures, where the atomic arrangement does not repeat in a simple, regular way. These are notoriously difficult to analyze because the patterns contain extra, weak signals that standard software often misses. The AI was able to detect these subtle signals, determine the complex modulation of the structure, and refine the model to match the data with high precision. It even managed to combine data from two different types of experiments, X-rays and neutrons, into a single coherent analysis, automatically adjusting for the differences in how the two beams interact with the material. Throughout these tests, the system consistently produced results that were identical to those generated by human experts, proving that the AI could be trusted to perform complex, multi-step scientific workflows.

The researchers emphasize that while the AI is powerful, it is not a replacement for human judgment. The system is designed to be transparent, providing detailed reports and interactive graphs that allow the user to see exactly what the AI did and why. If the AI makes a choice that seems unusual, the user can review the reasoning and adjust the parameters. The goal is not to remove the scientist from the process, but to free them from the tedious task of writing code so they can focus on interpreting the results. The team found that the system was highly reproducible; running the same analysis multiple times yielded nearly identical results, with only minor variations in choices that even human experts might make differently.

This new approach represents a significant shift in how diffraction data is analyzed. By combining the speed and reliability of the TOPAS software with the adaptability of artificial intelligence, the researchers have created a tool that can handle the full range of crystallographic problems, from simple phase identification to the most complex structural refinements. The system is available for anyone to use, and it can be extended with new rules or examples as the scientific community discovers new materials. The work suggests that the future of materials science may involve a partnership between human intuition and machine automation, where the computer handles the heavy lifting of calculation and the human provides the insight to understand what the numbers mean. The result is a faster, more accessible way to unlock the secrets hidden within the atomic world.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →