T-embeddings of the Aztec diamond with arbitrary weights     domino-tilings

Leonid Petrov


Simulation Info

T-embeddings of the Aztec diamond with arbitrary weights     domino-tilings

Leonid Petrov

About this simulation

This simulation computes and visualizes perfect T-embeddings of the Aztec diamond graph with arbitrary edge weights. For the mathematical definitions and recurrence formulas, see the "Perfect T-embeddings and their computation" section below.

Controls
  • n: Size of the Aztec diamond (number of domino rows). Values above 60 may take noticeable time.
  • Weights: Select a weight preset (see below for details).
  • Compute: Runs the T-embedding recurrence with the current parameters.
Weight Presets
  1. Uniform: All edge weights equal 1 (the classical uniformly weighted Aztec diamond). Computation is faster because all coefficients are 1, so the folding phase is skipped.
  2. i.i.d. random: Independent identically distributed random edge weights. Choose a distribution:
    • Uniform [a, b]: Uniformly distributed on interval [a, b].
    • Bernoulli (p, v₁, v₂): Weight = v₁ with probability p, otherwise v₂.
    • Exponential (λ): Exponential distribution with rate λ.
    • Pareto (α, x_min): Pareto distribution with shape α and scale x_min.
    • Geometric (p): Geometric distribution with success probability p (integer-valued).
  3. Gamma i.i.d.: Edge weights drawn from Gamma(α, β) distribution.
  4. Layered (diagonal): Diagonally layered weights where each diagonal (i + j = const) shares the same weight. Offers 5 regimes:
    • Regime 1 (Critical Scaling): Weights vary as Val1 + 2/√n or Val2 − 1/√n with given probabilities.
    • Regime 2 (Rare Event Scaling): Weight = Val1 with probability 1/√n, otherwise Val2.
    • Regime 3 (Bernoulli): Weight = Val1 (prob p₁) or Val2 (prob p₂). Default regime.
    • Regime 4 (Deterministic Periodic): Alternates between w₁ and w₂ by diagonal.
    • Regime 5 (Continuous Uniform): Weights uniform on [a, b], varying by diagonal.
  5. Layered (straight): Horizontally layered weights where each row (y = const) shares the same weight. Same 5 regimes as diagonal layered, but layers run horizontally instead of along diagonals.
  6. Periodic (k×l): k-by-l periodic pattern of face weights. Opens an editor to set individual weights.
Edge Weight Export/Import
  • ↓ Export: Saves current edge weights to a JSON file for later use or sharing.
  • ↑ Import: Loads edge weights from a previously saved JSON file, overriding the current weight preset.
Main Visualization
  • 2D/3D toggle: Switch between 2D T-embedding view and 3D origami surface view.
  • V / E sliders: Adjust vertex size and edge thickness.
  • Origami checkbox: Show/hide the origami map overlay (2D mode only).
  • Zoom buttons: +, −, and reset (⟲) for zooming the canvas.
  • Mouse/touch controls:
    • 2D: Drag to pan, scroll/pinch to zoom.
    • 3D: Drag to rotate, Cmd/Ctrl+drag to pan, scroll/pinch to zoom.
Dimer Covering on T-Graph

The Dimer covering button samples dimer configurations on an Aztec diamond of size N = n − 3, where n is the T-embedding order. The key correspondence is:

  • T-graph faces (quadrilateral cells) correspond to Aztec diamond vertices.
  • A domino covering two adjacent Aztec vertices corresponds to an edge connecting two adjacent T-graph face centers.
  • Face centers: Computed via circumcenter construction: pick a starting face, set its center to the circumcenter (equidistant from all vertices), then propagate to adjacent faces by reflecting across the shared T-embedding edge. This gives the dual graph embedding.

Two view modes are available:

  • Single: Shows one dimer configuration as edges between face centers.
  • Double (XOR): Shows the symmetric difference of two independent dimer configurations, which forms disjoint closed loops.

