12

A pair of hexagonal lattices with one scaled by the square root of a rational number $r = \sqrt{\frac{m}{n}}$ and then rotated will produce a variety of different hexagonal lattices of coincident points.

For the first lattice let

$$x, y = i+\frac{1}{2}j, \ \frac{\sqrt{3}}{2}j$$

and for the second

$$x, y = r\left(k+\frac{1}{2}l\right), \ r\left(\frac{\sqrt{3}}{2}l\right).$$

Per this and this helpful answer the squares of the distances to unit lattice points are given by Loeschian numbers (A003136) equal to $i^2+ij+j^2$ so in this case a point $i, j$ on the first lattice will coincide with a point $k, l$ on the second lattice once rotated by some amount if

$$n(i^2+ij+j^2) = m(k^2+kl+l^2).$$

For example if $m, n = 13, 7$ then both $(i, j) = (5, 6)$ and $(6, 5)$ will coincide with $(k, l) = (5, 3)$ at rotation angles of about 5.2 and 11.2 degrees as given by.

$$\theta = \arctan\left( \frac{\frac{\sqrt{3}}{2}l}{k+\frac{1}{2}l} \right) - \arctan\left( \frac{\frac{\sqrt{3}}{2}j}{i+\frac{1}{2}j} \right)$$

However, while the first solution is part of the hexagonal superlattice built on the much closer point $(i, j), (k, l) = (1, 3), (1, 2)$ the second point represents the shortest possible coincident distance and therefore a far lower density coincident lattice.

Question: Is there a simple test that can be applied to the pairs (5, 6), (3, 5) and (6, 5), (3, 5) (and knowing m, n) that will indicate immediately that one is based on a superlattice of much smaller period but the other represents the shortest distance in a much more sparse coincident lattice?

This answer and this comment below it provide some related tests and might adapted here, but ideally I'm looking for a yes/no test that does not involving testing all points closer.

coincident hexagonal lattices

plotting script: https://pastebin.com/6mwvudt6

uhoh
  • 1,864

1 Answers1

3

(I will use $p,q$ insteaf of your $i,j$, because I will use $i$ for the imaginary unit.)
Set $u := \frac{1+\sqrt{3} i}{2}$. Consider the set $\{a+bu\mid a,b\in\mathbb{Z}\}$. Since $u^2=u-1$, a product of two such numbers belongs to this set as well. I will denote this set $\mathbb{Z}[u]$.[1]

If your first lattice is put on the complex plane, its points will correspond exactly to elements of $\mathbb{Z}[u]$. And since scaling and rotating around the origin correspond to multiplication by a complex number, the points of your second lattice will correspond to numbers of the form $Az_1$, where $A\in \mathbb{Z}[u]$ and $z_1\in\mathbb{C}$ is the number where the point 1 ended up after the rotation and scaling.

In your case, $z_1$ is given by $P=Kz_1$, where $P=p+qu$ and $K=k+lu$ are elements of $\mathbb{Z}[u]$. The coincident points correspond to numbers $P'\in \mathbb{Z}[u]$ which can be represented as $P' = K'z_1$, where $K'\in \mathbb{Z}[u]$. You want to know whether there are such $P'$ with $0<|P'|<|P|$.

Assume that there are and that $P_1 = K_1z_1$ a coincident point with the minimal non-zero absolute value (i.e., closest to the origin). Since the coincident points form a hexagonal lattice, $P$ can be represented as $P=AP_1$, where $A\in\mathbb{Z}[u]$. Then $Kz_1 = AK_1z_1$, i.e., $K = AK_1$.

So if there is a coincident point closer to the origin than $P$, then there are elements $A, P_1, K_1\in \mathbb{Z}[u]$ such that $AP_1 = P$, $AK_1 = K$, and $|A|>1$. The converse is also true: if such $A, P_1, K_1\in \mathbb{Z}[u]$ exist, then $P_1 = K_1z_1$ is a coincident point, and since $|P_1| = \frac{|P|}{|A|}<|P|$, it is closer to the origin than $P$.

Therefore, the thing you want to know is equivalent to the following: given the elements $P=p+qu$ and $K=k+lu$ of $\mathbb{Z}[u]$, do they have a common divisor in $\mathbb{Z}[u]$ whose absolute value is greater than 1? This can be decided using Euclid's algorithm:

  • Set variables $A:= p+qu$ and $B:=k+lu$; if $|A|<|B|$, switch $A$ and $B$ in places.
  • While $B\neq 0$, repeat: Calculate $\frac AB$ [2] and "round" it to the nearest element of $\mathbb{Z}[u]$,[3] let's denote it $D$. Set $B$ to $A-DB$ and $A$ to the old value of $B$.(end of loop)
  • If $|A|=1$ (i.e., if $A$ is one of the numbers $\pm 1, \pm u, \pm(u-1)$), then the numbers $p+qu$ and $k+lu$ have no common divisors in $\mathbb{Z}[u]$ other than $\pm 1, \pm u, \pm(u-1)$; in the terms of your problem, it means that the corresponding coincident point is closest to the origin. Otherwise, there are closer points.

For example, if we start with values $A = 6+5u$ and $B = 5+3u$, then $\frac{A}{B} = \frac{9+u}{7}$; the closest element of $\mathbb{Z}[u]$ is $1$, so the values of $A$ and $B$ change to $5+3u$ and $6+5u - 1(5+3u) = 1+2u$. Now, $\frac{5+3u}{1+2u} = 3-u$, which lies in $\mathbb{Z}[u]$, so the values of $A$ and $B$ change to $1+2u$ and $0$. Since $|1+2u|>1$, we see that there must be a coincident point closer to the origin. And if you apply the algorithm to the starting values $5+6u$ and $5+3u$, you will find that there are no closer coincident points in that case. (I think that the inscriptions on your pictures are wrong: the first one corresponds to $(6,5)\leftrightarrow (5,3)$, and the second one to $(5,6)\leftrightarrow (5,3)$.)


[1] Actually, $\mathbb{Z}[u]$ means the set of all numbers of the form $a_0+a_1u+\dots+a_ku^k$, where $k\in\mathbb{Z}_{\geq 0}$ and $a_0,\dots,a_k\in \mathbb{Z}$; but since $u^2=u-1$, this is the set I described.

[2] Note that for $x,y,z,t\in\mathbb{R}$, $ \frac{x+yu}{z+tu} = \frac{(x+yu)(z+t-tu)}{z^2+zt+t^2} = \frac{x(z+t)+ (y(z+t)-xt)u - ytu^2}{z^2+zt+t^2}= \frac{(x(z+t)+yt) + (yz-xt)u}{z^2+zt+t^2}$.

[3] Nearest in the sense that the absolute value of their difference is smallest. If $x,y\in\mathbb{R}$, then the element of $\mathbb{Z}[u]$ nearest to $x+yu$ is one of $\lfloor x\rfloor + \lfloor y\rfloor u$, $\lfloor x\rfloor + \lceil y\rceil u$, $\lceil x\rceil + \lfloor y\rfloor u$, $\lceil x\rceil + \lceil y\rceil u$, so you need to check only these four numbers.

Litho
  • 4,396
  • This is exciting! I will go through this now. Yes you are also right and the indices are switched in the question: https://i.stack.imgur.com/bHodP.png – uhoh Sep 17 '20 at 09:24
  • I'm not a native speaker of mathematical notation, so this is very instructive and I'm getting there. I'm currently at $$ \text{"since } |P_1| = \frac{|P|}{|A|} \text{..."} $$ and while that certainly seems plausible, how can we know this is true? I don't need a proof, just an "insight boost". – uhoh Sep 17 '20 at 18:40
  • 2
    @uhoh It's a property of absolute value of complex numbers: for $a,b\in \mathbb{C}$, $|ab| = |a||b|$. Since $AP_1 = P$, $|A||P_1| = |P|$. – Litho Sep 17 '20 at 18:47
  • 1
    for your "rounding" inside Euclid; is that an instance of something that's done often in this kind of analysis, or is it somewhat special and/or unusual? – uhoh Sep 17 '20 at 19:21
  • 2
    @uhoh The thing which allows Euclid's algorithm to work is that $\mathbb{Z}[u]$ is a Euclidean domain. I.e., for any $A,B\in \mathbb{Z}[u]$, if $B\neq 0$, then there are $D,R\in\mathbb{Z}[u]$ such that $A=BD+R$ and $|R|^2<|B|^2$. Since $\mathbb{Z}[u]$ is embedded into $\mathbb{C}$, where you can divide by non-zero elements, $|R|=|A-BD|=|B||A/B-D|$, so it follows from the fact that for any $z:=A/B\in\mathbb{C}$, there is $D\in\mathbb{Z}[u]$ such that $|z-D|<1$. I don't know how common these things are, I'm not really familiar with this area. – Litho Sep 18 '20 at 08:01
  • 1
    @uhoh By the way, $D$ doesn't really have to be the closest to $A/B$, it's good as long as $|A/B-D|<1$. – Litho Sep 18 '20 at 08:05
  • 1
    *This is lovely, thank you very much!* Every line you've written is helpful. I apply the tests on $|B|$ and $|A|$ to their integers so there's no floating point problems. Now I can go in step by step and watch in detail what happens. – uhoh Sep 20 '20 at 14:37
  • 1
    You're welcome! – Litho Sep 20 '20 at 16:40
  • sorry to bother, quick question. Comments under the question make me wonder if the "Clifford algebra?" bit might be simply split off as a separate, new question. Since you've posted an answer here, would it be okay with you if I removed that bit from here and asked separately? – uhoh Sep 22 '20 at 00:58
  • 1
    @uhoh Sure, go ahead. – Litho Sep 22 '20 at 07:33
  • Oh! https://en.wikipedia.org/wiki/Eisenstein_integer#Euclidean_domain :-) – uhoh Nov 22 '20 at 22:48
  • @uhoh As I understand, in Python, converting a float to an int always rounds it towards 0, i.e., positive floats are rounded down, but negative floats are rounded up, so int(-2.7) is -2, not -3. In divround, you need to use math.floor(thing) instead of int(thing). – Litho Jan 03 '22 at 14:14
  • @uhoh The thing is, you choose among the wrong four points. If, for example, pfrac=qfrac=-2.9, then pint=qint=-2, and you choose among (-2,-2), (-2,-1), (-1,-2), (-1,-1). The closest of them is (-2,-2), but the actual closest is (-3,-3). – Litho Jan 03 '22 at 14:22
  • Wait, I'll take another look, yes, there's pint, qint = [int(thing) for thing in (pfrac, qfrac)] – uhoh Jan 03 '22 at 14:22
  • Oh, I see! Geez, that would be pretty silly! Okay please feel free to post a short answer there if you like. It's late here and I'm signing off but I'll dig in tomorrow. I think you only need to post that comment as an answer. – uhoh Jan 03 '22 at 14:23
  • 1
    @uhoh Now that I think of it, it should be enough for divround to simply return Point(round(pfrac), round(qfrac)). The result $D$ would not necessarily be the closest Eisenstein integer to $A/B$, but it would be such that $|D-A/B|<1$, which is enough for the algorithm. (Both the "real" and the "$u$-maginary" parts of $D-A/B$ would be between $-0.5$ and $0.5$, so its norm would be at most $\sqrt{0.5^2 + 0.5^2 + 0.5*0.5} = \sqrt{0.75}$.) – Litho Jan 03 '22 at 14:26
  • I'm just starting to write a paper about higher order coincidences in 2D materials and I'd like to use and cite this technique. So far I have not found an implementation of Euclid like this (complex plane with rounding to integers) so I'm thinking this is actually something new. Have you written it up anywhere, or know of something close enough that I could cite? I could also use the Stack Exchange citation (click "Cite" under your post) if that's all there is. – uhoh Dec 07 '22 at 12:04
  • Perhaps this is a known thing and my ignorance of algebraic integers is just getting in the way? I just ran across Using the Euclidean Algorithm to Identify Principal Ideals and their Generators in Quadratic Fields; Felicity A. W. George and some things are starting to look familiar... – uhoh Dec 07 '22 at 12:09
  • 1
    @uhoh I'm not really familiar with this area (and I haven't written any articles on it), but the concept of Euclidean domain is definitely not new. There are many questions about finding GCD of Gaussian integers (i.e., numbers of the form $m+ni$, where $m,n$ are integer) here on MSE; for example, this answer and this (in the second half) describe using Euclid's algorithm for this. Maybe their authors would know some good text for you to cite? – Litho Dec 07 '22 at 18:35
  • Oh, this is exactly what I needed. Somehow I thought you pulled a rabbit out of a hat, but now I see this is a known thing. I'll dig in and see if I can find an original source. Thanks yet again! – uhoh Dec 07 '22 at 22:57