# An algebraic approach to count the number of representations of an integer
by the quadratic form $x^{2}+ay^{2}$ for certain values of $a$

Thanathat Dechakulkamjorn  Department of Mathematics and Computer Science,
Chulalongkorn University, Bangkok, Thailand<EMAIL_ADDRESS>and  Nithi
Rungtanapirom  Department of Mathematics and Computer Science, Chulalongkorn
University, Bangkok, Thailand<EMAIL_ADDRESS>
###### Abstract.

By considering the norm of elements in the ring of integers in
${\mathbb{Q}}(\sqrt{-a})$, we give an algebraic approach to count the number
of integral solutions of diophantine equations of the form $x^{2}+ay^{2}=n$
where $a$ is a Heegner number or $a=27$.

###### Key words and phrases:

diophantine equations, binary quadratic forms

###### 2010 Mathematics Subject Classification:

11D09, 11D45, 11D72

###### Contents

  1. 1 Introduction
  2. 2 Counting the elements of given norm
  3. 3 Counting the number of representations
  4. 4 Applications of Eisenstein integers and the Cubic Reciprocity Law

##  1\. Introduction

The theory of representation of integers by binary quadratic forms has been
studied for a long time. One of interesting problems is to count the number of
representations of a fixed integer by a given binary quadratic form.
Dirichlet’s work [5] dealt with a variation of this problem, namely
representations by the collection of reduced binary quadratic forms of a given
discriminant. Based on this work, Hall [7] derived a formula for the case that
each genus of binary quadratic forms of the given discriminant consists of
exactly one reduced form. Further investigations on the number of
representations by certain single binary quadratic forms are based on an
analytic approach using Epstein zeta functions, theta series or Dirichlet
series among the others. The latest investigations have been done by Kaplan
and Williams [9]; Sun and Williams [11]; Berkovich and Yesilyurt [2]; Bagis
and Glaser [1]; etc.

This paper focuses on an algebraic approach for this problem in several cases.
The key tool for our approach is the ring of integers ${\mathcal{O}}_{\\!-a}$
in ${\mathbb{Q}}(\sqrt{-a})$. Such an approach has been employed, for
instance, in [3] to find an explicit formula for primitive solutions of the
equation $x^{2}+y^{2}=n$ using Gaussian integers. More precisely, the
expression $x^{2}+ay^{2}$ should be interpreted as the norm of $x+y\sqrt{-a}$,
so that one may first consider instead counting the number of elements of
${\mathcal{O}}_{\\!-a}$ of the given norm. As we shall see in Proposition 2.1,
this works well if $a$ is a Heegner number, or equivalently, if
${\mathcal{O}}_{\\!-a}$ is a unique factorization domain. It is known that a
Heegner number is one of the following numbers:

$1,2,3,7,11,19,43,67,163,$

see [10]. The slight difficulty for $a\geq 3$ is ${\mathcal{O}}_{\\!-a}$ also
contains linear combinations of $1$ and $\sqrt{-a}$ with half-integer
coefficients. Consequently, a more careful investigation is necessary. It
turns out that the case $a=27$ can also be done by this approach. To
summarize, we obtain the following results:

######  Theorem A.

Let $n$ be a natural number. For each natural number $a$, let $X(n,a)$ denote
the set of integral solutions to the equation $x^{2}+ay^{2}=n$.

  1. (I)

(Theorem 3.1) For $a=1,2$, we have

$|X(n,1)|=4\sum_{c\mid
n}\left(\frac{-4}{c}\right)\quad\text{and}\quad|X(n,2)|=2\sum_{c\mid
n}\left(\frac{-2}{c}\right).$

  2. (II)

(Theorem 4.1) For $a=3$, we have the following results:

    1. (a)

If $n$ is even, then
$\displaystyle|X(n,3)|=6\displaystyle\sum_{c|n}\left(\frac{c}{3}\right)$.

    2. (b)

If $n$ is odd, then
$\displaystyle|X(n,3)|=2\displaystyle\sum_{c|n}\left(\frac{c}{3}\right)$.

  3. (III)

(Theorem 3.2) For $a=7$, we have the following results:

    1. (a)

If $4\mid n$, then
$\displaystyle|X(n,7)|=2\displaystyle\sum_{c|\frac{n}{4}}\left(\frac{c}{7}\right)$.

    2. (b)

If $n$ is even but $4\nmid n$, then $X(n,7)=\emptyset$.

    3. (c)

If $n$ is odd, then
$\displaystyle|X(n,7)|=2\displaystyle\sum_{c|n}\left(\frac{c}{7}\right)$.

  4. (IV)

(Theorem 3.6) For every Heegner number $a\geq 11$, we have the following
results:

    1. (a)

If $n$ is even, then $\displaystyle|X(n,a)|=|Y(n,a)|$.

    2. (b)

If $n$ is odd, then

$|X(n,a)|=\frac{1}{3}\left[1+2\cdot\frac{(\tau(n_{q})|3)}{\tau(n_{q})}\right]\cdot|Y(n,a)|,$

where $n_{q}$ denotes the product of all prime factors (including
multiplicity) of $n$ which are quadratic residues modulo $a$ but not
expressible as $x^{2}+ay^{2}$ for any integers $x,y$.

  5. (V)

(Theorem 4.3) For $a=27$, we have the following results:

    1. (a)

If $3\mid n$, then $X(a,27)\neq\emptyset$ only if $9\mid n$. In this case, we
have

$|X(n,27)|=|X(\tfrac{n}{9},3)|.$

    2. (b)

If $3\nmid n$ but $2\mid n$, then

$|X(n,27)|=\frac{1}{3}|X(n,3)|.$

    3. (c)

If $\gcd(6,n)=1$, then

$|X(n,27)|=\frac{1}{3}\left[1+2\cdot\frac{(\tau(n_{q})|3)}{\tau(n_{q})}\right]\cdot|X(n,3)|,$

where $n_{q}$ denotes the product of all prime factors $q$ (including
multiplicity) of $n$ such that $q\equiv 1\pmod{3}$ and $2$ is not a cubic
residue modulo $q$.

This paper is organized as follows: Section 2 deals with a related problem,
namely counting the elements of given norm. The problem of our interest will
be discussed in Section 3 except the cases $a=3,27$. These two cases will be
discussed in Section 4, where the ring of Eisenstein integers with primitive
third roots of unity is involved.

#### Notation

The ring of integers in ${\mathbb{Q}}(\sqrt{-a})$, where $a$ is a square-free
natural number, will be denoted by

${\mathcal{O}}_{\\!-a}=\begin{cases}{\mathbb{Z}}[\sqrt{-a}]&\text{if $a\equiv
1,2\pmod{4}$,}\\\ {\mathbb{Z}}[\frac{-1+\sqrt{-a}}{2}]&\text{if $a\equiv
3\pmod{4}$.}\end{cases}$

We will also write
$\lambda_{a}:=\frac{-1+\sqrt{-a}}{2}\in{\mathcal{O}}_{\\!-a}$ if $a\equiv
3\bmod{4}$. The conjugate of $z=x+y\sqrt{-a}\in{\mathbb{Q}}(\sqrt{-a})$, where
$x,y\in{\mathbb{Q}}$, will be denoted by $\overline{z}:=x-y\sqrt{-a}$. The
norm of $z$ will be denoted by $N(z):=z\overline{z}=x^{2}+ay^{2}$.

In order to count the number of representations, we introduce the following
sets for natural numbers $a$ and $n$:

$\displaystyle X(n,a)$
$\displaystyle:=\\{(x,y)\in{\mathbb{Z}}\times{\mathbb{Z}}\ |\
x^{2}+ay^{2}=n\\}\quad\text{and}$ $\displaystyle Y(n,a)$
$\displaystyle:=\left\\{z\in{\mathcal{O}}_{\\!-a}\ \big{|}\ N(z)=n\right\\}.$

Both sets are connected by the map

$\varphi_{n,a}:X(n,a)\mapsto Y(n,a),\ (x,y)\mapsto x+y\sqrt{-a}$

as to be discussed in Sections 3 and 4. Finally, $\tau(n)$ denotes as usual
the number of positive divisors of $n$.

##  2\. Counting the elements of given norm

In order to count the number of elements of $Y(n,a)$, recall the Kronecker
symbol $\left(\frac{a}{n}\right)$ or $(a|n)$, which is a generalization of the
Legendre symbol. It is multiplicative in the upper and lower arguments. Note
that if $d$ is a square-free integer and $D$ is the discriminant of
${\mathbb{Q}}(\sqrt{d})/{\mathbb{Q}}$, the following holds for every prime
number $p$:

$\left(\frac{D}{p}\right)=\begin{cases}1&\text{if $p$ splits in
${\mathbb{Q}}(\sqrt{d})/{\mathbb{Q}}$,}\\\ 0&\text{if $p$ is ramified in
${\mathbb{Q}}(\sqrt{d})/{\mathbb{Q}}$,}\\\ -1&\text{if $p$ is inert in
${\mathbb{Q}}(\sqrt{d})/{\mathbb{Q}}$.}\end{cases}$

######  Proposition 2.1.

Let $a$ be a Heegner number. Furthermore, let $D$ be the discriminant of
${\mathbb{Q}}(\sqrt{-a})/{\mathbb{Q}}$. The following formula holds for all
natural numbers $n$:

$|Y(n,a)|=|{\mathcal{O}}_{\\!-a}^{\times}|\cdot\sum_{c\mid
n}\left(\frac{D}{c}\right).$ (2.1)

In particular, if $a\equiv 3\pmod{4}$, then

$|Y(n,a)|=|{\mathcal{O}}_{\\!-a}^{\times}|\cdot\sum_{c\mid
n}\left(\frac{c}{a}\right).$ (2.2)

Note that $|{\mathcal{O}}_{\\!-a}^{\times}|=2$ for all square-free natural
numbers $a$ except $a=1$, where ${\mathcal{O}}_{\\!-1}^{\times}$ is the group
of the fourth roots of unity, and $a=3$, where
${\mathcal{O}}_{\\!-3}^{\times}$ is the group of the sixth roots of unity.

