Interactive Moiré Topography and FFT Simulator for Square, Honeycomb, Triangular, and Kagome Lattices

I would like to share an interactive geometric moiré lattice simulator written in Igor Pro. The program supports independently selectable square, honeycomb, triangular, and Kagome lattices for the top and bottom layers. It generates a registry-modulated top-layer topography and displays the corresponding Hanning-windowed FFT in real time. All major parameters, including lattice constants, global orientation, relative twist, field of view, atomic width, and moiré contrast, can be adjusted interactively. The attached PXP file contains the complete demonstration workspace and procedures.

An interactive Igor Pro tool for generating geometric moiré topographies from two independently configurable two-dimensional lattices. Square, honeycomb, triangular, and Kagome lattices are supported for both the top and bottom layers, with real-time parameter adjustment and simultaneous real-space and Fourier-space visualization.

Full description

Interactive Geometric Moiré Lattice Simulator

This Igor Pro package provides an interactive tool for simulating geometric moiré patterns formed by two stacked two-dimensional lattices.

The top and bottom layers can be selected independently from four lattice types:

  • Square
  • Honeycomb
  • Triangular
  • Kagome

This allows both conventional and mixed-symmetry combinations, such as square/square, honeycomb/honeycomb, triangular/Kagome, or square/honeycomb heterostructures.

Physical model

The simulation does not simply add the apparent heights of the two layers. Instead, only the atoms in the top layer are directly rendered in the simulated topography. The bottom layer modifies the apparent height of each top-layer atom through the local geometric registry.

For each top-layer atom \(i\), the distance to the nearest bottom-layer atom is calculated as

\[ d_i= \min_{j\in\mathrm{bottom}} \left| \mathbf R_i^{\mathrm{top}} - \mathbf R_j^{\mathrm{bottom}} \right|. \]

The apparent amplitude of the top-layer atom is then modeled as

\[ A_i= 1+A_M \exp\left( -\frac{d_i^2}{2\xi_{\mathrm{stack}}^2} \right), \]

and the final topography is constructed from Gaussian atomic peaks:

\[ z(\mathbf r)= \sum_{i\in\mathrm{top}} A_i \exp\left[ -\frac{ |\mathbf r-\mathbf R_i^{\mathrm{top}}|^2 }{ 2\sigma_{\mathrm{atom}}^2 } \right]. \]

Here, \(A_M\) controls the strength of the moiré modulation, \(\xi_{\mathrm{stack}}\) determines the registry-selection length scale, and \(\sigma_{\mathrm{atom}}\) controls the apparent width of each atom.

This is a geometric registry-modulated apparent-height model. It is intended for visualizing lattice geometry and moiré structures rather than performing a microscopic LDOS or tunneling-current calculation.

Lattice convention

All input lattice constants are defined as Bravais-lattice translation lengths.

For the supported lattices:

\[ d_{\mathrm{NN}}^{\mathrm{square}}=a, \]\[ d_{\mathrm{NN}}^{\mathrm{triangular}}=a, \]\[ d_{AB}^{\mathrm{honeycomb}}=\frac{a}{\sqrt{3}}, \]\[ d_{\mathrm{NN}}^{\mathrm{Kagome}}=\frac{a}{2}. \]

The honeycomb lattice is implemented as a triangular Bravais lattice with a two-atom basis, while the Kagome lattice is implemented as a triangular Bravais lattice with a three-atom basis.

Angle convention

The layer orientations are parameterized by a global angle and a relative twist angle:

\[ \theta_{\mathrm{bottom}}=\phi, \]\[ \theta_{\mathrm{top}}=\phi+\theta. \]

The global angle \(\phi\) rotates the complete bilayer structure relative to the laboratory axes, while the twist angle \(\theta\) controls the relative rotation between the two layers.

Main features

  • Independent selection of top- and bottom-layer lattice forms
  • Independent top and bottom lattice constants
  • Global lattice rotation and relative twist angle
  • Fixed physical field of view with independently adjustable matrix resolution
  • Interactive SetVariable controls
  • Automatic recalculation after each parameter change
  • Simultaneous real-space and Fourier-space display
  • Two-dimensional Hanning window applied before FFT
  • Automatic FFT display range based on the first-order Bragg peaks of the visible top layer
  • Support for both commensurate and incommensurate lattice combinations

Interactive parameters

The main adjustable parameters are:

  • N: number of points along each image direction
  • L: physical field of view
  • \(a_{\mathrm{top}}\): top-layer Bravais lattice constant
  • \(a_{\mathrm{bottom}}\): bottom-layer Bravais lattice constant
  • \(\phi\): global rotation angle
  • \(\theta\): relative twist angle
  • \(\sigma_{\mathrm{atom}}\): atomic Gaussian width
  • \(\xi_{\mathrm{stack}}\): registry-selection length scale
  • \(A_M\): moiré modulation amplitude
  • Top-layer lattice form
  • Bottom-layer lattice form

The internal pixel spacing is

\[ \Delta x=\frac{L}{N-1}, \]

so changing the matrix size changes the spatial sampling without changing the physical field of view.

Usage

  1. Open the attached PXP experiment in Igor Pro.
  2. Run:
GenerateMoireSquareFastc()
  1. Enter the initial simulation parameters in the prompt dialog.
  2. Use the controls at the top of the interactive window to modify the lattice constants, lattice forms, angles, field of view, and apparent-height parameters.
  3. The real-space image and its FFT update automatically.

Notes and limitations

The program treats the lattices as rigid two-dimensional structures. It does not currently include:

  • Atomic relaxation
  • Strain fields
  • Interlayer hopping
  • Orbital-dependent tunneling matrix elements
  • Bias-dependent local density of states
  • Constant-current STM feedback
  • Sublattice-dependent atomic amplitudes
  • Microscopic stacking energies

For mixed lattice symmetries or incommensurate lattice constants, the calculated pattern may be nonperiodic within the selected field of view. Such a pattern should be interpreted as a geometric registry modulation and should not automatically be identified as a structural quasicrystal.

Package contents

The attached PXP file contains the interactive simulation interface, lattice-generation functions, registry calculation, FFT analysis, and example visualization workspace.

Comments, suggestions, and further extensions are welcome.

 

Project Details

Current Project Release

Release File: Moire STM Topography Simulator.pxp (63.16 KB)
Version Date:
View All Releases

Forum

Support

Gallery

Igor Pro 10

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More