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.
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:
This allows both conventional and mixed-symmetry combinations, such as square/square, honeycomb/honeycomb, triangular/Kagome, or square/honeycomb heterostructures.
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.
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.
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.
SetVariable controlsThe main adjustable parameters are:
N: number of points along each image directionL: physical field of viewThe 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.
GenerateMoireSquareFastc()The program treats the lattices as rigid two-dimensional structures. It does not currently include:
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.
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.
Forum
Support
Gallery
Learn More
Learn More
Learn More