Note: Boundary faces are not used. This is just a smaller-size sample (Aztec diamond of size N = n−3) placed onto only the interior quadrilateral faces, for illustration purposes.

Dual Graph Embedding

The Dual checkbox shows the dual graph of the T-embedding, with vertices at face centers and edges connecting adjacent faces. Two embedding modes are available:

  • Proper embedding (default): Uses the reflection algorithm (Lemma 2.3 from [KLRR]). Starting from w₀ (shown in orange), face centers are computed by reflecting across shared T-embedding edges. The position of w₀ can be dragged or adjusted via offset controls.
  • Naive embedding: Uses approximate incenters of each face independently. For triangles, this is the true incenter (weighted by opposite edge lengths). For quadrilaterals, vertices are weighted by opposite diagonal lengths. This gives a simpler embedding that doesn't depend on a starting position.
  • Circle patterns (proper embedding only): Displays circumcircles at each T-embedding vertex. By the circle pattern property (Lemma 2.3 from CLR), all adjacent dual vertices lie on a single circle centered at that T-embedding vertex. Shown in gold.

The V and E controls adjust vertex size and edge thickness for the dual graph independently of the T-embedding.

3D Mode Options
  • Re(Origami) / Im(Origami), matched: Select which surface(s) to display. When both are shown, they are rendered together with depth sorting. The Im surface is transformed to match the Re surface at boundary corners.
  • Projection toggle (🎯): Switch between orthographic and perspective projection.
  • Preset cycle (☀️): Cycle through visual presets (lighting, colors).
  • Auto-rotate (🔄): Enable continuous rotation animation.
Export Options
  • PDF: Vector export respecting all current overlays (T-embedding, origami, checkerboard, dual graph, circle patterns, dimer loops).
  • PNG: Raster image export with quality slider (1–100). Captures all visible overlays.
  • OBJ: 3D mesh export for external 3D viewers/software.
  • GIF: Animated GIF showing T-embeddings for a range of n values. Options:
    • n range: Set starting and ending n (e.g., n=1..50).
    • skip: Export every k-th frame (e.g., skip=4 exports n=1,5,9,...).
    • show n: Toggle display of "n = X" label on each frame.
    The GIF uses the currently selected weight preset and respects the Origami checkbox and V/E size sliders.
Random Domino Sampler

The 🎲 Sample button generates random domino tilings of the Aztec diamond using the domino shuffling algorithm with the currently selected edge weights.

  • Size (N): The Aztec diamond size (supports up to N = 330).
  • Border: Gap between dominoes for visual clarity.
  • Double Dimer: When checked, samples two independent dimer configurations and displays their symmetric difference as colored loops. Dominoes shared by both configurations are hidden; the remaining dominoes form disjoint closed loops.
  • Min loop: Filter to show only loops of at least this length (useful for hiding short loops).

Tip: Press Enter in the Size or Border fields to quickly re-sample.

Step-by-Step Visualization (n ≤ 15)

For small n, explore the T-embedding recurrence level by level:

  • Left panel (Aztec diamond graph): Shows the weighted bipartite graph. Arrow buttons (« ← → ») navigate between steps of the domino shuffling / urban renewal. Toggle edge weights (E wts) and face weights (F wts). Click on vertices or edges for details.
  • Right panel (T-embedding): Shows the T-embedding at level k. Buttons (← →) step through the recurrence. Toggle vertex labels with the Labels checkbox.
Mathematica Verification (n ≤ 15)

For small n, this section provides:

  • α/β parameters: The computed boundary parameters at each level.
  • T coordinates: The explicit T-embedding coordinates in Mathematica format.
  • XX Verification: Checks that each interior white vertex satisfies the face weight formula. Green = passed, red = numerical discrepancy.
T-embedding Performance Benchmark

Measures computation time for n = 10 to 40 and fits a power law t(n) = c·nα. Uses the currently selected weight preset.

Perfect T-embeddings and their computation

The notion of a t-embedding (also known as a Coulomb gauge) was introduced in [KLRR] and further developed in [CLR1], [CLR2].