###### Proof.

For simplicity, write $u:=|{\mathcal{O}}_{\\!-a}^{\times}|$. Consider the
function

$f:\mathbb{N}\rightarrow\mathbb{Q},\ n\mapsto f(n):=\frac{1}{u}|Y(n,a)|.$

We want to show that $f$ is multiplicative. It is evident that $f(1)=1$. Now
let $m,n\in\mathbb{N}$ be such that $\gcd(m,n)=1$. Consider the mapping

$h:Y(m,a)\times Y(n,a)\to Y(mn,a),\ (z_{1},z_{2})\mapsto z_{1}z_{2}.$

This is well-defined since the norm on ${\mathcal{O}}_{\\!-a}$ is
multiplicative. Furthermore, the uniqueness of factorization in
${\mathcal{O}}_{\\!-a}$ implies that each $z\in Y(mn,a)$ can be factored as
product of two elements of norms $m$ and $n$ uniquely up to association. Hence
$h$ is a $u$-to-one mapping, implying that

$|Y(m,a)|\cdot|Y(n,a)|=u\cdot|Y(mn,a)|.$

This proves the multiplicativity of $f$. Now we compute $|Y(a,p^{k})|$ for
each prime number $p$ and $k\in\mathbb{N}$ as follows:

  1. Case 1:

$(D|p)=0$.
In this case, there is exactly one prime element $\pi\in{\mathcal{O}}_{\\!-a}$
of norm $p$ up to association. This implies that every element in
${\mathcal{O}}_{\\!-a}$ of norm $p^{k}$ is an associate of $\pi^{k}$. This
implies that $|Y(a,p^{k})|=u$.

  2. Case 2:

$(D|p)=1$.
In this case, there are exactly two prime elements
$\pi_{1},\pi_{2}\in{\mathcal{O}}_{\\!-a}$ of norm $p$ up to association. This
implies that every element in ${\mathcal{O}}_{\\!-a}$ of norm $p^{k}$ is an
associate of $\pi_{1}^{j}\pi_{2}^{k-j}$ for some $j\in\\{0,1,\ldots,k\\}$.
This implies that $|Y(a,p^{k})|=u(k+1)$.

  3. Case 3:

$(D|p)=-1$.
In this case, $p$ remains prime in ${\mathcal{O}}_{\\!-a}$ and has norm
$p^{2}$. Hence there exists an element of norm $p^{k}$ if and only if $k$ is
even. In this case, such an element is an associate of $p^{k/2}$. This implies
that $|Y(a,p^{k})|=u$ if $k$ is even and $|Y(a,p^{k})|=0$ if $k$ is odd.

From all the three cases, we have

$f(p^{k})=\sum_{j=0}^{k}\left(\frac{D}{p}\right)^{j}=\left[\mathbf{1}*\left(\frac{D}{\cdot}\right)\right](p^{k}),$

where $*$ denotes the Dirichlet convolution of two arithmetic functions. Hence
(2.1) follows from the multiplicativity of both $f$ and the convolution
$\mathbf{1}*\left(\frac{D}{\cdot}\right)$. The formula (2.2) then follows from
the reciprocity law for the Kronecker symbol. ∎

##  3\. Counting the number of representations

We now count the number of elements of

$X(n,a)=\\{(x,y)\in{\mathbb{Z}}\times{\mathbb{Z}}\ |\ x^{2}+ay^{2}=n\\}.$

An important ingredient is to consider the mapping

$\varphi_{n,a}:X(n,a)\mapsto Y(n,a),\ (x,y)\mapsto x+y\sqrt{-a}.$ (3.1)

It is easily seen that $\varphi_{n,a}$ is well-defined and injective. The
surjectivity holds if every element of $Y(n,a)$ is of the form $b+c\sqrt{-a}$
for some $b,c\in{\mathbb{Z}}$ (i.e. $b$ and $c$ are not half of odd integers).
This is particularly the case if
${\mathcal{O}}_{\\!-a}={\mathbb{Z}}[\sqrt{-a}]$, i.e. $a\equiv 1,2\pmod{4}$.
The only such Heegner numbers are $1$ and $2$. Hence we get the following
result:

######  Theorem 3.1.

For all natural numbers $n$, we have

$|X(n,1)|=4\sum_{c\mid
n}\left(\frac{-4}{c}\right)\quad\text{and}\quad|X(n,2)|=2\sum_{c\mid
n}\left(\frac{-2}{c}\right).$

###### Proof.

This follows from the observation above together with Proposition 2.1 and the
fact that $(-8|\delta)=(-2|\delta)^{3}=(-2|\delta)$ for every
$\delta\in{\mathbb{Z}}$. ∎

If $a$ is a Heegner number such that $a\geq 3$, then necessarily $a\equiv
3\pmod{4}$, which implies that
${\mathcal{O}}_{\\!-a}={\mathbb{Z}}[\lambda_{a}]$, where
$\lambda_{a}:=\frac{-1+\sqrt{-a}}{2}$. Consequently, the map $\varphi_{n,a}$
defined in (3.1) may not be surjective. The case $a=3$ leads to the ring of
Eisenstein integers, which contains primitive third roots of unity. Hence this
case needs to be discussed separately and will be postponed to Section 4.
Instead, we will discuss first the cases $a=7$, where $2$ splits completely in
${\mathcal{O}}_{\\!-a}$, and $a\geq 11$, where $2$ remains prime in
${\mathcal{O}}_{\\!-a}$.

###  3.1. The case $a=7$

The number of representations by the quadratic form $x^{2}+7y^{2}$ can be
counted as follows:

######  Theorem 3.2.

Let $n$ be a natural number.

  1. (a)

If $4\mid n$, then
$\displaystyle|X(n,7)|=2\displaystyle\sum_{c|\frac{n}{4}}\left(\frac{c}{7}\right)$.

  2. (b)

If $n$ is even but $4\nmid n$, then $X(n,7)=\emptyset$.

  3. (c)

If $n$ is odd, then
$\displaystyle|X(n,7)|=2\displaystyle\sum_{c|n}\left(\frac{c}{7}\right)$.

###### Proof.

We first treat the case $n$ is even. Observe that for any $(x,y)\in X(7,n)$,
we have $x\equiv y\pmod{2}$. Consequently, if $X(7,n)$ contains an element
$(x,y)$, then $n=x^{2}+7y^{2}\equiv 0\pmod{4}$. This proves (b). In order to
prove (a), observe that if $4\mid n$, there is a bijection

$X(n,7)\to Y(\tfrac{n}{4},7),\ (x,y)\mapsto\tfrac{x+y}{2}+y\lambda_{7}.$

This together with Proposition 2.1 proves (a).

Now we come to the case $n$ is odd and claim that the map $\varphi_{n,7}$ from
(3.1) is bijective. To see the surjectivity, observe that if
$z=a+b\lambda_{7}\in Y(7,n)$, then

$n=N(z)=a^{2}-ab+2b^{2}\equiv a(a-b)\pmod{2}.$

This implies that $a$ and $ab$ are odd. Hence $b$ is even, i.e. $b=2y$ for
some $y\in{\mathbb{Z}}$. Consequently, $z=(a-y)+y\sqrt{-7}=\varphi(a-y,y)$.
This together with Proposition 2.1 proves (c). ∎

###  3.2. The case $a\geq 11$

For the remaining case, we have ${\mathcal{O}}_{\\!-a}^{\times}=\\{\pm 1\\}$
and $2$ remains prime in ${\mathcal{O}}_{\\!-a}$. Hence
${\mathcal{O}}_{\\!-a}/(2)$ is a field with four residue classes represented
by $0,1,\lambda_{a}$ and $\lambda_{a}^{2}\equiv 1+\lambda_{a}\bmod 2$.
Consequently, the elements of $X(n,a)$ will be enumerated differently from the
case $a=7$. We begin with the following observation:

######  Lemma 3.3.

Let $a$ be a Heegner number such that $a\geq 11$ and $p$ be a prime number
which splits completely in ${\mathcal{O}}_{\\!-a}$. Then $p$ can be written as
$x^{2}+ay^{2}$ for some $x,y\in{\mathbb{Z}}$ if and only if its prime factors
in ${\mathcal{O}}_{\\!-a}$ are congruent to $1$ modulo $2$.

###### Proof.

Let $\pi=b+c\lambda_{a}$ be a prime factor of $p$. Then $p=\pi\overline{\pi}$
with $\overline{\pi}=b+c\overline{\lambda_{a}}=(b-c)-c\lambda_{a}$. If both
$\pi$ and $\overline{\pi}$ are congruent to $1$ modulo $2$, then $2\mid c$,
say $c=2v$ for some $v\in{\mathbb{Z}}$, implying that
$p=N(b+2v\lambda_{a})=(b-v)^{2}+av^{2}$. Conversely, if
$p=x^{2}+ay^{2}=(x+y\sqrt{-a})(x-y\sqrt{-a})$ for some $x,y\in{\mathbb{Z}}$,
then $b+c\lambda_{a}=\pm x\pm y\sqrt{-a}=\pm x\pm(y+2y\lambda_{a})$, implying
that $c=\pm 2y$, i.e. $\pi,\overline{\pi}\equiv 1\pmod{2}$ as desired. ∎

######  Example 3.4.

Consider $a=11$ and $p=5$. Since $5$ is a quadratic residue modulo $11$, it
follows that $5$ splits completely in ${\mathcal{O}}_{\\!-11}$. In fact,
$5=(2+\lambda_{11})(2+\overline{\lambda_{11}})$. Its prime factors in
${\mathcal{O}}_{\\!-11}$, namely $2+\lambda_{11}$ and
$2+\overline{\lambda_{11}}=1-\lambda_{11}$ are both not congruent to $1$
modulo $2$. This corresponds to the fact that $5$ is not expressible as
$x^{2}+11y^{2}$ for any $x,y\in{\mathbb{Z}}$ as can be easily seen.

