# Supplemental Material for ”Confined states and topological phases in two-
dimensional quasicrystalline $\pi$-flux model”

Rasoul Ghadimi  Masahiro Hori  Takanori Sugimoto  Takami Tohyama

###### Contents

  1. S1 $\pi$-flux model on square lattice
  2. S2 inflation rule to obtain arrow-attached Ammann-Beenker and Penrose tilings
  3. S3 Bott index
  4. S4 Finding local confined states
  5. S5 The fraction of confined states in Penrose tiling
    1. S5.1 The fraction of confined states
    2. S5.2 The wavefunctions of confined states
  6. S6 The fraction of confined states in Ammann-Beenker tiling
    1. S6.1 AB.conf1 with $E=\sqrt{2}$
    2. S6.2 AB.conf2 with $E=0$
    3. S6.3 AB.conf2 with $E=2$
    4. S6.4 AB.conf3 with $E=0$
    5. S6.5 AB.conf3 with $E=2\sqrt{2}$
    6. S6.6 Summary for all the configurations

##  S1 $\pi$-flux model on square lattice

Figure S1: The $\pi$-flux model in the square lattice. Two tiles of (a)
$\pi$-flux, and $\pi$-flux with (b) staggered tile diagonal hopping (STDH),
and (c) non-staggered tile diagonal hopping (NSTDH). The two green symbols
inside the tiles indicate positive and negative $\pi$ [$\pi/2$] flux in (a)
[(b) and (c)]. In (c), red and blue diagonal links indicate hopping with
opposite signs regarding each other. (d) The $\pi$-flux model in the square
lattice, where $\vec{a_{1}},\vec{a_{2}}$ show basis vectors. The energy
dispersion for (e) $t_{d}=0$, (f) STDH with $t_{d}=0.1t$, and (g) NSTDH with
$t_{d}=0.1t$ along high-symmetry lines.

The $\pi$-flux model in the square lattice reads

$H=t\sum_{\expectationvalue{ij}}e^{iA_{ij}}\ket{i}\bra{j},$ (S1)

where $t$ is the electron hopping. $\ket{i}\bra{j}$ represents hopping
operator between site $i$ and $j$, and $\expectationvalue{ij}$ is the nearest
neighbor links of the square lattice, or equivalently edges of the square
lattice, and $A_{ij}=-A_{ji}$ is the phase of hopping. The total flux
penetrating each face or tile of the square lattice is given by the total
phases that accumulate around edges, i.e.,

$\phi\equiv\phi_{i,j,k,l}=A_{ij}+A_{j,k}+A_{k,l}+A_{l,i}.$ (S2)

where $i$, $j$, $k$, and $l$ represent vertices on a given tile and are
arranged in an anticlockwise way such as $i\rightarrow j\rightarrow
k\rightarrow l\rightarrow i$. The square lattice has bipartite properties.
This means that we can divide its vertices into two sets, A and B, without any
edges connecting the same set. In such a bipartite Hamiltonian, energy
eigenvalues come in pair $\pm E$, leading to a symmetric spectrum. We can
obtain a $\pi$-flux distribution, by assigning $A_{i,j}=\pi/2$
($A_{j,i}=-\pi/2$), if $i$ ($j$) belongs to A (B) set and
$\vec{r}_{i}-\vec{r}_{j}$ is parallel to either horizontal or vertical axis,
where $\vec{r_{i}}$ is the position vector of site $i$. In Fig. S1(d) we show
a $\pi$-flux model in the square lattice, where arrows along the vertical
direction represent $A_{i,j}=\pi/2$ belonging to the A set and broken
horizontal lines connecting two sites represent $A_{i,j}=0$. Figure S1(a)
represents two tiles in the $\pi$-flux model.

We can obtain the same $\pi$-flux distribution if we assign $A_{i,j}=\pi/2(0)$
along horizontal (vertical) directions. The energy dispersion of the
$\pi$-flux model is given by diagonalizing the Fourier-transformed Hamiltonian

$H(k)=2t\cos(k_{x})\sigma_{x}+2t\cos(k_{y})\sigma_{y}.$ (S3)

Figure S1(e) shows the resulting energy dispersion with two gapless Dirac
cones.

The Dirac cones of the square $\pi$-flux model can be gapped out by
introducing staggered tile diagonal hopping (STDH)

$H^{\prime}=t_{d}\sum_{\expectationvalue{\expectationvalue{ij}}_{f}}e^{iA_{ij}}\eta_{f}\ket{i}\bra{j},$
(S4)

where $\expectationvalue{\expectationvalue{ij}}_{f}$ represents a pair of
diagonal vertices of the faces indicated by $f$ and $\eta_{f}=1(-1)$ if the
corresponding face has $\pi$ ($-\pi$) flux [see Fig. S1(b)]. The Fourier
transformation of $H^{\prime}$ gives

$H^{\prime}(k)=2t_{d}\sin k_{x}\sin k_{y}\sigma_{z}.$ (S5)

As shown in Fig. S1(f), the gap of the Dirac cones opens up by introducing
STDH. We can confirm the topological state for $t_{d}\neq 0$, by calculating
the Chern number which gives nonzero and quantized values. Furthermore, due to
the bulk-boundary correspondence, the system hosts chiral edge modes in the
open boundary condition.

Note that introducing non-staggered tile diagonal hopping (NSTDH) [see Fig.
S1(c)] does not open up the gap [see Fig.S1(g)] as the underlying system still
has space-time symmetry.

##  S2 inflation rule to obtain arrow-attached Ammann-Beenker and Penrose
tilings

In Figs. S2(a) and S2(c), we present arrow-attached Ammann-Beenker and Penrose
tilings, where four and five distinct arrows exist, respectively. Note that,
connecting arrows, we obtain a strip of arrows whose adjacent arrows have
opposite directions. These strips are along a certain direction, which is
known as the Ammann bar in quasicrystal structures.

Note that one can obtain an inflation rule to generate these arrow-attached
quasicrystals. In the inflation rule, each tile is substituted by several
combinations of given quasicrystal tiles in a way that quasicrystalline tiling
holds after inflation/deflation. Therefore, by rescaling new quasicrystalline
tiling to have the same tiling as before, one can obtain a quasicrystal with a
larger number of tiles. To obtain the inflation rule of arrow-attached
quasicrystals, we need to know the original and inflated tiles. In Figs. S2(b)
and S2(d), we show all distinct tiles and their inflated ones for the Ammann-
Beenker and Penrose tilings, respectively.

Figure S2:  (a) Arrow-attached Ammann-Beenker and (c) arrow-attached Penrose
tilings. (b) Inflation rule for the Ammann-Beenker tiling and (d) that for the
Penrose tiling.

##  S3 Bott index

To determine the topological characteristic of the quasicrystalline $\pi$-flux
model, we use the Bott index. This index is a real space topological invariant
and has been used for systems without time-reversal symmetry. This index for a
given energy $\epsilon_{f}$ is defined by

$B(\epsilon_{f})=\frac{1}{2\pi}\imaginary\left[\text{tr}\log\left(X_{\epsilon_{f}}^{\dagger}Y_{\epsilon_{f}}^{\dagger}X_{\epsilon_{f}}Y_{\epsilon_{f}}\right)\right],$
(S6)

where $\imaginary$ is the imaginary part, tr is the matrix trace, $\log$ is
the matrix log,
$X_{\epsilon_{f}}=P_{\epsilon_{f}}XP_{\epsilon_{f}}+Q_{\epsilon_{f}}$, and
$Y_{\epsilon_{f}}=P_{\epsilon_{f}}YP_{\epsilon_{f}}+Q_{\epsilon_{f}}$. The
projection operators $P_{\epsilon_{f}},Q_{\epsilon_{f}}$ are given by

$P_{\epsilon_{f}}{=}\sum_{\epsilon<\epsilon_{f}}\ket{\epsilon}\bra{\epsilon},\qquad
Q_{\epsilon_{f}}{=}\sum_{\epsilon>\epsilon_{f}}\ket{\epsilon}\bra{\epsilon},$
(S7)

where $\epsilon$ and $\ket{\epsilon}$ are the eigen-energy and eigen-states of
the given Hamiltonian, respectively. The modified position matrix is defined
by

$\begin{matrix}X{=}\text{diag}\left[e^{2\pi ix_{1}/L_{x}},e^{2\pi
ix_{2}/L_{x}},\dots,e^{2\pi ix_{N}/L_{x}}\right]\\\ \\\
Y{=}\text{diag}\left[e^{2\pi iy_{1}/L_{y}},e^{2\pi iy_{2}/L_{y}},\dots,e^{2\pi
iy_{N}/L_{y}}\right],\end{matrix}$ (S8)

where diag indicates diagonal matrix, $(x_{i},y_{i})$ is the coordinates of
vertices, and $L_{x}$ ($L_{y}$) is the length along $x$ ($y$) direction. Note
that, for the calculation of the Bott index, we have to obtain $\epsilon$ and
$\ket{\epsilon}$ with the periodic boundary condition, where we need to use a
large approximant. Furthermore, the Bott index is not reliable when a given
energy gap is small. First, we calculate the Bott index for the gap with
$\Delta E>0.04t$ and then check the existence of edge modes for the open
boundary condition. To obtain a large approximant with the open boundary
condition, we remove inter-approximant links in periodic approximants.

##  S4 Finding local confined states

In this section, we explain our strategy to find well-localized confined
states. Consider general Hamiltonian $\mathcal{H}$. We can obtain eigenstate
$\ket{\lambda}$ with eigenenergy $\epsilon_{\lambda}$ by numerically
diagonalizing $\mathcal{H}$,

$\mathcal{H}\ket{\lambda}=\epsilon_{\lambda}\ket{\lambda}.$ (S9)

The obtained eigenstates are not necessary well localized and generally have
spatial overlap among the wavefunctions. To obtain well-localized confined
states, we first identify all eigenstates that are hugely degenerate with the
same energy value. Note that to suppress the effects of boundary conditions,
we need to introduce disorder potential for the boundary vertices. Searching
localized wavefunctions, we need to choose a small portion of the system. In
this region, we can construct new eigenstates from the degenerate eigenstates,
$\ket{\lambda_{\alpha}}=\sum\phi_{\alpha i}\ket{i}$, where
$\alpha=1,\dots,N_{c}$ indicates the $N_{c}$-fold degenerate states and $i$
represents indices of site, orbital, spin, etc. For this propose, we maximize
inverse participation ratio (IPR) for
$\ket{\psi}\equiv\sum\psi_{\alpha}\ket{\lambda_{\alpha}}=\sum_{i}\sum_{\alpha}\psi_{\alpha}\phi_{\alpha
i}\ket{i}$, which is defined as