Definition (T-embedding)

Let $\mathcal{G}$ be a weighted, finite, bipartite, planar graph with a marked outer face $f_{\mathrm{out}}$, and let $\mathcal{G}^*$ denote its augmented dual graph. A t-embedding of $\mathcal{G}$ is an embedding $\mathcal{T}: \mathcal{G}^* \to \mathbb{C}$ such that:

  1. $\mathcal{T}$ is a proper embedding: edges are non-degenerate straight segments, inner faces are convex and do not overlap;
  2. Angle condition: For each inner vertex $v^*$ of $\mathcal{T}(\mathcal{G}^*)$, the sum of angles at corners corresponding to black faces equals $\pi$ (and similarly for white faces);
  3. Weight condition: For each inner face $f$ of $\mathcal{G}$ with face weight $X_f$, if $v^*$ denotes the corresponding dual vertex with neighbors $v^*_1, \ldots, v^*_{2d}$ listed in counterclockwise order, then $$X_f = (-1)^{d+1} \prod_{k=1}^d \frac{\mathcal{T}(v^*) - \mathcal{T}(v^*_{2k-1})}{\mathcal{T}(v^*_{2k}) - \mathcal{T}(v^*)}.$$
Definition (Perfect T-embedding) [CLR2]

A t-embedding $\mathcal{T}$ of a finite weighted planar bipartite graph $\mathcal{G}$ is called perfect if the following additional boundary conditions are satisfied:

  1. The outer face of $\mathcal{T}(\mathcal{G}^*)$ is a tangential polygon, i.e., it admits an inscribed circle;
  2. For each outer vertex $v_k$ of $\mathcal{G}^*$, the edge connecting $v_k$ to its unique inner neighbor $v_{\mathrm{in},k}$ lies on the angle bisector of the corresponding corner of the tangential polygon. Equivalently, the line containing this edge passes through the center of the inscribed circle.
Definition (Face weight)

Given edge weights $\chi$ on a bipartite graph $\mathcal{G}$, one can associate a face weight $X_{v^*}$ to each face of $\mathcal{G}$ by $$X_{v^*}:=\prod_{s=1}^d\frac{\chi_{b_s w_s}}{\chi_{b_s w_{s+1}}},$$ where the face $v^*$ has degree $2d$ with vertices denoted by $w_1, b_1, \ldots , w_d, b_d$ in counterclockwise order (white vertices $w_i$, black vertices $b_i$, and $w_{d+1}:=w_1$).

Recurrence algorithm for computing $\mathcal{T}_k$

The T-embedding $\mathcal{T}$ of the Aztec diamond of size $n$ is computed iteratively as a sequence of embeddings $\mathcal{T}_0, \mathcal{T}_1, \ldots, \mathcal{T}_{n-2}$, where $\mathcal{T}_k$ has vertices at integer points $(i,j)$ with $|i|+|j| \leq k+1$.

Base case ($k=0$): The initial embedding $\mathcal{T}_0$ has 5 vertices:

$$\mathcal{T}_0(0,0) = 0, \quad \mathcal{T}_0(\pm 1, 0) = \pm 1, \quad \mathcal{T}_0(0, \pm 1) = \pm \frac{i}{\sqrt{X_{\mathrm{root}}}}$$

where $X_{\mathrm{root}}$ is the face weight of the central (root) face.