######  Lemma 3.5.

Let $a$ be a square-free natural number congruent to $3$ modulo $8$ and $n$ be
an even natural number. Then $\\#X(n,a)=\\#Y(n,a)$.

###### Proof.

Consider the map $\varphi_{n,a}$ defined in (3.1). It is easy to see that
$\varphi_{n,a}$ is well-defined and injective. To see the surjectivity, let
$z\in Y(n,a)$. Then $2\mid n=N(z)=z\overline{z}$. Since $2$ remains prime in
${\mathcal{O}}_{\\!-a}$ (note that this does not require the uniqueness of
factorization in ${\mathcal{O}}_{\\!-a}$), it follows that $2\mid z$ or
$2\mid\overline{z}$, but the latter case also implies that $2\mid z$. Hence
there are $b,c\in{\mathbb{Z}}$ such that
$z=2(b+c\lambda_{a})=\varphi_{n,a}(2b-c,c)$ as desired. ∎

######  Theorem 3.6.

Let $n$ be a natural number and $a$ be a Heegner number such that $a\geq 11$.

  1. (a)

If $n$ is even, then $\displaystyle|X(n,a)|=|Y(n,a)|$.

  2. (b)

If $n$ is odd, then

$|X(n,a)|=\frac{1}{3}\left[1+2\cdot\frac{(\tau(n_{q})|3)}{\tau(n_{q})}\right]\cdot|Y(n,a)|,$
(3.2)

where $n_{q}$ denotes the product of all prime factors (including
multiplicity) of $n$ which are quadratic residues modulo $a$ but not
expressible as $x^{2}+ay^{2}$ for any integers $x,y$.

Note that the results from [9, Cor. 1 and 3] are contained in (a).

######  Example 3.7.

Let $a=11$ and $n=437805=3^{4}\cdot 5\cdot 23\cdot 47$. We see that
$47=6^{2}+11\cdot 1^{2}$ and $3,5,23$ are the prime factors of $n$ which are
quadratic residues modulo $11$ but not expressible as $x^{2}+11y^{2}$. This
implies that $|Y(n,a)|=2\tau(n)=80$ and $n_{q}=3^{4}\cdot 5\cdot 23$, i.e.
$\tau(n_{q})=20$. Therefore,

$|X(n,a)|=\frac{1}{3}\left[1+2\cdot\frac{(20|3)}{20}\right]\cdot 80=24$

In fact, a computation shows that

$X(n,a)=\left\\{\begin{array}[]{c}(\pm 78,\pm 609),(\pm 114,\pm 543),(\pm
126,\pm 513),\\\ (\pm 166,\pm 367),(\pm 182,\pm 271),(\pm 198,\pm
81)\end{array}\right\\}.$

###### Proof of Theorem 3.6.

The case $n$ is even follows from Lemma 3.5. Now assume that $n$ is odd.
Following the proof of loc. cit., determining $|X(n,a)|$ amounts to counting
the number of elements of $Y(n,a)$ of the form
$x+y\sqrt{-a}=(x-y)+2y\lambda_{a}$ for some $x,y\in{\mathbb{Z}}$, or
equivalently, those congruent to $1$ modulo $2{\mathcal{O}}_{\\!-a}$. To this
end, fix a set ${\mathcal{P}}$ of representatives of the association classes
of prime elements of ${\mathcal{O}}_{\\!-a}$ which is stable under
conjugation. For each $z\in Y(n,a)$, consider its prime factorization (note
that $a$ is necessarily a prime integer and is ramified in
${\mathbb{Q}}(\sqrt{-a})/{\mathbb{Q}}$):

$z=\varepsilon(\sqrt{-a})^{\delta}\prod_{i=1}^{l}\Bigl{(}\pi_{i}^{\alpha_{i}}\overline{\pi}_{i}^{\alpha^{\prime}_{i}}\Bigr{)}\prod_{j=1}^{m}\Bigl{(}\rho_{j}^{\beta_{j}}\overline{\rho}_{j}^{\beta^{\prime}_{j}}\Bigr{)}\prod_{k=1}^{s}r_{k}^{\gamma_{k}},$
(3.3)

where $\varepsilon\in{\mathcal{O}}_{\\!-a}^{\times}$;
$(\pi_{i},\bar{\pi}_{i})$ are conjugate pairs of primes in ${\mathcal{P}}$
dividing prime numbers $p_{i}$ which can be written as $x^{2}+ay^{2}$;
$(\rho_{j},\overline{\rho}_{j})$ are conjugate pairs of primes in
${\mathcal{P}}$ dividing prime numbers $q_{j}$ which are quadratic residues
modulo $a$ but not expressible as $x^{2}+ay^{2}$ such that
$\rho_{j}\equiv\lambda_{a}^{2}$ and hence
$\overline{\rho}_{j}\equiv\lambda_{a}\bmod{2}$; and $r_{k}$ are prime numbers
that are not quadratic residues modulo $a$. Taking norm and comparing this
with the prime factorization of $n$ yields

$\delta=v_{a}(n),\quad\alpha_{i}+\alpha_{i}^{\prime}=v_{p_{i}}(n),\quad\beta_{j}+\beta_{j}^{\prime}=v_{q_{j}}(n)\quad\text{and}\quad
2\gamma_{k}=v_{r_{k}}(n),$

where $v_{p}(n)$ denotes the $p$-adic valuation of $n$, i.e. the exponent of
the highest power of $p$ that divides $n$. This means that the values of
$\delta$ and $\gamma_{k}$’s are fixed and
$0\leq\alpha_{i},\alpha_{i}^{\prime}\leq v_{p_{i}}(n)$ for all $i$ and
$0\leq\beta_{j},\beta_{j}^{\prime}\leq v_{q_{j}}(n)$ for all $j$. Furthermore,
reducing (3.3) modulo $2$ yields

$1\equiv
z\equiv\prod_{j}\lambda_{a}^{2\beta_{j}+\beta_{j}^{\prime}}=\prod_{j}\lambda_{a}^{2\beta_{j}+v_{q_{j}}(n)-\beta_{j}}=\lambda_{a}^{\sum_{j}(v_{q_{j}}(n)+\beta_{j})}\pmod{2}.$

This means that, provided that $2\mid v_{r}(n)$ for all primes $r$ which
remain prime in ${\mathcal{O}}_{\\!-a}$, we have

$|X(n,a)|=2\prod_{i=1}^{l}\bigl{(}v_{p_{i}}(n)+1\bigr{)}\cdot\bigl{|}T(v_{q_{1}}(n),\ldots,v_{q_{m}}(n))\bigr{|}$
(3.4)

where

$T(v_{1},\ldots,v_{m}):=\Biggl{\\{}(b_{1},\ldots,b_{m})\in{\mathbb{N}}_{0}^{m}\
\bigg{|}\ b_{j}\leq v_{j}\ \text{and}\ \sum_{j=1}^{m}(v_{j}+b_{j})\equiv
0\bmod{3}\Biggr{\\}}.$ (3.5)

To determine the cardinality of $T(v_{1},\ldots,v_{m})$, observe that it is
equal to the constant term of the remainder in the polynomial division of

$F_{(v_{1},\ldots,v_{m})}(x):=\prod_{j=1}^{m}G_{v_{j}}(x)$

by $x^{3}-1$, where $G_{v}(x):=x^{v}+x^{v+1}+\cdots+x^{2v}$. To compute this,
write

$F_{(v_{1},\ldots,v_{m})}(x)=Q(x)(x^{3}-1)+(A+Bx+Cx^{2}),$ (3.6)

where $Q(x)\in{\mathbb{Z}}[x]$ and $A,B,C\in{\mathbb{Z}}$. Denote by
$\omega\in{\mathbb{C}}$ a primitive third root of unity. Evaluating (3.6) in
$x$ at $1,\omega,\omega^{2}$ and summing all three obtained equations yields

$3A=F_{(v_{1},\ldots,v_{m})}(1)+F_{(v_{1},\ldots,v_{m})}(\omega)+F_{(v_{1},\ldots,v_{m})}(\omega^{2}).$

On the other hand, we have $G_{v}(1)=v+1$ and
$G_{v}(\omega)=G_{v}(\omega)=r(v)\in\\{-1,0,1\\}$ such that $v+1\equiv
r(v)\pmod{3}$. Note that $r(v)$ is exactly the Legendre symbol of $v+1$ over
$3$. This implies that

$|T(v_{1},\ldots,v_{m})|=A=\frac{1}{3}\left[V+2\left(\frac{V}{3}\right)\right],\quad\text{where}\
V:=\prod_{j=1}^{m}(v_{j}+1).$ (3.7)

Hence (3.2) follows from (3.4) and (3.7) in combination with the observation
that if $2\mid v_{r}(n)$ for all primes $r$ which remain prime in
${\mathcal{O}}_{\\!-a}$, then

$Y(n,a)=2\prod_{i=1}^{l}\bigl{(}v_{p_{i}}(n)+1\bigr{)}\prod_{j=1}^{m}\bigl{(}v_{q_{j}}(n)+1\bigr{)},$

which can be deduced from Proposition 2.1. ∎

##  4\. Applications of Eisenstein integers and the Cubic Reciprocity Law

The special feature of the case $a=3$ is that ${\mathcal{O}}_{\\!-3}^{\times}$
is exactly the group of the sixth roots of unity, whereas
${\mathcal{O}}_{\\!-a}$ for $a>3$ consists of only $1$ and $-1$. Hence the
discussion needs to be done separately. In what follows, we will write
$\omega:=\lambda_{3}\in{\mathcal{O}}_{\\!-3}$. This is a primitive third root
of unity and satisfies $1+\omega+\omega^{2}=0$.

######  Theorem 4.1.

Let $n$ be a natural number.

  1. (a)

If $n$ is even, then
$\displaystyle|X(n,3)|=6\displaystyle\sum_{c|n}\left(\frac{c}{3}\right)$.

  2. (b)

