Related Experiment Video
Updated: Jun 10, 2026

Optimizing Magnetic Force Microscopy Resolution and Sensitivity to Visualize Nanoscale Magnetic Domains
Published on: July 20, 2022
mrfmsim: A modular, extendable, and readable simulation package for magnetic resonance force microscopy experiments
Peter Sun1, Corinne E Isaac1, Michael C Boucher1
1Department of Chemistry and Chemical Biology, Cornell University, Ithaca, New York 14853, USA.
Abstract:
We present mrfmsim, an open-source Python package that facilitates the design, simulation, and analysis of magnetic resonance force microscopy (MRFM) experiments. MRFM is a scanning-probe technique that detects magnetic resonance from nanoscale ensembles of nuclear or electron spins with a force sensor. Because MRFM experiments are complex and operate at sensitivity limits, numerical simulation is essential for designing experiments and estimating per-spin sensitivity and imaging resolution from measured signals. In this paper, we highlight the challenges of developing MRFM simulations and show that software designed to simulate specific experiments only in a rapidly evolving experimental field can yield erroneous results. The mrfmsim package addresses these challenges by supporting post-definition customization without rewriting the internal model and by employing a plugin system for extending functionality. We show that the package's modular, extendable, and readable architecture improves reproducibility and accelerates development.
Insights
We developed mrfmsim, an open-source Python package for magnetic resonance force microscopy (MRFM) simulations. This tool aids in designing experiments and improving reproducibility in the rapidly evolving field of nanoscale spin detection.
Area of Science:
- Physics
- Materials Science
- Nanotechnology
Background:
- Magnetic Resonance Force Microscopy (MRFM) is a sensitive scanning-probe technique for detecting nanoscale spin ensembles.
- MRFM experiments require complex numerical simulations for design and analysis due to extreme sensitivity requirements.
- Existing simulation software can become outdated quickly in the fast-paced MRFM field.
Purpose of the Study:
- Introduce mrfmsim, a flexible and extendable open-source Python package for MRFM.
- Address challenges in MRFM simulation development and software longevity.
- Enhance reproducibility and accelerate research in MRFM.
Main Methods:
- Developed mrfmsim with a modular architecture and a plugin system.
- Enabled post-definition customization without internal model rewriting.
- Focused on creating an extendable and readable simulation package.
Main Results:
- mrfmsim facilitates the design, simulation, and analysis of MRFM experiments.
- The package supports customization and extension, overcoming limitations of static simulation software.
- Demonstrated improved reproducibility and accelerated development cycles for MRFM simulations.
Conclusions:
- mrfmsim provides a robust solution for the complexities of MRFM simulations.
- The package's design promotes adaptability and longevity in a dynamic research area.
- mrfmsim is poised to aid researchers in achieving higher per-spin sensitivity and imaging resolution.