Recurrence ($k \geq 1$): Given $\mathcal{T}_{k-1}$, compute $\mathcal{T}_k$ using the following rules:

  1. External corners (vertices at distance $k+1$ from origin, on axes): $$\mathcal{T}_k(\pm(k+1), 0) = \mathcal{T}_{k-1}(\pm k, 0), \qquad \mathcal{T}_k(0, \pm(k+1)) = \mathcal{T}_{k-1}(0, \pm k)$$
  2. Alpha vertices (on-axis boundary, $|i|+|j|=k$, either $i=0$ or $j=0$): Right (swapped): $(\alpha \cdot \text{outer} + \text{inner})/(\alpha + 1)$ $$\mathcal{T}_k(k, 0) = \frac{\alpha_R \cdot \mathcal{T}_{k-1}(k, 0) + \mathcal{T}_{k-1}(k-1, 0)}{\alpha_R + 1}$$ Left, Top, Bottom: $(\text{outer} + \alpha \cdot \text{inner})/(\alpha + 1)$ $$\mathcal{T}_k(-k, 0) = \frac{\mathcal{T}_{k-1}(-k, 0) + \alpha_L \cdot \mathcal{T}_{k-1}(-(k-1), 0)}{\alpha_L + 1}$$ $$\mathcal{T}_k(0, k) = \frac{\mathcal{T}_{k-1}(0, k) + \alpha_T \cdot \mathcal{T}_{k-1}(0, k-1)}{\alpha_T + 1}$$ $$\mathcal{T}_k(0, -k) = \frac{\mathcal{T}_{k-1}(0, -k) + \alpha_B \cdot \mathcal{T}_{k-1}(0, -(k-1))}{\alpha_B + 1}$$
  3. Beta vertices (off-axis boundary, $|i|+|j|=k$, $i \neq 0$ and $j \neq 0$). For $1 \leq m \leq k-1$: Upper-right quadrant $(i,j) = (m, k-m)$: $(\text{left} + \beta \cdot \text{down})/(\beta + 1)$ $$\mathcal{T}_k(m, k-m) = \frac{\mathcal{T}_{k-1}(m-1, k-m) + \beta_{m,k-m} \cdot \mathcal{T}_{k-1}(m, k-m-1)}{\beta_{m,k-m} + 1}$$ Lower-right quadrant $(i,j) = (m, -(k-m))$: $(\text{left} + \beta \cdot \text{up})/(\beta + 1)$ $$\mathcal{T}_k(m, -(k-m)) = \frac{\mathcal{T}_{k-1}(m-1, -(k-m)) + \beta_{m,-(k-m)} \cdot \mathcal{T}_{k-1}(m, -(k-m)+1)}{\beta_{m,-(k-m)} + 1}$$ Upper-left quadrant $(i,j) = (-m, k-m)$: $(\text{right} + \beta \cdot \text{down})/(\beta + 1)$ $$\mathcal{T}_k(-m, k-m) = \frac{\mathcal{T}_{k-1}(-m+1, k-m) + \beta_{-m,k-m} \cdot \mathcal{T}_{k-1}(-m, k-m-1)}{\beta_{-m,k-m} + 1}$$ Lower-left quadrant $(i,j) = (-m, -(k-m))$: $(\beta \cdot \text{up} + \text{right})/(\beta + 1)$ $$\mathcal{T}_k(-m, -(k-m)) = \frac{\beta_{-m,-(k-m)} \cdot \mathcal{T}_{k-1}(-m, -(k-m)+1) + \mathcal{T}_{k-1}(-m+1, -(k-m))}{\beta_{-m,-(k-m)} + 1}$$
  4. Interior pass-through ($|i|+|j| < k$, $i+j+k$ even): $$\mathcal{T}_k(i,j) = \mathcal{T}_{k-1}(i,j)$$
  5. Interior recurrence ($|i|+|j| < k$, $i+j+k$ odd): $$\mathcal{T}_k(i,j) = \frac{\gamma_{i,j}(\mathcal{T}_k(i-1,j) + \mathcal{T}_k(i+1,j)) + (\mathcal{T}_k(i,j-1) + \mathcal{T}_k(i,j+1))}{\gamma_{i,j} + 1} - \mathcal{T}_{k-1}(i,j)$$ where $\gamma_{i,j}$ is the face weight at position $(i,j)$. Note: $\gamma$ multiplies the horizontal (left/right) neighbors.
Classification of weights: α, β, γ