If $n$ is odd, then
$\displaystyle|X(n,3)|=2\displaystyle\sum_{c|n}\left(\frac{c}{3}\right)$.

###### Proof.

We first treat the case $n$ is even and claim that the map $\varphi_{n,3}$
from (3.1) is bijective. To see the surjectivity, observe that for all $z\in
Y(n,a)$, we have $2\mid N(z)=z\overline{z}$. Since $2$ remains prime in
${\mathcal{O}}_{\\!-3}$ and $2\mid z$ if and only if $2\mid\overline{z}$, it
follows that $2\mid z$, i.e. $z=2a+2b\omega=\varphi_{n,3}(2a-b,b)$ for some
$a,b\in{\mathbb{Z}}$. Combining this result with Proposition 2.1 yields

$|X(n,3)|=|Y(n,3)|=6\displaystyle\sum_{c|n}\left(\frac{c}{3}\right)$

We now come to the case $n$ is odd. The set $Y(n,a)$ may be partitioned into
subsets of the form $\\{z,z\omega,z\omega^{2}\\}$, i.e. orbits under the
action of $\\{1,\omega,\omega^{2}\\}$ given by the multiplication. Now
$\\{1,\omega,\omega^{2}\\}$ is a reduced residue system in
${\mathcal{O}}_{\\!-3}$ modulo $2$. Hence for each $z\in Y(n,a)$, the
$z,z\omega,z\omega^{2}$ are all different modulo $2$ since $\gcd(2,z)=1$.
Hence exactly one of them is congruent to $1$, i.e. of the form
$a+2b\omega=\varphi(a-b,b)$ for some $a,b\in{\mathbb{Z}}$. Combining this
result with Proposition 2.1 yields

$|X(n,3)|=\frac{1}{3}|Y(n,3)|=2\displaystyle\sum_{c|n}\left(\frac{c}{3}\right)\qed$

We conclude with the case $a=27$, in which also the Cubic Reciprocity Law is
involved. To this end, observe first that [8, Prop. 9.3.5] each association
class of prime elements of ${\mathcal{O}}_{\\!-3}$ not dividing $3$ contains
exactly one primary prime, by which we mean a prime element
$\pi\in{\mathcal{O}}_{\\!-3}$ congruent to $2$ modulo $3$, i.e.
$\pi=a+b\omega$ for some integers $a,b$ such that $a\equiv 2$ and $b\equiv
0\bmod 3$.

######  Theorem 4.2.

Let $p$ be a prime number congruent to $1$ modulo $3$. The following are
equivalent:

  1. (1)

There are integers $x,y$ such that $p=x^{2}+27y^{2}$.

  2. (2)

$2$ is a cubic residue modulo $p$.

  3. (3)

If $\pi\in{\mathcal{O}}_{\\!-3}$ is a primary prime dividing $p$, then
$\pi\equiv 1\pmod{2}$.

###### Proof.

[8, Prop. 9.6.1-2] ∎

######  Theorem 4.3.

Let $n$ be a natural number.

  1. (a)

If $3\mid n$, then $X(a,27)\neq\emptyset$ only if $9\mid n$. In this case, we
have

$|X(n,27)|=|X(\tfrac{n}{9},3)|.$

  2. (b)

If $3\nmid n$ but $2\mid n$, then

$|X(n,27)|=\frac{1}{3}|X(n,3)|.$

  3. (c)

If $\gcd(6,n)=1$, then

$|X(n,27)|=\frac{1}{3}\left[1+2\cdot\frac{(\tau(n_{q})|3)}{\tau(n_{q})}\right]\cdot|X(n,3)|,$

where $n_{q}$ denotes the product of all prime factors $q$ (including
multiplicity) of $n$ such that $q\equiv 1\pmod{3}$ and $2$ is not a cubic
residue modulo $q$.

Note that this result agrees with [2, Thm. 6.1].

###### Proof.

We begin with the case $3\mid n$. Observe that if $(x,y)\in X(27,n)$, then $3$
divides $n-27y^{2}=x^{2}$. Hence $x=3v$ for some $v\in{\mathbb{Z}}$. In
particular, if $X(27,n)$ contains an element $(x,y)=(3v,y)$, then
$n=9v^{2}+27y^{2}$, i.e. $9\mid n$ and $v^{2}+3y^{2}=\frac{n}{9}$. This yields
a bijection between $X(n,27)$ and $X(\frac{n}{9},3)$, which proves (a).

In order to treat the case $3\nmid n$, observe first that the map

$\psi:X(n,27)\to Y(n,3),\ (x,y)\mapsto x+3y\sqrt{-3}.$ (4.1)

is well-defined and injective. Furthermore, $z+b\omega\in Y(n,3)$ lies in the
image of $\psi$ if and only if $6\mid b$, i.e. $z\equiv\pm 1,\pm 2\bmod{6}$

For the case $2\mid n$, i.e. $\gcd(6,n)=2$, we claim that for each $z\in
Y(n,3)$, exactly one of $z,z\omega,z\omega^{2}$ is in the image of $\psi$. In
fact, the condition $3\nmid n$ and $2\mid n$ implies that $(1-\omega)\nmid z$
and $2\mid z$. Consequently, $\gcd(z,6)=\gcd(z,2(1-\omega)^{2})=2$. Hence $z$
is congruent to exactly one of the following elements modulo $6$:

$\pm 2,\pm 2\omega,\pm 2\omega^{2}=\mp 2\mp 2\omega.$

This implies that exactly one of $z,z\omega,z\omega^{2}$ is of the form
$a+b\omega$ for some $a,b\in{\mathbb{Z}}$ such that $a\equiv\pm 2\pmod{6}$ and
$6\mid b$. Therefore $|Y(n,3)|=3|X(n,27)|$, which proves (b) in combination
with Theorem 4.1.

We now come to the case $\gcd(6,n)=1$. For each $z\in Y(n,3)$, consider its
prime factorization

$z=\varepsilon\prod_{i=1}^{l}\Bigl{(}\pi_{i}^{\alpha_{i}}\overline{\pi}_{i}^{\alpha^{\prime}_{i}}\Bigr{)}\prod_{j=1}^{m}\Bigl{(}\rho_{j}^{\beta_{j}}\overline{\rho}_{j}^{\beta^{\prime}_{j}}\Bigr{)}\prod_{k=1}^{s}r_{k}^{\gamma_{k}},$
(4.2)

where $\varepsilon\in{\mathcal{O}}_{\\!-3}^{\times}=\\{\pm
1,\pm\omega,\pm\omega^{2}\\}$; $(\pi_{i},\bar{\pi}_{i})$ are conjugate pairs
of primary primes dividing prime numbers $p_{i}$ such that $\pi_{i}\equiv
1\bmod 2$; $(\rho_{j},\overline{\rho}_{j})$ are conjugate pairs of primary
primes dividing prime numbers $q_{j}$ such that $\rho_{j}\equiv\omega^{2}$ and
hence $\overline{\rho}_{j}\equiv\omega\bmod{2}$; and $r_{k}$ are prime numbers
that are not quadratic residues modulo $3$. Taking norm and comparing this
with the prime factorization of $n$ yields

$\alpha_{i}+\alpha_{i}^{\prime}=v_{p_{i}}(n),\quad\beta_{j}+\beta_{j}^{\prime}=v_{q_{j}}(n)\quad\text{and}\quad
2\gamma_{k}=v_{r_{k}}(n),$

i.e. the values of $\gamma_{k}$’s are fixed and
$0\leq\alpha_{i},\alpha_{i}^{\prime}\leq v_{p_{i}}(n)$ for all $i$ and
$0\leq\beta_{j},\beta_{j}^{\prime}\leq v_{q_{j}}(n)$ for all $j$. Furthermore,
reducing (4.2) modulo $3$ yields

$\pm 1\equiv
z\equiv\varepsilon(-1)^{\sum_{i}(\alpha_{i}+\alpha^{\prime}_{i})+\sum_{j}(\beta_{j}+\beta_{j}^{\prime})+\sum_{k}\gamma_{k}}\pmod{3},$

which implies that $\varepsilon=\pm 1$. Now reducing (4.2) modulo $2$ yields

$1\equiv
z\equiv\prod_{j}\lambda_{a}^{2\beta_{j}+\beta_{j}^{\prime}}=\prod_{j}\lambda_{a}^{2\beta_{j}+v_{q_{j}}(n)-\beta_{j}}=\lambda_{a}^{\sum_{j}(v_{q_{j}}(n)+\beta_{j})}\pmod{2}.$

This means that, provided that $2\mid v_{r}(n)$ for all primes $r$ which
remain prime in ${\mathcal{O}}_{\\!-3}$, we have

$|X(n,a)|=2\prod_{i=1}^{l}\bigl{(}v_{p_{i}}(n)+1\bigr{)}\cdot\bigl{|}T(v_{q_{1}}(n),\ldots,v_{q_{m}}(n))\bigr{|}$
(4.3)

where $T(v_{q_{1}}(n),\ldots,v_{q_{m}}(n))$ is as defined in (3.5) in the
proof of Theorem 3.6. Hence a similar argument from the proof of loc. cit.
applies here, which proves (c). ∎

######  Remark 4.4.

Contrary to this case, a criterion for a prime integer $p$ to be of the form
$x^{2}+ay^{2}$ in an explicit form depending on $a$ is not known to the
authors. It is only guaranteed by [4, Thm.9.2] that such a polynomial
criterion exists. Also the case $a=11$ has been discussed in [6] with an
explicit polynomial, but it is unlikely to extend this result to a general
case, even for Heegner numbers.

