Live PyProcar Electronic Structure Agent
Direct interactive session with the PyProcar AI Agent and Virtual Corresponding Author.
Reimagining PyProcar as an Autonomous AI Agent
Institution: West Virginia University β Department of Physics & Astronomy / Research Computing
Contributor: Mike Snodgrass, AI Specialist @ Google
Live Interactive Prototype: https://pyprocar-agent-33007372238.us-central1.run.app
β³ Note: As a serverless deployment that scales to zero when idle, the instance requires a 15β20 second "warm up" period on first launch.
1. Executive Summary
On September 16, 2026, researchers from Stanford University (Jiacheng Miao, James Zou et al.) published a landmark framework in Nature:
"Reimagining research papers as interactive and reliable AI agents" (Nature, doi:10.1038/s41586-026-11044-y).
The paper argues that the traditional scientific publicationβa static PDF artifactβcreates severe friction for dissemination, reuse, and reproducibility. The authors introduced Paper2Agent, an automated methodology that converts a scientific paper, its code, and its datasets into an interactive AI agent powered by a Model Context Protocol (MCP) server.
To demonstrate how this applies to computational condensed matter physics, we selected Prof. Aldo H. Romero's flagship software publication:
"PyProcar: A Python library for electronic structure pre/post-processing"
Uthpala Herath, Pedram Tavadze, Xu He, Eric Bousquet, Sobhit Singh, Francisco MuΓ±oz, Aldo H. Romero
Computer Physics Communications 251 (2020) 107080.
Using Google Antigravity, we implemented a complete Paper2Agent prototype and deployed it live as a web application. This document outlines what this prototype proves, how it functions, and the exact 4-step Antigravity prompt template so Dr. Romero and his research group can replicate this for any paper or tool in their laboratory.
2. What the Implementation Proves
Proof 1: Research Moves from "Passive Artifact" to "Active Computational Endpoint"
- Traditional Model: Readers manually read equations, hunt down GitHub repositories, configure Python environments, resolve library version conflicts, and write boilerplate scripts to parse VASP/QE output files.
- Agent Model: The paper itself becomes an interactive system. Anyone can inspect formulations or execute calculations conversationally directly from any browser.
Proof 2: The "Virtual Corresponding Author" Eliminates Knowledge Bottlenecks
- Rather than asking a general-purpose LLM that hallucinates equations or parameter conventions, the agent is strictly grounded in the PyProcar publication.
- It answers nuanced theoretical questions with mathematical precision:
- Non-collinear spinor representation:
β¨S_Ξ±β© = Tr[Ο Ο_Ξ±] - Helical spin-momentum locking:
Helicity = S Β· (k Γ z) / (|S||k|) - Spectral weight supercell band unrolling:
P_Km(k_i) = Ξ£_n |β¨k_i, n | K, mβ©|Β²
- Non-collinear spinor representation:
Proof 3: Zero-Code Electronic Structure Analysis (Democratizing Tools)
- Experimentalists and junior researchers often lack the time or Python fluency to write complex array-slicing scripts for raw DFT outputs.
- The agent proves that natural language can replace complex API hierarchies: asking "Calculate the band gap for Silicon and plot the projected p-orbital bands" automatically coordinates the parser, identifies the 1.12 eV indirect gap, and generates publication-grade plots.
Proof 4: Permanent Reproducibility and Self-Verification
- Scientific software notoriously suffers from "library rot" and broken dependencies over time.
- The agent packages built-in canonical benchmark datasets (Silicon semiconductor, Bi2Se3 3D topological insulator) and automated unit test suites (10/10 tests passing), proving that physical results remain verifiable on demand.
Proof 5: Interoperability with Autonomous "AI Co-Scientists"
- By implementing the open standard Model Context Protocol (MCP), this agent can be autonomously called by other AI models in multi-agent materials discovery workflows (e.g. screening candidate superconductors or topological semimetals).
3. The 4-Step Antigravity Recipe: How to Replicate This for Any Paper
This entire prototype was researched, built, tested, and deployed in under 30 minutes using Google Antigravity. Below are the 4 core steps with both the PyProcar prompt and a generalized template you can copy and adapt for your own research:
Step 1: Research Catalog Discovery
Identify software tools, algorithms, or methodologies within a researcher's published catalog.
"find a recent research paper by aldo romero from WVU."
Step 2: Feed the Nature Paper to Antigravity to Pick the Best Candidate
Instruct Antigravity to ingest the live Nature paper on Paper2Agent, evaluate the tools against the paper's criteria, and recommend the best candidate.
"which of his research papers would be a good candidate to turn into an AI agent based on the idea suggested by this paper: https://www.nature.com/articles/s41586-026-11044-y"
Step 3: Implement the Paper2Agent Prototype (MCP Server + Virtual Author)
Direct Antigravity to scaffold the agent: ground the theoretical knowledge, wrap the Python library into standard MCP tools, and create self-verifying test datasets.
"go ahead and implement a paper2agent prototype for the PyProcar paper"
1. Virtual Corresponding Author: Construct a structured knowledge base containing the manuscript's citations, core mathematical formulas (in LaTeX), supported input/output formats, and theoretical explanations.
2. Model Context Protocol (MCP) Server: Expose the library's 4β6 primary computational workflows (e.g., data ingestion, calculations, property analyses, and publication-ready plotting) as standard MCP tools over stdio.
3. Reproducibility & Benchmarks: Include canonical benchmark datasets and automated unit tests (using pytest) to verify that calculations reproduce expected physical values."
Step 4: Build an Interactive Web Showcase & Workbench
Wrap the agent into an accessible web application (using Streamlit) so collaborators, students, or reviewers can immediately interact with it without writing code or installing packages.
"Build an interactive web demo of this prototype to show the researcher."
1. Virtual Author Q&A: A natural language chat interface with quick-prompt buttons that answers theoretical questions using LaTeX equations and automatically executes computational tools when appropriate.
2. Interactive Workbench: A visual dashboard allowing users to select benchmark materials/datasets, adjust parameters, compute properties, and inspect generated figures in real time.
3. Manuscript Knowledge Tab: A section displaying the original paper's abstract, full citations, mathematical derivations, and registered MCP tool schemas."
4. Blueprint for Other Papers from Dr. Romero's Lab
Dr. Romero's group can apply this exact 4-prompt blueprint to their other open-source software libraries:
- MechElastic: Create an autonomous mechanical screening agent that computes Born stability criteria, directional elastic moduli (Young's, shear, bulk), and Pugh's ductility ratio from elastic stiffness matrices.
- PyChemia: Create an autonomous materials design agent executing Firefly crystal structure search algorithms and orchestrating high-throughput DFT calculations.
- ParquetDB: Create a high-speed scientific data agent providing conversational query capabilities over large-scale materials databases.
Created with Google Antigravity • Paper2Agent Case Study • September 2026
Model Context Protocol (MCP) Server Architecture
The PyProcar agent implements the standard Model Context Protocol over stdio (pyprocar_agent.server), exposing 8 standard tool endpoints:
1. get_paper_metadata() -> Dict[str, Any]
2. query_paper_knowledge(query: str) -> List[Dict[str, Any]]
3. list_benchmark_materials() -> List[Dict[str, str]]
4. calculate_band_gap(material_id: str) -> Dict[str, Any]
5. compute_projected_dos_tool(material_id, energy_min, energy_max, sigma) -> Dict[str, Any]
6. analyze_spin_texture_tool(material_id, band_index) -> Dict[str, Any]
7. plot_band_structure_tool(material_id, orbital_projection, output_path) -> Dict[str, Any]
8. plot_fermi_surface_tool(material_id, output_path) -> Dict[str, Any]
Repository Structure
find_aldo_romero_paper/
βββ src/pyprocar_agent/
β βββ __init__.py
β βββ paper_knowledge.py # Virtual Corresponding Author & Theory
β βββ core_tools.py # Band gap, DOS, spin texture, Fermi surface
β βββ server.py # FastMCP JSON-RPC server
β βββ cli.py # CLI runner and benchmark command
βββ tests/
β βββ test_core_tools.py # Pytest validation
β βββ test_mcp_server.py # MCP schema & tool validation
β βββ test_paper_knowledge.py # Knowledge grounding validation
βββ app.py # Interactive Streamlit application
βββ paper2agent_guide.html # Comprehensive demonstration guide
βββ Dockerfile # Container definition
βββ README.md # Hugging Face Space documentation