$\text{IPR}=\frac{\sum_{i}|\sum_{\alpha}\psi_{\alpha}\phi_{\alpha
i}|^{4}}{\sum_{i}|\sum_{\alpha}\psi_{\alpha}\phi_{\alpha i}|^{2}}.$ (S10)

It is known that, if IPR is equal to one (zero), $\ket{\psi}$ is localized
(extended). We numerically optimize $\ket{\psi}$ to achieve the largest IPR.
Therefore, we can obtain a confined state denoted by $\ket{\psi_{1}}$.
Subtracting $\ket{\psi_{1}}$ from a set of $\ket{\lambda_{\alpha}}$, we can
find a next confined state $\ket{\psi}_{2}$ from $N_{c}-1$ remaining set of
independent eigenstates by maximizing IPR. We can finally find $N_{c}$ well-
localized confined states in this region by continuing this procedure. By
redoing the calculation for other parts of the system, we can obtain all
distinct confined states. Note that the optimization cost increases rapidly
with increasing $N_{c}$.

##  S5 The fraction of confined states in Penrose tiling

Figure S3: Penrose tiling, where the bipartite index of vertices is given by
red and blue dots. The green lines show the forbidden ladder and separate
regions with different bipartite imbalances.

###  S5.1 The fraction of confined states

Koga and Tsunetsugu [1] have calculated the fraction of confined states in
Penrose tiling by considering the cluster structures systematically. In
Penrose tiling, the confined states have finite amplitudes in specific regions
named clusters in Ref. [1]. There are several sizes of clusters [see Fig. S3],
where we label the $i$-th smallest cluster as cluster-$i$. The clusters are
surrounded by stripe regions named forbidden ladders in Ref. [2]. Koga and
Tsunetsugu [1] have calculated the generation dependence of the number of
confined states in each cluster. The confined states in each cluster have
finite amplitudes either in the A sublattice or B sublattice only. Here,
following Ref. [1], M and D sites refer to the sites of a sublattice with
finite and zero amplitudes, respectively. It has been shown that the number of
confined states in each cluster coincides with the difference between the
number of M and D sites in the cluster [1]. In other words, the confined
states in Penrose tiling are related to the imbalance between A and B
sublattices[3]. This systematic approach reveals the fraction of confined
states in the nonzero flux model on Penrose tiling.