## References

  * [1] N. Bagis and L. Glasser, M. On the number of representations of integers by various quadratic and higher forms, 2014.  arXiv:1406.0466.
  * [2] A. Berkovich and H. Yesilyurt, Ramanujan’s identities and representation of integers by certain binary and quaternary quadratic forms, The Ramanujan Journal 20(3) (2009), 375–408.
  * [3] C. Busenhart, L. Halbeisen, N. Hungerbühler, and O. Riesen, On primitive solutions of the diophantine equation $x^{2}+y^{2}=M$, Open Mathematics 19(1) (2021), 863–868.
  * [4] A. Cox, D. Primes of the form $x^{2}+ny^{2}$. Fermat, class field theory, and complex multiplication, Pure Appl. Math., Wiley Ser. Texts Monogr. Tracts, Hoboken, NJ: John Wiley & Sons, 2nd edition, 2013.
  * [5] Peter Dirichlet, Vorlesungen über Zahlentheorie, Vieweg, 4th edition, 1894.
  * [6] T. Evink and A. Helminck, P. Tribonacci numbers and primes of the form $p=x^{2}+11y^{2}$, Mathematica Slovaca 69(3) (2019), 521–532.
  * [7] A. Hall, N. The number of representations function for binary quadratic forms, American Journal of Mathematics 62(1) (1940), 589–598.
  * [8] K. Ireland and M. Rosen, A classical introduction to modern number theory., Vol. 84 of Grad. Texts Math., New York etc.: Springer-Verlag, 2nd edition, 1990.
  * [9] P. Kaplan and S. Williams, K. On the number of representations of a positive integer by a binary quadratic form, Acta Arithmetica 114 (2004), 87–98.
  * [10] M. Stark, H. A complete determination of the complex quadratic fields of class-number one, Michigan Mathematical Journal 14(1) (1967), 1–27.
  * [11] Zhi-Hong Sun and Kenneth S. Williams, On the number of representations of $n$ by $ax^{2}+bxy+cy^{2}$, Acta Arithmetica 122 (2006), 101–171.


These authors contributed equally to this work.

These authors contributed equally to this work.

[1,4]Mengxin Ren [2,3]Andrea Alù [1]Jingjun Xu

1]The Key Laboratory of Weak-Light Nonlinear Photonics, Ministry of Education,
School of Physics and TEDA Applied Physics Institute, Nankai University,
Tianjin, 300071, China

2]Photonics Initiative, Advanced Science Research Center, City University of
New York, New York, NY 10031, USA

3]Physics Program, Graduate Center, City University of New York, New York, NY
10016, USA

4]Collaborative Innovation Center of Extreme Optics, Shanxi University,
Taiyuan, Shanxi, 030006, China

# Beam shaping by nonlinear moiré metasurfaces

Lun Qu  Wei Wu  Di Zhang  Chenxiong Wang  Lu Bai  Chenyang Li  Wei Cai
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>[  [  [  [

###### Abstract

This paper explores the interplay of momentum transfer and nonlinear optical
processes through moiré phenomena. Momentum transfer plays a crucial role in
the interaction between photons and matter. Here, we study stacked
metasurfaces with tailored dispersion and rotated against each other with
varying twisted angles. The stacking introduces interlayer interactions, which
can be controlled by the relative angle between metasurfaces, significantly
enriching the resulting response compared to the single layer counterpart. By
focusing on second-harmonic generation (SHG) from these twisted metasurfaces,
we delve into the realm of nonlinear moiré photonics. Through experimental
observations, we unveil the emergence of intricate far-field SHG radiation
patterns, showing their effective tuning by varying the twisted angles. These
findings offer a fresh perspective to explore nonlinear wavefront shaping
through moiré phenomena, opening new avenues for nonlinear information
processing, optical steering, and nonlinear optical switching.

###### keywords:

Moiré metasurfaces, Second harmonic generation, Reciprocal lattice, Momentum
transfer, Lithium niobate

##  1 Introduction

Momentum transfer plays an important role in governing the interaction between
photons and matter.[1] This effect can be observed in the diffraction from
periodic structures such as gratings, where momenta associated with the
reciprocal lattice vectors are transferred to photons, altering the direction
of light propagation.[2] The concept of momentum transfer is essential in the
design of optical elements that control and manipulate light, facilitating
applications such as beam steering,[3, 4, 5] beam splitting,[6] information
processing,[7] and multichannel communications.[8] It forms the foundation for
advancing optical technologies with wide-ranging implications across diverse
scientific and engineering domains.

The quest for enhanced flexibility in light manipulation necessitates the
establishment of highly reconfigurable devices capable of yielding a
customizable spectrum of momentum components. Moiré phenomena, arising from
the superposition of two or more periodic lattices with twisted angles or
mismatched lattice constants, emerge as a versatile platform to generate
diverse lattices with variable symmetries and periodicities.[9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20] This large degree of tunability is achieved
through the manipulation of the twist angle and of the relative lattice
constant, providing a promising avenue for the creation of new Brillouin zones
with intricate band structures and a rich manipulation of momentum space.[21,
22, 23, 24, 25, 26] The control of the twisted angles facilitates band
structure manipulation, leading to phenomena such as remarkably flat photonic
bands,[27, 28, 29, 30, 31, 32, 33] light localization-delocalization
transitions,[34, 35, 36] and photonic band structure engineering.[37, 38, 24,
25, 39, 40, 26]

In a parallel effort, metasurfaces, renowned for their control over light
wavefronts, serve as a captivating framework for the design of both real and
reciprocal lattices. The fusion of metasurface concepts with moiré photonics
has resulted in substantial advancements in nanophotonics. This field has
witnessed notable progress and has catalyzed innovative applications,
including the development of photonic magic-angle nanolasers,[41, 42, 43] and
steering of both microwave and optical laser emissions.[44, 45, 46]
Additionally, optical vortex generation and enhanced optical chirality have
been demonstrated from twisted moiré metasurfaces.[47, 48, 49, 50] Despite
these significant advances, nonlinear phenomena in moiré metasurfaces have not
been experimentally explored yet. Yet, the new degree of control over
dispersion and momentum offered by moiré metasurfaces can provide exciting
opportunities for nonlinear optical modulation.

In this paper, we delve into the capabilities of moiré metasurfaces to govern
nonlinear optical processes, with a specific focus on the manipulation of
second harmonic generation (SHG). Our experimental approach involves the
fabrication of stacked nonlinear moiré metasurfaces with varied twisted
angles. The interlayer interaction in these structures results in a
combination of reciprocal lattice vectors from the two elementary
metasurfaces, thereby enriching the momentum components compared to their
single layer counterparts. The intricate far-field SHG radiation patterns
observed in our experiments are efficiently tuned by adjusting the twisted
angles. The intriguing possibility of shaping SHG with moiré phenomena adds
new versatility to nonlinear photonics, opening avenues for innovative
applications in information processing, optical routing, as well as nonlinear
optical switching and modulation. Our findings also provide valuable
opportunities for the modulation of nonlinear wavefronts and diffraction,
paving the way to further exploration of nonlinear phenomena within the realm
of moiré and aperiodic photonics.

##  2 Results

Figure 1 shows a conceptual diagram of a stacked nonlinear moiré metasurface
designed to manipulate SHG radiation. The chosen nonlinear constitutive
material is $x$-cut lithium niobate (LN), renowned for its large second-order
nonlinearity and broad transparent window.[51, 52, 53] This material is
commonly employed in the study of nonlinear metasurfaces for frequency
conversion.[54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64] In our design, the two
metasurface layers are composed of a square lattice of circular air holes,
stacked with a relative twisted angle $\alpha$, forming a distinct moiré
pattern in the overlapped region. When excited by a fundamental frequency (FF)
beam, nonlinear polarization dipoles $P^{(2)}$ are generated inside the LN via
the second-order susceptibility $\chi^{(2)}$. These dipoles oscillate at twice
the frequency of the FF fields, acting as secondary sources that radiate
second harmonic (SH) waves to the far-field. Each metasurface hole array forms
a nonlinear photonic lattice with a periodic distribution of $\chi^{(2)}$,
which gives rise to reciprocal lattice vectors and corresponding lattice
momentum perpendicular to the FF beam. In addition to the intrinsic lattice
momentum of each metasurface, the quasi-periodic moiré lattice supports
additional momentum components resulting from the interlayer coupling between
the stacked layers. These momenta transfer to SHG photons and modulate the
propagation direction of the SHG waves.

Figure 1: Schematic representation of stacked nonlinear moiré metasurfaces to
control SHG radiation. The moiré metasurface comprises two layers, each
featuring a square lattice of hole arrays milled in an $x$-cut LN membrane.
The experimental coordinate was chosen to overlap with the principal
crystallographic axes of the untwisted layer LN, defining $z$-axis along its
optic axis ($e$). The other layer introduces a counterclockwise twist by an
angle $\alpha$ (as viewed against the direction of incident light). The FF
light beam is normally incident onto the structure, while SHG signals are
collected in the transmission direction. A sketch of momentum transfer is
shown in the bottom-right corner. The red and blue arrows represent the wave
vectors of the FF light and SHG wave, respectively. The green arrow denotes
the reciprocal lattice vector of the metasurface. The emission angle $\theta$
of the SHG is defined as the angle between the SHG beam path and the normal of
the metasurface.

###  2.1 Fabrication of bilayer moiré metasurfaces

Figure 2: Fabrication process of stacked moiré metasurfaces. a) Depiction of
key steps in fabricating bilayer moiré metasurfaces, presented in both top and
side views. The process involves precise techniques of FIB milling and
nanomanipulator stacking operation. b) Corresponding SEM images providing
visual representations of the described fabrication steps, which confirm the
successful realization of the designed moiré metasurfaces.

Our nonlinear moiré metasurfaces were fabricated in a 210 nm thick $x$-cut
single-crystalline freestanding LN membrane.[55] The detailed procedures for
fabricating the freestanding LN membrane are outlined in the Experimental
Section. Figure 2 illustrates the step-by-step fabrication process for the
stacked moiré metasurfaces. Initially, we employed a focused ion beam (FIB,
Ga+ ion, 30 kV, 24 pA) milling technique for metasurface fabrication. The air
holes had a diameter ($D$) of 225 nm and the lattice constant ($P$) was 600 nm
(Figure S2a, Supporting Information). Seven metasurface arrays were
fabricated, each occupying a 25 $\times$ 25 $\mu$m2 area. To stack one LN
metasurface onto another, we first partially cut one metasurface using the ion
beam. Subsequently, we welded a nanomanipulator needle tip to the metasurface
using ion-assisted platinum (Pt) deposition. The remaining connecting sections
were milled by ions to completely release the metasurface from the membrane.
The lower membrane was twisted by a specific angle by rotating the sample
holder. During stacking, the Pt deposition was used to bond the overlayer
metasurface to the bottom metasurface at corners. Finally, the needle tip was
cut away by ion milling, fully releasing the metasurface and completing the
assembly of the bilayer moiré metasurfaces (Figure S2b, Supporting
Information). Figure 2b provides a visual depiction of the fabrication process
through scanning electron microscope (SEM) images.

###  2.2 Optical moiré patterns

Figure 3: Moiré lattices in metasurfaces. a) Schematic representations
delineating the formation of moiré lattices. The series includes a depiction
of a single layer metasurface and three stacked moiré metasurfaces with
varying twisted angles (15∘, 30∘, and 45∘) arranged from left to right. b)
Theoretical calculations of moiré lattice patterns. Notably, the 45∘ moiré
pattern features 8-fold symmetry. An inset showing the corresponding Ammann-
Beenker tiles is presented in the top-left corner, providing additional
insight into the lattice structure. c) Experimental observations of moiré
patterns captured through microscopy, providing a visual confirmation of the
constructed metasurfaces.

Figure 3 shows the formation of moiré lattices through the stacking of
metasurfaces. In Figure 3a, we show the configurations, starting with a single
layer square lattice in the first panel, and progressing to three moiré
metasurfaces created by stacking two identical square lattices with twisted
angles of 15∘, 30∘ and 45∘, respectively. Figure 3b plots the calculated
patterns of both single layer and moiré lattices. The stacking process
introduces novel quasi-periodical features, notably the enlarged moiré squares
resulting from 15∘ and 30∘ twisting, as highlighted by the dashed black
squares. It is imperative to recognize that our design incorporates
incommensurate twisted angles, resulting in aperiodic rather than periodical
moiré patterns. The quasi-period of the moiré lattice can be determined using
the formula $P_{M}=P/[2\sin(\alpha/2)]$ (Figure S3 in the Supporting
Information).[21] Furthermore, the moiré lattice formed with a 45∘ twisting
gives rise to a quasi-crystal lattice, adhering to Ammann-Beenker tiles and
exhibiting remarkable 8-fold rotation symmetry.[65, 66] In Figure 3c, optical
images of our metasurfaces observed under a microscope are presented. These
images closely replicate the theoretical patterns, providing a visual
confirmation of the constructed moiré metasurfaces.

###  2.3 SHG beam shaping by nonlinear moiré metasurfaces

Figure 4: SHG beam shaping by nonlinear moiré metasurfaces. a) Experimental
optical setup featuring key components such as the Glan-Taylor prism (GTP),
half-wave plate (HWP), objective lens (Obj), short-pass filter (BG40), plastic
screen, lens (L), and camera. b) The first panel displays the measured SHG
pattern from a single layer metasurface, with the dashed circle indicating the
N.A. of the objective. The second panel illustrates the reciprocal lattice
corresponding to the single layer metasurface, where momentum transfer from
the reciprocal lattice to SHG photons generates peripheral first order
diffraction spots, marked by blue circles in the first panel. c-e) SHG
patterns and reciprocal lattices for different twisted moiré metasurfaces. The
first column presents the measured SHG patterns, while the second column shows
the reciprocal lattices of the untwisted (blue) and twisted (red) metasurface
layers, contributing to the SHG spots marked by the blue and red circles in
the first column. The third and fourth columns depict reciprocal lattice
vectors of the moiré metasurface, formed by combining reciprocal lattice
vectors of the elementary metasurfaces. These vectors are categorized into
several groups, such as $M_{2,g1}$ (dark green), $M_{2,g2}$ (light green),
$M_{3,g1}$ (dark yellow), and $M_{3,g2}$ (light yellow), based on different
vector combination configurations. This leads to the formation of different
groups of SHG spots in the first column, shown by circles of the corresponding
colors.

To experimentally characterize the SHG radiation of various moiré
metasurfaces, the samples were illuminated by a tunable Ti:sapphire
femtosecond laser (Maitai, Spectra-Physics, 80 MHz, 230 fs), as shown in
Figure 4a. The pump laser was focused onto the metasurfaces by a 10$\times$
objective (N.A.=0.25) forming a focal spot with a diameter of about 10 $\mu$m.
A 100$\times$ objective (N.A.=0.90) was used on the transmission side to
collect the SHG signals. The transmitted pump wave underwent filtering with
short-pass filters (BG40 colored glass). Subsequently, SHG patterns were
projected on a semi-transparent plastic screen and captured by a camera. In
the experiment, the pump wavelength was selected at 950 nm, overlapping with
the transmission resonance of the metasurfaces (Figure S4, Supporting
Information). The choice of this wavelength enables resonantly enhanced SHG
efficiency.[55] Notably, the corresponding SHG wavelength of 475 nm is smaller
than the periods of both the elementary metasurface lattice and moiré lattice,
facilitating diffraction phenomena for the SHG light. Given the short
interaction length of the beams in the studied metasurfaces, the diffraction
of the SHG is in the Raman-Nath regime. In this regime, lattice momentum
transfer along the transverse direction dominates, modulating the propagation
direction of the SHG waves.

Figure 4b presents the far-field SHG radiation pattern from the single layer
metasurface, with the numerical aperture (N.A.) of the objective delineated by
a dashed circle. The normally incident FF light mainly generates SHG photons
with zero transverse momentum, resulting in a prominent central spot observed
in the pattern. Four additional peripheral spots (marked by four blue circles)
are also discernible in the far-field, corresponding to non-zero transverse
momentum. The presence of these peripheral SHG spots indicates momentum
transfer from the reciprocal lattice to the SHG photons. Specifically, for the
square lattice under consideration, the reciprocal lattice manifests as a
square array, expressed as
$\mathbf{G}_{1,(k,l)}=\frac{2\pi}{P}(k\mathbf{a}+l\mathbf{b})$, where $k$ and
$l$ are integers, and $\mathbf{a}$ and $\mathbf{b}$ are unit vectors in
reciprocal space. In the second panel of Figure 4b, the reciprocal space of
the metasurface is presented. The interaction between the SHG wave and the
zero reciprocal lattice vector $\mathbf{G}_{1,(0,0)}$ (i.e., the origin of the
reciprocal space) results in the central SHG spot in experiment, as mentioned
earlier. Concurrently, the momentum transfer originating from the reciprocal
lattice vectors $\mathbf{G}_{1,(\pm 1,0)}$ and $\mathbf{G}_{1,(0,\pm 1)}$,
resulting in the four peripheral spots, i.e., the first order diffraction.

Figure 5: Evolution of SHG spot trajectories and angular correlation with
twist angle. a) Trajectories of SHG spots in reciprocal space for groups of
$M_{2,g1}$, $M_{2,g2}$, and $M_{3,g1}$, illustrating how their motion changes
with the twisted angle $\alpha$. Arrows indicate the direction of increasing
$\alpha$ from 0 to 90∘. b) Correlation between SHG propagation angle $\theta$
and the twisted angles $\alpha$ of the moiré metasurfaces.

When two metasurfaces are stacked, the interlayer coupling introduces a
superposition of reciprocal lattices from the individual metasurfaces. The
reciprocal lattice of the twisted layer is expressed as
$\mathbf{G}_{2,(m,n)}=\frac{2\pi}{P}(m\mathbf{a}^{\prime}+n\mathbf{b}^{\prime})$,
where $\mathbf{a}^{\prime}=\cos(\alpha)\mathbf{a}-\sin(\alpha)\mathbf{b}$ and
$\mathbf{b}^{\prime}=\sin(\alpha)\mathbf{a}+\cos(\alpha)\mathbf{b}$ are unit
vectors in the reciprocal space of the twisted metasurface. Consequently, the
reciprocal lattice of moiré metasurfaces, which is the sum of the reciprocal
lattices of each layer, can be represented as
$\mathbf{G}_{M,(k,l,m,n)}=\frac{2\pi}{P}(k\mathbf{a}+l\mathbf{b}+m\mathbf{a}^{\prime}+n\mathbf{b}^{\prime})$.

Figure 4c illustrates the SHG pattern for a 15∘ twisted moiré metasurface.
Beyond the central zeroth order diffraction spot, we identify two distinct
groups of first order peripheral spots, distinguished by blue and red circles.
These groups exhibit a relative 15∘ angular offset, each corresponding to the
intrinsic emission from either the bottom or top layers. Visual
representations of the reciprocal lattices of the elementary metasurfaces are
provided in the second panel of Figure 4c, where red and blue dots signify the
reciprocal lattices associated with the twisted or untwisted layers,
respectively. In contrast to the single layered metasurface, which exclusively
features zeroth and first diffraction orders, the twisted moiré metasurface
exhibits additional SHG spots. The generation of these spots arises from the
composition of reciprocal lattice vectors from two elementary lattices. As
exemplified in the third panel of Figure 4c, the combination of vectors
$\mathbf{G}_{1,(1,0)}$ (horizontal blue arrow) and $\mathbf{G}_{2,(-1,0)}$
(red arrow) results in a vector of $\mathbf{G}_{M,(1,0,-1,0)}$, as indicated
by a short dark green arrow. These dark green points in the reciprocal lattice
basically originate from the moiré lattice, as indicated in Figure 3b. The
momentum transfer from these vectors forms the SHG spots closely surrounding
the zeroth order spot, indicated by dark green circles in the first panel of
Figure 4c. This group of spots is classified as $M_{2,g1}$. Similarly, the
combination of vectors $\mathbf{G}_{1,(0,1)}$ (vertical blue arrow) and
$\mathbf{G}_{2,(-1,0)}$ generates a vector at $\mathbf{G}_{M,(0,1,-1,0)}$, as
indicated by a light green arrow. This contributes to the formation of SHG
spots marked by light green circles in the first panel of Figure 4c, labeled
as $M_{2,g2}$. Due to the proximity of these spots to the edge of the
objective aperture, two spots were missing in the experiment, as indicated by
dotted circles in Figure 4c. These spots, resulting from the combination of
two reciprocal lattice unit vectors, are designated as second-order
diffraction. Additionally, the vector $\mathbf{G}_{M,(0,1,-1,0)}$ combines
with $\mathbf{G}_{2,(0,-1)}$ to yield a vector $\mathbf{G}_{M,(0,1,-1,-1)}$
(dark yellow arrows). This forms a group of third-order SHG diffraction spots,
which are marked by dark yellow circles in Figure 4c and labeled as
$M_{3,g1}$. These sharp diffraction patterns confirm the existence of long-
range order in the quasi-periodic moiré metasurface. The presence of second
and third order diffractions underscores the contribution from the moiré
lattice momentum to the observed SHG phenomena.

