Skip to content

TaoELi/MaxwellLink

Repository files navigation

MaxwellLink icon

Docs badge PyPI version License: GPLv2 Python versions arXiv:2512.06173 10.1021/acs.jctc.5c02028

MaxwellLink is a free and open-source framework for self-consistent light–matter simulations. It connects electromagnetic solvers, such as MEEP FDTD or the built-in single-mode cavity, to a wide range of molecular drivers, from multilevel open quantum systems to (nonadiabatic) first-principles molecular dynamics.

This code supports both exploratory demonstrations and production-scale calculations. In particular, its socket-based architecture allows large-scale self-consistent light–matter simulations to run efficiently across multiple HPC nodes.

The latest version of MaxwellLink (v0.3) ships with AI Agent Skills. With simple natural language inputs, users can easily create input files and run jobs on both local machines and HPC systems.

Key Features

  • Embracing state-of-the-art ecosystems in both computational electrodynamics and quantum chemistry, extending the boundary of light-matter simulations.
  • Unified Python interfaces for socket-connected and embedded molecular drivers in light-matter simulations.
  • Heterogeneous molecular theories including TLS, QuTiP model Hamiltonians, in-house RT-TDDFT/Ehrenfest dynamics using Psi4 integrals, ASE classical dynamics, and modified LAMMPS via fix mxl, all in one simulation.
  • Extensible code structure to add custom EM solvers or molecular drivers with minimal effort.
  • Embedded AI Agent Skills to allow users to chat within, e.g., Visual Code IDE + Codex, to directly generate desired input files and even run jobs on both local machines and HPC systems.

Quick Start

Create a fresh conda environment and install using pip:

pip install maxwelllink

Optional drivers (MEEP FDTD, QuTiP, Psi4, ASE, LAMMPS) can be added by following the instructions in the documentation.

Running simulations with AI Agents

Inspired by the recently developed FermiLink agent framework, MaxwellLink now provides an elegant method for integrating with AI agents. All we need is to type in mxl init in a working directory:

mkdir myproject
cd myproject/
mxl init

Then we can interact with any local AI agent (Claude Code, OpenAI Codex, Gemini CLI, or their desktop apps, VS Code IDE extensions, etc) for autonomous light-matter simulations by simple natural language prompts.

mxl init will set up the package knowledge base (source code tree + agent skills layer) in your working directory for agent reasoning. After the simulation, we can simply clean up the package knowledge base by:

mxl clean

If your machine supports SLURM job management (such as HPCs), run the following command to set up the HPC environment, so the agent can automatically use the correct SLURM environments for large-scale HPC simulations.

mxl hpc

Documentation

Visit the documentation for installation details, tutorials, API reference, and guidelines on extending MaxwellLink.

Tutorials

The jupyter notebook tutorials are located at tutorials/. Users may also view the tutorials rendered at the documentation website.

Citation

If you find MaxwellLink helpful for your research, please cite the following reference:

About

A flexible framework for self-consistent EM-molecular simulations, powered by AI agent skills

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors