A square lattice with an index-8 sublattice. The arrows are the sublattice basis vectors and in units of the lattice constant, and the parallelogram they span is a fundamental domain of the sublattice containing 8 lattice points. Points of the same color are related by sublattice translations, so the 8 colors label the cosets of the sublattice in the lattice.
#import "@preview/cetz:0.5.3": canvas, draw
#import draw: circle, content, line, on-layer
#set page(width: auto, height: auto, margin: 8pt, fill: none)
#canvas({
let spacing = 0.6 // half the lattice constant
// One color per coset of the index-8 sublattice spanned by (2, 1) and (0, 4)
let colors = (
rgb("#4040d9"), // blue
rgb("#90EE90"), // light green
rgb("#006400"), // dark green
rgb("#9ACD32"), // yellow green
rgb("#FFA500"), // orange
rgb("#FF0000"), // red
rgb("#000000"), // black
rgb("#800080"), // purple
)
for ii in range(5) {
for jj in range(8) {
// ii - 2 jj is invariant under both sublattice translations (mod 8)
let color = colors.at(calc.rem-euclid(ii - 2 * jj, colors.len()))
// Flat disc with a darker rim, which survives the site's dark-mode inversion
circle(
(2 * ii * spacing, 2 * jj * spacing),
radius: 0.12,
stroke: color.darken(35%) + 0.4pt,
fill: color,
name: str(ii) + "," + str(jj),
)
}
}
let arrow-style = (mark: (end: "stealth", fill: black, scale: .5), stroke: 1pt)
on-layer(-1, {
line("0,0", "2,1", ..arrow-style)
line("0,0", "0,4", ..arrow-style)
line("2,1", "2,5")
line("0,4", "2,5")
})
// Name the sublattice basis vectors beside their arrows
let label-size = 9pt
let b1-angle = calc.atan(0.5)
content(
(2 * spacing - 0.26 * calc.sin(b1-angle), spacing + 0.26 * calc.cos(b1-angle)),
angle: b1-angle,
text(size: label-size)[$bold(b)_1 = (2, 1)$],
)
content(
(-0.45, 4 * spacing),
angle: 90deg,
text(size: label-size)[$bold(b)_2 = (0, 4)$],
)
content(
(4 * spacing, -0.6),
anchor: "north",
text(size: label-size, align(center)[
arrows: sublattice basis vectors $bold(b)_1, bold(b)_2$ (units of lattice constant) \
parallelogram: fundamental domain holding 8 lattice points \
same color: same coset (related by a sublattice translation)
]),
)
})