Figure 4d and Figure 4e depict SHG from 30∘ and 45∘ twisted moiré
metasurfaces, including components spanning from zeroth to third order
diffractions. The visual representation reveals the pronounced influence of
the twist angle on both the position of SHG spots and the symmetry of SHG
patterns. Significantly, in contrast to the 15∘ and 30∘ twisted moiré
metasurfaces, where a singular set of third order diffraction spots is
observed, the 45∘ twisted moiré metasurface manifests two distinct sets of
third order diffraction spots, which are distinguished by dark ($M_{3,g1}$)
and light yellow ($M_{3,g2}$) circles in the first panel of Figure 4e. This
phenomenon indicates a strong variation in higher-order diffraction
characteristics associated with the twist angle. Moreover, owing to the
inherent 8-fold quasicrystal nature intrinsic to the 45∘ twisted moiré
metasurface (as shown in Figure 3b), the SHG pattern exhibits an octagonal
symmetry. This distinctive 8-fold symmetry further elucidates the unique
geometric properties introduced by the specific twist angle, adding a layer of
complexity to the observed SHG phenomena.

To intuitively elucidate the intricate modulation of SHG emission induced by
moiré twisting, Figure 5 delineates the trajectories of SHG spots as a
function of the twist angle. The first panel tracks the evolution of the spot
group $M_{2,g1}$ (indicated by dark green in Figure 4). With an increasing
twist angle, the SHG spots migrate outward from the origin of the reciprocal
space to the corners, following quarter arcs (see Figure S5, Supporting
Information). In the second panel, the $M_{2,g2}$ spots traverse quarter arcs
as well, but their trajectories, in conjunction with those of $M_{2,g1}$,
manifest mirror symmetry about the diagonals of the reciprocal lattice.
Intriguingly, these spots shift inward from the corners towards the center
with an increasing twist angle, adding a distinctive feature to the SHG
emission dynamics. The third panel unveils the trajectories of $M_{3,g1}$
spots. As the twisted angle varies, these spots trace a unique path of
quatrefoil, embodying the complex interplay of moiré-induced effects on SHG
emission. The intricate variation of these trajectories provides a tangible
evidence of how moiré twisting intricately influences the spatial distribution
of SHG spots in a deterministic yet efficient way.

Figure 5b depicts the divergence angles $\theta$ of the SHG spots, which are
defined as the angles between the SHG beam path and the normal of the
metasurface (as presented in Figure 1). Intersection points between different
curves signify SHG spots with identical divergence angles, indicating an equal
distance from the central zeroth order. Notably, for the 30∘ twisted moiré
metasurface, all the $M_{2,g1}$ and $M_{3,g1}$ spots maintain an equal
distance from the canter, as evidenced in Figure 4d. Additionally, in the case
of the 45∘ twisted moiré metasurface, the $M_{2,g1}$ and $M_{2,g2}$ spots form
a circular arrangement, as depicted in Figure 4e. These observations provide a
concrete demonstration of the opportunities emerging from modulating SHG
processes through moiré metasurfaces. Furthermore, it is worth noticing that
the moiré photonics exhibits remarkable versatility and adaptability, allowing
for the integration of diverse materials, geometries, and functionalities
within the moiré lattice framework. Through strategic adjustments in lattice
constants, lattice types, and the number of stacked layers, a myriad of
complex moiré patterns can be generated, each showing a unique evolution. Such
versatility endows considerable flexibility in shaping radiation patterns and
engineering beam tracking, facilitating a broad spectrum of applications in
photonics.

##  3 Conclusion

In summary, our investigation shows the potential of moiré metasurfaces to
govern nonlinear optical processes, with a specific emphasis on tailored
shaping of SHG waves in momentum space. We achieved these features through the
fabrication of stacked nonlinear moiré metasurfaces employing LN membranes.
These metasurfaces, characterized by extended quasi-periodic patterns, give
rise to intricate diffracted spots and twist-angle-controlled directional SHG.
Our findings highlight the manipulation of angular emission and nonlinear beam
patterns through moiré twisting. Notably, the efficient modulations of SHG
emission patterns through varying twist angles present opportunities to
harness the unique properties of moiré lattices for applications such as beam
steering, beam splitting, light modulation, multi-channel optical
communication, and information processing. Such versatile functionalities
underscore the broad potential of moiré metasurfaces in advancing diverse
fields within photonics and nonlinear optics.

##  4 Experimental Section

###  4.1 Fabrication of freestanding LN membrane.

The freestanding LN membranes were created by wet etching LN on insulator
(LNOI) wafers (NANOLN Co. Ltd.), which consist of a 210 nm thick $x$-cut
single crystalline LN film bonded to a 300 $\mu$m thick silicon (Si) substrate
with a 2 $\mu$m thick silicon dioxide (SiO2) buffer layer. A 500 nm thick
silicon nitride (SiN) film was deposited by inductively coupled plasma
chemical vapor deposition (ICPCVD) onto the backside of the Si substrate as a
protective layer. UV lithography was used to create patterned resist windows,
and reactive ion etching (RIE) was employed to remove the SiN within the
windows. Subsequently, the sample was immersed in a potassium hydroxide (KOH)
solution, which etched the Si layer within the windows at a rate of
approximately 1 $\mu$m/min, halting at the SiO2 layer. The sample was further
treated with a buffered oxide etching solution (BOE, NH4F:HF = 20:1) to remove
the SiO2 layer within the windows (Figure S1, Supporting Information).

Supporting Information

Supporting Information is available from the author.

Acknowledgements

This work was supported by National Key R&D Program of China (2023YFA1407200,
2022YFA1404800, 2019YFA0705000); National Natural Science Foundation of China
(12222408, 92050114, 12174202, 12074200, 12304423, 12304424); Guangdong Major
Project of Basic and Applied Basic Research (2020B0301030009); China
Postdoctoral Science Foundation (2022M721719, 2022M711710); 111 Project
(B23045); PCSIRT (IRT0149); Fundamental Research Funds for the Central
Universities (010-63241512); Simons Foundation. We thank Nanofabrication
Platform of Nankai University for fabricating samples.

Conflict of Interest

The authors declare no conflict of interest.

Author contributions

L.Q. and W.W. contributed equally to this work. L.Q. and M.R. conceived and
performed the design. W.W., L.Q. and L.B. fabricated samples. L.Q. and C.W.
performed optical measurements, L.Q., M.R., D.Z., C.L., A.A. and J.X. analyzed
data. L.Q., M.R., A.A. and J.X. jointly wrote the manuscript. All authors
discussed the results and prepared the manuscript.

Data Availability Statement

The data that support the findings of this study are available from the
corresponding author upon reasonable request.