Given an Aztec diamond with arbitrary edge weights, the T-embedding recurrence uses three types of weights classified by their position in the reduced graph at each level $k$:

  • α (alpha) weightsOn-axis boundary weights: These correspond to faces at positions $(i,j)$ where $|i|+|j| = k$ and either $i=0$ or $j=0$. That is, the four cardinal positions: $$\alpha_R \leftrightarrow (k, 0), \quad \alpha_L \leftrightarrow (-k, 0), \quad \alpha_T \leftrightarrow (0, k), \quad \alpha_B \leftrightarrow (0, -k).$$
  • β (beta) weightsOff-axis boundary weights: These correspond to faces at positions $(i,j)$ where $|i|+|j| = k$ with $i \neq 0$ and $j \neq 0$. These are the diagonal boundary positions: $$\beta_{m, k-m} \text{ for } 1 \leq m \leq k-1 \text{ in each quadrant.}$$
  • γ (gamma) weightsInterior weights: These correspond to faces at positions $(i,j)$ where $|i|+|j| \leq k-1$. These are the interior face weights of the reduced graph.
Extraction from double edges

The α and β weights are extracted during the urban renewal and double edge combination steps of the Aztec diamond graph reduction. After performing:

  1. Gauge transformations (to equalize edges along the boundary)
  2. Degree-2 vertex removal and edge contraction
  3. Urban renewal on the 4-valent faces

the graph develops double edges (pairs of edges connecting the same two vertices). The α and β weights are then computed as ratios of these double edge weights:

$$\alpha = \frac{w_{\text{black} \to \text{white}}}{w_{\text{white} \to \text{black}}}$$

where:

  • Alpha edges: Double edges where both endpoints lie on the boundary (at maximal distance from the origin).
  • Beta edges: Double edges where exactly one endpoint lies on the boundary and one is interior.

The γ weights are simply the face weights at interior positions, stored during the reduction process.

Edge Weight Distributions

This simulation supports several edge weight distributions:

IID Distributions: Each edge weight drawn independently from:

  • Uniform [a, b]: $w \sim \mathrm{Uniform}(a, b)$.
  • Bernoulli: $w = v_1$ with prob. $p$, else $w = v_2$.
  • Exponential: $w \sim \mathrm{Exp}(1)$. (Other rates only scale weights, which doesn't affect T-embeddings.)
  • Pareto (α, x_min): $w = x_{\min} \cdot U^{-1/\alpha}$ where $U \sim \mathrm{Uniform}(0,1)$. Heavy-tailed distribution.
  • Geometric (p): $w \sim \mathrm{Geom}(p)$ with support $\{1, 2, 3, \ldots\}$. Mean = $1/p$.

Gamma Distribution [Duits–Van Peski]: Edges on the bottom of each face have weight $\sim \Gamma(\alpha, 1)$; edges on the right of each face have weight $\sim \Gamma(\beta, 1)$.

Layered Weights (diagonal: [Bufetov–Petrov–Zografos]; straight: [Moulard–Toninelli]): Weight depends on layer index (diagonal $i+j$ or row $y$). Five regimes:

  • Regime 1 (Critical Scaling): $w = v_1 + 2/\sqrt{n}$ with prob. $p_1$, else $w = v_2 - 1/\sqrt{n}$.
  • Regime 2 (Rare Event): $w = v_1$ with prob. $1/\sqrt{n}$, else $w = v_2$.
  • Regime 3 (Bernoulli): $w = v_1$ with prob. $p_1$, else $w = v_2$.
  • Regime 4 (Deterministic): $w = w_1, w_2, w_1, w_2, \ldots$ alternating by layer.
  • Regime 5 (Uniform): $w \sim \mathrm{Uniform}(a, b)$ drawn independently for each layer.

Periodic (k×l): Face weights follow a spatially periodic $k \times l$ pattern, specified via an interactive editor.

3D Visualization: Origami Map

The origami map $\mathcal{O}$ is a companion to the T-embedding. Together, $\mathcal{T}$ and $\mathcal{O}$ define a t-surface $\bigl(\mathrm{Re}(\mathcal{T}), \mathrm{Im}(\mathcal{T}), \mathrm{Re}(\mathcal{O}), \mathrm{Im}(\mathcal{O})\bigr)$ in the Minkowski space $\mathbb{R}^{2,2}$. For uniform weights, the surface lies in $\mathbb{R}^{2,1}$ [CLR2]; for periodic weights with gas regions, it is genuinely four-dimensional and converges to a space-like maximal surface [BNR]. The scaling limit for arbitrary (non-periodic) weights remains an open question.

The 3D view shows a projection: the T-embedding as the $(x,y)$ base and $\mathrm{Re}(\mathcal{O})$ as height $z$.

Im(Origami), matched: The imaginary part $\mathrm{Im}(\mathcal{O})$ gives a second height function, but with different boundary conditions than $\mathrm{Re}(\mathcal{O})$. To compare them, we apply a linear transformation $z = \alpha \cdot \mathrm{Im}(\mathcal{O}) + \beta$ where $\alpha, \beta$ are chosen via least squares to match $\mathrm{Re}(\mathcal{O})$ at the four external corners. This "matched" Im surface can be overlaid with Re to visualize how the two components relate.

References
  • [BNR] T. Berggren, M. Nicoletti, M. Russkikh. Perfect t-embeddings of doubly periodic Aztec diamonds. arXiv:2508.04938 (2025).
  • [CLR2] D. Chelkak, B. Laslier, M. Russkikh. Bipartite dimer model: perfect t-embeddings and Lorentz-minimal surfaces. arXiv:2109.06272 (2021).
  • [CLR1] D. Chelkak, B. Laslier, M. Russkikh. Dimer model and holomorphic functions on t-embeddings of planar graphs. Proc. Lond. Math. Soc. 126(5):1656–1739 (2023). arXiv:2001.11871.
  • [KLRR] R. Kenyon, W. Y. Lam, S. Ramassamy, M. Russkikh. Dimers and circle patterns. Ann. Sci. Éc. Norm. Supér. 55(3):863–901 (2022). arXiv:1810.05616.
⚙️ Configuration
📊 IID Distribution
Each edge weight ~ Uniform[a, b]
📊 T-embedding Visualization
💾 Export Options
|
|
may take minutes
📐 T-graph (T + Origami)
💾 Export T-graph
|
🎲 Random Domino Tiling
|
💾 Export:
Step-by-step visualization and explicit edge and face weights
k = 0
Mathematica verification code for small n

The XX verification formula checks that all interior vertices satisfy XX · γ + 1 = 0:

XX[n1_, n2_, n3_, n4_][z_] := ((z - n1)(z - n3)) / ((n2 - z)(n4 - z))

where n1, n2, n3, n4 are neighbors in CCW order (R, U, L, D). For T_k, always use γ[k] (the face weight at that level).

α/β parameters:
α/β parameters will appear here
T coordinates:
T coordinates will appear here
XX Verification (by level):
XX verification checks will appear here

Acknowledgement: Developed during the reunion conference for the IPAM long program on Geometry, Statistical Mechanics, and Integrability (December 2025). I thank Mikhail Basok, Dmitry Chelkak, and Marianna Russkikh for helpful discussions. I also thank Matthew Nicoletti for providing face-based T-embedding code. Part of this research was performed while the author was visiting the Institute for Pure and Applied Mathematics (IPAM), which is supported by the National Science Foundation (Grant No. DMS-1925919).

T-embedding Performance Benchmark

Runs T-embedding computation for n=10 to n=40, measures time for each, and fits a power law t(n) = c · nα (c in nanoseconds). Uses the current weight selection.


code

(note: parameters in the code might differ from the ones in simulation results below)

Dear colleagues:
Feel free to use code (unless otherwise specified next to the corresponding link), data, and visualizations to illustrate your research in talks and papers, with attribution (CC BY-SA 4.0). Some images are available in very high resolution upon request. I can also produce other simulations upon request - email me at lenia.petrov@gmail.com
This material is based upon work supported by the National Science Foundation under Grant DMS-2153869