SciPostPhysCodeb 34
SciPostPhysCodeb 34
Codebases 34 (2024)
Abstract
HYPERTILING is a high-performance Python library for the generation and visualization
of regular hyperbolic lattices embedded in the Poincaré disk model. Using highly op-
timized, efficient algorithms, hyperbolic tilings with millions of vertices can be created
in a matter of minutes on a single workstation computer. Facilities including computa-
tion of adjacent vertices, dynamic lattice manipulation, refinements, as well as powerful
plotting and animation capabilities are provided to support advanced uses of hyperbolic
graphs. In this manuscript, we present a comprehensive exploration of the package, en-
compassing its mathematical foundations, usage examples, applications, and a detailed
description of its implementation.
This publication is part of a bundle: Please cite both the article and the release you used.
DOI Type
doi:10.21468/SciPostPhysCodeb.34 Article
doi:10.21468/SciPostPhysCodeb.34-r1.3 Codebase release
Contents
1 Introduction 3
1.1 Hyperbolic lattices 4
1.2 Applications 5
1.3 Existing implementations 5
2 Setup 6
2.1 Environment 6
2.2 Installation 7
2.3 Quick start 7
1
SciPost Phys. Codebases 34 (2024)
3 Features 7
3.1 Tilings 8
3.2 Graphs 9
3.3 Neighbors 10
3.4 Refinements 11
3.5 Dynamic modification and filters 12
3.6 Drawing 14
3.7 Animations 15
4 Mathematical foundations 16
4.1 Isometries 16
4.2 Geodesics 18
4.3 Polygons 19
5 Architecture 21
5.1 Codemap 21
5.2 Terminology 22
5.3 Static rotational kernels 22
5.3.1 General idea 22
5.3.2 Rotational duplicates 24
5.3.3 Implementation details 25
5.3.4 Neighbors 27
5.4 Dunham’s algorithm 28
5.5 Generative reflection kernel 29
5.5.1 General concepts 29
5.5.2 Algorithmic details 31
5.5.3 Layer definition 32
5.5.4 Graph kernels 35
5.5.5 Neighbors 35
5.5.6 Integrity check 37
5.6 Benchmarks 37
5.7 Choosing a kernel 39
6 Examples 40
6.1 Epidemic spreading 40
6.2 Scalar field theory 41
6.3 Helmholtz equation 42
7 Road map 44
7.1 Triangle groups 44
7.2 Regular maps 44
7.3 Symbolic kernels 45
7.4 Parallelization 45
8 Conclusion 45
References 47
2
SciPost Phys. Codebases 34 (2024)
1 Introduction
The exploration of curved spaces is motivated by the recognition that the intrinsic geometry
of a system can dramatically affect its behavior and characteristics, and that the flat Euclidean
geometry, which accurately describes our everyday experiences, is not universally applicable
across all scales and contexts. Curvature plays a significant role in various branches of science,
most notably general relativity. Although measurements of the cosmic microwave indicate
that the universe as a whole is flat or very close to it [1–3], curvature remains a key concept
in cosmology and astronomy, as massive objects directly change space and time around them.
Spaces with negative curvature in particular are of great interest. These so-called hyperbolic
spaces play a decisive role in the AdS/CFT correspondence [4–7], which provides a duality
between conformal field theory (CFT) operators and Anti-de Sitter (AdS) gravity fields and is
of great significance both for fundamental aspects of quantum gravity [8] and for applications
to strongly correlated condensed matter systems [9].
Applications of curved manifolds are also found in many other fields of science and engi-
neering, for instance, in large-scale climate simulations encompassing the entire planet Earth.
Accounting for the effects of curvature becomes then crucial for accurately modeling and pre-
dicting weather patterns, climate changes and their potential impact on ecosystems. Specifi-
cally, Earth can be represented as a two-sphere, S2 , which is a compact manifold of constant
positive curvature. Constant negative curvatures, on the other hand, correspond to hyperbolic
spaces. These non-compact manifolds distinguish themselves from flat spaces, in that, for in-
stance, the volume encompassed by a ball of radius r grows exponentially with r instead of
polynomially, and there are not one, but infinitely many parallels to any given line L, passing
through any point P not on L.
Manifolds of constant curvature are fully characterized by their scalar curvature radius ℓ.
From a more abstract point of view, ℓ can be seen as a control parameter, representing a
natural extension of the usual flat geometry. Induced by the curvature, established physical
systems exhibit different behaviors or even entirely new phenomena, which, in turn, can be
used as probes, yielding novel insights into the physics of the corresponding flat models, in
the limit ℓ → ∞. Examples of physical processes which are substantially affected by their
supporting geometry can be found in diffusive systems [10–14], in magnetic properties of
nano-devices [15–17], soft materials [18], complex networks [19, 20], including information
infrastructure [21], quantum gravity [22–24], bio-membranes [11], glass transitions [25, 26],
equilibrium spin systems and critical phenomena [27–30] as well as adsorption and coating
phenomena on non-flat surfaces [26].
The investigation of many of the phenomena mentioned so far demands a numerical ap-
proach, often involving a discretized geometric representation, which is generally a nontrivial
task in hyperbolic spaces. The purpose of HYPERTILING [31] is to provide a robust, powerful
and flexible solution for this step.
This paper is organized as follows: In the remainder of this Introduction, we briefly present
hyperbolic spaces and lattices, their application and existing numerical implementations. In
Section 2, we show how easy it is to install and use HYPERTILING and in Section 3 we show-
case the range of features it offers. Section 4 is a short summary of the package’s underlying
mathematical foundations and Section 5 provides an extensive discussion of our algorithmic
numerical implementations, their different features and performances. We show the package
in action in Section 6, discuss our future plans in Section 7 and offer our closing remarks in
Section 8.
3
SciPost Phys. Codebases 34 (2024)
In this paper, we restrict ourselves to the case d = 2, also known as the pseudosphere. This
notion stems from an apparent resemblance of the H2 metric to that of an ordinary sphere.
Using the parametrization x 0 = cosh ρ, x 1 = sinh ρ cos φ and x 2 = sinh ρ sin φ, we arrive at
where ρ ∈ [0, ∞) and φ ∈ [0, 2π). In the literature, a certain variety of similar, polar-like
coordinates representations can be found, a frequently used one being
1
d s2 = dr 2 + r 2 dφ 2 , (4)
1 + r 2 /ℓ2
where the curvature radius ℓ enters explicitly and r ∈ [0, ∞). All these coordinate systems
are mathematically equivalent in that they describe the same manifold. The coordinate rep-
resentation primarily used in this paper is the so-called Poincaré disk model of the hyperbolic
space, denoted as D2 . Its metric is given by
4ℓ2
d s2 = dzdz̄ , (5)
(1 − zz̄)2
where z ∈ C, |z| < 1. Note that K = −1/ℓ2 represents the constant negative curvature of the
manifold. In the Poincaré model, the entire H2 space is projected onto the complex plane,
with the unit circle representing points infinitely far away from the origin.
The hyperbolic two-space can be naturally discretized by regular hyperbolic tilings [32],
which have been studied already since the late 19th century [33, 34]. They become known
to a broader scientific audience due to the works of H.S.M. Coxeter [35, 36], which also have
been an inspiration for M.C. Eschers famous Circle Limit drawings [37]. Regular hyperbolic
tilings preserve a large subgroup of the isometries of H2 [38,39], which makes them promising
candidates for a wide range of numerical simulations setups. Regular tilings are characterized
by their Schläfli symbol (p, q), where the condition (p −2)(q −2) > 4 has to be met in order for
a tiling with q regular p-gons meeting at each vertex, to be hyperbolic. The (7, 3) hyperbolic
tiling and its dual (3, 7) tiling are shown in Figure 1 as an example. Since hyperbolic spaces
exhibit a length scale, defined by their radius of curvature ℓ, the edge lengths of hyperbolic
polygons are fixed quantities, depending only on the Schläfli parameters p and q [40]. Their
geodesic length h(p,q) in units of ℓ can be computed via the Poincaré metric (5) and can be
interpreted as a fixed lattice spacing that cannot be tuned.1 In general, the inherent length
scale has significant implications for the discretization of hyperbolic spaces. Foremost, it ren-
ders a continuum limit of (p, q) tilings in the usual way impossible, which severely limits the
applicability of traditional finite-size scaling methods [41, 42].
1
A detailed discussion can be found Section 4.3.
4
SciPost Phys. Codebases 34 (2024)
1.2 Applications
Hyperbolic lattices found particular interest in the field of critical phenomena [49,50] over the
last two decades. For the Ising model [51] there are strong indications that the critical expo-
nents take on their corresponding mean-field values as the hyperbolic grid can be regarded as
effectively infinite-dimensional [52,53]. Moreover, even at very high temperatures small-sized
ferromagnetic domains can be observed [54]. Despite the mean-field properties on hyperlat-
tices, the correlation length does not diverge at criticality, rather it stays finite, thus indicating
the existence of an inherent length scale linked to the curvature radius which destroys the
usual concept of scale invariance at criticality [55, 56]. Also, other equilibrium critical phe-
nomena have been examined on hyperbolic lattices, including the q-state Potts model and
the X Y model [25, 57, 58]. For the latter, it turned out that the hyperbolic surface induces
a zero-temperature glass transition even in systems without disorder. This is due to the non-
commutativity of parallel transport of spin vectors which causes a breakdown of their perfect
orientational order and consequently gives rise to local frustration. Even more striking novel
effects were found in percolation systems on hyperbolic lattices [59–65]. Specifically, an inter-
mediate phase associated with two critical thresholds arises. At the lower critical probability,
infinitely many unbounded clusters emerge. At the upper critical point, these clusters join into
one unique unbounded cluster, spanning the entire system. In the flat Euclidean limit, these
two thresholds coincide and the intermediate phase vanishes. It was found that this behavior
is due to the non-vanishing surface-volume ratio of these lattices in the infinite-volume limit.
Besides critical phenomena, the physics of hyperbolic tilings has recently been studied in
the context of condensed matter physics [66], circuit quantum electrodynamics [67–69], quan-
tum field theory [70, 71] and topolectric circuits [72–74]. Another research branch where hy-
perbolic lattices arise very naturally is the AdS/CFT correspondence [4], as an Anti de-Sitter
space with Euclidean signature, EAdS2 , is isomorphic to H2 . Current attempts to discretize
the AdS/CFT correspondence are based on modeling hyperbolic spaces [75]. Very recently,
some of the authors were able to show that the Breitenlohner-Freedman bound [76, 77], a
central result in supergravity, which states that certain perturbations that are unstable in flat
geometries are actually stable on hyperbolic spaces, thus allowing for a straightforward exper-
imental realization via hyperbolic electric circuits [78]. In this study, an earlier version of the
HYPERTILING package was used.
5
SciPost Phys. Codebases 34 (2024)
Figure 1: Selection of regular hyperbolic tilings projected onto the Poincaré disk.
Tilings in the upper (lower) row are centered about a cell (vertex).
constructing hyperbolic lattices and, over the years, individual researchers and small research
groups have been developing their own codes. These codes, however, are typically neither
openly available nor maintained after the publication of their associated work and are there-
fore of little use for the wider research community. Among the implementations that are
available, some are for demonstration or educational purposes and have as their main ob-
jective simply displaying hyperbolic tilings [82–86], sometimes with artistic goals [81, 87],
or supporting manufacturing applications [88, 89] that demand the construction of relatively
small tessellations. Other, more group-theoretic approaches, are understood as proof of con-
cept rather than high performance modules [90, 91]. Hence, all these projects do not provide
the performance, data availability, facilities/resources and documentation required for sus-
tained scientific research. It is with the aim of fulfilling these research needs that HYPERTILING
has been created.
2 Setup
2.1 Environment
HYPERTILING is a Python package and should run everywhere where a Python 3 interpreter is
available. In order to construct and visualize basic hyperbolic lattices, we only require two
very common package dependencies, namely numpy and matplotlib. To fully utilize the high
performance aspect of the library, we furthermore recommend installing numba, which is used
to significantly speed up many of HYPERTILING’s internal functions. However, note that even
without numba the package is fully functional, only potentially slower. Finally, specific op-
6
SciPost Phys. Codebases 34 (2024)
tional dependencies are the package sortedcontainers,2 employed for a faster internal memory
layout of specific construction kernels, as well as networkx,3 which can be a useful extension
of the visualization capabilities already provided directly in HYPERTILING. Note that all these
packages are available via standard sources, such as PyPI or conda.
2.2 Installation
The HYPERTILING library can be installed directly from the PyPI package index using the ubiq-
uitous pip installer:
python -m pip install hypertiling
All releases as well as the latest version can also be downloaded or cloned from our public
GitLab repository, using
git clone https :// git . physik . uni - wuerzburg . de / hypertiling /
hypertiling . git
p, q, n = 7, 3, 4
tiling = HyperbolicTiling (p , q , n )
quick_plot ( tiling )
This should display a tessellation similar to the (7,3) lattice shown in Figure 1. In the code
example, the parameter n denotes the number of layers of the tilings, a concept which relates
to the size of the tiling and is also termed coronas or generations in the literature.
A couple of further examples of the capabilities of the package are found in the remainder
of this manuscript, however, a larger selection of code examples and use cases is available as
interactive Jupyter notebooks in the code base.
In the following sections, we explore the features of the package in more detail. In order
to keep the document concise, the complete in-depth documentation and API reference of the
package is included in the code repository https://git.physik.uni-wuerzburg.de/hypertiling/
hypertiling.4
3 Features
The HYPERTILING package centers on the construction of tilings of the two-dimensional hy-
perbolic plane. A hyperbolic tiling (or tessellation) consists of individual cells or, in two di-
mensions, polygons, which are arranged to cover the hyperbolic manifold without voids or
2
https://grantjenks.com/docs/sortedcontainers.
3
https://networkx.org.
4
In case the URL changes in the future, the hypertiling repository is always available through our website,
www.hypertiling.de.
7
SciPost Phys. Codebases 34 (2024)
3.1 Tilings
The kernels which produce a HyperbolicTiling currently available in the package are:
• StaticRotationalSector or "SRS"
Cells are constructed via rotations about vertices of existing ones. Cells are implemented
as HyperPolygon class objects and can be refined (compare Section 3.4). A bookkeeping
system is used to avoid duplicate cells.
• GenerativeReflection or "GR"
Very fast and lightweight tiling construction mechanism, which uses reflections on
“open” edges to generate new cells. Only one symmetry sector is held on storage, with
cells outside of this sector being generated on demand.
• Dunham or "DUN07"
An implementation of the influential construction algorithm by D. Dunham [79, 92].
Recursive calls to a hierarchical tree structure are used to build duplicate free tilings in
hyperboloid coordinates rather than in the Poincaré disk representation.
• DunhamX or "DUN07X"
A modern, heavily optimized variant of DUN07 , with a performance increase of more
than one order of magnitude.
When instantiating a tiling, the kernel can be selected via a keyword argument, using either
the abbreviation string
from hypertiling import HyperbolicTiling
8
SciPost Phys. Codebases 34 (2024)
T = HyperbolicTiling (7 ,3 ,2 ,
kernel = TilingKernels . GenerativeReflection )
An optional keyword for the kernels "SRS" and "SRG" is center , which can take on the
values cell (default) and vertex and determines whether the tiling is centered around a
polygon or a vertex. Examples for both cases can be found in Figure 1. In this context, it is
worth to be remarked that a cell-centered (p, q) tiling is the graphic-theoretical dual of a vertex
centered (q, p) tiling and vice versa.
An in-depth description of all kernels, including their particular advantages and shortcom-
ings, as well as a detailed performance comparison can be found in Section 5. In most cases,
however, the user is well served by either the "SRG" kernel (default), for greater flexibility, or
the "GR" kernel, when speed is important or computing resources are a constraint.
Encapsulating all of the internal mechanics into kernel objects guarantees easy debugging,
modification, and, most important, extendability of the package. Irrespective of which kernel
has been selected for the construction, a HyperbolicTiling object provides, e. g. iterator func-
tionality (which returns a list of coordinates of the cell center and vertices) and can return its
size via the Python built-in len() function. Moreover, cells come with several attributes, such
as the coordinates of their vertices and center, angle in the complex plane, orientation, layer
(or generation) in the tiling, and symmetry sector. These attributes can be accessed using get
functions, for example
T . get_vertices ( i )
T . get_angle ( i )
T . get_layer ( i )
which return these quantities for the i-th cell. A full reference of get-functions can be found
in the package documentation. Note that the definition of polygon layers, the output of
get_layer , might differ among kernels and can be unavailable for some (such as "DUN07"
and "DUN07X" ) due to algorithmic constraints.
3.2 Graphs
In addition to the kernels described in the previous section, we provide kernels which con-
struct HyperbolicGraph objects. What is the difference between a HyperbolicTiling and a
HyperbolicGraph ? Broadly, in Section 3.1, cells are considered as individual entities, with-
out knowledge of their surroundings. It is clear, however, that neighborhood relations are a
crucial property in many applications, as detailed, e. g., in Section 1.2. For this reason, we
provide methods for establishing adjacency between cells or, in other words, to access tilings
as graphs. Such graphs capture the entire geometric structure of the tiling and can be rep-
resented, for instance, as an array of adjacent cell indices, similar to a sparse representation
of the corresponding adjacency matrix. Kernels, which construct only this graph structure,
independent of an actual representation of cells (in terms of their coordinates) are dedicated
graph kernels and produce HyperbolicGraph objects. These leaner objects yield reduced fea-
tures and functionality compared to a full HyperbolicTiling . Currently, two graph kernels
are available in the package:
• GenerativeReflectionGraph or "GRG"
Following the same algorithmic principles as the GR tiling kernel, this class constructs
neighborhood relations already during the construction of the lattice. Only one symme-
try sector is explicitly stored, whereas any information outside this sector is generated
on demand. Geometric cell information, except for the center coordinates, is not stored.
9
SciPost Phys. Codebases 34 (2024)
Figure 2: Adjacency can be defined by shared edges (left panel), shared vertices
(middle panel) or within a radial region (right panel, black circle).
• GenerativeReflectionGraphStatic or "GRGS"
A static variant of the GRG kernel. Adjacency relations for all cells are explicitly com-
puted, such that no sector construction and no on-demand generation is required. Hence
the memory requirement is about a factor p larger compared to GRG. Nonetheless, GRGS
is still very fast and therefore particularly suited for large-scale simulations of systems
with local interactions.
Compared to tilings, hyperbolic graphs are invoked via a separate factory pattern, shown
in the following code example:
from hypertiling import HyperbolicGraph
3.3 Neighbors
For kernels that do not establish adjacency relations already upon lattice construction, these
relations can be computed in a separate second step, if required. The methods get_nbrs and
get_nbrs_list , internally implemented as wrapper functions, offer various neighbor search
algorithms, selectable using the method keyword, as shown in the following code example:
# construct tiling
T = HyperbolicTiling (7 , 3 , 5 , kernel = " SRS " )
The default method is kernel specific and generally the fastest available. Output of
get_nbrs_list is a sparse nested List of length N , where N is the total number of poly-
gons in the tiling. Sublist i contains the indices of those cells which are neighbors of the
cell with index i. The function get_nbrs is invoked with an explicit index and yields only
the list of neighbors of that particular cell. Note that, even though HyperbolicTiling and
HyperbolicGraph are different objects, neighbors are accessed in the same way
# let T be a HyperbolicTiling or HyperbolicGraph
10
SciPost Phys. Codebases 34 (2024)
For the SRS kernel, the available neighbor search methods include method="ROS" (ra-
dius optimized slice), where the distance between any pair of cells in one symmetry sec-
tor is computed and compared against the lattice spacing. Also, a combinatorial algorithm
method="EMO" (edge map optimized), where adjacency relations are obtained by identifying
corresponding edges among polygons, is provided. A detailed discussion of all neighbor meth-
ods of the SR kernel family can be found in Section 5.3.4. The GR kernel provides several
different algorithms as well, including a radius search method="radius" and a geometrical al-
gorithm exploiting the lattice construction mechanics, method="geometrical" . For a detailed
list of all methods specific to the GR kernel, refer to Section 5.5.5.
Omitting the method keyword and hence resorting to the default algorithm is a solid choice
in many use cases – unless an unusual definition of neighborhood is required. As illustrated in
Figure 2, neighbors may for instance be defined by sharing either an edge or a vertex with the
cell under consideration. But also broader neighborhoods are possible, e. g. by employing an
appropriately tuned radius search. To ensure clarity regarding the specific definition employed
by a particular method , refer to the package documentation.
In general, the computation of adjacency relations in an existing tiling presents a non-
trivial task. Given the fact that a two-dimensional manifold of negative curvature can not be
embedded into a higher dimensional Euclidean space, a natural ordering, which can be used
to group or sort cells depending on their position, is lacking. Merely partitioning the Poincaré
disk into one or several rectangular grids, inspired by techniques like hierarchical multigrids,
fails to achieve efficient ordering. In a loose sense, this issue arises due to the exponential
growth of the manifold’s volume in all directions. At the same time, the representation is
heavily distorted towards the boundary as the unit circle is finite. As a result, neither the
Poincaré disk coordinates nor any Euclidean-style grid can be employed for efficient sorting
purposes.
Given these difficulties, a conceptually straightforward way of identifying adjacent cells in
any regular geometry is by radius search, which is available as a standalone function in the
neighbors module and used as the default algorithm behind get_nbrs_list in some kernels,
such as DUN07. However, it should be emphasized that any neighbor search method that
makes explicit use of Poincaré disk coordinates risks becoming inaccurate close to the unit
circle, where the Euclidean distance between adjacent cells vanishes. For this reason, we rec-
ommend performing additional consistency checks whenever very large lattices are required.
3.4 Refinements
Unlike in traditional Euclidean structures, in a regular hyperbolic lattice, the edge length of a
cell (which is equivalent to the effective lattice spacing) can not be tuned freely. This is a direct
consequence of a non-zero curvature radius, which introduces an intrinsic length scale to the
system. As discussed in detail in Section 4.3, shrinking or enlarging a regular polygonal cell
also changes its shape. In particular, the interior angles at the vertices are altered, resulting
in overlapping or voids in the tessellation. As a consequence, a continuum limit, where the
lattice spacing tends to zero, is not trivially achievable.
To a certain extent, this limitation can be circumvented by introducing refinements. As
demonstrated in Figure 3, in a triangular tiling, each triangle can always be subdivided into
four smaller ones. The bisectors of the edges of the original triangle are used as new vertices.
In principle, this process can be repeatedly applied and returns more and more fine-grained
refinement levels. If the original tiling is not a triangular one, the first refinement step needs
to be adjusted. In this case, we first subdivide every p-gon (p > 3) into p uniform triangles,
employing the center (of mass) of the original cell as a new vertex, shared among the new tri-
angles. Note that these new cells can be highly non-equilateral, depending on the parameters
p and q. After this first refinement step, we can proceed as described above.
11
SciPost Phys. Codebases 34 (2024)
p, q, n = 6, 4, 3
T = HyperbolicTiling (p , q , n , kernel = " SRS " )
The method refine takes the number of refinement levels as its only argument. One should
be aware that the size of the tiling increases quickly with the number of refinement iterations.
Specifically, the number of cells after r refinement steps is given by
¨
4 r N0 p=3
Nc (r) = for (6)
4 r−1
pN0 p>3
12
SciPost Phys. Codebases 34 (2024)
Figure 3: A cell-centered (3,8) lattice before (left), after one (middle) and after two
(right) refinement iterations.
An illustration of the SRG kernel’s ability to add and remove cells dynamically is given in
Figure 4. We start by adding cells to an existing tiling using the add method. This function acts
on exposed cells, i. e. those with incomplete neighborhoods or, more precisely, cells that have
less than q neighbors. When invoked without arguments, all vacant spaces around exposed
cells are filled with grid cells. Using an efficient container-based bookkeeping system (refer to
Section 5.3.3 for an in-depth explanation) this can be accomplished without creating identical
copies of already existing cells, so-called duplicates. Also, all absent cells which share a vertex
with a currently exposed cell are created by add .
Considering that the SRG kernel gradually builds up the neighbor structure, it is important
to note that exposed cells do only know about their “inwards” neighbors i. e. their parents, but
not their siblings, until the next layer is generated. Naturally, cells located in the boundary
layer of a tiling are always exposed.
When invoking add , also the associated adjacency relations are computed alongside the
process of generating new cells. Newly created cells are always tagged as exposed, even in
case they happen to close a gap or void within the lattice, as can be seen from Figure 4. Cells
acted upon by add lose this attribute, as by design all possible neighbors are then present. In
order to un-expose all cells, i. e. to obtain the complete graph structure of the current tiling, the
user might consider calling a neighbor search method which globally computes the adjacency
structure (see Section 5.3.4).
Apart from adding an entire new “layer”, the add function can also be applied to a subset
of cells, using a list of their indices as an input argument. Those can be exposed cells as well
as “bulk” cells. Clearly, when a cell is already surrounded by the full set of q neighbors, no
new cells are created since any addition would be a duplicate. Newly added cells are assigned
unique indices. The list of exposed cells can be queried using the get_exposed() class method.
13
SciPost Phys. Codebases 34 (2024)
The SRG kernel also provides the functionality to remove cells in an existing tiling, using
the method remove , which takes a list of integers containing indices of cells, that are to be
removed. Cells can be removed anywhere in the lattice, as demonstrated in Figure 4. As for
the addition process, all local adjacency relations are updated accordingly.
In the SRG kernel, both the (usual) one-step lattice construction, as well as the dynamic
addition of cells offer the option to incorporate filters. Filters are small helper functions, that
can be implemented by the user. They can be used, for instance, to limit the generation of the
tiling to certain regions in the Poincaré disk. Filters are expected to follow a simple syntax,
namely they take a complex number (representing the central coordinate of a cell) as an input
argument and return a boolean determining whether this cell is to be created or not. During
the construction procedure, every candidate for a new cell is checked against that filter and
only created if the associated condition is met. For example, in case one wants to grow a tiling
only into the upper half of the complex plane, a filter like this might be suitable:
import numpy as np
def my_angular_filter ( z ) :
angle = np . angle (z , deg = True )
return True if (0 < angle < 180) else False
3.6 Drawing
Working with non-standard computational lattices also demands suitable methods for data
visualization. In the Poincaré disk model of hyperbolic geometry, we are confronted with a
number of challenges regarding graphical representations. First and foremost, lattice cells are
always bound by curved edges, a property that is not natively supported by many standard
plot engines. Moreover, for larger lattices, the strong distortion of the stereographic projec-
tion towards the boundary of the unit circle results in a pollution of cells near that boundary.
This consumes substantial numerical resources, even though these cells typically can not be
resolved.
To support the user to deal with those challenges, in HYPERTILING, we provide a selection of
visualization routines for hyperbolic tilings and associated geometric objects. These routines
are summarized in Table 1 and described in more detail below.
14
SciPost Phys. Codebases 34 (2024)
Matplotlib API
• quick_plot
Focus on simplicity and speed, offering the best performance, but the fewest extra op-
tions, namely, adding the Poncaré disk boundary (unit circle), setting the image resolu-
tion and the arguments from matplotlib’s Polygon , such as linewidth or alpha.
• plot_tiling
Offers more customizable plots: by internally using matplotlib’s Patch es instead of
Polygon s, the full extent of matplotlib’s keyword arguments is available. Besides, lazy
plotting (see below) and individually colored cells are available.
• plot_geodesic
Plots the tessellation with geodesic edges. The routines above plot polygons with Eu-
clidean straight lines instead of hyperbolic geodesics, which is faster but of course not
exact. In this routine, this limitation is partially overcome by converting edges to arc ob-
jects – the cost of this trick, however, is the loss of the notion of cells or patches, which
therefore can not, e. g., be filled with color. We intend to include this feature in a future
release.
Lazy plotting Since cells near the boundary of the unit circle often can not be displayed
properly, it can be useful to set a cutoff radius beyond which polygons are omitted. This feature
is activated by the option lazy plotting, available for the plot_tiling and plot_geodesic
routines, and results in lighter plots without slicing the lattice itself.
Code extension The modular design of the code simplifies the integration of specific features
from the library into the user’s custom routines. Two important internal plotting functions
are given by convert_polygons_to_patches and convert_edges_to_arcs , which produce the
corresponding matplotlib graphic objects from hyperbolic cells. The routines plot_tiling
and plot_geodesic described above are essentially wrappers for these functions, which are
useful building blocks for further plot scripts, as shown in our demo notebooks, available in
the package repository.
SVG module
Many applications demand tessellations to be depicted in a geometrically accurate manner –
e. g. with vertices connected by geodesics instead of Euclidean straight lines – and in a for-
mat that allows the usual graphical manipulations, such as filling areas with color. To make
this possible we provide an SVG drawing extension module in HYPERTILING. The function
make_svg renders the tiling as a vector graphic object where edges are drawn as geodesics
and polygons are encoded as closed loops consisting of several edges. The SVG image can
then be displayed by the interpreter using draw_svg or written to a file via write_svg .
The SVG module provides in many respects the most flexible drawing option in the HYPER-
TILING package since SVG images can be freely manipulated in any text editor or vector graphic
program. The module’s downside is its incompatibility with the matplotlib plot environment:
The extension provides a few options, such as line color and thickness, however, production
quality images typically demand additional polishing using external programs.
3.7 Animations
Besides its plotting facilities, HYPERTILING also comes with animation classes, which support
dynamically adjustable viewpoints and cell colors. The resulting animations can be exported as
15
SciPost Phys. Codebases 34 (2024)
video files. These classes are implemented as wrappers around matplotlib’s built-in animation
module and render particularly well in a Jupyter notebook environment, where interactive
plotting can be activated using the %matplotlib notebook command. HYPERTILING’s anima-
tion classes are briefly described below and a demonstration notebook with code examples is
available in the package’s repository.
List animations Given a pre-computed array-like object of color states, the AnimatorList
creates an animation in which the cells’ colors cycle through this list. Standard matplotlib
animation keyword arguments are also accepted, including interval , setting the distance
between color changes in milliseconds, or repeat or repeat_delay .
Live animations The AnimatorLive class has a very similar signature to that of
AnimatorList , but instead of taking a pre-computed list of states, it allows the color values to
be updated dynamically, according to a user-implemented function. This function must take
the current state as its first argument and return a new state (an array-like object matching the
number of cells in the tiling). Additional function arguments (such as physical parameters)
can be passed as keyword arguments using stepargs . As with AnimatorList , matplotlib ani-
mation keyword arguments are passed using the animargs dictionary. Note that the argument
frames in this case controls the duration of exported animations.
Path animations The classes above vary only the colors on an otherwise static background
tiling. The PathAnimation class introduces the possibility of translating the lattice during the
animation. Colors can also be animated, according to a list, like in ListAnimation . The trans-
lation is defined by a path, which can be a sequence of polygon indices or of coordinates in the
complex plane: These path elements are sequentially moved to the origin, with the smooth-
ness of the animation being controlled by the number of intermediate frames, path_frames ,
between every path element.
4 Mathematical foundations
We now transition to the mathematical foundations of two-dimensional hyperbolic geome-
try. This section explains key concepts such as isometries, Möbius transformations, and the
construction of geodesics and polygons in the Poincaré representation.
4.1 Isometries
As already hinted in the introduction, the hyperbolic 2-space in the Poincaré disk representa-
tion is given by the interior region of the complex unit circle, D2 = {z ∈ C, |z| < 1}, equipped
with the metric
4ℓ2
d s2 = dzdz̄ , (7)
(1 − zz̄)2
where K = −1/ℓ2 represents the constant negative Gaussian curvature of the manifold. The
set of orientation-preserving Möbius transformations f : C → C, defined as
az + b
f (z) = ; a, b, c, d ∈ C; ad − bc ̸= 0 (8)
cz + d
establishes the Möbius group
Möb+ ∼
= PGL(2, C) , (9)
16
SciPost Phys. Codebases 34 (2024)
which is isomorphic to the projective linear group of degree two with complex coefficients.
These transformations take on a key role in hyperbolic geometry since certain subgroups act
as conformal isometries on the Poincaré disk D2 . Specifically, the subgroup of Möbius transfor-
mations which describes all orientation-preserving isometries of D2 and contains all elements
as in Eq. (8) can be written as 2 × 2 matrices
z a b z
7→ . (10)
1 c d 1
Through the unitarity requirement, we find |a|2 − |b|2 = 1 as well as d = ā and c = b̄, yielding
the final form
z a b z
7→ , (11)
1 b̄ ā 1
| {z }
M
with |M | = 1. This makes it manifest that the set of orientation-preserving isometries forms a
projective special unitary group
PSU(1, 1) = SU(1, 1) / {±1} ⊂ Möb+ , (12)
which is isomorphic to PSL(2, R) [39]. Discrete subgroups of PSU(1, 1) are oftentimes referred
to as the Fuchsian groups in the literature [38].
Depending on the choice of the three independent coefficients, M represents elementary
isometric transformations of the hyperbolic plane such as rotation, translation, and reflections.
Factoring a complex angle, we arrive at
z−α
f (z) = eiφ , 0 ≤ φ < 2π, α ∈ D2 , (13)
1 − ᾱz
and setting α = 0 we find rotations about the origin z 7→ eiφ z, which in matrix form can be
written as
e iφ/2 0
R(φ) = . (14)
0 e−iφ/2
Translations on D2 are proper Lorentz boosts in 2 + 1 dimensions, or in other words ele-
ments of SO+ (1, 2). Consequently, we may write translations as
cosh θ2 sinh θ2
z z
7→ θ θ , (15)
1 sinh 2 cosh 2 1
| {z }
T x (θ )
for boosts along the real axis with rapidity θ (not θ /2!). Boosts in an arbitrary direction can
readily be realized by adding suitable rotations before and after the actual translation, i. e.
T (θ ) = R(φ)T (θ )R(−φ) , (16)
where φ is the angle between a vector pointing in the translation direction and the positive
x-axis. Likewise, a rotation around an arbitrary point can be accomplished through the proper
composition of elementary transformations. Thus, in addition to rotation, we implement the
general form of a translation of point z0 to the origin, given by
z − z0
z 7→ f T (z) = , (17)
1 − z z¯0
where the inverse transformation is given by
z + z0
z 7→ f T −1 (z) = , (18)
1 + z z¯0
which maps the origin back to z0 .
17
SciPost Phys. Codebases 34 (2024)
za
u
zb
v
Figure 5: Geodesic line segments (black arcs) and their continuation towards infinity
(dashed lines). The boundary of the gray disk represents the complex unit circle. The
point m denotes the center of a hyperbolic circle and has equal distance to all points
on its boundary (red). Corresponding shortest paths are marked by dotted lines.
4.2 Geodesics
On the Poincaré disk, straight lines are circular arcs which intersect orthogonally with the
boundary, i. e. the unit circle S1 , as illustrated in Figure 5. Points on S1 (compare u, v in the
Figure) are located infinitely far away from the interior region of the disk in terms of geodesic
distance. Geometrically, the construction of a geodesic line through two points za , z b ∈ D2
requires a circle inversion on the set of complex numbers without the origin, i. e. f : C+ → C+ ,
where f (z) = 1/z̄ = z/|z|2 of either of the two points, which gives us zc outside the unit
circle. We are left to construct a circle through the points za , z b , zc and suitably parametrize
the segment from za to z b . Note that the circle inversion can not be applied if za , z b and the
origin are collinear. In this case, the geodesic becomes a straight line in the projection.
One particular advantage of the Poincaré disk representation of two-dimensional hyper-
bolic space is that it represents a conformal model. Therefore, angles on D2 are measured
exactly as the corresponding Euclidean angle in C and hyperbolic circles are mapped to Eu-
clidean circles, although hyperbolic and Euclidean circle centers and radii do not coincide, as
illustrated in Figure 5.
We define the length of a parametrized path γ : [a, b] → D2 as a suitable integral over the
hyperbolic line element
Z b Z b
dγ 2ℓ
lengthD2 (γ) = dt ≡ 2
γ′ (t) 2 dt (19)
a dt D2 a 1 − |γ(t)|
Z
2ℓ
= 2
|dz| , (20)
γ 1 − |z|
where ||·||2 represents the Euclidean norm. This allows to compute geodesic distances between
two points za , z b on the Poincaré disk by evaluating the above integral along the corresponding
shortest path
d(za , z b ) = inf lengthD2 (γ) : γ with endpoints za , z b . (21)
The hyperbolic distance between a point z ∈ D2 and the origin yields
1 + |z|
−1
d(0, z) = 2ℓ tanh (|z|) = ln , (22)
1 − |z|
18
SciPost Phys. Codebases 34 (2024)
α
γ
Figure 6: Hyperbolic triangles of different size. The left panel depicts a so-called
ideal triangle, where all three vertices are located at infinity (ideal points) and the
sum of interior angles is zero. The middle panel shows a finite triangle and the right
panel the fundamental cell of a regular (7,3) tiling, with equal edge lengths and an
angle sum of exactly 2πp/q.
whereas the general form of the distance between two points w, z ∈ D2 is given by
|z − w|
d(w, z) = 2ℓ tanh−1 . (23)
|1 − z w̄|
4.3 Polygons
We define a hyperbolic polygon as a region confined by a set of geodesic line segments, so-called
edges. The endpoints of these edges are called vertices. If all edges have the same length, the
polygon is said to be regular. Unlike in Euclidean geometry, where the sum of the inner angles
at the vertices is exactly (p − 2)π, polygons in hyperbolic (spherical) spaces have angle sums
of less (more) than (p − 2)π, respectively.
A tiling or tessellation is a set of regular polygons which are isometric and cover the entire
manifold without overlappings or voids. In the Euclidean case there exist exactly three iso-
metric tilings, which are the well-known square, triangular and honeycomb lattices [93]. The
corresponding characteristic lattice spacing h can be scaled freely. We encounter a substantially
different behavior in a hyperbolic space, where the curvature radius introduces an additional
length scale. As a result, the sum of inner angles depends on the size of a polygon. In Figure 6
we demonstrate the interplay between polygon areas and its vertex angles. From the picture,
it becomes clear that as the triangle size decreases, the angle sum approaches π. This can be
intuitively understood as the space becoming more and more flat locally. Additionally, at any
point in the manifold, the local circumangle must sum up to 2π. These constraints result in
the fact that the fundamental (and any other) polygon must possess specific dimensions to
enable the tiling to cover the entire disk. Specifically, in order to accomplish a full covering,
the angles at the vertices need to have an angle of exactly 2π/q, as shown, for instance, in the
rightmost panel of Figure 6. Here, angles are given by α = β = γ = 2π/7.
Stated differently, the shape of cells in a regular tiling depends on the Schläfli parameters p
and q. In Figure 7 we show a more detailed illustration of all fundamental angles in a regular
tesselation. In this example of a (6,4) lattice, the size of the hexagonal cells is determined by
the restriction that the angle at the edges is exactly 2β = 2γ = 2π/q = 90◦ . A larger size (and
consequently smaller inner vertex angles) would result in gaps between adjacent hexagon cells
along their edges. A smaller size (and consequently larger angle) would result in overlaps.
19
SciPost Phys. Codebases 34 (2024)
The fact that the choice of p and q fixes the polygon size, is a crucial property to keep
in mind when working in hyperbolic geometry. It means that the characteristic length of the
system can not be tuned. We list the most important geometric lengths in Table 2 for a selec-
tion of p and q values. Functions that help to compute these quantities are provided in the
hypertiling.util module. Their exact definition is discussed in the following:
The circumradius r0 of a polygon, which is the distance from its center to either of its
vertices is given by
v
π π
u
u cos +
u
p q
r0 = u
u
. (24)
π π
t
cos −
p q
Furthermore, the radius rm of the in-circle, i. e. the largest circle centered at the origin and
fully inside the polygon is implicitly given by the expression
tanh 2 tanh−1 rm
π
cos = . (25)
p tanh (2 tanh−1 r0 )
Recall that r0 and rm are distances in the complex plane. The true geodesic distance can easily
be computed via Equation (22) as d(0, r0 ) and d(0, rm ), respectively.
For computations involving triangles, hyperbolic geometry provides a particularly useful
rule, the so-called law of sines. Given a generic hyperbolic triangle, where a, b and c represent
the edge lengths opposite to the respective vertices A, B, C, one finds
sin α sin β sin γ
= = . (26)
sinh(a) sinh(b) sinh(c)
It is always possible to divide the fundamental polygon into 2p isometric triangles (compare
△AC D in Figure 7). In this case, where the inner vertex angle at D is exactly π/2, the relation
reduces to
α sinh DC
sin = , (27)
2 sinh AC
which is equivalent to
π sinh(h/2)
sin = . (28)
p sinh d0
20
SciPost Phys. Codebases 34 (2024)
C
D
γ
rm B
r0 β
h α
A
Figure 7: Example of the fundamental polygon (white), its subdivision into isometric
triangles and associated angles in a (6,4) tiling. Angles are given by α = 2π/p and
β = γ = π/q. Moreover h = BC = DC/2 represents the lattice spacing, i. e. the
geodesic distance between any two adjacent vertices in the tiling.
The letter h denotes the hyperbolic distance between vertices, which is nothing but the effective
lattice spacing and can be computed as
cos πp
h = h(p,q) = 2ℓ cosh−1 . (29)
sin πq
Finally, the area enclosed by a general triangle in the hyperbolic domain is given by
A△ = (π − α − β − γ) ℓ2 , (30)
5 Architecture
5.1 Codemap
The HYPERTILING library offers a number of different methods for constructing hyperbolic
tilings and graphs. At the heart of the package, these are implemented as kernels, each of
which contains its own construction algorithm, memory design, auxiliary functions and spe-
cific manipulation features.
This section aims to provide an overview of the relationships among the parts of the library.
These are summarized in the hierarchy of classes and modules depicted in Figure 8. Both
hyperbolic tilings and graphs (see Sections 3.1 and 3.2) are typically instantiated through
factory functions, highlighted in orange in the diagram. Alternatively, objects can be directly
created using constructors of the respective kernel classes. All kernel classes are required
to implement the respective abstract base class, either for graph or tiling, marked in yellow.
21
SciPost Phys. Codebases 34 (2024)
The actual kernel classes themselves are represented in purple. Some kernels share common
foundational structures and inherit from shared base classes, depicted in blue. This streamlines
the development and maintenance of the library by promoting code reusability. Utility classes,
which are essential for the functionality of kernels, but are separated into distinct classes, are
also color-coded blue in Figure 8.
A range of modules, indicated in white in the diagram, provide auxiliary functions such
as distance calculations, coordinate transformations and more. These modules are universally
accessible to all kernels and utility classes due to the common interface provided by the abstract
base classes. Additional modules for plotting, animation, and neighbor calculations further
extend the capabilities of constructed tilings and graphs. These modules typically act upon
the tilings and graphs to provide, e.g. visual representations.
Due to their extensive number, the figure omits specific class methods. For a comprehensive
overview of available functions and detailed API usage, the package documentation can be
consulted.
5.2 Terminology
A property that is shared among all construction algorithms is that they work incrementally,
with new polygons being generated from existing ones. Hence before we start to dive deeper
into kernel-specific properties, it is useful to define commonly used family relations, relative
to a given polygon:
In what follows, the internal mechanics of all kernels currently available in the package
is discussed in greater detail. We remark that this discussion is quite technical. If the reader
does not require this level of detail at present, they might choose to skip Sections 5.3 – 5.5
and refer to it on an as-needed basis later.
22
SciPost Phys. Codebases 34 (2024)
creates creates
svg geodesics
act on
module module
Graph Tiling
extends
abstract class abstract class
plot
module
Module: core
implements
implements implements
HyperPolygon
class
uses extends
Dunham
GR_util class KernelRotationalCommon
class class
extends
uses extends
GenerativeReflectionGraphStatic Kernels
DunhamTransformation
class
class
StaticRotationalSector
uses class
GRGS_util DunhamLegacy
class StaticRotationalGraph
class uses
class
DuplContCirc
SR kernel family class
use
use
Figure 8: UML type diagram for the HYPERTILING library. Rectangles represent classes
or modules, while connections between them describe their relationships. Color
code: Factory function: orange; abstract base class: yellow; kernel class: purple;
shared base class: blue; auxiliary and extension modules: white. Gray regions de-
note different functional families.
about the vertices of existing ones. Building a lattice starts with the construction of a funda-
mental cell, whose edge length is determined by geometric properties of the hyperbolic space
(compare Section 4.3). In the case of a cell-centered tiling (which is the default option, and
can be manually set by adding the center="cell" keyword in the HyperbolicTiling factory
function) this fundamental polygon represents the first layer of the tessellation, whereas for
center="vertex" the innermost layer consists of q polygons (compare Figure 1). Next, the
second layer is constructed by iterating over each vertex in the first layer and computing all
adjacent polygons using successive rotations by an angle of 2π/q about that vertex. Tech-
nically, this operation can be split into a sequence of Möbius transformations, as detailed in
23
SciPost Phys. Codebases 34 (2024)
Figure 9: Class and program flow diagram for the SR kernel section of the package.
Section 4.1. First, a translation is carried out, which moves the vertex to the origin; there, the
polygon is rotated by 2π/q and the inverse translation brings the vertex back to its original
position.
It is evident that the construction scheme presented above produces duplicates. For in-
stance, adjacent parents create a number of identical children. As we aim to produce a
proper duplicate-free tiling, a mechanism that avoids these identical copies is required. This
is achieved by introducing an auxiliary data structure we call DuplicateContainer . In this
container, the coordinates of the center of every cell already present in the computed tiling are
stored. Newly constructed cells are compared against existing ones and those already present
in the container will be discarded.
24
SciPost Phys. Codebases 34 (2024)
in the complex plane, hence, in this case, polygon 2. In practice, however, due to the close-
ness of both polygons to their associated sector boundary, combined with the finite numerical
precision, four cases can occur:
3. Only the one with the smaller angle ends up in the sector.
4. Only the one with the greater angle ends up in the sector.
In the first case, we end up with one rotational duplicate. Note that, in this example, polygons
with indices 2 and 14 are no duplicates per se, i. e. considering only the sector they would
not be recognized as duplicates due to their different center coordinates. However, upon the
angular replication step polygon 2 will be rotated by 2π/p around the origin and then exactly
coincide with polygon 14.
It is obvious that scenarios 1 and 2 must be avoided and we select scenario 4 to be the
desired one. As a result of what is discussed above, a mechanism that reliably filters out
potential rotational duplicates is required. To this end, we introduce a second instance of the
DuplicateContainer data structure. Similar to the global duplicate management container,
this second container stores the cells’ center positions during the construction, however only
those being located within a tiny slice around the lower sector boundary, i. e. with angles
|φ| < ε, where ε ≪ 1◦ . Including these cells automatically ensures that options 2 and 3 can not
be realized, since the polygon with the smaller angle is always inside this “soft boundary”. After
the entire sector is generated and before the angular replication of the lattice is carried out, the
auxiliary container can be used to implement a filtering step. We loop over all cells in the soft
boundary around the upper sector border, i. e. those with an angle of 2π/p −ε < φ < 2π/p +ε
and perform a clockwise rotation by 2π/p. In Figure 10 this soft boundary region is indicated
by the colored lines. If polygon 14 had accidentally been included into the fundamental sector,
after this rotation its center position would be identical to that of polygon 2, which is already
inside the large duplicate container. As a consequence, polygon 14 is deleted from the tiling,
since it will be generated as a copy of polygon 2 at the replication stage of the algorithm.
25
SciPost Phys. Codebases 34 (2024)
II
23 24 21
22 19 20
29
III 32 30 16 15 18
17
33
26 10
31 27 11
14
36
12 I
35
28 13 4 7
34
41
25 3
9
8
38 1
42 6
44 5
39 2
45
37 82
IV 43
48 40 73 76 83
84
47
79
46
50
49 75
81 VII
53 61 74 80
54 78
51
56 77
57
55
52 62 64 70
63 71
60
59 58 67 72
66
V 65 68 69
VI
Figure 10: A hyperbolic lattice, divided into the fundamental symmetry sectors, sepa-
rated by dotted lines and labeled by Roman numerals. Colored straight lines indicate
the soft sector boundary of ±ε, which is used to filter out rotational duplicate cells
as described in the text.
When available on the system, we utilize the external sortedcontainer library, which en-
ables searching within the data structure in logarithmic time O(log(N )), where N denotes the
number of cells already constructed. If it is not available, then our own, slower, fallback im-
plementation is used. Since the centers of a polygon are complex numbers we first need to
establish an ordering relation in order to utilize a binary tree-like data structure. In practice,
we employ the complex angles of the center coordinates for this purpose, hence allowing for
efficient access into a sorted container type. As a result, binning can be avoided altogether,
and we are able to efficiently decide whether a polygon has already been constructed, with an
accuracy up to nearly the relative machine precision. As a double check, during the lattice con-
struction, the typical Euclidean distance of adjacent cells in the complex plane is monitored
and a warning is issued in case this distance comes close to machine precision. This sets a
theoretical limit on the available size of lattices in terms of the radial distance from the origin.
Additionally to this “upper” error limit, we also need to account for the accumulation of
errors due to repeated calculation of layers. In order to keep track of this type of uncertainty
we take a sample of polygons from every newly constructed layer and compute the distances to
their corresponding neighbors. In particular, we are interested in the minimal geodesic distance
within the sample, since this quantity can be interpreted as an approximate bound of the
accumulated error, given the sample is large enough. We compare this minimal distance with
the fundamental geodesic distance of the tiling (i. e. the lattice spacing, compare Section 4.3).
In a scenario of error-free arithmetic, both values would be identical. However, due to the
accumulation of gradually applied Möbius transformations, this discrepancy does not vanish
but usually increases towards the outer layers. Once it reaches the order of magnitude the
coordinates are rounded to (our binning size), the construction becomes unreliable and the
user is duly warned.
26
SciPost Phys. Codebases 34 (2024)
5.3.4 Neighbors
When it comes to adjacency (or neighbor relations) between polygons, SRG and SRS follow
fundamentally different approaches. The static rotational graph (SRG) kernel is capable of
constructing the local neighborhood of cells already during the generation of the tiling. This
is accomplished by a suitable generalization of the DuplicateContainer class (compare Fig-
ure 9) which can hold tuples consisting of center coordinates and corresponding cell indices.
This allows to not only detect whether a candidate polygon is already in the lattice (compare
discussion above) but also to return its index in case it is already present. Since according to
the SR construction principle all adjacent cells of the polygon under consideration (self ) are
attempted to be created, this way we can recover mutual neighbor relations; either the can-
didate polygon already exists, in which case its associated index is added to the neighbor list
of self – or the candidate is, in fact, a valid new polygon, in which case it is assigned a unique
new index and this index is being added to the list of neighbors. Clearly, in both cases, the
index of self is added to other polygon’s neighbor list, to establish mutual adjacency.
The generalized duplicate container furthermore opens the opportunity to dynamically
remove cells, as has been demonstrated in Section 3.5. In principle, this would be possible
with the standard duplicate container as well, but the requirement to identify cells based
on floating point comparisons of their center coordinates would make this approach prone
to rounding errors. Instead, having a cell index available in the container allows to remove
cells by their indices, and use the center coordinate as a helper structure to quickly pinpoint
the corresponding position in the array. In summary, removing a polygon self from the tiling
requires the following steps:
In order to perform these operations efficiently, it is necessary that the list of polygons and
the list of neighbors in the SRG kernel are implemented as Python dictionaries. Only this way,
entries can be added and removed by index in constant time. Overall, step 4 presents the
bottleneck of the removal operation since, as detailed above, locating the correct entry in the
duplicate container, in general, requires logarithmic time (binary search in a sorted container).
Turning to the SRS kernel, where neighborhood relations are not computed upon construc-
tion, we provide several different methods to obtain them in a separate step. All methods can
be accessed by using the standard wrapper function get_nbrs_list via the parameter method ,
which can take on the following values:
• get_nbrs_radius_brute_force or method="RBF"
If the distance between any pair of polygons falls below a certain threshold, they are
declared neighbors. The radius can be passed as a keyword argument. In case no radius
is provided, the lattice spacing is used. Note that this algorithm is very reliable but too
slow for large tilings due to the brute-force all-to-all comparison.
• get_nbrs_radius_optimized or method="RO"
Similar to "RBF" but uses numpy to gain a significant performance improvement.
27
SciPost Phys. Codebases 34 (2024)
31
41
21
2
1 3
11 4
5 6
7
8
1O 9
Figure 11: Sequence in which cells are created in the Dunham algorithm. First layer
polygons {1,11,21,31,41} can be seen as initial nodes of independent branches, re-
sembling the concept of a depth-first search. To enhance clarity, numerical labels are
displayed only in the first branch.
• get_nbrs_radius_optimized_slice or method="ROS"
Variant of the "RO" scheme, which exploits the discrete rotational symmetry and applies
the radius search only to a p-fold sector of the tiling. Neighbors outside the fundamental
sector are obtained via suitable index shifts.
• get_nbrs_edge_map_optimized or method="EMO"
Locating neighbors by identification of shared edges. Apart from the initialization of the
edges, this is a coordinate-free, combinatorial algorithm.
• get_nbrs_edge_map_brute_force or method="EMBF"
Brute-force variant of "EMO" , available for testing and debugging purposes.
28
SciPost Phys. Codebases 34 (2024)
polygon and another factor of −1 from the adjacent closing polygon, which will be created by
a sibling. For closing polygons, the exposure is reduced to Nexp = p − 3, due to the connection
to the formerly mentioned polygon.
In HYPERTILING we implement two variants of the improved version of Dunham’s combi-
natorial algorithm, as outlined in Ref. [92] and a series of unpublished notes around the year
2007. The DUN07 kernel represents an almost literal Python implementation, which suffers
from a number of obvious performance bottlenecks. We address these in an improved version,
named DUN07X , where we are able to achieve a significant performance speed-up and further-
more make the kernel ready for numba just-in-time compilation. Due to the recursive structure
and hence independent trees, this kernel also offers a great starting point for parallelization,
which we leave to future work.
A particular strength of Dunham’s algorithm is that the number of polygons per layer as
well as the correct parent-child relations are deduced exactly. However, it does not provide
a trivial way of determining the neighbor relations during construction since the individual
trees grow independently. A coordinate representation of cell vertices is still required to store
and work with the tiling, introducing floating numbers and limiting the accuracy in practice.
The shortcomings with respect to the determination of neighborhood relations, the perfor-
mance loss due to the construction of an entire tiling, as well as the recursive structure, which
in general provides inferior performance compared to iterative sequential approaches, inspire
us to develop the generative reflection (GR) kernel. It shares several strengths of Dunham’s
approach, such as an exact combinatorial scheme, which avoids duplicates and automatically
determines when a layer is completed, but at the same time provides several substantial im-
provements. This includes a non-recursive algorithmic design, which exploits the discrete
rotational symmetry of a regular tiling and allows to determine adjacency relations natively.
29
SciPost Phys. Codebases 34 (2024)
Figure 12: A parent polygon (black) and its children, constructed by edge reflections.
Left: Orientations and starting points of the children are different from the parent.
Right: Orientations and starting points of the children have been adjusted.
30
SciPost Phys. Codebases 34 (2024)
Figure 13: Left: Filler polygons of first kind (green) and non-filler polygons (orange)
in the second layer of a (7, 4) tiling. Right: Filler polygons of second kind (green) in
a (5, 5) tiling.
Depending on whether the lattice parameter q is odd or even, regular tilings feature either
both or only one kind of filler polygon. This can be understood as follows. Naturally, the
first set of vertices to be closed are those of the fundamental polygon. Specifically, for each
vertex, q − 1 additional polygons are required. As the polygons are created pairwise on the
two open edges connected to a vertex, for q being odd, a final pair of polygons will close this
vertex. However, the vertex in between them, i. e. the one on the edge they share, starts with
two polygons instead of one. Therefore, it needs to be closed like the even-q case for the
fundamental polygon. In this case, the final polygon can be created by both open edges. The
polygon thus has two parents and is therefore a filler polygon of first kind. Its vertices behave
like the vertices of the fundamental polygon. Hence, for q even, the tiling consists of regular
and filler polygons of the first kind only. However, for q odd, the tiling consists of regular
polygons and alternating types of filler polygons. For q = 3, a different scenario arises. In
this case, each polygon is connected to two of its siblings and thus every polygon is a filler
of second kind. However, while for q ̸= 3 filler polygons of second kind are only connected
to one single other filler polygon of second kind, for q = 3 the filler polygons of second kind
are connected to two other filler polygons of second kind. Together these polygons act as two
separate pairs whereas each pair creates a filler of first kind in the next layer. These first kind
filler polygons are also connected to their siblings and thus can be interpreted as filler polygons
of both types, i.e. first and second kind, at the same time.
As cells are created in strictly deterministic order, i. e. layer by layer and in counter-
clockwise direction, all filler polygons involve the last created nibling and the first child of
the next polygon. If the first created child is equal to the last created nibling the filler polygon
is of first kind. If the last created nibling is a neighbor to the first child, both are filler poly-
gons of second kind. Therefore, the vertices of each first child of a polygon are compared to
the edges of the immediately preceding one. If two consecutive vertices match, the polygons
share an edge and for both polygons, the corresponding edge is blocked for a child. Whether
an edge is blocked or not is an important quantity in this algorithm and is encoded as a single
bit.
31
SciPost Phys. Codebases 34 (2024)
• BLOCK_PARENTS_EDGES: For the array edge_array, which encodes whether edges of polygons
are blocked or free, the entry for every polygon is an unsigned integer considered as
a bitset, where each bit represents a certain edge of the respective polygon. For the
initial representation, every bit except the bit for the parent’s edge is set to 1. The
corresponding integer is given as η = 2 p − 1, where p is the number of polygon edges,
as usual.
• CHECK_FILLER_1ST_KIND: Checks whether the first input argument is a filler polygon of first
kind by comparing vertices of the next parent and the most recently created polygon.
This is done using a p × p matrix η, where the components are defined as ηi j = (vi − v̂ j ),
with v and v̂ representing the respective polygon vertices. The row index indicates the
vertex of vi and the column index is the vertex of v j for a certain component. Now, ηi j is
compared against zero, with a threshold in order to account for numerical uncertainties.
This way, matching vertices are identified. If two consecutive vertices match, a filler
polygon of first kind is found and the indices in the matrix η can be used to block the
corresponding edge.
• REFLECT: Computes vertex coordinates for a new polygon through reflection across a
specific edge of the parent polygon. In practice, this is done by a series of Möbius trans-
formations. To be more precise, the polygon is shifted in a manner that positions the
initial vertex of the edge to be reflected upon at the center of the tiling,i. e. at 0 + 0i.
Subsequently, a rotation ensures that the second vertex of the edge under consideration
is also located on the real axis. The actual reflection is done by a complex conjugation,
which inverts the imaginary values of the vertices. Finally, the polygon is rotated again
and moved back to its original position.
• CORRECT_ORIENTATION: Ensures the correct sequence of vertices for the polygon, as illus-
trated in Figure 12.
p
• RADIUS_OF: Calculates the distance of the polygon’s center from the origin as r = zz̄.
In the pseudo-code, input arguments are the lattice parameters p and q, as well as the
number of reflective layers to be constructed, nlayers . Lastly, the polygons variable represents
an array that will serve as the storage for the polygons. It already contains the fundamental
polygon. In the algorithm’s progression, the actual offspring polygon is created in line 24 and
inserted into the list of cells in line 27. The variables poly_counter and index_shift denote a
global polygon number counter and a counter which accounts for the appropriate adjustment
of indices when a new layer is initialized. They are initially set to 1 and 0, respectively.
32
SciPost Phys. Codebases 34 (2024)
with whom the parent shares an edge, will be part of layer n + 1. This is different compared
to the traditional layer definition where children are constructed by rotations about vertices
and therefore might only share a vertex with the parent. We show examples for two different
combinations of (p, q) in Figure 16. In panel (a), cells are colored according to the traditional
layer definition and in panel (b) according to their reflective layer attribute.
In general, it is important to remark that the parameter n in the input parameter set (p, q, n)
denotes the reflective rather than the traditional layer number. For given n, a lattice generated
by GR will therefore in general feature fewer cells than a lattice generated by other kernels.
Due to the different definitions of layers (compare Section 5.5.3), also the overall shape of the
tiling is generally different compared to other kernels. The layer definitions coincide for q = 3
as the vertices will be closed in every reflective layer, however for any q > 3, the behavior is
different. In the traditional layer definition, boundary vertices are immediately closed once
a new layer is constructed, i. e. all polygons which share this vertex are constructed and it
becomes a bulk layer. In the GR, a boundary vertex in layer i will be closed only
q
2, for q even,
∆i = q−1 (31)
2 , for q odd,
reflective layers later. Therefore, the vertex remains at the lattice boundary until ∆i further
layers have been constructed. This holds for every vertex. Hence, as q is increased, the tiling
33
SciPost Phys. Codebases 34 (2024)
Figure 14: Left: (3, 20) grid with ten layers. A vertex shared by two regular polygons
needs ∆i = q/2 = 10 subsequent layers to be closed. Right: (3, 10) lattice with seven
layers. Here, ∆i = 5, hence only vertices of the first layer are closed.
7 7
6 6
5 5
Layer
Layer
4 4
3 3
2 2
2 3 4 5 6 7 5 10 15 20
Geodesic distance to origin Geodesic distance to origin
Figure 15: Distributions of cell distances to the origin for a (7, 3) tiling (left panel)
and a (7, 20) tiling (right panel).
becomes increasingly sparse and its surface more and more fractal. Two examples are depicted
in Figure 14. The vertices appear as white dots due to the boundary lines of the polygons. In
the left panel, we show a (3,20) lattice with ten layers. The vertices for the first layer are
not yet closed. In contrast, the vertices of the first layer in the right panel are closed. The
vertices of the second layer, however, are still open, as one further layer is required to close
them. Consequently, by design, since in the GR a lattice is built until the target number of
reflective layers is reached, the completeness of the last (q − 3)/2 traditional layers can not be
guaranteed.
For compatibility reasons we provide functions that return the layer of a polygon in the
traditional definition, map_layers and get_layer . The former method performs the actual
computation, whereas the latter one represents a wrapper for convenient access. Note that
upon the first call to get_layer , the mapping function is invoked internally, unless manually
executed beforehand. Once mapped, subsequent calls are then simple memory access opera-
tions and hence fast.
It is clear that among the cells in a layer, the radial distances to the origin vary and, more-
over, that the corresponding distance distribution of two adjacent layers in general overlaps.
This is illustrated in Figure 15 for a (7,3) tiling (left panel), as well as for a (7,20) tiling (right
panel). For q = 3, where the traditional and reflective layer definitions coincide, all open
vertices of a layer are immediately closed by the subsequent one, which makes the overlap
minimal. Instead, the overlap is considerably large for q = 20 since subsequent ∆i = q/2 = 10
layers are required to close a vertex. The filler polygons in a layer always represent the maxi-
mal radial extension into previous layers.
34
SciPost Phys. Codebases 34 (2024)
(a) (b)
Figure 16: Comparison of traditional (a) and reflective layers (b) for a (3,7) tiling.
In both cases, n = 5, however the resulting lattice size (number of cells) is different.
Only for q = 3, both definitions become identical (not shown).
5.5.5 Neighbors
As mentioned above, the GRG and GRGS kernels construct adjacency relations automatically.
For the original GR kernel, this is not the case, however, we provide a number of methods that
allow to obtain the neighbors of a polygon in a separate second step. The methods can be
accessed either directly or using the get_nbrs method. The latter wrapper function, which
is shared by all kernels (compare Section 3.3), takes a keyword method which specifies the
algorithm. In the following, we go through all methods available in the GR kernel in detail:
• get_nbrs_generative or method="GEN"
Neighbors are determined in a brute-force manner, where the center of the cell is re-
flected across all edges, and resulting points are compared to the center coordinates of
35
SciPost Phys. Codebases 34 (2024)
every other cell in the lattice. This is achieved by calling the helper routine find on
these points, which, as detailed earlier, extracts the corresponding polygon index. As a
consequence, similar to the find function itself, execution times for this method heavily
depend on the structure and size of the lattice. However, at the same time, this method
is therefore relatively robust and good for testing and debugging purposes.
• get_nbrs_radius or method="RAD"
This method calculates the overall distance between the considered polygon and all other
polygons in a brute-force manner. In case the distance matches the lattice spacing, the
respective polygons are considered neighbors.
• get_nbrs_geometrical or method="GEO"
In "GEO" we compute adjacency relation using the relative positions of polygons inside
their reflection layers, defined as
i
Γi = , (32)
Nj
where i is the index of the polygon and N j is the number of polygons in its corresponding
reflection layer j. This measure can be interpreted as an angular position in the layer. Let
us consider an arbitrary child-parent pair, where the parent index is i and the child index
K. By design, we know that the child is created directly from its parent and therefore
the relative positions in their respective layers must be similar. This allows to provide a
precise guess for the index of neighbor cells, given by
k ≈ Γi · nk . (33)
It needs to be remarked that filler polygons create a minor additional shift. In practice, a
small region around the guess index is scanned for children and as soon as one is found,
the remaining ones can be determined straightforwardly. Only for q = 3, the siblings of
a polygon are its neighbors. They are always located at indices i − 1 and i + 1.
• get_nbrs_mapping or method="MAP"
This method assumes that the neighbors of all cells in the fundamental sector have been
mapped (i. e. explicitly stored) earlier and are hence immediately available. This can
be achieved by invoking the function map_nbrs once. In case the region of interest is
outside the fundamental sector, all relations are properly adjusted. In case the neighbors
have not been mapped beforehand, get_nbrs_mapping will perform the mapping first,
resulting in a significantly larger execution time for the initial call. The way map_nbrs
works is that it computes the distance of the current polygon to all polygons in the
previous layer in order to find the two closest points which are candidates for its parents.
Analogously, the next layer is searched for the remaining neighbors. In the process, all
candidates are compared against the lattice spacing in order to determine which of them
are actual adjacent cells. Only in case of q = 3, siblings are relevant, which can be readily
identified as the immediately adjacent indices of self .
Additionally to these methods, which return neighbors of single cells, the GR kernel pro-
vides an implementation of get_nbrs_list , which returns the neighbors for the entire tiling.
This function calls map_nbrs and generates a list format from the result. Be aware that com-
pared to invoking map_nbrs , the memory requirement is larger by a factor of about p, since
get_nbrs_list is not restricted to the fundamental sector but explicitly returns all connections
in the lattice.
36
SciPost Phys. Codebases 34 (2024)
(6, 4) (3, 8)
(7, 4) (14, 3)
101 (7, 5) (3, 12)
102
100
DUN07X GR GRG GRGS SRS SRG DUN07X GR GRG GRGS SRS SRG
Figure 17: Computing time and memory footprint comparison for different kernels
and (p, q) lattices. In the right panel, peak memory consumption is displayed for the
construction process (solid bars) and neighbor search (transparent bars). Kernels
that compute neighbors during lattice construction present only solid bars.
5.6 Benchmarks
In this section, we provide detailed performance results for tiling construction and the gen-
eration of adjacency relations. These benchmarks should aid the selection of the appropriate
kernel when computing resources are a constraint. All tests have been performed on a desktop
workstation with an Intel Xeon W-1390p and 64 Gb RAM. Besides these performance bench-
marks, a feature-based comparison is presented in Section 5.7.
For a given (p, q) lattice, we anticipate the kernels to generate polygons at a steady rate,
with some additional algorithm-specific overhead which should be negligible for large tilings.
This time per polygon is therefore a good indicator for the kernel performance. Results for
different kernels are shown in the left panel of Figure 17. In the Figure, the heights of the
individual bars represent the average time to construct a single polygon t poly (p, q, n) for a
specific tiling. This quantity is determined using linear regression of the time required to
construct a full tiling, t(p, q, n) and the number of polygons N (p, q, n). Therefore, in the
regression the function
f : N (p, q, n) ∈ N → t(p, q, n) ∈ R , (34)
is fitted. A similar approach is used for calculating the memory footprint per polygon, displayed
37
SciPost Phys. Codebases 34 (2024)
103 DUN07X
102 SRS
GR
100
10−1
10−2
10−3
Figure 18: Computing time required for detecting adjacent cells. Graph kernels gen-
erate neighboring relations automatically and are hence not included. Dashed lines
indicate quadratic scaling.
in the right panel of Figure 17. The advantage of a linear regression over a simple arithmetic
average is the compensation of systematic shifts due to systematic overhead. Error bars are
mostly smaller than 1% and not shown.
In general, GR and GRG are the fastest algorithms in the package. Remarkably, DUN07X’
runtime is of the same order of magnitude as those of GR and GRG, even though it creates an
entire tiling instead of only one sector. It is more than two times faster than GRGS, which is a
variant of GRG that constructs a full tiling. The main reason for its performance is that DUN07X
dispenses with explicit coordinate comparisons. The SR kernels are, as expected, significantly
slower, even when only one sector is created, such as for SRS. This stems from the internal
duplicate management system of the SR kernels, which even with its optimized containers and
efficient binary search, introduces a systematic performance overhead for large tilings. Finally,
our analysis reveals that SRG offers the poorest performance, which is the expected trade-off
for its dynamics manipulation capabilities.
In the analysis above we focus solely on the time required to generate the tiling. However,
for many applications adjacency relations are essential and measurements encompassing the
time both for tiling creation and for retrieving neighbor information become relevant. Con-
sidering graph kernels, GRG and GRGS are the fastest implementations in the package. As
expected, GRGS is slower by roughly a factor of p compared to GRG. We also find that once
neighbor relations are required, DUN07X turn out to be one of the slowest kernels for large
lattices, as the lack of specialized neighbor detection methods leads us to resort to a brute-
force radius search instead. As the majority of adjacency algorithms do not scale linearly with
the number of polygons, there is not a simple time-per-polygon ratio as in Figure 17 and we
present our benchmark results separately in Figure 18. Besides DUN07X, we evaluate SRS and
GR with their default algorithms ROS (see Section 5.3.4) and get_nbrs_list (which calls MAP
and expands the results from one sector to the whole tiling), respectively. Despite numerical
optimizations, they all exhibit quadratic scaling for large tilings, owing to the all-to-all distance
comparisons needed. The GR kernel displays a larger overhead, but benefits from its heavily
optimized internal structure and is generally the fastest for large lattices.
Another important performance quantity is the required memory per polygon. It is best
evaluated by monitoring the peak memory consumption during the construction of tiling and
neighbor structure, shown in the right panel of Figure 17 as solid and transparent bars, re-
spectively. Again, linear regression is used to compensate for systematic offset. The results
38
SciPost Phys. Codebases 34 (2024)
clearly show that GR and GRG heavily outperform every other kernel in this category, due to
the fact that only one sector is stored and generators are used to construct remaining regions
only on demand. As soon as neighbor relations are required, however, their memory footprint
increases significantly, as an explicit, full list of neighbor indices is produced. The GR kernel
nonetheless remains the most memory efficient option. Finally, SRS as well as SRG are the
most expensive kernels in this category, stemming from the same memory requirement for
the list output combined with algorithmic overhead due to the HyperPolygon class and the
duplicate management mentioned earlier.
Table 3: Feature comparison of the construction kernels in the package. More bullets
correspond to better performance.
39
SciPost Phys. Codebases 34 (2024)
For a concise overview, see the summary of the various kernel properties in Table 3. Note
that our plotting and animation functions work with all kernels, since they share a common
API. We also want to remark that the summary in the Table represents a current depiction, and
as the library continues to evolve, some kernels may receive further updates and additional
features in the future.
6 Examples
In this section we offer a selection of scientific uses of the HYPERTILING package.
40
SciPost Phys. Codebases 34 (2024)
104
10−1
103 0.623000
0.624000
0.625000
102
10−2 0.626000
0.627000
101 0.628000
0.629000
100 10−3
102 103 104 102 103 104
𝑡 𝑡
Figure 19: Epidemic spreading on a large hyperbolic (5,4) tiling. The left panel shows
the time evolution of the number of active sites, whereas the right panel displays the
corresponding survival probabilty. Colors indicate the infection probability.
In all simulations we monitor the mean square geodesic radius of the spreading cluster and
stop the simulation once this quantity reaches the order of magnitude of the lattice boundary
region in order to avoid finite-size effects, since at this point, the process can not spread fur-
ther. Moreover, we use random sequential updates, i. e. in every time step an active particle is
randomly selected and updated according to the dynamic rules described above. Then, time
is incremented by the inverse of the current cluster size, 1/Na .
Concluding this section, we want to emphasize that state-of-the-art high precision simu-
lations of reaction-diffusion processes, such as in the context of epidemic spreading from a
localized seed, require considerably large lattices in order to avoid boundary effects and to
extract the true asymptotic scaling behavior. Since the dynamics of continuous phase transi-
tions in non-Euclidean geometry is generally a challenging field of research (see Section 1.2
and references therein), which requires substantial resources when addressed numerically, a
more detailed study falls out of the scope of this paper and is left to future work.
1 1
L = ∂ν φ∂ ν φ − µ2 φ 2 − λφ 4 , (35)
2 2
in Minkowski spacetime, where the parameter µ is associated to the mass and the partition
function (or generating functional) is given by
Z Z Z
Z= Dφe iS = Dφ exp i dn x L . (36)
The phase structure of this model resembles that of an Ising model [108, 109], a well-known
model in statistical mechanics and magnetic solids. In particular, a critical transition from a
high-temperature disordered phase into an ordered low-temperature phase where the sym-
metry of the scalar field is spontaneously broken, can be observed. Simulations of this theory
on a lattice first require a suitable Wick rotation, transforming the path integral factor e iS
41
SciPost Phys. Codebases 34 (2024)
into a Boltzmann exponent e−SE , thus resulting in a classical n-dimensional Euclidean the-
ory. The actual lattice discretization is straightforward and described in many textbooks, such
as [110, 111]. Eventually, one finds a lattice Hamiltonian of the form
X X X 2
β H = S E = −J φi φ j + m φi2 + λ φi2 − 1 , (37)
〈i, j〉 i i
where φi is an N -component real variable and the angular brackets 〈i, j〉 denote a summation
over nearest neighbors with coupling J. The inverse temperature is denoted by β. For any
positive λ, this system undergoes a continuous phase transition which lies in the universality
class of the classical O(N ) model, which can be seen as the N -component vector-valued gener-
alization of the Ising model. The parameter λ proves particularly useful in numerical analysis
since it can often be adjusted in a way that leading scaling corrections approximately vanish.
In this case, one speaks of an improved Hamiltonian [112,113]. For λ → ∞ the classical Ising,
XY, Heisenberg, and higher–symmetry vector–models are recovered, as the field is effectively
forced to unit-length φi2 = 1.
In order to illustrate how a remarkably distinct behavior can arise on hyperbolic geome-
tries, compared to flat Euclidean lattices, we simulate the classical scalar-field Hamiltonian on
two different lattice structures, a (3,7) lattice, as well as a flat square grid, both confined to a
circular region. We choose the couplings between adjacent cells (“spins”) in a way that ener-
getically favors anti-parallel local alignment (J < 0). Both systems are initiated in a random
hot configuration of positive (red) and negative (green) field values, which – in the magnetic
picture – can be interpreted as uniaxial spins pointing upwards or downwards, respectively.
By repeatedly applying the Metropolis update algorithm [114] the system eventually reaches
thermal equilibrium. An animation of this process is available on our YouTube channel.6 In
Figure 20 we show examples of equilibrium configurations for both systems. In the tradi-
tional flat lattice, we find extended anti-ferromagnetic domains, separated by so-called anti-
phase boundaries [115, 116], originating from the quench of the initially hot system towards
a colder temperature. In the hyperbolic lattice, however, imposed by connectivity restrictions,
local forces always compete with each other, and a true ground state (a perfect anti-parallel
alignment) cannot exist. Instead one finds what is commonly referred to as geometrical frus-
tration [117].
42
SciPost Phys. Codebases 34 (2024)
15
10
10
15
D = A - G # Laplacian
H = D - M # Helmholtzian
As hyperbolic tilings quickly can become very large, a memory-efficient sparse matrix for-
mat is used instead of a dense representation. In Figure 21(a) we display the Helmholtz
operator for a (7, 3) tiling with 3 layers, where we set w = 2 and m = 5. As can be seen, the
adjacency matrix is indeed sparse and furthermore symmetric due to the graph being undi-
rected. The sevenfold pattern can be directly related to the construction kernel, in this case,
SRS, where only one symmetry of the tiling is explicitly created and then replicated. Note that
both constant and position-dependent weights can be set for all operators using the optional
weights keyword (not shown in the code fragment above). Moreover, the operator functions
accept an optional boundary keyword which takes a boolean array of length N (number of
cells), encoding whether a vertex is considered a boundary vertex. For boundary points, the
corresponding rows are left empty, the matrix is non-symmetric. This characteristic provides
an approach to Dirichlet boundary value problems, since this way it is ensured that boundary
points act as ghost cells; they affect their bulk neighbors, but remain unchanged themselves.
The right-hand side of the resulting linear system thus carries precisely the Dirichlet boundary
values for those sites.
Now we are ready to solve the linear system H x = y, where H is the differential operator,
x is the solution vector and y is the right-hand side. We use GMRES [118, 119], which is an
established solver for non-symmetric and potentially indefinite linear systems. In Figure 21(b),
we show an example where we solve an electrostatic boundary value problem in a (3,7) tiling
with 6 layers and one refinement step (compare Section 3.4). The boundary has been fixed
to values of either −1 (red) or +1 (blue). In this example, we set m = 0, hence reducing
the Helmholtz equation to a Laplace problem. In the interior region of the lattice a smooth
“electrostatic potential” is obtained, as expected, with interfaces between areas of positive
and negative solutions roughly following hyperbolic geodesics. A more detailed exploration of
Helmholtz and Laplace problems on hyperbolic tilings can be found in our example notebooks,
provided in the HYPERTILING repository.
43
SciPost Phys. Codebases 34 (2024)
(a) (b)
Figure 21: Left: Discretized Helmholtz operator for a (7,3) tiling with 3 layers. Right:
Solution of an electrostatic problem on a refined (3,7) tiling, where boundary values
have been fixed to either -1 (red) or +1 (blue).
7 Road map
With its wide range of scientific applications and potential for producing visually captivating
artistic content, hyperbolic geometry remains an active and evolving field. The discretization
of hyperbolic Riemann surfaces, in particular, grows in importance across a number of scientific
disciplines. This continued interest motivates us to further extend HYPERTILING’s capabilities
and we already have some new features in the pipeline, some of which we outline below.
44
SciPost Phys. Codebases 34 (2024)
intend to tackle the challenge of implementing this possibility in future releases. Currently,
the user may, for instance, use the dynamic features of the SRG kernel (compare Section 5.3)
to manually construct periodic tilings by identifying edges of a properly chosen fundamental
domain, as outlined for example in References [43] and [48].
7.4 Parallelization
So far we do not offer parallel lattice construction in HYPERTILING. One reason for this is that
most of our kernels are designed for efficient serial execution. In the GR kernel, for the gen-
eration of every new polygon, the precise state of the previously generated one is required.
Therefore exactly only one polygon can be created in each iteration. The static rotational ker-
nels SRS and SRG on the other hand use global duplicate management containers (compare
Section 5.3.3) which need to be accessed frequently and hence would require heavy inter-node
communication in a distributed memory environment. Alternatively, a single node shared-
memory parallelization, where the lattice is simultaneously expanded by several replication
drivers, each working through a share of the currently outmost polygons to be replicated,
would be possible. Also, the DUN07 algorithm offers potential for parallelization, given its
tree-like structure, where independent sub-trees can be traversed in parallel. However, as the
calculations inside a single tree do not contain many operations of the same type, it is ques-
tionable whether the use of a GPU is efficient here or whether bypassing the global interpreter
lock by means of running several processes on the same CPU might be superior. A detailed
consideration is reserved for future work.
Finally, we would like to note that, although there are potential performance gains from
parallel implementations of some of the existing algorithms, this would only yield notable
advantages for extremely large sizes, due to the already considerable single-core speed of the
existing serial implementations. Moreover, in situations involving numerical simulations on
large tilings, almost always the actual simulations are bound to consume substantially more
resources than the lattice creation process, when done with the current version of HYPERTILING.
Hence, parallelization is not one of our top priorities at the moment.
8 Conclusion
In this article, we present an open-source library for the construction, modification and visual-
ization of regular hyperbolic tilings. We developed HYPERTILING to give researchers and visual
45
SciPost Phys. Codebases 34 (2024)
artists access to hyperbolic lattices by using straightforward high-level Python commands. Our
primary emphasis lies on high-performance computing, and our algorithms are optimized to
deliver the highest possible speed and memory efficiency. To further support scientific appli-
cations, our library includes an extensive tool set of methods to establish adjacency relations,
enabling the use of tilings as graphs. In this context, our generative reflection (GR) kernel
family currently is, to the best of our knowledge, the fastest available algorithm to construct
these geometric structures, substantially outperforming other standard algorithms. This per-
formance can be achieved by employing a combinatorial design of the algorithm, bit-coded
memory layout, generator functionality (to significantly decrease storage requirements) as
well as Python optimizations such as numpy and numba’s just-in-time compilation. Given
these optimizations, the GR kernels are able to construct huge lattices – a crucial requirement
for scientific applications where large hyperbolic bulk regions with minimal boundary effects
are needed. For instance, a (7, 3) lattice with 1.5 billion cells (roughly equivalent to a 35 0002
square lattice) can be generated on a standard desktop workstation in less than one hour.
In addition to speed, the library also enables flexible and dynamic lattice manipulation
by means of its static rotational (SR) kernels: A tiling can be created explicitly layer-wise or
expanded around particular cells, and cells can be added or removed at any place in the lat-
tice. This is made possible by a sophisticated bookkeeping system that avoids the creation of
duplicate cells. Together with fast, optimized implementations of all required Möbius trans-
formations provided in the package, this opens the way for the construction of very individual,
even procedural and dynamically generated lattices. The SR kernels also provide triangle re-
finements, which can be particularly useful whenever a better spatial resolution beyond the
geometrically fixed hyperbolic polygon edge length is required. Finally, a Python implementa-
tion of the well-known construction algorithm by D. Dunham is available, both in its original,
as well as in a modern, performance optimized version.
All internal arithmetics and algorithmic details are hidden from the user. The interested de-
veloper can nevertheless profit from a hierarchy of class objects, which allows easy debugging,
modification and, most importantly, extendability.
Our library provides considerable plotting and animation capabilities. We offer plotting
methods that are both fast as well as accurate, and tilings can moreover be exported as SVG
vector graphics for further manipulation and publication-ready plots. Finally, our anima-
tion classes facilitate the presentation of dynamic processes on a hyperbolic lattice as well
as changes of the lattice itself, all realized via straightforward matplotlib animation wrappers.
The combination of all these resources renders HYPERTILING a uniquely capable package.
It puts large hyperbolic lattices at the fingertips of researchers, lowering the threshold for
exploration and opening up new avenues of application of numerical hyperbolic geometry.
Acknowledgements
We thank P. Basteiro, J. Erdmenger, H. Hinrichsen, R. Meyer, A. Stegmeier and L. Upreti for
fruitful discussions. We are also grateful to the Information Technology Center of Würzburg
University for providing computational resources through the JULIA cluster.
Author contributions M.S. initiated and leads the project. M.S. and Y.T. conceived the core
program design and implemented the main lattice construction algorithms. F.G. specialized on
numerical optimization and HPC aspects of the code. F.D, F.G, D.H. and J.S.E.P. implemented
specific modules and extensions and tested the code. All authors contributed to writing the
documentation and the manuscript.
46
SciPost Phys. Codebases 34 (2024)
References
[1] P. de Bernardis, P. A. R. Ade, J. J. Bock, J. R. Bond, J. Borrill, A. Boscaleri, K. Coble,
B. P. Crill, G. D. Gasperis, P. C. Farese, P. G. Ferreira, K. Ganga et al., A flat Universe from
high-resolution maps of the cosmic microwave background radiation, Nature 404, 955
(2000), doi:10.1038/35010035.
[2] J. Levin, Topology and the cosmic microwave background, Phys. Rep. 365, 251 (2002),
doi:10.1016/s0370-1573(02)00018-2.
[4] J. M. Maldacena, The Large N limit of superconformal field theories and supergravity, Int.
J. Theor. Phys. 38, 1113 (1999), doi:10.1023/a:1026654312961.
[5] S. Gubser, I. Klebanov and A. Polyakov, Gauge theory correlators from non-critical string
theory, Phys. Lett. B 428, 105 (1998), doi:10.1016/s0370-2693(98)00377-3.
[6] E. Witten, Anti-de Sitter space and holography, Adv. Theor. Math. Phys. 2, 253 (1998),
doi:10.4310/ATMP.1998.v2.n2.a2.
[7] M. Ammon and J. Erdmenger, Gauge/gravity duality, Cambridge University Press, Cam-
bridge, UK, ISBN 9780511846373 (2015), doi:10.1017/CBO9780511846373.
[8] L. Susskind, The world as a hologram, J. Math. Phys. 36, 6377 (1995),
doi:10.1063/1.531249.
[9] S. A. Hartnoll, Lectures on holographic methods for condensed matter physics, Class.
Quantum Gravity 26, 224002 (2009), doi:10.1088/0264-9381/26/22/224002.
[10] J. Balakrishnan, Spatial curvature effects on molecular transport by diffusion, Phys. Rev.
E 61, 4648 (2000), doi:10.1103/physreve.61.4648.
[11] J. Faraudo, Diffusion equation on curved surfaces. I. Theory and application to biological
membranes, J. Chem. Phys. 116, 5831 (2002), doi:10.1063/1.1456024.
[12] A. Ghosh, J. Samuel and S. Sinha, A Gaussian for diffusion on the sphere, Europhys. Lett.
98, 30003 (2012), doi:10.1209/0295-5075/98/30003.
[14] P. Castro-Villarreal, Brownian motion meets Riemann curvature, J. Stat. Mech.: Theory
Exp. 2010, P08006 (2010), doi:10.1088/1742-5468/2010/08/p08006.
47
SciPost Phys. Codebases 34 (2024)
[17] N. Park, M. Yoon, S. Berber, J. Ihm, E. Osawa and D. Tománek, Magnetism in all-carbon
nanostructures with negative gaussian curvature, Phys. Rev. Lett. 91, 237204 (2003),
doi:10.1103/physrevlett.91.237204.
[18] W. Moura-Melo, A. Pereira, L. Mól and A. Pires, Geometrical pinning of magnetic vortices
induced by a deficit angle on a surface: Anisotropic spins on a conic space background,
Phys. Lett. A 360, 472 (2007), doi:10.1016/j.physleta.2006.07.009.
[21] M. Boguñá, F. Papadopoulos and D. Krioukov, Sustaining the internet with hyperbolic
mapping, Nat. Commun. 1, 62 (2010), doi:10.1038/ncomms1063.
[22] C. Crnković, P. Ginsparg and G. Moore, The Ising model, the Yang-Lee edge singularity, and
2D quantum gravity, Phys. Lett. B 237, 196 (1990), doi:10.1016/0370-2693(90)91428-
e.
[24] P. Francesco, P. Ginsparg and J. Zinn-Justin, 2D gravity and random matrices, Phys. Rep.
254, 1 (1995), doi:10.1016/0370-1573(94)00084-g.
[26] G. Tarjus, F. Sausset and P. Viot, Statistical mechanics of liquids and fluids in curved space,
in Advances in Chemical Physics, Wiley, Hoboken, USA, ISBN 9781118158715 (2011),
doi:10.1002/9781118158715.ch4.
[27] O. Diego, J. Gonzalez and J. Salas, The Ising model on tetrahedron-like lattices:
a finite-size analysis, J. Phys. A: Math. Gen. 27, 2965 (1994), doi:10.1088/0305-
4470/27/9/013.
[28] C. Hoelbling and C. B. Lang, Universality of the Ising model on spherelike lattices, Phys.
Rev. B 54, 3434 (1996), doi:10.1103/physrevb.54.3434.
[29] M. Weigel and W. Janke, Universal amplitude-exponent relation for the Ising model on
sphere-like lattices, Europhys. Lett. 51, 578 (2000), doi:10.1209/epl/i2000-00377-0.
[30] R. Costa-Santos, The Ising model on curved lattices, Acta Phys. Pol. B 34, 4777 (2003).
[31] M. Schrauth, Y. Thurn, F. Goth, J. S. E. Portela, D. Herdt and F. Dusel, hypertiling, Zenodo
(2023), doi:10.5281/zenodo.7559393.
[32] W. Magnus, Noneuclidean tesselations and their groups, Academic Press, New York,
United States, ISBN 9780080873770 (1974).
48
SciPost Phys. Codebases 34 (2024)
[33] R. Fricke and F. Klein, Vorlesungen über die Theorie der automorphen Functionen, BG
Teubner, Leipzig, Germany, (1897).
[34] R. Fricke, F. Klein, A. M. DuPre and P. Boland, Lectures on the theory of automorphic
functions, Higher Education Press, Beijing, China, ISBN 9787040478402 (2017).
[35] H. S. M. Coxeter, Regular honeycombs in hyperbolic space, in Proc. Int. Congr. Math. 3,
155 (1954).
[36] H. Coxeter, Crystal symmetry and its generalizations, R. Soc. Can. 51, 1 (1957).
[37] H. S. M. Coxeter, The non-Euclidean symmetry of Escher’s picture ’Circle Limit III’,
Leonardo 12, 19 (1979), doi:10.2307/1574078.
[38] S. Katok, Fuchsian Groups, University of Chicago Press, Chicago, United States, ISBN
9780226425825 (1992).
[40] H. S. M. Coxeter, The trigonometry of hyperbolic tessellations, Can. Math. Bull. 40,
158–168 (1997), doi:10.4153/cmb-1997-019-0.
[42] V. Privman, Finite size scaling and numerical simulation of statistical systems, World Sci-
entific Publishing, Singapore, ISBN 9789813208766 (1990), doi:10.1142/1011.
[43] F. Sausset and G. Tarjus, Periodic boundary conditions on the pseudosphere, J. Phys. A:
Math. Theor.l 40, 12873 (2007), doi:10.1088/1751-8113/40/43/004.
[44] H. S. M. Coxeter and W. O. J. Moser, Generators and relations for discrete groups, in
Ergebnisse der mathematik und ihrer Grenzgebiete, Springer, Berlin, Heidelberg, Ger-
many, ISBN 9783540092124 (1980), doi:10.1007/978-3-662-21943-0.
[46] M. Conder and P. Dobcsányi, Determination of all regular maps of small genus, J. Comb.
Theory B 81, 224 (2001), doi:10.1006/jctb.2000.2008.
[47] M. D. Conder, Regular maps and hypermaps of euler characteristic- 1 to- 200, J. Comb.
Theory B 99, 455 (2009), doi:10.1016/j.jctb.2008.09.003.
[48] J. J. van Wijk, Visualization of regular maps: The chase continues, IEEE Trans. Vis. Com-
put. Graph. 20, 2614 (2014), doi:10.1109/tvcg.2014.2352952.
[49] H. Nishimori and G. Ortiz, Elements of Phase Transitions and Critical Phe-
nomena, Oxford University Press, Oxford, UK, ISBN 9780191722943 (2010),
doi:10.1093/acprof:oso/9780199577224.001.0001.
[50] J. Cardy, Scaling and Renormalization in Statistical Physics, Cambridge University Press,
Cambridge, UK, ISBN 9787506238229 (1996), doi:10.1017/cbo9781316036440.
[51] D. Chandler, Introduction to Modern Statistical Mechanics, Oxford University Press, Ox-
ford, United Kingdom, ISBN 9780195042764 (1987).
49
SciPost Phys. Codebases 34 (2024)
[52] H. Shima and Y. Sakaniwa, The dynamic exponent of the Ising model on negatively
curved surfaces, J. Stat. Mech.: Theory Exp. 2006, P08017 (2006), doi:10.1088/1742-
5468/2006/08/p08017.
[53] H. Shima and Y. Sakaniwa, Geometric effects on critical behaviours of the Ising model, J.
Phys. A: Math. Gen. 39, 4921 (2006), doi:10.1088/0305-4470/39/18/010.
[54] Y. Sakaniwa and H. Shima, Survival of short-range order in the Ising model on negatively
curved surfaces, Phys. Rev. E 80, 021103 (2009), doi:10.1103/physreve.80.021103.
[55] T. Iharagi, A. Gendiar, H. Ueda and T. Nishino, Phase transition of the Ising model on a
hyperbolic lattice, J. Phys. Soc. Jpn. 79, 104001 (2010), doi:10.1143/jpsj.79.104001.
[57] S. K. Baek, P. Minnhagen and B. J. Kim, Phase transition of XY model in heptagonal lattice,
Europhys. Lett. 79, 26002 (2007), doi:10.1209/0295-5075/79/26002.
[59] I. Benjamini and O. Schramm, Percolation in the hyperbolic plane, J. Am. Math. Soc. 14,
487 (2001), doi:10.1007/978-1-4419-9675-6_24.
[60] R. Lyons, Phase transitions on nonamenable graphs,J. Math. Phys. 41, 1099 (2000),
doi:10.1063/1.533179.
[61] S. K. Baek, P. Minnhagen and B. J. Kim, Percolation on hyperbolic lattices, Phys. Rev. E
79, 011124 (2009), doi:10.1103/physreve.79.011124.
[62] T. Nogawa, T. Hasegawa and K. Nemoto, Local cluster-size statistics in the critical phase
of bond percolation on the cayley tree, J. Stat. Mech.: Theory Exp. 2016, 053202 (2016),
doi:10.1088/1742-5468/2016/05/053202.
[63] S. K. Baek, P. Minnhagen and B. J. Kim, Surface and bulk criticality in midpoint percola-
tion, Phys. Rev. E 81, 041108 (2010), doi:10.1103/physreve.81.041108.
[64] F. Sausset, C. Toninelli, G. Biroli and G. Tarjus, Bootstrap percolation and kinet-
ically constrained models on hyperbolic lattices, J. Stat. Phys. 138, 411 (2009),
doi:10.1007/s10955-009-9903-1.
[65] J. H. Lopez and J. M. Schwarz, Constraint percolation on hyperbolic lattices, Phys. Rev.
E 96, 052108 (2017), doi:10.1103/physreve.96.052108.
[68] A. J. Kollár, M. Fitzpatrick and A. A. Houck, Hyperbolic lattices in circuit quantum elec-
trodynamics, Nature 571, 45 (2019), doi:10.1038/s41586-019-1348-3.
50
SciPost Phys. Codebases 34 (2024)
[71] R. C. Brower, C. V. Cogburn and E. Owen, Hyperbolic lattice for scalar field theory in
AdS3 , Phys. Rev. D 105, 114503 (2022), doi:10.1103/physrevd.105.114503.
[72] S. Yu, X. Piao and N. Park, Topological hyperbolic lattices, Phys. Rev. Lett. 125, 053901
(2020), doi:10.1103/PhysRevLett.125.053901.
[74] A. Chen et al., Hyperbolic matter in electrical circuits with tunable complex phases, Nat.
Commun. 14 (2022), doi:10.1038/s41467-023-36359-6.
[75] P. Basteiro, G. Di Giulio, J. Erdmenger, J. Karl, R. Meyer and Z.-Y. Xian, Towards explicit
discrete holography: Aperiodic spin chains from hyperbolic tilings, SciPost Phys. 13, 103
(2022), doi:10.21468/scipostphys.13.5.103.
[83] M. Sremcevic, S. Radmila and S. Vukmirovic, Tessellations of the euclidean, elliptic and
hyperbolic plane (2003), https://library.wolfram.com/infocenter/MathSource/4540/.
51
SciPost Phys. Codebases 34 (2024)
[88] K. Walmsley, Generating variable density fill patterns for 3D printing (2012),
https://through-the-interface.typepad.com/through_the_interface/2012/01/
an-interesting-challenge-generating-variable-density-fill-patterns-for-3d-printing.
html.
[90] R. Nelson and H. Segerman, Visualizing hyperbolic honeycombs, J. Math. Arts 11, 4
(2017), doi:10.1080/17513472.2016.1263789.
[91] Z. Liang, Coxeter groups, automata and uniform tilings (2012), https://pywonderland.
com/uniform-tilings.
[92] D. Dunham, An algorithm to generate repeating hyperbolic patterns, Proc. Symp. Adv.
Mater. Appl. 111 (2007).
[93] B. Grünbaum and G. C. Shephard, Tilings by regular polygons, Math. Mag. 50, 227
(1977), doi:10.1080/0025570x.1977.11976655.
[94] D. Dunham, J. Lindgren and D. Witte, Creating repeating hyperbolic patterns, in Proceed-
ings of the 8th annual conference on computer graphics and interactive techniques, 215
(1981), doi:10.1145/965161.806808.
[98] P. Grassberger, On phase transitions in schlögl’s second model, Z. Phys. B Condens. Matter
47, 365 (1982), doi:10.1007/bf01313803.
[99] W. Von Niessen and A. Blumen, Dynamics of forest fires as a directed percolation model,
J. Phys. A: Math. Gen. 19, L289 (1986), doi:10.1088/0305-4470/19/5/013.
[100] R. M. Ziff, E. Gulari and Y. Barshad, Kinetic phase transitions in an irreversible surface-
reaction model, Phys. Rev. Lett. 56, 2553 (1986), doi:10.1103/physrevlett.56.2553.
[101] L.-H. Tang and H. Leschhorn, Pinning by directed percolation, Phys. Rev. A 45, R8309
(1992), doi:10.1103/physreva.45.r8309.
52
SciPost Phys. Codebases 34 (2024)
[104] P. Grassberger and A. de la Torre, Reggeon field theory (Schlögl's first model) on a
lattice: Monte Carlo calculations of critical behaviour, Ann. Phys. 122, 373 (1979),
doi:10.1016/0003-4916(79)90207-0.
[106] H. Hinrichsen, Non-equilibrium critical phenomena and phase transitions into absorbing
states, Adv. Phys. 49, 815 (2000), doi:10.1080/00018730050198152.
[108] W. Lenz, Beitrag zum Verständnis der magnetischen Erscheinungen in festen Körpern, Z.
Phys. 21, 613 (1920).
[109] E. Ising, Beitrag zur Theorie des Ferromagnetismus, Z. Phys. Hadrons Nucl. 31, 253
(1925), doi:10.1007/bf02980577.
[110] D. J. Amit and V. Martin-Mayor, Field theory, the renormalization group, and critical
phenomena, World Scientific, New Jersey, USA, ISBN 9812561196 (2005).
[111] U. C. Täuber, Critical dynamics: A field theory approach to equilibrium and non-
equilibrium scaling behavior, Cambridge University Press, Cambridge, UK, ISBN
9781139046213 (2014), doi:10.1017/cbo9781139046213.
[113] A. Pelissetto and E. Vicari, Critical phenomena and renormalization-group theory, Phys.
Rep. 368, 549 (2002), doi:10.1016/s0370-1573(02)00219-3.
[115] R. Kikuchi and J. W. Cahn, Theory of interphase and antiphase boundaries in fcc alloys,
Acta Metall. 27, 1337 (1979), doi:10.1016/0001-6160(79)90203-7.
[116] K. Binder and A. P. Young, Spin glasses: Experimental facts, theoretical concepts, and open
questions, Rev. Mod. Phys. 58, 801 (1986), doi:10.1103/revmodphys.58.801.
[117] J.-F. Sadoc and R. Mosseri, Geometrical frustration, Cambridge University Press, Cam-
bridge, UK, ISBN 9780511599934 (1999), doi:10.1017/cbo9780511599934.
[118] Y. Saad and M. H. Schultz, GMRES: A generalized minimal residual algorithm for solving
nonsymmetric linear systems, Soc. Ind. Appl. Math. J. sci. stat. comput. 7, 856 (1986),
doi:10.1137/0907058.
53
SciPost Phys. Codebases 34 (2024)
[119] Y. Saad, Iterative methods for sparse linear systems, Society for Industrial
and Applied Mathematics, Philadelphia, USA, ISBN 9780898715347 (2003),
doi:10.1137/1.9780898718003.
[120] A. L. Edmonds, J. H. Ewing and R. S. Kulkarni, Regular tessellations of surfaces and (p,
q, 2)-triangle groups, Ann. Math. 116, 113 (1982), doi:10.2307/2007049.
[121] H. Schwarz, Ueber diejenigen Fälle, in welchen die Gaussische hypergeometrische Reihe
eine algebraische Function ihres vierten Elementes darstellt., J. reine angew. Math. 1873,
292 (1873), doi:10.1515/crll.1873.75.292.
[122] J. E. Humphreys, Reflection groups and Coxeter groups, Cambridge University Press,
Cambridge, UK, ISBN 9780511623646 (1990), doi:10.1017/cbo9780511623646.
[125] B. Casselman, Computation in Coxeter groups II. Constructing minimal roots, Represent.
Theory Am. Math. Soc. 12, 260 (2008), doi:10.1090/s1088-4165-07-00319-6.
54