## References

  *   * [1] Mobley, M. J.  Momentum exchange theory of photon diffraction.  _Opt. Eng._ 57, 015105 (2018).
  * [2] Xu, K., Huang, L. & Xu, S.  Line-shaped laser lithography for efficient fabrication of large-area subwavelength nanogratings.  _Optica_ 10, 97–104 (2023).
  * [3] Liu, W. & Miroshnichenko, A. E.  Beam steering with dielectric metalattices.  _ACS Photonics_ 5, 1733–1741 (2017).
  * [4] Wei, D. _et al._ Experimental demonstration of a three-dimensional lithium niobate nonlinear photonic crystal.  _Nat. Photon._ 12, 596–600 (2018).
  * [5] Tang, Y. _et al._ Quasicrystal photonic metasurfaces for radiation controlling of second harmonic generation.  _Adv. Mater._ 31, 1901188 (2019).
  * [6] Ra’di, Y., Sounas, D. L. & Alù, A.  Metagratings: Beyond the limits of graded metasurfaces for wave front control.  _Phys. Rev. Lett._ 119, 067404 (2017).
  * [7] Ren, H. _et al._ Complex-amplitude metasurface-based orbital angular momentum holography in momentum space.  _Nat. Nanotechnol._ 15, 948–955 (2020).
  * [8] Zhao, R. _et al._ Multichannel vectorial holographic display and encryption.  _Light Sci. Appl._ 7, 95 (2018).
  * [9] Lau, C. N., Bockrath, M. W., Mak, K. F. & Zhang, F.  Reproducibility in the fabrication and physics of moiré materials.  _Nature_ 602, 41–50 (2022).
  * [10] Du, L. _et al._ Moiré photonics and optoelectronics.  _Science_ 379, eadg0014 (2023).
  * [11] Sunku, S. S. _et al._ Photonic crystals for nano-light in moiré graphene superlattices.  _Science_ 362, 1153–1156 (2018).
  * [12] Lu, J. _et al._ Valley topological phases in bilayer sonic crystals.  _Phys. Rev. Lett._ 120, 116802 (2018).
  * [13] Hu, G. _et al._ Topological polaritons and photonic magic angles in twisted $\alpha$-MoO3 bilayers.  _Nature_ 582, 209–213 (2020).
  * [14] Yang, F. _et al._ Tunable second harmonic generation in twisted bilayer graphene.  _Matter_ 3, 1361–1376 (2020).
  * [15] Yao, K. _et al._ Enhanced tunable second harmonic generation from twistable interfaces and vertical superlattices in boron nitride homostructures.  _Sci. Adv._ 7, eabe8691 (2021).
  * [16] Kim, B. _et al._ Three-dimensional nonlinear optical materials from twisted two-dimensional van der waals interfaces.  _Nat. Photon._ 18, 91–98 (2024).
  * [17] Hu, G., Wang, M., Mazor, Y., Qiu, C.-W. & Alù, A.  Tailoring light with layered and moiré metasurfaces.  _Trends Chem._ 3, 342–358 (2021).
  * [18] Chen, J. _et al._ A perspective of twisted photonic structures.  _Appl. Phys. Lett._ 119, 240501 (2021).
  * [19] Li, H. _et al._ Twisted moiré conductive thermal metasurface.  _Nat. Commun._ 15, 2169 (2024).
  * [20] Zhou, H.-T. _et al._ Dynamic acoustic beamshaping with coupling-immune moiré metasurfaces.  _Adv. Mater._ 36, 2313004 (2024).
  * [21] Amidror, I.  Moiré patterns between aperiodic layers: quantitative analysis and synthesis.  _JOSA A_ 20, 1900–1919 (2003).
  * [22] Lubin, S. M., Zhou, W., Hryn, A. J., Huntington, M. D. & Odom, T. W.  High-rotational symmetry lattices fabricated by moiré nanolithography.  _Nano Lett._ 12, 4948–4952 (2012).
  * [23] Baake, M. & Grimm, U.  Mathematical diffraction of aperiodic structures.  _Chem. Soc. Rev._ 41, 6821–6843 (2012).
  * [24] Lou, B. _et al._ Theory for twisted bilayer photonic crystal slabs.  _Phys. Rev. Lett._ 126, 136101 (2021).
  * [25] Lou, B. & Fan, S.  Tunable frequency filter based on twisted bilayer photonic crystal slabs.  _ACS Photonics_ 9, 800–805 (2022).
  * [26] Tang, H. _et al._ Experimental probe of twist angle–dependent band structure of on-chip optical bilayer photonic crystal.  _Sci. Adv._ 9, eadh8498 (2023).
  * [27] López, M. R., Peñaranda, F., Christensen, J. & San-Jose, P.  Flat bands in magic-angle vibrating plates.  _Phys. Rev. Lett._ 125, 214301 (2020).
  * [28] Deng, Y. _et al._ Magic-angle bilayer phononic graphene.  _Phys. Rev. B_ 102, 180304 (2020).
  * [29] Dong, K. _et al._ Flat bands in magic-angle bilayer photonic crystals at small twists.  _Phys. Rev. Lett._ 126, 223601 (2021).
  * [30] Tang, H. _et al._ Modeling the optical properties of twisted bilayer photonic crystals.  _Light Sci. Appl._ 10, 157 (2021).
  * [31] Oudich, M. _et al._ Photonic analog of bilayer graphene.  _Phys. Rev. B_ 103, 214311 (2021).
  * [32] Yi, C.-H., Park, H. C. & Park, M. J.  Strong interlayer coupling and stable topological flat bands in twisted bilayer photonic moiré superlattices.  _Light Sci. Appl._ 11, 289 (2022).
  * [33] Huang, L., Zhang, W. & Zhang, X.  Moiré quasibound states in the continuum.  _Phys. Rev. Lett._ 128, 253901 (2022).
  * [34] Wang, P. _et al._ Localization and delocalization of light in photonic moiré lattices.  _Nature_ 577, 42–46 (2020).
  * [35] Fu, Q. _et al._ Optical soliton formation controlled by angle twisting in photonic moiré lattices.  _Nat. Photon._ 14, 663–668 (2020).
  * [36] Nguyen, D. X. _et al._ Magic configurations in moiré superlattice of bilayer photonic crystals: Almost-perfect flatbands and unconventional localization.  _Phys. Rev. Res._ 4, L032031 (2022).
  * [37] Wang, H.-F. _et al._ Bound states in the continuum in a bilayer photonic crystal with TE-TM cross coupling.  _Phys. Rev. B_ 98, 214101 (2018).
  * [38] Hu, G., Krasnok, A., Mazor, Y., Qiu, C.-W. & Alù, A.  Moiré hyperbolic metasurfaces.  _Nano Lett._ 20, 3217–3224 (2020).
  * [39] Lou, B., Wang, B., Rodríguez, J. A., Cappelli, M. & Fan, S.  Tunable guided resonance in twisted bilayer photonic crystal.  _Sci. Adv._ 8, eadd4339 (2022).
  * [40] Salakhova, N. S., Fradkin, I. M., Dyakov, S. A. & Gippius, N. A.  Twist-tunable moiré optical resonances.  _Phys. Rev. B_ 107, 155402 (2023).
  * [41] Mao, X.-R., Shao, Z.-K., Luan, H.-Y., Wang, S.-L. & Ma, R.-M.  Magic-angle lasers in nanostructured moiré superlattice.  _Nat. Nanotechnol._ 16, 1099–1105 (2021).
  * [42] Raun, A., Tang, H., Ni, X., Mazur, E. & Hu, E. L.  GaN magic angle laser in a merged moiré photonic crystal.  _ACS Photonics_ 10, 3001–3007 (2023).
  * [43] Luan, H.-Y., Ouyang, Y.-H., Zhao, Z.-W., Mao, W.-Z. & Ma, R.-M.  Reconfigurable moiré nanolaser arrays with phase synchronization.  _Nature_ 624, 282–288 (2023).
  * [44] Liu, S. _et al._ Moiré metasurfaces for dynamic beamforming.  _Sci. Adv._ 8, eabo1511 (2022).
  * [45] Guan, J. _et al._ Far-field coupling between moiré photonic lattices.  _Nat. Nanotechnol._ 18, 514–520 (2023).
  * [46] Guan, J. _et al._ Plasmonic nanoparticle lattice devices for white-light lasing.  _Adv. Mater._ 35, 2103262 (2023).
  * [47] Zhang, T. _et al._ Twisted moiré photonic crystal enabled optical vortex generation through bound states in the continuum.  _Nat. Commun._ 14, 6014 (2023).
  * [48] Wu, Z. & Zheng, Y.  Moiré chiral metamaterials.  _Adv. Opt. Mater._ 5, 1700034 (2017).
  * [49] Han, Z., Wang, F., Sun, J., Wang, X. & Tang, Z.  Recent advances in ultrathin chiral metasurfaces by twisted stacking.  _Adv. Mater._ 35, 2206141 (2023).
  * [50] Zhang, J. C. _et al._ Nanoimprint meta-device for chiral imaging.  _Adv. Funct. Mater._ 33, 2306422 (2023).
  * [51] Weis, R. S. & Gaylord, T. K.  Lithium niobate: Summary of physical properties and crystal structure.  _Appl. Phys. A_ 37, 191–203 (1985).
  * [52] Ma, J. _et al._ Second-harmonic generation and its nonlinear depolarization from lithium niobate thin films.  _Opt. Lett._ 45, 145–148 (2020).
  * [53] Jia, Y., Wang, L. & Chen, F.  Ion-cut lithium niobate on insulator technology: recent advances and perspectives.  _Appl. Phys. Rev._ 8, 011307 (2021).
  * [54] Ma, J. _et al._ Nonlinear lithium niobate metasurfaces for second harmonic generation.  _Laser Photonics Rev._ 15, 2000521 (2021).
  * [55] Qu, L. _et al._ Giant second harmonic generation from membrane metasurfaces.  _Nano Lett._ 22, 9652–9657 (2022).
  * [56] Fang, B., Li, H., Zhu, S. & Li, T.  Second-harmonic generation and manipulation in lithium niobate slab waveguides by grating metasurfaces.  _Photon. Res._ 8, 1296–1300 (2020).
  * [57] Fedotova, A. _et al._ Second-harmonic generation in resonant nonlinear metasurfaces based on lithium niobate.  _Nano Lett._ 20, 8608–8614 (2020).
  * [58] Carletti, L. _et al._ Steering and encoding the polarization of the second harmonic in the visible with a monolithic LiNbO3 metasurface.  _ACS Photonics_ 8, 731–737 (2021).
  * [59] Yuan, S. _et al._ Strongly enhanced second harmonic generation in a thin film lithium niobate heterostructure cavity.  _Phys. Rev. Lett._ 127, 153901 (2021).
  * [60] Huang, Z. _et al._ Resonant enhancement of second harmonic generation in etchless thin film lithium niobate heteronanostructure.  _Sci. China Phys. Mech. Astron._ 65, 104211 (2022).
  * [61] Zhang, J. _et al._ Spatially entangled photon pairs from lithium niobate nonlocal metasurfaces.  _Sci. Adv._ 8, eabq4240 (2022).
  * [62] Qu, L. _et al._ Bright second harmonic emission from photonic crystal vertical cavity.  _Adv. Funct. Mater._ 33, 2308484 (2023).
  * [63] Zhao, Y., Chen, Z., Wang, C., Yang, Y. & Sun, H.-B.  Efficient second-and higher-order harmonic generation from LiNbO3 metasurfaces.  _Nanoscale_ 15, 12926–12932 (2023).
  * [64] Fedotova, A. _et al._ Lithium niobate meta-optics.  _ACS Photonics_ 9, 3745–3763 (2022).
  * [65] Wang, N., Chen, H. & Kuo, K.  Two-dimensional quasicrystal with eightfold rotational symmetry.  _Phys. Rev. Lett._ 59, 1010 (1987).
  * [66] Ammann, R., Grünbaum, B. & Shephard, G. C.  Aperiodic tiles.  _Discrete Comput. Geom._ 8, 1–25 (1992).