We apply the method of Ref. [1] to the $\pi$-flux model. Here, we should note
that clusters in the $\pi$-flux model are the same as those in the zero flux
model. For example, let us consider the configuration Pe.conf1 as a $\pi$-flux
model [see Fig. 4(d1) in the main text. Two clusters are shown in Figs. S4(a)
and S4(b). These are examples of cluster-1 with different angles. Because the
$\pi$-flux model is angle-dependent, the Hamiltonian for the two clusters can
be different. However, the five-fold rotational symmetry and mirror symmetry
of the clusters assure that the Hamiltonian of the $\pi$-flux model does not
depend on their angles. Accordingly, Fig. S4(a) coincides with Fig. S4(b) by a
single mirror reflection about $y$-axis or the $\pi$ rotation about $z$-axis.

Calculating the generation dependence of the number of confined states for
Pe.conf1, we find that the number of confined states for the $\pi$-flux model
is the same as that of the zero flux model for each generation of the cluster.
Also, the number of confined states is the same for other configurations such
as Pe.conf2 and Pe.conf3 [see Figs. 4(e1) and 4(f1) in the main text]. This
suggests that the confined states in the $\pi$-flux model are also related to
the sublattice imbalance of the clusters.

Figure S4: Cluster-1 of Pe.conf1 for the $\pi$-flux model. The angle of the
cluster is different between (a) and (b). The arrows denote the hopping with
nonzero Peierls phase (see the main text for definition).

###  S5.2 The wavefunctions of confined states

Next, we consider the wavefunctions of confined states on Penrose tiling. In
the case of the zero flux model, there are only six types of the confined
states [4, 2, 1], illustrated in Figs. S5 (a-f). Each number on the vertices
represents the relative components of the wavefunction in each type. The red
(blue) color for the numbers implies a positive (negative) sign. Note that the
tiles of type-4 and type-5 include those of type-3 and 2, respectively. Also,
the tiles of type-6 include those of type-1 and type-2. The number of confined
states for each type is summarized in Table. S1.

Figure S5: Six types of confined states in the zero flux model on Penrose tiling. The number on each vertex represents the relative components of the wavefunction. Table S1: The number of confined states in the zero flux model for each type in Penrose tiling. type | 1 | 2 | 3 | 4 | 5 | 6
---|---|---|---|---|---|---
the number of confined states | 1 | 1 | 1 | 2 | 2 | 3

The confined states in the $\pi$-flux model cannot be classified by the six
types shown in Figs. S5 (a-f), although the fraction of the confined states in
the $\pi$-flux model is the same as that of in the zero flux model. Due to the
lack of five-fold rotational symmetry and mirror symmetry in the $\pi$-flux
model, the angle of the tiles is crucial for the type-3,4,5, and 6 in Fig. S5.
We indicate the angle of the tiles by using a rotational index
$r\in{0,1,2,3,4}$. We define the tiles with $r=0$ as illustrated in Figs. S6.
The tiles with $r$ are obtained by rotating anticlockwise the $r=0$ tiles by
$-2\pi r/10$. For example, the type-3 tiles of Pe.conf1 in the $\pi$-flux
model are illustrated in Figs. S7(a) and S7(b) for $r=0$ and 3, respectively.

Figure S6: Six types of the tiles with $r=0$ on Penrose tiling. Figure S7: The
type-3 tiles of Pe.conf1in the $\pi$-flux model. (a) $r=0$ and (b) $r=3$. The
arrows denote the hopping with nonzero Peierls phase (see the main text for
definition).

The number of confined states for a given type and $r$ in several
configurations are listed in Table. S2. It is clearly seen that the number of
confined states for the tiles of type-2,4,5 and 6 in Pe.conf1-3 is the same as
those of the zero flux case. We note that the absence of confine states for
type-1 and type-3 does not affect the fraction of the confined states on the
entire Penrose tiling, because the tiles of type-1 (type-3) are included in
those of type-6 (5 and 6).

Table S2: The number of confined states for given type and $r$ in the three
configurations in the $\pi$-flux model and in zero flux case

.  (a) Pe.conf1 $r$ 0 1 2 3 4 1 0 0 0 0 0 2 1 1 1 1 1 type 3 0 0 0 1 0 4 2 2 2
2 2 5 2 2 2 2 2 6 3 3 3 3 3 (b) Pe.conf2 $r$ 0 1 2 3 4 1 0 0 0 0 0 2 1 1 1 1 1
type 3 0 0 0 0 1 4 2 2 2 2 2 5 2 2 2 2 2 6 3 3 3 3 3 (c) Pe.conf3 $r$ 0 1 2 3
4 1 0 0 0 0 0 2 1 1 1 1 1 type 3 0 1 0 0 0 4 2 2 2 2 2 5 2 2 2 2 2 6 3 3 3 3 3
(d) no flux $r$ 0 1 2 3 4 1 1 1 1 1 1 2 1 1 1 1 1 type 3 1 1 1 1 1 4 2 2 2 2 2
5 2 2 2 2 2 6 3 3 3 3 3

Except for type-3, the number of the confined states in the $\pi$-flux model
does not depend on configurations and rotation indexes. Because type-3 has
mirror symmetry about the diagonal line of the central tile, the confined
states exist only when this mirror symmetry is unchanged even in the presence
of $\pi$-flux. Such a symmetry condition is satisfied only for one value of
$r$ in each configuration.

In Fig. S8, we show some examples of the confined states for the given type of
tiles and $r$ in each configuration of the $\pi$-flux model in Penrose tiling.
Note that the confined states for the type-1 do not exist. The confined states
for the type-6 are not shown in Fig. S8, since they are too complicated to
illustrate. There exist two confined states for type-4 and type-5. The tiles
in type-4 and 5 include those in type-3 and 2, respectively. Accordingly, one
of the confined states in type-4 and type-5 is those in type-3 [Figs. S8
(b,f,j)] and type-2 [Figs. S8 (a,e,i)], respectively. We select a linear
combination of the confined states so that the other confined states in type-4
and type-5 [Figs. S8 (c,g,k) and (d,h,l)] are orthogonal to the confined
states in type-3 and type-2. The green lines in Figs. S8 (a-c), (d-g), and
(i-l) represent the axis of mirror symmetry in each configuration. The
confined states shown in Figs. S8 (a-c), (d-g), and (i-k) have the odd mirror
symmetry about the green lines, while the confined state shown in Fig. S8 (l)
has the even mirror symmetry about the green line. The $\pi$-flux models
illustrated in Figs. S8 (d,h) have no mirror symmetry.

Figure S8: Some examples of the confined states in Pe.conf1 (a-d), Pe.conf2
(e-h), and Pe.conf3 (i-l) of the $\pi$-flux model on Penrose tiling. The tiles
are (a) type-2 with $r=1$, (b) type-3 with $r=3$, (c) type-4 with $r=3$, (d)
type-5 with $r=1$, (e) type-2 with $r=0$, (f) type-3 with $r=4$, (g) type-4
with $r=4$, (h) type-5 with $r=0$, (i) type-2 with $r=1$, (j) type-3 with
$r=3$, (k) type-4 with $r=3$, and (l) type-5 of $r=1$. Each number written on
the lattice sites is the relative components of the wavefunctions for the
confined states with zero energy. The arrows denote the hopping with nonzero
Peierls phase (see the main text for definition).

##  S6 The fraction of confined states in Ammann-Beenker tiling

Koga [5] has calculated the fraction of confined states in Ammann-Beenker
tiling by focusing on the domain structures with locally eight-fold rotational
symmetry. Koga has considered the zero flux model in Ammann-Beenker tiling,
whose fraction of confined states has been obtained analytically as
$1/2\tau_{s}^{2}$. In this subsection, we estimate the fraction of confined
states in the $\pi$-flux model by following the method utilized in Ref. [5].

First, we briefly explain the method used in Ref. [5]. To estimate the
fraction of confined states, the number of confined states is systematically
counted focusing on the domain structures $D^{1},D^{2},D^{3},\ldots$,
illustrated in Fig. S9. Here, $D^{i+1}$ is generated by applying
inflation/deflation operation to $D^{i}$ for any generation $i\in\mathbb{N}$.
For each domain, the boundary sites are excluded. Consequently, the number of
sites in $D^{1},D^{2}$, and $D^{3}$ are 17, 121, 753, respectively. There are
sixteen $D^{1}$ structures in $D^{3}$. Note that, when $D^{i}$ and $D^{j}$
($i>j$) structures share their centers, only $D^{i}$ structure is counted as
domain structures and $D^{j}$ is not counted for the sake of preventing a
double count. Following this rule, the $D^{1}$ structure around the center of
$D^{3}$ is not regarded as $D^{1}$.

Figure S9: Ammann-Beenker tiling. The red, blue, and green shaded areas are
$D^{1}$, $D^{2}$, and $D^{3}$, respectively. The sites on the boundary that
are indicated by blue dashed lines are not included in the domains. For
example, the red, blue, and green dots at the boundary of $D^{1}$, $D^{2}$,
and $D^{3}$ are excluded.

The net number of confined states in $D^{i}$ is defined as

$N^{{\rm{net}}}_{i}=N^{{\rm{tot}}}_{i}-\sum_{j=1}^{i-1}N_{i,j}N^{{\rm
net}}_{j},$ (S11)

where $N^{{\rm{tot}}}_{i}$ is the total number of confined states in $D^{i}$
and $N_{i,j}$ is the number of $D^{j}$ in $D^{i}$. Note that
$N^{{\rm{net}}}_{i}$ is the contribution of $D^{i}$ to $N^{{\rm{tot}}}_{j}$
($i<j$). As a consequence, we can break down $N^{{\rm{tot}}}_{j}$ into the
contributions from each domain $i(\leq j)$, which enables us to count the
number of confined states systematically.

Since $N_{i,j}$ satisfies $N_{i,j}=N_{i-1,j-1}$, Eq. S11 can be rewritten as

$N^{{\rm{net}}}_{i}=N^{{\rm{tot}}}_{i}-\sum_{j=1}^{i-1}N_{i-j+1,1}N^{{\rm
net}}_{j}.$ (S12)

We can numerically obtain $N^{{\rm{tot}}}_{i}$ by diagonalizing the zero flux
Hamiltonian. Also, Koga [5] has obtained $N_{i,1}$ analytically for
$i\in\mathbb{N}$. Consequently, we can calculate $N^{{\rm{net}}}_{i}$ from
S12. Table S3 lists $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for
each generation $i$ ($1\leq i\leq 7$). For instance, in the original Ammann-
Beenker tiling $N^{{\rm{net}}}_{i}=i(i+1)$ (see Table S3). The fraction of
confined states is obtained by

$p=\sum_{i}p_{i}N^{{\rm{net}}}_{i},$ (S13)

where $p_{i}$ is the fraction of $D^{i}$. Since Koga [5] has obtained $p_{i}$
analytically as $p_{i}=2\tau_{s}^{-(2i+3)}$, we can obtain $p$ analytically
when the analytical assumption of $N^{{\rm{net}}}_{i}$ is provided. In the
case of the zero flux model, $p$ results in $1/2\tau_{s}^{2}$. We apply Koga’s
method to our $\pi$-flux models. In the following, we consider each
configuration separately.

Note that, since in the $\pi$-flux models, fluxes penetrating tiles are either
$\pm\pi$ or zero, the system has time-reversal symmetry
$\mathcal{T}H^{*}-H\mathcal{T}=0$. On the other hand, due to the bipartite
properties of the structure, the system has chiral symmetry
$\mathcal{C}H+H\mathcal{C}=0$. The product of time-reversal and chiral
operators gives a particle-hole operator $\mathcal{P}=\mathcal{C}\mathcal{T}$,
where $\mathcal{P}H^{*}+H\mathcal{P}=0$. By applying particle-hole (chiral)
operation on a wavefunction with energy $E$, one can see
$\Psi\rightarrow\mathcal{P}\Psi^{*}$ ($\Psi\rightarrow\mathcal{C}\Psi$) and
$E\rightarrow-E$. Therefore, in the following, we consider the confined states
whose energy is greater than or equal to 0.

Table S3: $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for $1\leq i\leq 7$ in the zero flux model of Ammann-Beenker tiling. $i$ | $N_{i1}$ | $N^{{\rm tot}}_{i}$ | $N^{{\rm net}}_{i}$
---|---|---|---
1 | 1 | 2 | 2
2 | 0 | 6 | 6
3 | 16 | 44 | 12
4 | 104 | 324 | 20
5 | 632 | 2110 | 30
6 | 3768 | 12938 | 42
7 | 22152 | 77112 | 56

###  S6.1 AB.conf1 with $E=\sqrt{2}$

For the AB.conf1 in the $\pi$-flux model [see Fig. 2(a1) in the main text]
with $E=\sqrt{2}$, $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for
$1\leq i\leq 5$ are listed in Table S4. As is clearly shown in Table S4,
$N^{{\rm net}}_{i}=1$ for any generation $i$. As a consequence, the fraction
of confined states calculated from Eq. (S13) is $p=\tau_{s}^{-4}$ which
coincides with $p^{{\rm F}}=\tau_{s}^{-4}$, where $p^{{\rm\alpha}}$ is the
fraction of $\alpha$ vertex with $\alpha=$ A, B, C, D, E, and F whose
coordination number is 3, 4, 5, 6, 7, and 8, respectively [6].

By definition, $D^{i}$ always includes $D^{i-1}$ structure, where $D^{i}$ and
$D^{i-1}$ share their centers. Note that we ignore the $D^{i-1}$ structure
when we count the number of $D^{i-1}$ in $D^{i}$. Accordingly, the set of
confined states in $D^{i}$ always includes that of in $D^{i-1}$. As a result,
the number of confined states in $D^{i}$ is greater than or equal to that of
in $D^{i-1}$, namely, $N^{{\rm net}}_{i}-N^{{\rm net}}_{i-1}\geq 0$. The
number of confined states that do exist in $D^{i}$ and do not exist in
$D^{i-1}$ is $N^{{\rm net}}_{i}-N^{{\rm net}}_{i-1}$. In Table S4, $N^{{\rm
net}}_{i}-N^{{\rm net}}_{i-1}=0$ for any $i\in\mathbb{N}$. This implies that
all of the confined states in $D^{i}$ for $2\leq i$ are the confined states in
$D^{1}$. After all, the fact that $N^{{\rm net}}_{i}=1$ for any $i$ implies
the presence of only one type of confined state localized inside $D^{1}$,
which justifies $p=p^{{\rm F}}$.

Table S4: $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for $1\leq i\leq 5$ in AB.conf1 of the $\pi$-flux model on Ammann-Beenker tiling for $E=\sqrt{2}$. $i$ | $N^{{\rm tot}}_{i}$ | $N^{{\rm net}}_{i}$
---|---|---
1 | 1 | 1
2 | 1 | 1
3 | 17 | 1
4 | 121 | 1
5 | 753 | 1

We consider the confined state in $D^{1}$. The choice of confined states is
not unique because a linear combination of confined states is also the
eigenstates with the same eigenenergy. Koga [5] selected confined states so
that they are described by the one-dimensional representation of the dihedral
group $D_{8}$. In the case of the $\pi$-flux model of AB.conf1, all of the
confined states are described by the irreducible representation of the
dihedral group $D_{2}$. A character table for the dihedral group $D_{2}$ is
shown in Table S5. We use Table S5 to classify the confined states in AB.conf1
of the $\pi$-flux model.

Table S5: A character table for the dihedral group $D_{2}$, where $E$ is the identity operator and $C_{2}(\alpha)$ is the rotation operator of $\pi$ around $\alpha(=x,y,z)$ axis. Here, the unit vectors for $x$ and $y$ axes are $\mbox{\boldmath$e$}_{x}=(1,0)$ and $\mbox{\boldmath$e$}_{y}=(0,1)$, respectively. The unit vector for $z$ axis, $\mbox{\boldmath$e$}_{z}$, is defined so that $\mbox{\boldmath$e$}_{x},\mbox{\boldmath$e$}_{y}$, and $\mbox{\boldmath$e$}_{z}$ form the right-handed coordinate system. The arrows denote the hopping with nonzero Peierls phase (see the main text for definition). | $E$ | $C_{2}(z)$ | $C_{2}(y)$ | $C_{2}(x)$
---|---|---|---|---
$\rm{A}$ | +1 | +1 | +1 | +1
$\rm{B_{1}}$ | +1 | +1 | -1 | -1
$\rm{B_{2}}$ | +1 | -1 | +1 | -1
$\rm{B_{3}}$ | +1 | -1 | +1 | -1

The confined state in $D^{1}$ is schematically shown in Fig. S10. We denote
$\Psi^{c,E}_{k}$ as the confined state of configuration $c$ in the $\pi$-flux
model with energy $E$, where $k\in\mathbb{N}$ is the index of confined states.
The $\Psi^{1,\sqrt{2}}_{1}$ is a confined state because it is a locally
distributed eigenstate regardless of the outside structure of $D^{1}$.
According to the Table S5, $\Psi^{1,\sqrt{2}}_{1}$ is described by the
irreducible representation ${\rm{B_{1}}}$. We note that
$\Psi^{1,\sqrt{2}}_{1}$ has amplitudes in both sublattices A and B. As Koga
mentioned [5], the confined states in the zero flux model in Ammann-Beenker
tiling have amplitudes only in one of the sublattices A and B. This noteworthy
feature of Ammann-Beenker tiling is confirmed in AB.conf1 of the $\pi$-flux
model.

Figure S10: The confined state in $D^{1}$ for AB.conf1 of the $\pi$-flux model
with $E=\sqrt{2}$ on Ammann-Beenker tiling. The number represents the
wavefunction’s components of the confined state on each vertex. The arrows
denote the hopping with nonzero Peierls phase (see the main text for
definition).

We discuss how the confined states in $D^{1}$ appear in $D^{i}$ for $2\leq i$.
The confined state in $D^{2}$ is $\Psi^{1,\sqrt{2}}_{1}$ since $D^{2}$
includes the structure of $D^{1}$ around its center. There are 17 confined
states in $D^{3}$ since $D^{3}$ includes sixteen $D^{1}$ and a single $D^{1}$
structure around its center. Figure S11 (a) illustrates the Hamiltonian of
$\pi$-flux model for generation $i=3$, and the red rectangular region is
magnified in Fig. S11 (b). There are two yellow shaded $D^{1}$ structures in
Fig. S11 (b). When the central vertex of $D^{3}$ is A sublattice, the centers
of left and right yellow-shaded $D^{1}$ structures are A and B sublattices,
respectively. Inside these two yellow-shaded regions, the orientations of the
arrows are dependent upon if its central vertex is A sublattice or B
sublattice. By definition, the flip of the orientation of arrows corresponds
to taking the complex conjugate of the Hamiltonian. The eigenstates of the
complex-conjugated Hamiltonian are the complex conjugates of the eigenstates
of the original Hamiltonian. Accordingly, the confined state localized around
the right yellow shaded $D^{1}$ structures in Fig. S11 (b) is
$\left(\Psi^{1,\sqrt{2}}_{1}\right)^{*}$. In general, the confined states
configuration $c$ with energy $E$ in a $D^{i}$ structure included in
$D^{j}(i<j)$ are $\left\\{\Psi^{c,E}_{k}\right\\}_{k}$ and
$\left\\{\left(\Psi^{c,E}_{k}\right)^{*}\right\\}_{k}$ when the center of
$D^{i}$ is on A and B sublattices, respectively.

Figure S11: (a) Schematically drawn Hamiltonian of $\pi$-flux model for $i=3$
Ammann-Beenker tiling. The hopping value from vertex $i$ to $j$ is 1,
$\imath$, and $-\imath$ black lines connecting $i$ and $j$, green arrows from
$i$ to $j$, and green arrows from $j$ to $i$, respectively. (b) The area is
represented by the red rectangle in (a). The yellow-shaded regions are $D^{1}$
structures.

In the zero flux model on Ammann-Beenker tiling, there is a way to choose a
linear combination of confined states so that their weights are +1 or -1, at
least for the smaller generations $1\leq i\leq 3$ [5]. Although the weights
are always real in the zero flux model, those in the confined states of the
$\pi$-flux model can be complex. Correspondingly, we consider if there is a
choice of the linear combination of confined states where the weights of
confined states are one of +1, -1, $\imath$, and $-\imath$. Obviously, the
components of $\Psi^{1,\sqrt{2}}_{1}$ are not in the form of +1, -1, $\imath$,
and $-\imath$.

The fraction of confined states in the $\pi$-flux model with energy $E$ is the
same as that with energy $-E$. For example, the confined state of AB.conf1
with energy $E=-\sqrt{2}$ is $\tilde{\Psi}^{1,\sqrt{2}}_{1}$, and the
corresponding fraction of confined states $p$ is the same as that of energy
$E=\sqrt{2}$.

###  S6.2 AB.conf2 with $E=0$

Next, we consider AB.conf2 [see Fig. 2(b1) in the main text] with $E=0$. For
$1\leq i\leq 5$, $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ are
shown in Table S6. In this case, it is impossible to guess the general
expression of the sequence of $N^{{\rm net}}_{i}$ reasonably. In the case of
the zero flux model, $N^{{\rm net}}_{i}\propto i^{2}$. On the other hand,
$N^{{\rm net}}_{i}$ in the $\pi$-flux model grows faster than quadratic growth
according to Table S6.

Table S6: $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for $1\leq i\leq 5$ in AB.conf2 of the $\pi$-flux model on Ammann-Beenker tiling for $E=0$. $i$ | $N^{{\rm tot}}_{i}$ | $N^{{\rm net}}_{i}$
---|---|---
1 | 1 | 1
2 | 4 | 4
3 | 31 | 15
4 | 236 | 68
5 | 1635 | 347
Figure S12: $\tau_{s}^{2i}$ (black line) and $N^{{\rm net}}_{i}$ (blue
circles) as a function of generation $i$. $N^{{\rm net}}_{i}$ is fitted by
$a\tau_{s}^{bi}$ shown by the red line.

The sum in Eq.(S13) should converge because $p\leq 1$ by definition. Because
$p_{i}\propto\tau_{s}^{-2i}$, the sum in Eq.(S13) does not converge if the
growth speed of $N^{{\rm net}}_{i}$ is faster than $\tau_{s}^{2i}$.
Accordingly, when we fit $N^{{\rm net}}_{i}$ as $a\tau_{s}^{bi}$, $b$ should
be less than 2. We compare $N^{{\rm net}}_{i}$ with $\tau_{s}^{2i}$ in Fig.
S12. By fitting $N^{{\rm net}}_{i}$ as $a\tau_{s}^{bi}$, we obtain the fitting
parameters $a\sim 1.058\times 10^{-1}$ and $b\sim 1.837$, where $b$ is less
than 2.

For numerically obtaining the extrapolation value of $p$ in Eq.(S13), we
define $p(i)$ as

$p(i)=\sum_{j=1}^{i}p_{j}N^{{\rm{net}}}_{j}.$ (S14)

In the zero flux model, we numerically check that $p(i)$ converges faster than
the fraction of $i$-th generation in the limit of $i\rightarrow\infty$. By
fitting $p(i)$ as $c(1-\tau_{s}^{di})$, we obtain $c\sim 8.096\times 10^{-2}$
and $d\sim 3.966\times 10^{-1}$. As shown in Fig. S13, $p(i)$ converges to
$c\sim 8.096\times 10^{-2}$.

Figure S13: The generation $i$ dependence of $p(i)$. $p(i)$ is plotted by blue
circles, while the fitted result using $c(1-\tau_{s}^{di})$ is shown by the
red line.

Next, we consider the confined state in $D^{1}$. Similar to AB.conf1, the
confined states of AB.conf2 should be described by the irreducible
representation of the dihedral group $D_{2}$. Here, the unit vectors for $x$
and $y$ axes are $\mbox{\boldmath$e$}_{x}=(\cos{(-\pi/8)},\sin{(-\pi/8)})$ and
$\mbox{\boldmath$e$}_{y}=(\cos{(3\pi/8)},\sin{(3\pi/8)})$, respectively. The
unit vector for $z$ axis, namely $\mbox{\boldmath$e$}_{z}$, is defined so that
$\mbox{\boldmath$e$}_{x},\mbox{\boldmath$e$}_{y}$, and
$\mbox{\boldmath$e$}_{z}$ form the right-handed coordinate system. The
confined state $\Psi^{2,0}_{1}$ is schematically shown in Fig. S14, which
belongs to the irreducible representation ${\rm{B_{1}}}$.

Figure S14: The confined state in $D^{1}$ for AB.conf2 in the $\pi$-flux model
on Ammann-Beenker tiling with $E=0$. Each number on the vertices represents
the relative wavefunction’s components

of the confined state at each vertex.

The confined states in $D^{2}$ are shown in Fig. S15. The confined states
$\Psi^{1,\sqrt{2}}_{2}$, $\Psi^{1,\sqrt{2}}_{3}$, and $\Psi^{1,\sqrt{2}}_{4}$
belong to the irreducible representations ${\rm{B_{1}}}$, ${\rm{B_{1}}}$, and
${\rm{A}}$, respectively. Although $\Psi^{1,\sqrt{2}}_{1}$,
$\Psi^{1,\sqrt{2}}_{2}$, and $\Psi^{1,\sqrt{2}}_{3}$ belong to the same
irreducible representations ${\rm{B_{1}}}$, we have checked that these states
are orthogonal each other.

Figure S15: The confined state in $D^{2}$ for the $\pi$-flux model of AB.conf2
with $E=0$ on Ammann-Beenker tiling. Each number on the vertices represents
the amplitude of the confined state at each site. The arrows denote the
hopping with nonzero Peierls phase (see the main text for definition).

We note that $\\{\Psi^{2,0}_{k}\\}_{k}$ has amplitudes only in one of the
sublattices A or B, similar to the zero flux model. The components of
$\Psi^{1,\sqrt{2}}_{k}$ for $k=1,3,$ and 4 are one of +1, -1, $\imath$, and
$-\imath$. But if we assume a nonzero coefficient of linear combination for
$\Psi^{1,\sqrt{2}}_{2}$, there is no choice of the linear combination of
confined states whose components of confined states are one of +1, -1,
$\imath$, and $-\imath$.

###  S6.3 AB.conf2 with $E=2$

For the AB.conf2 with $E=2$, $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm
net}}_{i}$ for $1\leq i\leq 5$ are listed in Table S7. It is possible to
assume that the sequence of $N^{{\rm net}}_{i}$ is given by
$N^{{\rm{net}}}_{1}=1$ and $N^{{\rm net}}_{i}=2(2\leq i)$. This sequence of
$N^{{\rm net}}_{i}$ implies that all of the confined states in $D^{i}$ for
$3\leq i$ are the confined states in $D^{2}$, while there is a single confined
state in $D^{2}$ that does not exist in $D^{1}$. We define the confined state
in $D^{1}$ as $\Psi^{2,2}_{1}$ and the confined states in $D^{i}(2\leq i)$ as
$\Psi^{2,2}_{1}$ and $\Psi^{2,2}_{2}$. From Eq. (S13), the fraction of
confined states results in
$p=\tau_{s}^{-4}+(\tau_{s}^{-4}-2\tau_{s}^{-5})=p^{{\rm{F}}}+(p^{{\rm{F}}}-p^{{\rm{F_{1}}}})\sim
3.449\times 10^{-2}$. The component $p^{{\rm{F}}}$ in $p$ is originated from
$\Psi^{2,2}_{1}$ that exists in all the domains $D^{i}(1\leq i)$. On the other
hand, the component $(p^{{\rm{F}}}-p^{{\rm{F_{1}}}})$ in $p$ is originated
from $\Psi^{2,2}_{2}$ that exists in $D^{i}(2\leq i)$. Because
$\Psi^{2,2}_{2}$ does not exist in $D^{1}$, $p^{{\rm{F_{1}}}}$ is subtracted
from $p$.

Table S7: $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for $1\leq
i\leq 5$ for AB.conf2 in the $\pi$-flux model on Ammann-Beenker tiling with
$E=2$

.  $i$ $N^{{\rm tot}}_{i}$ $N^{{\rm net}}_{i}$ 1 1 1 2 2 2 3 18 2 4 138 2 5
874 2

In Fig. S16, $\Psi^{2,2}_{1}$ and $\Psi^{2,2}_{2}$ are schematically
illustrated. The irreducible representation of $\Psi^{2,2}_{1}$ and
$\Psi^{2,2}_{2}$ are A and $\rm{B_{1}}$. Note that $\Psi^{2,2}_{1}$ and
$\Psi^{2,2}_{2}$ have amplitudes in both sublattices A and B. The components
of $\Psi^{2,2}_{1}$ ($\Psi^{2,2}_{2}$) are (not) in the form of +1, -1,
$\imath$, and $-\imath$.

Figure S16: Two confined states, $\Psi^{2,2}_{1}$ and $\Psi^{2,2}_{2}$, for
AB.conf2 in the $\pi$-flux model on Ammann-Beenker tiling with $E=2$. Each
number on the vertices represents the wavefunction’s components of the
confined state at each vertex. The arrows denote the hopping with nonzero
Peierls phase (see the main text for definition).

###  S6.4 AB.conf3 with $E=0$

For the AB.conf3 [see Fig. 2(c1) in the main text] with $E=0$, $N_{i1}$,
$N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for $1\leq i\leq 5$ are listed in
Table S8. Judging from $N^{{\rm net}}_{i}$, we speculate $N^{{\rm net}}_{i}=7$
more than $i=5$. We define the confined state in $D^{1}$ as $\Psi^{3,0}_{1}$,
the confined states in $D^{2}$ as $\left\\{\Psi^{3,0}_{k}\right\\}_{k}(1\leq
k\leq 5)$, and the confined states in $D^{3}$ as
$\left\\{\Psi^{3,0}_{k}\right\\}_{k}(1\leq k\leq 7)$. The fraction of confined
states is obtained as
$p=\tau_{s}^{-4}+4(\tau_{s}^{-4}-2\tau_{s}^{-5})+2(\tau_{s}^{-4}-2\tau_{s}^{-5}-2\tau_{s}^{-7})=p^{{\rm{F}}}+4(p^{{\rm{F}}}-p^{{\rm{F_{1}}}})+2(p^{{\rm{F}}}-p^{{\rm{F_{1}}}}-p^{{\rm{F_{2}}}})\sim
5.137\times 10^{-2}$. The component $p^{{\rm{F}}}$ in $p$ is the contribution
of $\Psi^{3,0}_{1}$ that exist in all the domains $D^{i}(1\leq i)$. The
component $4(p^{{\rm{F}}}-p^{{\rm{F_{1}}}})$ in $p$ is the contribution of
four confined states that exist in $D^{i}(2\leq i)$, namely, $\Psi^{3,0}_{2}$,
$\Psi^{3,0}_{3}$, $\Psi^{3,0}_{4}$, and $\Psi^{3,0}_{5}$. Also, the component
$2(p^{{\rm{F}}}-p^{{\rm{F_{1}}}}-p^{{\rm{F_{2}}}})$ in $p$ is the contribution
of two confined states that exist in $D^{i}(3\leq i)$, namely,
$\Psi^{3,0}_{6}$ and $\Psi^{3,0}_{7}$. Because both $\Psi^{3,0}_{6}$ and
$\Psi^{3,0}_{7}$ do exist neither in $D^{1}$ nor $D^{1}$, $2p^{{\rm{F_{1}}}}$
and $2p^{{\rm{F_{2}}}}$ are subtracted from $p$.

Table S8: $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for $1\leq
i\leq 5$ for AB.conf3 in the $\pi$-flux model on Ammann-Beenker tiling with
$E=0$

.  $i$ $N^{{\rm tot}}_{i}$ $N^{{\rm net}}_{i}$ 1 1 1 2 5 5 3 23 7 4 191 7 5
1271 7

The confined states in AB.conf3 belong to the irreducible representation of
the dihedral group $D_{4}$. Table S9 is a character table for the dihedral
group $D_{4}$.

Table S9: A character table for the dihedral group $D_{4}$, where $E$ is an identity operator, $C_{4}(z)$ is a rotation operator of $\pi/2$ about $z$-axis, $C_{2}(z)$ is a rotation operator of $\pi$ about $z$-axis, $C^{\prime}_{2}$ and $C^{\prime\prime}_{2}$ are umklappung operators, namely, $C^{\prime}_{2}$ and $C^{\prime\prime}_{2}$ are rotation operators of $\pi$ about $x$-axis and the axis whose unit vector is $(\mbox{\boldmath$e$}_{x}+\mbox{\boldmath$e$}_{y})/\sqrt{2}$, respectively. Here, the unit vectors for $x$ and $y$ axes are $\mbox{\boldmath$e$}_{x}=(1,0)$ and $\mbox{\boldmath$e$}_{y}=(0,1)$, respectively. The unit vector for $z$ axis, namely $\mbox{\boldmath$e$}_{z}$, is defined so that $\mbox{\boldmath$e$}_{x},\mbox{\boldmath$e$}_{y}$, and $\mbox{\boldmath$e$}_{z}$ form the right-handed coordinate system. | $E$ | $2C_{4}(z)$ | $C_{2}(z)$ | $2C^{\prime}_{2}$ | $2C^{\prime\prime}_{2}$
---|---|---|---|---|---
$\rm{A_{1}}$ | +1 | +1 | +1 | +1 | +1
$\rm{A_{2}}$ | +1 | +1 | -1 | -1 | -1
$\rm{B_{1}}$ | +1 | -1 | +1 | +1 | -1
$\rm{B_{2}}$ | +1 | -1 | +1 | -1 | +1
E | +2 | 0 | -2 | 0 | 0

In Fig. S17, $\left\\{\Psi^{3,0}_{k}\right\\}_{k}(1\leq k\leq 7)$ are
schematically shown. The irreducible representations of $\Psi^{3,0}_{k}$ for
$k=1,2,3,4,5,6,$ and 7 are ${\rm A_{2}}$, ${\rm B_{1}}$, ${\rm B_{2}}$, ${\rm
B_{1}}$, ${\rm B_{2}}$, ${\rm A_{2}}$, and ${\rm A_{2}}$, respectively. Note
that $\left\\{\Psi^{3,0}_{k}\right\\}_{k}(1\leq k\leq 7)$ have amplitudes in
one of the sublattices A or B only, similar to the zero flux model on Ammann-
Beenker tiling. There is a way to choose the linear combination of confined
states so that their wavefunction’s components are one of +1, -1, $\imath$,
and $-\imath$. In detail, $\Psi^{3,0}_{1}$,
$(\Psi^{3,0}_{2}+\imath\Psi^{3,0}_{3})/2$,
$(\Psi^{3,0}_{2}-\imath\Psi^{3,0}_{3})/2$,
$(\Psi^{3,0}_{4}+\Psi^{3,0}_{5})/2$,
$(\Psi^{3,0}_{4}-\imath\Psi^{3,0}_{5})/2$, $\Psi^{3,0}_{6}$, and
$\Psi^{3,0}_{7}$ are in the form of +1, -1, $\imath$, and $-\imath$. It is
interesting that since $\Psi^{3,0}_{1}\in\mathbb{Z}$ satisfies
$\left(\Psi^{3,0}_{1}\right)^{*}=\Psi^{3,0}_{1}$, $\Psi^{3,0}_{1}$ is a
confined state regardless of the sublattice type of the central vertex in
$D^{1}$.

Figure S17: Seven confined states, $\left\\{\Psi^{3,0}_{k}\right\\}_{k}(1\leq
k\leq 7)$, for AB.conf3 in the $\pi$-flux model on Ammann-Beenker tiling with
$E=0$. Utilizing the even or odd mirror symmetry of confined states, one-
fourth of the entire tiling of $\Psi^{3,0}_{6}$ and $\Psi^{3,0}_{7}$ are
shown. Each number on the vertices represents the amplitude of the confined
state at each vertex. The arrows denote the hopping with nonzero Peierls phase
(see the main text for definition).

###  S6.5 AB.conf3 with $E=2\sqrt{2}$

For the AB.conf3 with $E=2\sqrt{2}$, $N_{i1}$, $N^{{\rm tot}}_{i}$, and
$N^{{\rm net}}_{i}$ for $1\leq i\leq 5$ are listed in Table S10. Similar to
AB.con1 with $E=\sqrt{2}$ $N^{{\rm net}}_{i}$ should be 1 for $1\leq i$.
Accordingly, the fraction of confined states results in
$p=\tau_{s}^{-4}=p^{{\rm{F}}}\sim 2.944\times 10^{-2}$. There is a single type
of the confined state $\Psi^{3,2\sqrt{2}}_{1}$ that is localized around the
central vertex of $D^{1}$.

Table S10: $N_{i1}$, $N^{{\rm tot}}_{i}$, and $N^{{\rm net}}_{i}$ for $1\leq
i\leq 5$ in AB.conf3 of $\pi$-flux model on Ammann-Beenker tiling with
$E=2\sqrt{2}$

.  $i$ $N^{{\rm tot}}_{i}$ $N^{{\rm net}}_{i}$ 1 1 1 2 1 1 3 17 1 4 121 1 5
753 1

The confined state $\Psi^{3,2\sqrt{2}}_{1}$ is schematically shown in Fig.
S18. Its irreducible representation is ${\rm A_{1}}$. Note that
$\Psi^{3,2\sqrt{2}}_{1}$ has amplitudes in both sublattices A and B.
Obviously, the components of $\Psi^{3,2\sqrt{2}}_{1}$ are not in the form of
+1, -1, $\imath$, and $-\imath$.

Figure S18: The confined state, $\Psi^{3,2\sqrt{2}}_{1}$, for AB.conf3 in the
$\pi$-flux model on Ammann-Beenker tiling with $E=2\sqrt{2}$. Each number on
the vertices represents the amplitude of the confined state at each vertex.
The arrows denote the hopping with nonzero Peierls phase (see the main text
for definition).

###  S6.6 Summary for all the configurations

We summarize the generation $i$ dependence of $p(i)$ for the $\pi$-flux model
in Fig. S19, where Conf.0 corresponds to the zero flux model. We plot
$p=\lim_{i\to\infty}p(i)$ at $i=\infty$. It is found that $p$ for any
configuration in the $\pi$-flux model is smaller than that of the zero flux
model. The behavior of convergence in $p(i)$ is almost the same for all the
configurations and $p(5)\sim p$, except for AB.conf2 with $E=0$.

Figure S19: The generation $i$ dependence of $p(i)$ for the $\pi$-flux model
on Ammann-Beenker tiling. “Conf.$c$, $E=e$” corresponds to the configuration
$c$ with energy $e$, where configuration 0 is the zero flux model. The
converged value of $\lim_{i\to\infty}p(i)$, which is obtained by calculating
$p$ in Eq.(S13) except for the AB.conf2 with $E=0$, is plotted at $i=\infty$.
The converged value of $\lim_{i\to\infty}p(i)$ for the AB.conf2 with $E=0$ is
obtained by the fitting in Fig. S13.

Table. S11 summarizes the properties of confined states of the zero flux model
and the $\pi$-flux model on Ammann-Beenker tiling. The amplitudes of the
confined states for zero (nonzero) energy are (not) on one of the sublattices
A or B. Whether the energy of the confined states is zero or not is irrelevant
to whether or not there is a way to choose confined states so that they are
one of +1,-1,$\imath$, and $-\imath$ only.

Table S11: A summary of the properties of confined states of the zero flux model and the $\pi$-flux model on Ammann-Beenker tiling. “Conf.” shows the configuration, “Dihedral group” shows the dihedral group by which the confined states are described, $E$ shows the energy of confined states, “A or B only?” shows if the amplitudes of the confined states are only on one of the sublattices A or B, “$\pm 1,\pm\imath 1$ only?” shows if there is a way to choose confined states so that they are one of +1,-1,$\imath$, and $-\imath$ only, $p$ is the converged value of the fraction of confined states calculated by Eq.(S13) except for the AB.conf2 with $E=0$. Y and N correspond to yes and no, respectively.  Conf. | 0 | 1 | 2 | 3
---|---|---|---|---
Dihedral group | $D_{8}$ | $D_{2}$ | $D_{2}$ | $D_{4}$
$E$ | 0 | $\sqrt{2}$ | 0 | 2 | 0 | $2\sqrt{2}$
A or B only? | Y | N | Y | N | Y | N
$\pm 1,\pm\imath$ only? | Y | N | N | N | Y | N
$p$ | $1/2\tau^{2}$ | $p^{\rm{F}}$ | ? |  | $p^{\rm{F}}$
---
$+(p^{\rm{F}}-p^{\rm{F_{1}}})$
| $p^{\rm{F}}$
---
$+4(p^{\rm{F}}-p^{\rm{F_{1}}})$
$+2(p^{\rm{F}}-p^{\rm{F_{1}}}-p^{\rm{F_{2}}})$
$p^{\rm{F}}$

## References

  * Koga and Tsunetsugu [2017] A. Koga and H. Tsunetsugu, Antiferromagnetic order in the hubbard model on the penrose lattice, Phys. Rev. B 96, 214402 (2017).
  * Arai  _et al._ [1988] M. Arai, T. Tokihiro, T. Fujiwara, and M. Kohmoto, Strictly localized states on a two-dimensional penrose lattice, Phys. Rev. B 38, 1621 (1988).
  * Day-Roberts  _et al._ [2020] E. Day-Roberts, R. M. Fernandes, and A. Kamenev, Nature of protected zero-energy states in penrose quasicrystals, Phys. Rev. B 102, 064210 (2020).
  * Kohmoto and Sutherland [1986] M. Kohmoto and B. Sutherland, Electronic states on a penrose lattice, Phys. Rev. Lett. 56, 2740 (1986).
  * Koga [2020] A. Koga, Superlattice structure in the antiferromagnetically ordered state in the hubbard model on the ammann-beenker tiling, Phys. Rev. B 102, 115125 (2020).
  * Baake and Joseph [1990] M. Baake and D. Joseph, Ideal and defective vertex configurations in the planar octagonal quasilattice, Phys. Rev. B 42, 8091 (1990).


# Natural Language to Verilog: Design of a Recurrent Spiking Neural Network
using Large Language Models and ChatGPT

Paola Vitolo12, George Psaltakis13, Michael Tomlinson1, Gian Domenico
Licciardo2, and Andreas G. Andreou1  1Department of Electrical & Computer
Engineering,
Johns Hopkins University, Baltimore, MD, USA
Email: {pvitolo1, gpsalta1, mtomlin5<EMAIL_ADDRESS>2Department of
Industrial Engineering
University of Salerno, Fisciano, IT  3Department of Electrical & Computer
Engineering,
Hellenic Mediterranean University, Heraklion, GR

###### Abstract

This paper investigates the use of Large Language Models (LLMs) for automating
the generation of hardware description code, aiming to explore their potential
in supporting and enhancing the development of efficient neuromorphic
computing architectures. Building on our prior work, we employ OpenAI’s
ChatGPT4 and natural language prompts to synthesize a RTL Verilog module of a
programmable recurrent spiking neural network, while also generating test
benches to assess the system’s correctness. The resultant design was validated
in three case studies, the exclusive OR,the IRIS flower classification and the
MNIST hand-written digit classification, achieving accuracies of up to 96.6%.
To verify its synthesizability and implementability, the design was prototyped
on a field-programmable gate array and implemented on SkyWater 130 nm
technology by using an open-source electronic design automation flow.
Additionally, we have submitted it to Tiny Tapeout 6 chip fabrication program
to further evaluate the system on-chip performance in the future.

###### Index Terms:

generative AI, LLM, neuromorphic architecture, open-source hardware design,
recurrent spiking neural network.

##  I Introduction

In recent years, the demand for custom integrated circuits has increased
exponentially, driving the Application-Specific Integrated Circuits (ASICs)
market towards a trajectory forecasted to reach USD 33.3 billion by 2033, with
an annual growth rate of 6.4% [1]. Various industries, including aerospace,
telecommunications, automotive, consumer electronics, and healthcare,
increasingly require tailored solutions with custom ASICs to improve their
products’ efficiency and performance in terms of power consumption, area
occupation, and computational capabilities [1, 2]. However, high fabrication
costs, lengthy design and verification times, combined with the increasingly
reliability and stringent demands required by the aforementioned sectors, pose
significant challenges in the hardware design process [3].

To address these challenges, generative Artificial Intelligence (GenAI) and
specifically Large Language Models (LLMs), coupled with Electronic Design
Automation (EDA) tools, could offer viable solutions [4]. In particular, it is
possible to use them in order to automatically generate hardware description
code starting from textual instructions. Many researchers have investigated
the use of LLMs in the hardware design [5, 6]. Tailoring for hardware
debugging, Fu et al. used them for the identification and resolutions of bugs
in hardware designs [7, 8]. To adequately leverage them and improve their
outputs, the authors in [9, 10, 11] fine-tuned them to generate hardware
description code in Verilog or VHDL with reduced syntax errors. The most
popular choice for hardware case-study implementations of LLMs seems to be
OpenAI’s GPT-4. J. T. Meech in [12] used Microsoft Bing-chat, which uses
GPT-4, in order to generate a permuted congruential random number generator
design with a wishbone interface. The die-harder test and the simulations he
conducted verified its functionality and quality of the design. Similarly, our
previous work tackled a programmable 3 by 3 digital spiking neuron array
created solely from conversational language using GPT-4. The above
implementation was submitted for fabrication in Skywater 130 nm technology and
was verified through simulation [13].

While all of above showcase a promising shift in the field, there is still a
need for improvements and further investigations to support more complex
designs.

Building on our prior work [13], in this paper we explore GPT-4’s potential to
design more complex hardware design architectures, such as a Recurrent Spiking
Neuron Network (RSNN), and showcase that an LLM can be used effectively to aid
in neuromorphic hardware design and verification process. Spiking Neural
Networks (SNNs) are known as the third generation of artificial neural
networks. They mimic biological neural networks and are usually designed
requiring smaller architectures than traditional ones with the aim of reducing
power consumption, making them suitable for edge computing applications [14,
15]. Moreover, by leveraging recurrent connections, RSNNs show inherent
capabilities in handling temporal dynamic series classification problems [16,
17].

Specifically, in this work, we tasked ChatGPT, which is a chatbot based on
GPT-4, with generating a Verilog module for a programmable 3 by 3 by 3 RSNN
and create the corresponding test bench to verify its correctness. We tailored
three case studies to validate the generated system, leveraging the assistance
of GPT-4 at this phase as well. The three case studies consisted of exclusive
OR, IRIS flower classification, and MNIST handwritten digit classification.
The system proposed by chatGPT was able to reach accuracies upwards to 96.6%
in our case studies.

To further assess the synthesizability and implementability of the generated
system, we prototyped it on a Field-Programmable Gate Array (FPGA) and
implemented it on Skywater 130 nm technology, utilizing an open source EDA
tool. The design has been submitted to the Tiny Tapeout 6 program for chip
fabrication and will be evaluated for on-chip performance in future work.

##  II Methods

In this work, we used OpenAI’s ChatGPT-4 chatbot based on the Generative Pre-
trained Transformer 4 (GPT-4) LLM. ChatGPT is capable of generating text
human-like responses by leveraging a transformer, a particular neural network
architecture suitable to efficiently process sequences of data, like text,
through parallel processing and attention mechanisms that emphasize relevant
parts of the data [18].

After several attempts, we concluded that to effectively use ChatGPT for
hardware design and verification, a modular approach and bottom-up design
methodology are needed. This involves breaking down the complex RSNN system
into smaller, reusable submodules, which leads to speeding up the development
process, improving manageability, scalability, reusability, as well as
enabling efficient testing by facilitating early error detection and
simplifying maintenance.

Therefore, we asked ChatGPT to describe each submodule in the hardware
description language Verilog and generate the corresponding documentation,
crucial for future maintenance and upgrades. Once a component was ready,
ChatGPT generated the relative test bench to verify each module independently.
Finally, it instantiated all the modules in a top module, thereby constructing
the entire system.

All source code and conversation transcripts are available in the publicly
accessible Github repository at Andreou-JHULabOrg/tinytapeout_06_chatgpt_rsnn
[19].

###  II-A System Hardware Design with ChatGPT

We asked ChatGPT to describe the hardware design of the RSNN schematized in
Fig. 1. The architecture consists of a fully connected neural network
comprising three input spikes and three output spikes. It includes 3 layers,
each consisting of 3 recurrent spiking neurons. Each neuron of a layer is
connected to all neurons of the previous layer, or to all its inputs in the
case of the first layer, resulting in 3 weights per neuron. Consequently, each
layer has a total of 3$\times$3 weigths, amounting 3$\times$3$\times$3=27
weights across the entire network.

RLIFRLIFRLIFRLIFRLIFRLIFRLIFRLIFRLIFHidden layerneuronsInput
layerneuronsOutput layerneuronsInput spikesOutput spikes Figure 1: Schema of
the desired Recurrent Spiking Neural Network, consisting of 3 fully connected
layers, each layer having 3 recurrent spiking neurons.

For the neuronal model, we considered the Leaky Integrate-and-Fire (LIF)
recurrent spiking neuron modeled by 1, where $I_{in}$ represents the input
current, $U$ is the membrane potential, $U_{thr}$ denotes the membrane
threshold, $S_{out}$ is the output spike, $R$ represents the reset mechanism,
$\beta$ is the membrane potential decay rate, and $V$ is the feedback scale
factor.

$\displaystyle U(t)>U_{thr}\rightarrow S(t+1)=1$ (1) $\displaystyle
U(t+1)=\beta U(t)+I_{in}(t+1)+VS_{out}(t)-RU_{thr}$

When the membrane potential exceeds $U_{thr}$, an output spike $S_{out}$ is
generated and $R$ becomes 1, resetting the potential $U$ by subtracting the
threshold value. The recurrent mechanism is characterized by one-to-one
connections, where each neuron is connected back to itself, scaling its output
spike by V. Additionally, the model includes a refractory period during which
the membrane potential $U$ is not affected by neuron inputs after spiking.
This feature ensures that the neuron does not immediately fire again,
providing a more realistic emulation of neuronal behaviour.

Following a bottom-up design approach, we first asked ChatGPT to describe a
LIF spiking neuron. We iteratively refined the Verilog module described by the
chatbot, progressively detailing our requirements and systematically
addressing the emerging errors. The final LIF module provided by ChatGPT is
presented in Table I, alongside the initial output. Then ChatGPT produced the
documentation for this module.

TABLE I: Leaky Integrate-and-Fire Spiking Neuron Verilog Module generated by
ChatGPT

Listing 1: Initial Module

⬇

1module LeakyIntegrateFireNeuron(

2 input clk,

3 input reset_n,

4 input [7:0] input_current,

5 input [7:0] threshold,

6 input [7:0] leak,

7 input [3:0] refractory_period,

8 output reg fired

9);

10

11 reg [7:0] membrane_potential;

12 reg [3:0] refractory_counter;

13

14 always @(posedge clk or negedge reset_n) begin

15 if (!reset_n) begin

16 membrane_potential <= 8’b0;

17 refractory_counter <= 4’b0;

18 fired <= 1’b0;

19 end else begin

20 if (refractory_counter > 0) begin

21 refractory_counter <= refractory_counter - 1;

22 end else begin

23 membrane_potential <= membrane_potential + input_current -
(membrane_potential * leak >> 8);

24

25 if (membrane_potential >= threshold) begin

26 fired <= 1’b1;

27 membrane_potential <= membrane_potential - threshold;

28 refractory_counter <= refractory_period;

29 end else begin

30 fired <= 1’b0;

31 end

32 end

33 end

34 end

35endmodule

Listing 2: Final Module

⬇

1module LeakyIntegrateFireNeuron(

2 input clk,

3 input reset,

4 input enable,

5 input [7:0] input_current,

6 input [7:0] threshold,

7 input [7:0] decay,

8 input [7:0] refractory_period,

9 output reg spike_out

10);

11

12 reg [7:0] membrane_potential = 8’b0;

13 reg [7:0] refractory_counter = 8’b0;

14 wire signed [9:0] potential_update;

15

16 assign potential_update = $signed({membrane_potential[7],
membrane_potential[7], membrane_potential}) +$signed({input_current[7],
input_current[7], input_current}) +(membrane_potential[7] ? $signed({decay[7],
decay[7], decay}) : -$signed({decay[7], decay[7], decay}));

17

18 always @(posedge clk or posedge reset) begin

19 spike_out <= 1’b0;

20

21 if (reset) begin

22 membrane_potential <= 8’b0;

23 refractory_counter <= 8’b0;

24 end else if (enable) begin

25 if (refractory_counter > 0) begin

26 refractory_counter <= refractory_counter - 1;

27 end else begin

28 if (potential_update[9] && potential_update < -128)

29 membrane_potential <= 8’b1000_0000;

30 else if (potential_update > 127)

31 membrane_potential <= 8’b0111_1111;

32 else

33 membrane_potential <= potential_update[7:0];

34

35 if ($signed(membrane_potential) >= $signed(threshold)) begin

36 spike_out <= 1’b1;

37 membrane_potential <= $signed(membrane_potential) - $signed(threshold);

38 refractory_counter <= refractory_period;

39 end

40 end

41 end

42 end

43endmodule

TABLE II: Test Bench for the LIF Spiking Neuron Verilog Module generated by
ChatGPT

Listing 3: Initial Module

⬇

1‘timescale 1ns / 1ps

2module tb_LeakyIntegrateFireNeuron;

3 reg clk;

4 reg reset;

5 reg [7:0] input_current;

6 reg [7:0] threshold;

7 reg [7:0] decay;

8 reg [7:0] refractory_period;

9 wire spike_out;

10 LeakyIntegrateFireNeuron uut (

11 .clk(clk),

12 .reset(reset),

13 .input_current(input_current),

14 .threshold(threshold),

15 .decay(decay),

16 .refractory_period(refractory_period),

17 .spike_out(spike_out)

18 );

19 initial begin

20 clk = 0;

21 forever #10 clk = !clk;

22 end

23 initial begin

24 reset = 1;

25 input_current = 0;

26 threshold = 50;

27 decay = 5;

28 refractory_period = 5;

29 #25 reset = 0;

30 // Stimulus 1:

31 // Small input current, no spike

32 input_current = 10;

33 #40;

34 // Stimulus 2: Larger current

35 // to trigger spike

36 input_current = 60;

37 #20;

38 // Stimulus 3: Check refractory

39 // behavior, should not spike

40 // despite high current

41 input_current = 60;

42 #100;

43 // Stimulus 4: After refractory

44 // period, should be able

45 // to spike again

46 input_current = 60;

47 #100;

48 // Complete the test

49 #50 $finish;

50 end

51 initial begin

52 $monitor("Time = %t, Input Current = %d, Membrane Potential = %d, Spike =
%b", $time, input_current, uut.membrane_potential, spike_out);

53 end

54endmodule

Listing 4: Final Module

⬇

1‘timescale 1ns / 1ps

2module tb_LeakyIntegrateFireNeuron;

3 reg clk;

4 reg reset;

5 reg enable;

6 reg [7:0] input_current;

7 reg [7:0] threshold;

8 reg [7:0] decay;

9 reg [7:0] refractory_period;

10 wire spike_out;

11 LeakyIntegrateFireNeuron uut (.clk(clk),.reset(reset),
.enable(enable),.input_current(input_current),.threshold(threshold),
.decay(decay), .refractory_period(refractory_period),.spike_out(spike_out));

12 initial begin

13 clk = 0;

14 forever #10 clk = !clk;

15 end

16 initial begin

17 reset = 1; enable = 0;

18 input_current = 0; threshold = 127;

19 decay = 1; refractory_period = 10;

20 #25 reset = 0; enable = 1;

21 input_current = 10; #40;

22 input_current = 60; #20;

23 input_current = 60; #100;

24 enable = 0;

25 input_current = 60; #40;

26 enable = 1; #20;

27 input_current = 30; #100;

28 enable = 0; #40;

29 enable = 1;

30 input_current = 75; #60;

31 reset = 1; #30;

32 reset = 0; #40;

33 input_current = 15; #100;

34 enable = 0; #40;

35 enable = 1; #60;

36 input_current = 5;

37 $display("Starting test with low input and high threshold at time %t",
$time);

38 fork

39 begin

40 wait (spike_out == 1);

41 $display("Spike occurred at time %t with low input current", $time);

42 $finish;

43 end

44 begin

45 #10000;

46 $display("No spike after 10000ns with low input current");

47 $finish;

48 end

49 join

50 end

51 initial begin

52 $monitor("Time = %t, Input Current = %d, Membrane Potential = %d, Spike =
%b", $time, input_current, uut.membrane_potential, spike_out);

53 end

54endmodule

Figure 2: Block Diagram describing the pipeline used for our proposed
Sequential MNIST model.

Using the same iterative refinement methodology, the chatbot described the
recurrent LIF neuron including an additional input for the feedback scale
factor. Then we asked it to implement a layer of three neurons, managing the
generation of input currents for each neuron by multiplying input spikes with
weights. Subsequently, ChatGPT described a network with three layers, a First-
In-Parallel-Out (FIPO) based memory for the neuron parameters, and a Finite
State Machine (FSM)-based control unit to manage the memory operations. The
final design is a top module that integrates the network, memory, control unit
for the memory, synchronizers for asynchronous inputs, and a Flip Flop
(FF)-based memory for the input spikes.

The requirements we provided to ChatGPT included that the system support both
negative and positive weights, two’s complement 8-bit fixed point encoding,
management of both negative and positive overflow, and extension of arithmetic
bit length to adequately support accumulation operations.

###  II-B Test Bench Generation with ChatGPT

Once a module was ready, we opened a new chat conversation in a separate
window asking ChatGPT to generate a Verilog test bench for that module. Also
in this task, we iteratively refined the chatbot’s output by troubleshooting
and providing it more details on how we wanted the various test to be run.
Each module was tested individually and, finally, all together with the top
module. Table II illustrates an example of the initial (left) and final
(right) outputs of the LIF module test bench.

##  III Case Studies and Model Results

To assess the functional correctness of the Verilog modules developed by
ChatGPT, we tested the generated design in three case studies: exclusive OR,
IRIS flower classification, and the MNIST handwritten digit classification. To
model this we used the snntorch as well as the the documentation provided for
the recurrent leaky integrate and fire neurons with one-to-one connections
[20]. We also quantized the weights and the parameters of the neural network
using the libraries of snntorch and brevitas [21]. Our architecture consisted
of a three layer network with each of the layers having a quantized linear
layer with recurrent spiking neurons with one-to-one connections consisting of
three neurons each.

###  III-A Exclusive OR

The exclusive OR is a simple classification problem to verify if the network
can learn nonlinear boundaries. For this problem we only used two of the three
input neurons as well as only two of the three output neurons. We were able to
reach accuracies of 95%.

###  III-B IRIS flower classification

The IRIS dataset was a straightforward decision for our network architecture
due to its three classes, the iris setosa,versicolor and virginica. For this
classification we dropped the last feature of the dataset in order to adapt it
for our three inputs architecture. We were able to reach accuracies of upwards
96.6%.

###  III-C MNIST Handwritten digit classification

The previous two case studies do not benefit significantly from the temporal
dynamics of the recurrent spiking neural network we implemented. For that
reason our final case study is the MNIST but in Sequential Order. For this
case study, as can be seen in Fig. 2, we chose the first three digits of the
MNIST dataset (zero, one and two). Additionally to take full advantage of the
architecture we implemented, we split the images of the dataset into three
equal segments, the top , middle and bottom part. In order for those parts to
be split equally we distorted the images and added two additional padding
pixels in our images. That way we were also able to reduce the time-steps
needed from 784 -if we used the image as a whole- to 262. We used those three
segments as inputs for the three input-neurons of our network and we were able
to reach accuracies of 89% for the multi-class classification (zero,one and
two) and 94.7% for the binary classification (zero and one). This case study
showcased the potential of the recurrent spiking neural networks effectively.

##  IV Results and Discussion

ChatGPT successfully generated the Verilog hardware description code for each
module after a total of 117 iterations.

Table III details the iterative conversational design process with ChatGPT for
each hardware module. The LIF Neuron module and RLIF Layer proved the most
challenging, requiring 38 and 17 iterations respectively, across 2 separate
conversations.

The reason lies in two factors: the complex overflow/underflow management,
with bitwidth adjusting to adequately handle input current accumulations, and
in the number of lines of the code. Indeed, the lines count influenced the
difficulty in resolving errors, and module with fewer lines were easier to
troubleshoot, as seen with the RLIF neuron module, which had to handle
overflow/underflow, but has fewer lines of code.

The findings highlight the importance of a modular system design and the need
for clear and well-defined requirements, supplemented by practical examples.

TABLE III: Verilog Hardware Description Code Generation Results | Module
---
Name
| Chat
---
#
| Itera-
---
tions
#
| Lines
---
count
Improvements |
| LIF
---
Neuron
2 |  | 38
---
(24+14)
33 |  | \- Overflow/underflow
---
management
(Bit Width Adjustments +
sign extension)
\- Verilog Syntax +
best practices
\- Adding proper inputs
| RLIF
---
Neuron
1 | 6 | 19 |  | \- Overflow/underflow
---
management
(Bit Width Adjustments
\+ sign extension)
| RLIF
---
Layer
2 |  | 17
---
(10+7)
63 |  | \- Clarification of requirements
---
(format of input data,
parameter sharing among
neurons, behaviour of the
module)
\- Verilog Syntax
\- Oveflow/underflow
management
RSNN | 1 | 8 | 37 |  | \- Clarification on module
---
behaviour
\- Verilog best practices
| FIPO
---
Memory
1 | 12 | 21 |  | \- Clarification on module
---
behaviour
\- Adding control input signals
RegN | 1 | 5 | 6 |  | \- Module Parameterizability
---
\- Adding control input signals
\- Change in reset behaviour
| Control
---
Memory
1 | 9 | 55 |  | \- Clarification on model
---
behaviour
\- Verilog Syntax
| Top
---
Module
1 | 22 | 103 |  | \- Clarification on model
---
behaviour
\- Refining Connections

To verify the synthesizability and implementability of the Verilog modules
generated by ChatGPT, we prototyped the design on an FPGA and implemented it
in ASIC, submitting it to Tiny Tapeout 6 program for chip fabrication. This
submission will allow us to further evaluate the design’s on-chip performance
in the future.

###  IV-A FPGA Prototyping Results

For the FPGA prototyping, we used the Xilinx Vivado Design Suite along with
the Digilent CMOD S7 board, which is equipped with the Xilinx Spartan 7 FPGA.
The post-implementation results of the ChatGPT-generated design show an
utilization of 1011 LUTs and 507 FFs. The maximum allowed system clock
frequency is 83 MHz. Power analysis was conducted using the Switching Activity
Interchange Format (SAIF) file generated during a timing post-implementation
simulation and revealed a total power consumption of 65 mW, of which 4 mW is
dynamic power and 61 mW static power.

Fig. 3 and 4 show a timing post-implementation simulation. It can be seen that
the system has two functional modes: startup mode and running mode. In the
initial mode, all the network parameters are loaded into memory while in the
second the input spikes are processed.

Figure 3: Timing Post-Implementation Simulation of the RSNN hardware design
generated by ChatGPT on Spartan 7 FPGA.

Figure 4: Timing Post-Implementation Simulation of the RSNN hardware design
generated by ChatGPT on Spartan 7 FPGA. Startup mode: loading all network
parameters into the memory.

###  IV-B ASIC implementation and Tiny Tapeout

The chatbot-generated design was implemented using SkyWater 130 nm technology
and OpenLane, an open-source EDA flow. OpenLane automates the digital hardware
design steps, from RTL synthesis and implementation to the generation of the
Graphic Design System II (GDSII) file, which is the final output containing
all the layout information.

Fig. 5 presents a 2D visualization of the final GDSII file. The implementation
results show an area occupation of 0.11 2 and 5187 total cells, distributed as
follows: 1635 combo logics, 1577 taps, 647 NORs, 580 ORs, 512 FFs, 495
buffers, 345 NANDs, 337 ANDs, 242 Misc, 220 multiplexers, 124 inverters, 49
diodes) and in an area occupation of 0.11 mm2.

These results, combined with the all signoff tests passed, demonstrate the
implementability of the hardware design described by ChatGPT and highlight its
potential as a useful tool in the hardware design process.

Figure 5: 2D Visualization of the GDSII file of the RSNN hardware design
generated by ChatGPT.

##  V Conclusions

In this paper, the hardware architecture of a programmable RSNN generated by
the ChatGPT LLM was presented. The design was verified through FPGA prototype
and also synthesized and taped out in the SkyWater 130 nm technology
-TinyTapeout 6-. The system was evaluated by performing inference with three
applications, the exclusive OR,the IRIS flower classification, and hand-
written digit classification MNIST, obtaining an accuracy upwards 96%. Future
work will aim to explore the generation of hardware description code for more
complex networks and to build more comprehensive test benches.

## References

  * [1] “Application specific integrated circuit market full report,” _market.us_ , 2024, accessed: 2024-04-29. [Online]. Available: https://market.us/report/application-specific-integrated-circuit-market.
  * [2] K. Rogdakis, G. Psaltakis, G. Fagas, A. Quinn, R. Martins, and E. Kymakis, “Hybrid chips to enable a sustainable internet of things technology: opportunities and challenges,” _Discover Materials_ , vol. 4, no. 1, p. 4, 2024. [Online]. Available: https://doi.org/10.1007/s43939-024-00074-w
  * [3] Y. Li, J. He, Z. Xie, D. Jiang, and Y. Li, “Frontier development of chips design and production,” _Procedia Computer Science_ , vol. 139, pp. 554–560, 01 2018.
  * [4] G. Huang, J. Hu, Y. He, J. Liu, M. Ma, Z. Shen, J. Wu, Y. Xu, H. Zhang, K. Zhong, X. Ning, Y. Ma, H. Yang, B. Yu, H. Yang, and Y. Wang, “Machine learning for electronic design automation: A survey,” _ACM Trans. Des. Autom. Electron. Syst._ , vol. 26, no. 5, jun 2021. [Online]. Available: https://doi.org/10.1145/3451179
  * [5] J. Blocklove, S. Garg, R. Karri, and H. Pearce, “Chip-chat: Challenges and opportunities in conversational hardware design,” in _2023 ACM/IEEE 5th Workshop on Machine Learning for CAD (MLCAD)_ , 2023, pp. 1–6.
  * [6] M. Liu, N. Pinckney, B. Khailany, and H. Ren, “Invited paper: Verilogeval: Evaluating large language models for verilog code generation,” in _2023 IEEE/ACM International Conference on Computer Aided Design (ICCAD)_ , 2023, pp. 1–8.
  * [7] W. Fu, K. Yang, R. G. Dutta, X. Guo, and G. Qu, “Llm4sechw: Leveraging domain-specific large language model for hardware debugging,” in _2023 Asian Hardware Oriented Security and Trust Symposium (AsianHOST)_ , 2023, pp. 1–6.
  * [8] S. Thakur, B. Ahmad, H. Pearce, B. Tan, B. Dolan-Gavitt, R. Karri, and S. Garg, “Verigen: A large language model for verilog code generation,” _ACM Trans. Des. Autom. Electron. Syst._ , vol. 29, no. 3, apr 2024. [Online]. Available: https://doi.org/10.1145/3643681
  * [9] W. Fu, S. Li, Y. Zhao, H. Ma, R. Dutta, X. Zhang, K. Yang, Y. Jin, and X. Guo, “Hardware phi-1.5b: A large language model encodes hardware domain specific knowledge,” in _2024 29th Asia and South Pacific Design Automation Conference (ASP-DAC)_ , 2024, pp. 349–354.
  * [10] L. J. Wan, Y. Huang, Y. Li, H. Ye, J. Wang, X. Zhang, and D. Chen, “Invited paper: Software/hardware co-design for llm and its application for design verification,” in _2024 29th Asia and South Pacific Design Automation Conference (ASP-DAC)_ , 2024, pp. 435–441.
  * [11] S. Thakur, B. Ahmad, Z. Fan, H. Pearce, B. Tan, R. Karri, B. Dolan-Gavitt, and S. Garg, “Benchmarking large language models for automated verilog rtl code generation,” in _2023 Design, Automation & Test in Europe Conference & Exhibition (DATE)_, 2023, pp. 1–6.
  * [12] J. T. Meech, “Leveraging high-level synthesis and large language models to generate, simulate, and deploy a uniform random number generator hardware design,” _ArXiv_ , vol. abs/2311.03489, 2023. [Online]. Available: https://api.semanticscholar.org/CorpusID:265043065
  * [13] M. Tomlinson, J. Li, and A. Andreou, “Designing silicon brains using llm: Leveraging chatgpt for automated description of a spiking neuron array,” in _2024 Argentine Conference on Electronics (CAE)_ , 2024, pp. 154–159.
  * [14] A. Akusok, K.-M. Björk, L. E. Leal, Y. Miche, R. Hu, and A. Lendasse, “Spiking networks for improved cognitive abilities of edge computing devices,” in _Proceedings of the 12th ACM International Conference on PErvasive Technologies Related to Assistive Environments_ , ser. PETRA ’19. New York, NY, USA: Association for Computing Machinery, 2019, p. 307–308. [Online]. Available: https://doi.org/10.1145/3316782.3321546
  * [15] A. S. Cassidy, J. Georgiou, and A. G. Andreou, “Design of silicon brains in the nano-CMOS era: Spiking neurons, learning synapses and neural architecture optimization,” _Neural Networks_ , vol. 45, pp. 4–26, Sep. 2013. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0893608013001597
  * [16] J. Shen, J. K. Liu, and Y. Wang, “Dynamic Spatiotemporal Pattern Recognition With Recurrent Spiking Neural Network,” _Neural Computation_ , vol. 33, no. 11, pp. 2971–2995, 10 2021. [Online]. Available: https://doi.org/10.1162/neco_a_01432
  * [17] J. Craley, T. S. Murray, D. R. Mendat, and A. G. Andreou, “Action recognition using micro-Doppler signatures and a recurrent neural network,” in _Proceedings of the 51st Annual Conference on Information Sciences and Systems (CISS-2017)_ , 2017.
  * [18] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. u. Kaiser, and I. Polosukhin, “Attention is all you need,” in _Advances in Neural Information Processing Systems_ , I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, Eds., vol. 30. Curran Associates, Inc., 2017. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547de e91fbd053c1c4a845aaPaper.pdf
  * [19] P. Vitolo, M. Tomlinson, ChatGPT-4, G. Domenico, and A. Andreou, “Tiny tapeout 06: Chatgpt designed recurrent spiking neural network,” _Andreou JHU Lab_ , 2024, accessed: 2024-04-29. [Online]. Available: https://github.com/Andreou-JHULabOrg/tinytapeout_06_chatgpt_rsnn
  * [20] J. K. Eshraghian, M. Ward, E. O. Neftci, X. Wang, G. Lenz, G. Dwivedi, M. Bennamoun, D. S. Jeong, and W. D. Lu, “Training spiking neural networks using lessons from deep learning,” _Proceedings of the IEEE_ , vol. 111, no. 9, pp. 1016–1054, 2023.
  * [21] A. Pappalardo, “Xilinx/brevitas,” 2023. [Online]. Available: https://doi.org/10.5281/zenodo.3333552