# The Five-Dollar Model:
Generating Game Maps and Sprites from Sentence Embeddings

Timothy Merino, Roman Negri, Dipika Rajesh, M Charity, Julian Togelius

###### Abstract

The five-dollar model is a lightweight text-to-image generative architecture
that generates low dimensional images from an encoded text prompt. This model
can successfully generate accurate and aesthetically pleasing content in low
dimensional domains, with limited amounts of training data. Despite the small
size of both the model and datasets, the generated images are still able to
maintain the encoded semantic meaning of the textual prompt. We apply this
model to three small datasets: pixel art video game maps, video game sprite
images, and down-scaled emoji images and apply novel augmentation strategies
to improve the performance of our model on these limited datasets. We evaluate
our models performance using cosine similarity score between text-image pairs
generated by the CLIP VIT-B/32 model.

Figure 1: New video game maps generated using unseen text prompts.  Figure 2:
New sprite characters generated using unseen text prompts.  Figure 3: New
emojis generated using unseen text prompts.

## Introduction

Recent developments with text-to-image generators in the AI community have
spurred a renaissance of large generative models. Both open and closed source
generators, such as DALL-E and StableDiffusion have demonstrated their
versatility and range in image generation, from hyper-realistic photos to
abstract artworks. However, to generate these quality images, these large
models require large amounts of training data—both in text captions and paired
images—large amounts of compute and training time, and large amounts of
storage. Though these models boast incredible textual understanding and image
fidelity, they cannot be used in every domain. For more specific tasks, such
as creating assets like sprites, textures, or levels for video games, these
models require extensive prompt engineering or fine tuning to meet domain-
specific constraints.

Within procedural content generation (PCG) research, various smaller models
have been proposed specifically to create assets. These models are much
simpler in architectural design and include evolutionary models, GANs, VAEs,
and others. However, most PCG models lack conditional prompting. Conditional
prompting is a technique used to guide the generation process towards more
specific artifacts using a provided condition, such as a class label or text
description. A small-scale model that requires low amounts of training data
and has direct text-to-image generation capabilities would benefit game
developers considerably, as it would facilitate content creation and provide a
greater degree of control over the output of the AI system.

We introduce the five-dollar model111A model so simple, one of the authors bet
another $5 it wouldn’t work.—a text-to-image generator designed for low-
dimensional, pixel-size images and categorical-based samples. We use this
model to generate game levels (Figure 1), sprites (Figure 2), and emoji images
(Figure 3). We find that despite the conceptual simplicity and comparatively
small size of our model, it demonstrates surprising performance and language
understanding in these domains. This generator is remarkably fast because of
its small size and lack of iterative steps, making it suitable for real-time
content generation. It is also easy to train because of the lack of
adversarial dynamics (unlike GANs) and it can be trained using relatively
small training sets. Because of the lack of denoising (unlike diffusion
models), it is suitable for discrete and categorical content such as tile-
based maps. Finally, the simplicity of the model makes it easier to study and
potentially modify after training.

## Background

Procedural content generation in games is an active field of game AI research.
This field includes algorithmically creating artificial samples for game
content, such as levels, sprites, or narratives (Shaker, Togelius, and Nelson
2016). Previous works have used evolutionary algorithms (Charity and Togelius
2022), generative adversarial networks (GANs) (Volz et al. 2018), variational
autoencoders (VAEs) (Sarkar and Cooper 2021), VQ-VAEs (Saravanan and Guzdial
2022), cellular automata (Earle et al. 2022), diffusion models (Xu et al.
2023), transformer models (Todd et al. 2023), and more.

Conditional generation allows for more control over the output of the black-
box neural network models by providing auxiliary information, called the
condition. Conditional information can come in many forms. Class labels (Mirza
and Osindero 2014), text descriptions (Reed et al. 2016), and other images
(Dumoulin, Shlens, and Kudlur 2017) have been used as conditional inputs to
guide image-generation models towards a specific goal. Works done by Van den
Oord (Van den Oord et al. 2016), Kang (Kang and Park 2020), Mirza (Mirza and
Osindero 2014), Perez (Perez et al. 2017), and Isola (Isola et al. 2017) with
conditional generators on various domains such as face and image generation
demonstrate the effectiveness of control over the final output when using
conditional inputs all the while retaining quality.

Text-to-Image generation employs natural language image descriptions as a
means to condition generative image models. This class of models aims to
generate high quality images that semantically align with the provided input
prompt. With the rise of conditional diffusion (Sinha et al. 2021) and Stable
Diffusion models (Ramesh et al. 2022), text-to-image generation has seen a
huge increase in popularity. Current research in this domain focuses largely
on the zero-shot capabilities of such models — the ability for them to
generalize to unseen data.

Procedural Content systems are most often designed for a specific game, where
zero-shot generalization is not a primary concern. With this paper, we aim to
explore domain-specific text to image generation in the context of digital
game art. In contrast to state of the art systems, which are typically trained
on large scale datasets of real world RGB images, we train on low dimensional
categorical data.

## Methodology

### Model Architecture

The five-dollar text-to-image generator model is a simple feedforward network.
The model learns a mapping from the embedded text vector to a higher dimension
categorical image. The generator model has 2 inputs: (1) an embedding vector
representing the text condition and (2) a random noise vector. The input text
caption is encoded outside of the system by a pre-trained sentence transformer
model. We use the multi-qa-MiniLM-L6-cos-v1 sentence transformer model, which
encodes text into a 384-dimensional vector. The noise layer allows for
diversity in the final generated output with the same text encoding. The two
input layers are combined via a concatenation layer, then reshaped by a dense
layer and fed into the network. This reshaped input is then passed through
residual blocks — 2 Convolutional layers with Batch Normalization — to
generate an image. Upsampling layers are placed before the first residual
blocks, to reach the desired output shape (8x8 for sprites, 10x10 for maps,
16x16 for emojis).

We experiment with different numbers of residual blocks, kernel sizes, and
convolutional filters within each dataset. We choose the architecture that
maximizes validation accuracy, with some consideration for model size, to
generate the final images.

Figure 4 shows the model architecture of the five-dollar model. Further
experimentation was done with more complex architectures involving Conditional
Instance Normalization (Dumoulin, Shlens, and Kudlur 2017) and Feature-wise
Linear Modulation (Perez et al. 2017) conditioning layers. The results of
these experiments are shown in Table 3 of the appendix. In general, these
conditioning methods did not noticeably improve the generated output compared
to the input concatenation-based conditioning. We instead focus on the simpler
concatenation-conditioned model throughout the paper.

Figure 4: Architecture design of the five-dollar model. This outputs a NxNx16
image. For maps, N = 10. For sprites, N=8. For emojis, N=16

### Training Data

We train our models in a supervised setting, using pairs of caption embeddings
and images. We use categorical cross-entropy loss between the generated image
and training image, using an Adam optimizer with learning rate = $0.001$

Figure 5: Example images with labels from all 3 datasets. From left to right:
Map, Sprite, Emoji.

We use three datasets to evaluate our model — the largest dataset containing
882 samples and the smallest containing 100 samples. These datasets are
selected due to their small pixel resolutions and diverse domains, ultimately
allowing us to demonstrate the range of output for the model with the text
conditioned generation. In contrast to most image datasets, ours use a one-hot
encoded representation rather than RGB. This is similar to functional
constraints present in many games, where assets are limited by color space or
tiles.

The first is a crowd-source map dataset, consisting of 882 images that
resemble sections of the game map from retro RPGs such as Pokemon. These maps
are represented by a one-hot encoded 10x10x16 image, using 16 possible 8-pixel
tiles. Each map is paired with a sentence describing the scene depicted in the
map, such as ”A house in a grassy field”. 452 of the maps in this dataset come
from existing work, without labels (Charity and Togelius 2022). Labels were
manually added to these existing maps by the authors. The remaining 430
caption-map pairs were created via an interactive webpage, which was shared
via the authors’ Twitter. Users were asked to create a map using the tile set,
and provide one sentence describing the map they created.

The second dataset consists of emoji images and labels (Hendrycks and
Dietterich 2018). These 10,000 emoji images are represented by 32x32x3 RGB
images. They are separated by style (Apple, Facebook, etc), and are clustered
into 50 categories, such as Face, Animal, and Bird. We train our models on a
subset of this dataset, consisting of Apple-style emojis in 29 categories.
This filtering results in 663 emoji images. We downscale these images by a
factor of 2 using inter-area interpolation, to obtain 16x16x3 RGB images.
Then, 16 colors are selected using K-Means clustering of color values across
the filtered Apple-style dataset. Each pixel is then quantized based on this
color palette, resulting in a 16x16x16 one-hot encoded image.

The third dataset uses 100 8x8 pixel sprites created from the PICO-8 game
engine - using 16 possible colors according to the PICO-8 palette. These
sprites were designed based on recognizable game and cartoon characters (i.e.
Super Mario, Adventure Time, and the Simpsons) but with their own unique
designs and structures. Instead of labeling these characters by their
canonical names, we manually labeled them with generic descriptions. For
example, instead of the label ’Mario’ for the sprite, it is described as ’a
man with a mustache dressed in red.’

Figure 5 shows example caption-image pairs from each dataset. The 16 tile and
color values for each dataset can be found in Figure 11 in the appendix.

### Encoding Augmentations

To enrich the text embedding space, we use 4 different methods of augmentation
— (1) using GPT-4 to generate alternate labels for each image, (2) increasing
the dataset with multiplicative Gaussian noise, and (3)/(4) two different
adaptations of MixUp (Zhang et al. 2017), to linearly interpolate between
samples. Each encoding augmentation is discussed in further details below.

In order to create GPT-4 generated alternate labels, we pass our existing
dataset labels along with a custom prompt into GPT-4, tasking it to write an
alternate version of each label using simple language. We instruct GPT to
assume it has the vocabulary of a 10-year old, as early experiments resulted
in uncommon words that were out of distribution with our original dataset. The
prompt used for the map dataset can be found in the Appendix in Figure 12.

The alternate labels are then passed through the text encoder model to get new
embeddings vectors. We only generate 1 alternate version of each label, as it
was challenging to generate more alternate versions without duplicating
labels.

We also incorporate a multiplicative Gaussian noise augmentation. For an
arbitrary sentence embedding vector in our dataset, we generate a
384-dimensional noise vector, with each element $\in\mathcal{N}~{}(1,0.15)$.
By taking the Hadamard product of the sentence embedding vector and the noise
vector, a ”noisy” embedding is generated. For our final models, we use a
dataset with 3 noisy embeddings per original label.

We also experiment with two forms of MixUp. In the first form, which we call
”alt label interpolation”, we generate $n$ vectors interpolated between an
embedded label and its matching embedded GPT label. In the second form, random
Mixup, we generate a vector through interpolation between a sample and another
randomly selected sample, with $\lambda=0.5$222This is the degree to which
each sample will be represented in the interpolated vector. A value of $.5$
indicates equal representation of each input vector..

Both the GPT alt labels and noise augmentations improved the performance of
our models in all 3 datasets. We only saw improvements to the models from the
two Mixup forms in the map dataset. In the other datasets, while alt label
interpolation did not cause noticable performance degredations, random MixUp
resulted in much poorer generated sprites.

## Experiments

We create various experiments to evaluate the language understanding and
generative abilities of the five-dollar model in each domain.

First, the latent space of the model is investigated using interpolation, also
known as “walking the latent space” (Radford, Metz, and Chintala 2015). A
smooth latent space should result in a gradual transition of the intermediate
outputs between the two associated images. We manually select two points in
the dataset with either similar semantic meanings, or similar image
representations for these experiments.

Secondly, to evaluate the natural language understanding of our model, we use
latent vector arithmetic. Using arithmetic operations on the encoded text
vectors of two similar images, we attempt to isolate vectors which represent
important semantic concepts within the image domain. For example, by
subtracting “neutral face” from “angry face” in the emoji domain, we obtain a
vector that represents “anger”. We can then visualize adding this vector to
other text prompts, to see whether the model encodes an intuitive
understanding of these concepts.

## Model Training

We lay out the entire training pipeline in 4 steps: (1) Alternate Label
Creation with GPT-4 (2) Data Preparation, (3) Data Augmentation, (4) Model
training. Step (1), the alternate label step consists of generating the
alternate labels from GPT-4 in order to increase the base size of the dataset.
Step (2), the data preparation step, includes quantization of images into one-
hot encoded representation and encoding of text labels using the embedding
model. Step (3), applying the augmentations mentioned above such as MixUp and
noise augmentations. Finally, step (4), the model training stage, which in our
case included a grid search for the best performance in each domain.

At inference time the only models used are the pretrained embedding model and
the five-dollar model, completely foregoing of steps 1 and 3. Large models,
such as GPT-4, are only used during the alternate label creation step. Thus,
GPT-4 gives no increase in computational resources required to use this model
in downstream applications.

## Evaluation

To fully understand the capabilities of these models we aimed to optimize the
following hyperparameters through a grid search: the noise input vector’s
dimension, the filter counts, sizes of the kernels, the number of residual
blocks, and the conditioning type333The three options for conditioning types
are concatenation based (depicted in Figure 4), Conditional Instance
Normalization (CIN layers after every residual block), or Feature-wise Linear
Modulation (FILM layers after every residual block).. The models were
evaluated based on validation accuracy within their domains with validation
sets consisting of withheld human-made labels and a matching pixel map,
sprite, or emoji respectively for each of the domains.

While a correlation between validation accuracy and output quality is noted,
the augmentation strategies used on the dataset introduced some information
leakage between the training and validation sets. To combat this, we evaluate
the top performing models in two ways. 444When deciding between two models
with similar performance, the model with the lower number of parameters was
selected.

First, we subjectively evaluate the top models’ performance on various sets of
unseen labels. These were designed to test the semantic understanding of the
models, such as applying a different color to a learned outline i.e.: duck
with a pink shirt  as the unseen sprite, with duck, pink, and shirt all having
independent examples in the training set. More examples of unseen prompts can
be found in Figure 13 in the Appendix.

Secondly, we use CLIP Score as a measure of the text-image alignment.
Contrastive Language-Image Pre-Training (CLIP) models embed similar text
labels and images into an overlapping embedding space, aiming to maximize the
cosine similarity of the embedded vectors for corresponding text-image pairs
(Radford et al. 2021). We use a pretrained clip-vit-base-patch32 as the CLIP
model in this paper. A scaled version of this similarity metric, called the
CLIP Score, has a high correlation with human judgements (Hessel et al. 2021).
We compute the Clip Score as the scaled cosine similarity, with a scaling
factor of $2.5$.

We utilize this metric as an indicator of model performance without the need
for human review. In contrast to some state-of-the-art generative models, our
model does not include direct optimization for text-image alignment when
training, maintaining the lightweight characteristics of the model. However,
CLIP Score has limitations as a metric for our model evaluation. Due to the
low dimensionality of our data, the domains of our images diverge
significantly from the datasets used to train CLIP. Therefore, knowing CLIP
performs well on zero shot tasks, and CLIP Score demonstrates its ability to
reason about non-photographic art, we perform experiments to validate its use
in our domains.

For each domain, we generate a fake dataset by pairing real captions with
randomly tiled images555These were generated through a simple RandInt()
function in the needed shape to match the real data.. We then compare the
average CLIP Score of the real dataset vs the fake, random-tile dataset. We
determine the validity of this metric by comparing these two scores: A
significantly higher score on the real dataset vs the random dataset points to
some semantic understanding of the pretrained CLIP model in our domains.

Lacking performance was noted when prompting CLIP with only the raw text input
given to the generator models. Therefore, to gain a more representative metric
we prepend the text with a dataset specific preprompt to guide the CLIP model
towards our domain-specific task. The preprompts for each domain can be found
in Figure 14 in the Appendix.

Now that we have target CLIP Score for our generators and after finding
candidate hyperparameters via grid search, we compute CLIP Score of each model
using a set of unseen labels. Table 2 shows the Clip Scores of the top
standard and non-standard models in each domain666”Standard” refers to models
without added CIN or FiLM conditioning.

## Results

We find that the five-dollar Model was able to generate aesthetically pleasing
images that were semantically consistent with the input prompt in all 3
domains. Though our models suffered from some overfitting, particularly in the
smallest sprite dataset, augmentation strategies were able to significantly
improve generalization and metric performance.

The 3 different datasets resulted in five-dollar models with varying
properties. The map generator seemed to perform the best when given
descriptive strings. This dataset consisted of sentence-long descriptions of
maps, and we found the best results came from clearly describing scenes to
generate.

The map model also demonstrated a good understanding of the tileset. Text
prompts that specify tiles, such as ”trees”, ”rocks” and ”water” were
consistently accurate. We experiment with generating island maps with
different features, depicted in Figure 6. Additionally, providing a single
word text prompt such as ”rocks” generated maps entirely covered by that tile.
We utilize and explore this property in the vector arithmetic experiments
shown in Figure 7.

Figure 6: Results of the video game map generator for island generation. The
model is able to understand concepts such as ”empty”, as well as tile names
such as ”tree” and ”rock” Figure 7: Feature Vector Arithmetic experiments in
the Map domain. We use single word text prompts representing high-level map
features, and experiment with applying them to other maps. The first two rows
use a “tree to rock” transformation. The third row use a “road” vector to add
a road. The fourth row uses a “red flower” vector to add red flowers.

The sprite generator was most effective in generating variations of existing
characters, but understandably struggled to depict entirely original
characters. This was the smallest of our datasets with only 100 samples, and
these models often struggled with overfitting and memorization. The structure
of this dataset (including similar characters with slight variations, such as
color) gave this model the best understanding of color. We explore this in the
vector arithmetic experiments shown in Figure 8.

Figure 8: Vector Arithmetic experiments in the sprite domain. The first row
isolates a “red to green” feature vector, and applies it to Mario to get a
Luigi sprite. The second and third rows use a “duck to Mario Brother” vector.
First we use it to transform a green duck into Luigi. Then, we apply it to a
blue duck to obtain a novel blue Mario brothers character. The last row
isolates a “orange to pink” vector, then applies it to an orange fox. Notably,
this method achieves a more accurate result for a pink fox than simply
specifying “pink” in the input text prompt.

The emoji generator had the poorest performance in terms of generalization and
generation of novel images. This dataset had the most diversity of images and
subjects depicted. While emoji faces have a consistent structure and style,
other categories like animals and flowers vary dramatically. While the model
demonstrated good understanding of semantically similar descriptions (ex:
Angry, Mad, or Furious face), it struggled to generate emoji faces depicting
unseen emotions. Experiments on this model are shown in Figure 9. We tested
models trained on only emoji faces, but did not notice much improvement.

Figure 9: Interpolation and Feature Vector experiments in the Emoji domain.

We find through interpolation experiments that the embedding space in all 3
domains is smooth, and results in smooth transitions between interpolated
images. Additionally, we are able to perform vector arithmetic within the
embedding space. This is demonstrated in Figures 7, 8, and 9.

### Grid Search for Best Architecture

We find that within these 3 domains, deeper networks were not always better.
The top performing models were consistently made up of 3 residual blocks, and
achieved performance on par or exceeding the deeper 5 and 7 residual block
architectures. In the sprite domain, deeper architectures (5 residual blocks)
scored marginally higher in validation accuracy versus their 3 res block
counterparts, though this difference was not noticeable in generated assets.
We find the width of a network, i.e. a network with a larger kernel size or
higher filter count, contributed the most to a models’ generated image
quality.

As seen in Table 3, the experiments with more advanced methods of
incorporating the textual condition, such as CIN and FiLM layers, received
scores very similar to the simple concatenation-based input conditioning. From
the CIN architecture we found slightly higher validation accuracy in the
emojis domain with consistently better validation accuracy in the sprite
domain. The map dataset, in comparison, had slightly worse accuracy with these
large conditioning methods.

It was determined that these kinds of conditioning methods did not offer
compelling enough improvements over simple concatenation-based input for the
increase in the size of the architecture. As such, we leave the decision to
the reader on which to implement based on the constraints of their downstream
task.

### CLIP Metric

The CLIP evaluation metric indicated positive results in terms of quality
performance from our architectures. When analyzing both the emoji dataset and
the sprite dataset, the CLIP model was able to easily differentiate between
the real datasets and the fake, random datasets. This gave us a target CLIP
score when evaluating our models, which generated well above the random level,
and even up to the expected dataset level. The full data can be found in Table
1.

Despite preprompt testing, the CLIP model was unable to meaningfully score the
real dataset above the random dataset for the map domain. We hypothesize that
this is due to the map generation using pre-structured tiles (tiles that
already represent information, such as a tree or a door), which could give
enough structure to images for the CLIP model to s core the random images as
high as the real data. The map generating models were still able to generate
at a level consistent with the real data and noted subjectively high quality
aesthetic output (as shown earlier in Figure 1). This data is shown in Table
2.

Figure 10: Results of the sprite generator on ducks and Ghosts. The closest
labels in the dataset are ”a white duck with a green outfit and a green hat”,
and ”a pink cross-eyed ghost”. The model is able to understand colors, and
apply them to the shirt or hat of the duck sprites. It is also able to
recognize and erase the pupils of the ghost sprite when given a caption with
”no eyes”

## Discussion

We pursued this research topic as a means to have an alternative to generative
adversarial networks and diffusion models for generating small content fast,
especially when this content may not naturally be an RGB image. We especially
focused on the lightweight aspect of the model as smaller models are more
accessible. Having smaller models enables applications that larger models
would not allow, such as real-time local generation. Exploring the model under
the constraint of being much smaller than state-of-the-art alternatives also
allows for easier reproducibility, iterative testing, and accessibility.

Viewing these results through the lens of procedural game content generation
it can be easy to imagine many possible use cases. Players could decide what
the map, the characters, or any other asset looks like for infinite
replayability. In the extreme, this could be done frame-to-frame with this new
model’s lightweight capabilities. This would allow for variability not just
between user-prompted, generative playthroughs but to have individual
characters with individual sprites, on tailor-made maps from any device all in
real time.

That being said, it is important to realize the limitations of these new
models. While this work demonstrates the capabilities of lightweight aesthetic
generation in a novel, easily interpretable model, it may be the case that
these architectures have been pushed close to their limit and could only have
a limited amount of room to improve. The zero-shot capabilities of these
models are also very limited as they are only able to generate pixel images
related in some way to the training data, though possible future works could
build on this issue to resolve it through clever prompting.

## Conclusion and Future Work

This work has demonstrated the effectiveness of our simple, lightweight
architecture for low-dimensional image generation with possible uses from
video game maps to pixel art sprite generation. It also demonstrates the
applicability of smaller models for specific use cases, even with limited data
through the numerous augmentation methods discussed.

Though we find that GPT-generated alternate labels and MixUp augmentations can
improve the performance of our model in these small datasets, there are many
more augmentation strategies we did not explore. NLP augmentation methods such
as synonym replacement and back-translation may further improve the language
understanding and generalization capabilities of our models. There may also be
useful computer vision augmentation methods. Though we experimented with
horizontal flips and image noising, these methods often introduced artifacts
into generated images. Due to the categorical representation of our images
(rather than the more common RGB), and extremely small image dimensions, many
common image augmentation strategies are difficult or impossible to apply to
our datasets.

We do not explore the use of attention mechanisms in our networks. Cross
attention has shown incredible potential in text-to-image models, as
demonstrated by models such as CAGAN (Schulze, Yaman, and Waibel 2021) and
AttnGAN (Xu et al. 2018). Similar to CIN and FiLM, while attention may improve
our performance, it also adds a significant amount of size and computational
complexity to our models. We leave exploration of attention for categorical
pixel image generation to future work.

## References

  * Charity and Togelius (2022) Charity, M.; and Togelius, J. 2022.  Aesthetic Bot: Interactively Evolving Game Maps on Twitter.  In _Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment_ , volume 18, 18–25.
  * Dumoulin, Shlens, and Kudlur (2017) Dumoulin, V.; Shlens, J.; and Kudlur, M. 2017.  A Learned Representation For Artistic Style.  In _International Conference on Learning Representations_.
  * Earle et al. (2022) Earle, S.; Snider, J.; Fontaine, M. C.; Nikolaidis, S.; and Togelius, J. 2022.  Illuminating diverse neural cellular automata for level generation.  In _Proceedings of the Genetic and Evolutionary Computation Conference_ , 68–76.
  * Hendrycks and Dietterich (2018) Hendrycks, D.; and Dietterich, T. 2018.  Benchmarking Neural Network Robustness to Common Corruptions and Surface Variations.  _arXiv preprint arXiv:1807.01697_.
  * Hessel et al. (2021) Hessel, J.; Holtzman, A.; Forbes, M.; Le Bras, R.; and Choi, Y. 2021.  CLIPScore: A Reference-free Evaluation Metric for Image Captioning.  In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_ , 7514–7528. Online and Punta Cana, Dominican Republic: Association for Computational Linguistics.
  * Isola et al. (2017) Isola, P.; Zhu, J.-Y.; Zhou, T.; and Efros, A. A. 2017.  Image-to-image translation with conditional adversarial networks.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , 1125–1134.
  * Kang and Park (2020) Kang, M.; and Park, J. 2020.  Contragan: Contrastive learning for conditional image generation.  _Advances in Neural Information Processing Systems_ , 33: 21357–21369.
  * Mirza and Osindero (2014) Mirza, M.; and Osindero, S. 2014.  Conditional Generative Adversarial Nets.  _CoRR_ , abs/1411.1784.
  * Perez et al. (2017) Perez, E.; Strub, F.; de Vries, H.; Dumoulin, V.; and Courville, A. C. 2017.  FiLM: Visual Reasoning with a General Conditioning Layer.  In _AAAI Conference on Artificial Intelligence_.
  * Radford et al. (2021) Radford, A.; Kim, J. W.; Hallacy, C.; Ramesh, A.; Goh, G.; Agarwal, S.; Sastry, G.; Askell, A.; Mishkin, P.; Clark, J.; Krueger, G.; and Sutskever, I. 2021.  Learning Transferable Visual Models From Natural Language Supervision.  arXiv:2103.00020.
  * Radford, Metz, and Chintala (2015) Radford, A.; Metz, L.; and Chintala, S. 2015.  Unsupervised representation learning with deep convolutional generative adversarial networks.  _arXiv preprint arXiv:1511.06434_.
  * Ramesh et al. (2022) Ramesh, A.; Dhariwal, P.; Nichol, A.; Chu, C.; and Chen, M. 2022.  Hierarchical text-conditional image generation with clip latents.  _arXiv preprint arXiv:2204.06125_.
  * Reed et al. (2016) Reed, S.; Akata, Z.; Yan, X.; Logeswaran, L.; Schiele, B.; and Lee, H. 2016.  Generative Adversarial Text to Image Synthesis.  In Balcan, M. F.; and Weinberger, K. Q., eds., _Proceedings of The 33rd International Conference on Machine Learning_ , volume 48 of _Proceedings of Machine Learning Research_ , 1060–1069. New York, New York, USA: PMLR.
  * Saravanan and Guzdial (2022) Saravanan, A.; and Guzdial, M. 2022.  Pixel VQ-VAEs for Improved Pixel Art Representation.  _arXiv preprint arXiv:2203.12130_.
  * Sarkar and Cooper (2021) Sarkar, A.; and Cooper, S. 2021.  Generating and blending game levels via quality-diversity in the latent space of a variational autoencoder.  In _Proceedings of the 16th International Conference on the Foundations of Digital Games_ , 1–11.
  * Schulze, Yaman, and Waibel (2021) Schulze, H.; Yaman, D.; and Waibel, A. 2021.  CAGAN: Text-To-Image Generation with Combined Attention Generative Adversarial Networks.  In Bauckhage, C.; Gall, J.; and Schwing, A., eds., _Pattern Recognition_ , 392–404. Cham: Springer International Publishing.  ISBN 978-3-030-92659-5.
  * Shaker, Togelius, and Nelson (2016) Shaker, N.; Togelius, J.; and Nelson, M. J. 2016.  _Procedural Content Generation in Games: A Textbook and an Overview of Current Research_.  Springer.
  * Sinha et al. (2021) Sinha, A.; Song, J.; Meng, C.; and Ermon, S. 2021.  D2c: Diffusion-decoding models for few-shot conditional generation.  _Advances in Neural Information Processing Systems_ , 34: 12533–12548.
  * Todd et al. (2023) Todd, G.; Earle, S.; Nasir, M. U.; Green, M. C.; and Togelius, J. 2023.  Level Generation Through Large Language Models.  In _Proceedings of the 18th International Conference on the Foundations of Digital Games_ , 1–8.
  * Van den Oord et al. (2016) Van den Oord, A.; Kalchbrenner, N.; Espeholt, L.; Vinyals, O.; Graves, A.; et al. 2016.  Conditional image generation with pixelcnn decoders.  _Advances in neural information processing systems_ , 29.
  * Volz et al. (2018) Volz, V.; Schrum, J.; Liu, J.; Lucas, S. M.; Smith, A.; and Risi, S. 2018.  Evolving mario levels in the latent space of a deep convolutional generative adversarial network.  In _Proceedings of the genetic and evolutionary computation conference_ , 221–228.
  * Xu et al. (2023) Xu, J.; Wang, X.; Cheng, W.; Cao, Y.-P.; Shan, Y.; Qie, X.; and Gao, S. 2023.  Dream3d: Zero-shot text-to-3d synthesis using 3d shape prior and text-to-image diffusion models.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , 20908–20918.
  * Xu et al. (2018) Xu, T.; Zhang, P.; Huang, Q.; Zhang, H.; Gan, Z.; Huang, X.; and He, X. 2018.  AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks.  In _2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)_ , 1316–1324. Los Alamitos, CA, USA: IEEE Computer Society.
  * Zhang et al. (2017) Zhang, H.; Cisse, M.; Dauphin, Y. N.; and Lopez-Paz, D. 2017.  mixup: Beyond empirical risk minimization.  _arXiv preprint arXiv:1710.09412_.

##  Appendix A Appendix

Figure 11: Dataset tile and color palettes Domain  | Dataset Type | Average CLIP score
---|---|---
Maps  | Real Data | $0.760$
Maps  | Random Data | $0.750$
Sprites  | Real Data | $0.803$
Sprites  | Random Data | $0.638$
Emojis  | Real Data | $0.800$
Emojis  | Random Data | $0.705$
Table 1: The Average CLIP score for real labels with Real image data and the real labels with Random image data in each domain Domain  | Conditioning Type | CLIP Score on Unseen
---|---|---
Maps  | Standard | $0.758$
Maps  | FiLM | $0.765$
Sprites  | Standard | $0.813$
Sprites  | CIN | $0.830$
Emojis  | Standard | $0.715$
Emojis  | CIN | $0.743$
Table 2: The average CLIP score of each of the top performing standard and non-standard models in each domain Domain  | Noise Dimension | Filter Count | Kernel Size | Res Blocks | Conditioning Type  | Highest Validation Accuracy
---|---|---|---|---|---|---
Maps  | 5 | 256 | 7 | 3 | Standard  | $0.854$
Maps  | 5 | 256 | 7 | 3 | FiLM  | $0.849$
Sprites  | 5 | 256 | 7 | 5 | CIN  | $0.997$
Sprites  | 5 | 256 | 7 | 6 | Standard  | $0.943$
Emojis  | 5 | 256 | 7 | 3 | CIN  | $0.829$
Emojis  | 5 | 256 | 5 | 3 | Standard  | $0.812$
Table 3: Grid Search results with best performing standard model and
experimental conditioning models separated by each domain.

⬇

Take each string in the list and write an alternate label for each one.These
strings describe an image of a pixel video game map. These alternate labels
should describe the same image as the original label, but use different words
and a different sentence structure. Use simple or common words when writing
the alternate labels. Assume you have the vocabulary of a 10 year old. Your
output should have the same number of strings as the input list.

Figure 12: The GPT prompt for the Map dataset. Prompts for the Sprite and
Emoji datasets were similar, but replaced ”pixel video game map”

⬇

newunseen_map = ["a house with a pool in the forest", "a flower garden by the
beach", "a trail through a seaside town", "a lake in the middle of a forest
town", "rows of flowers by a house in a desert"]

newunseen_emoji = ["hand with three fingers up", "a face with a wide smile",
"a face raising one eyebrow", "sad cat face", "a devil face with sunglasses"]

newunseen_sprite = ["a buff man with a blue headband and red shirt", "a blue
duck with a red headband", "a green woman with blonde hair", "a dog with a
black hat", "a man with blue shoes, a red hat, and a green shirt"]

Figure 13: Examples of unseen prompts for each domain

⬇

preprompt_map = "a frame from a pixel game map of "

preprompt_emoji = "a pixelated emoji of "

preprompt_sprite = "a pixel art style sprite of "

Figure 14: The preprompts used for each domain type


# Supplementary Material for:
Moiré Engineering of Nonsymmorphic Symmetries and Hourglass Superconductors

###### Contents

  1. I Computational methods
  2. II Illustration of stacking domains under the nonsymmorphic symmetry
  3. III DFT calculated band structures
  4. IV Real space illustration of wave functions
  5. V Low-energy tight-binding model
  6. VI Multi-orbital random-phase approximation
  7. VII Analyzing spin-/charge density wave and superconducting order
  8. VIII Hourglass Superconductivity in twisted SnS

##  I Computational methods

The first-principles calculations are performed within the density functional
theory (DFT) framework using the projected augmented-wave (PAW) method[1] as
implemented in the Vienna ab initio simulation package (VASP)[2, 3]. The
exchange-correlation term is treated in the generalized gradient approximation
(GGA) of Perdew-Burke-Ernzerhof (PBE)[4]. The Kohn-Sham orbitals are expanded
in a plane wave basis set with an energy cutoff of 350 eV. A
1$\times$1$\times$1 k-point grid is used for the ground state and relaxation
calculations. The experimental lattice constants for bulk SnS ($a$=4.07 Å,
$b$=4.31Å) are used to build the supercell of twisted bilayer SnS. A
negligible strain ($\approx$ 0.05%) is applied on $b$ to satisfy the
commensurate periodic boundary condition. All the structures are optimized
until the Hellman-Feynman forces on each atom are smaller than 0.01 eV/Å and
the energy convergence is reached when the energy difference is below 10-6 eV
between two consecutive self-consistent steps. A vacuum space of more than 15
Å along the $z$ direction is built to decouple artificial interactions between
periodic neighboring slabs. Van der Waals corrections are taken into account
using the DFT-D2 method of Grimme[5]. The VESTA[6] package is used to
visualize the geometry structures and the real space illustration of wave
functions. The twisted bilayer SnS supercells with twist angles of 12.03°and
6.03°contain 728 and 2888 atoms, respectively.

##  II Illustration of stacking domains under the nonsymmorphic symmetry

The unitcell of a tSnS structure contains 4 different domains for each type of
stacking. The screw rotation $\widetilde{\mathcal{C}}_{2y}$ further divides
them into two pairs, as displayed in Fig. S1. The stacking domains labeled by
”1” and ”2” are totally different, while ”+” and ”-” indicate screw mapping.
The atoms in the top layer of ”+” are mapped into the lower layer ”-” domains.
According to the position of their domain centers relative to the screw axes,
the arrangement these domains along $y$ can be either zigzag or linearly
alternate, as shown in the left and right panel of Fig. S1 respectively.

Figure S1: Schematics diagrams of the screw rotation symmetry connecting two
AB (left panel) and AB’ (right panel) stacking domains for tSnS with a
relative twist of 6.03$\degree$. The straight dashed lines represent screw
axes. The solid and dashed curved arrow lines show the symmetry operation in 2
inequalent domain pairs within the unit cell.

##  III DFT calculated band structures

Figure S2:  Band structures near VBM calculated by DFT (a) with and (b)
without SOC for tSnS with a relative twist of 12.03$\degree$. The insets in
(b) show the symmetry protected band crossings near $Y$ and $S$.

##  IV Real space illustration of wave functions

Figure S3:  Real space illustration of wave function squared at $\Gamma$ point
for bands labeled by 1-4 in Fig. S2 (a).

##  V Low-energy tight-binding model

The emergence of strong charge localization points as shown in Fig. S3 hints
towards an effective description of the low-energy valence band manifold (VBM)
within a tight-binding (TB) approach. Following the real-space distribution of
the wave functions obtained from first-principle calculations, we adapt a
rectangular lattice model with two sites per unit cell, in the following
referred to as sublattice A and B with relative coordinates
$\bm{r}_{A}=(\frac{3}{4},\frac{1}{4})$ and
$\bm{r}_{B}=(\frac{1}{4},\frac{3}{4})$. The wavefunctions obtained from DFT
calculations suggest that the residual coupling between the upper (lower) 4
bands in the VBM is rather small and we therefore model each of these bands
separately resulting in the two band sets I/II.

To construct the effective low-energy tight-binding model that captures the
topological features of the hourglass fermion it is essential to preserve the
non-symmorphic symmetry $\widetilde{\mathcal{C}}_{2y}=i\tau_{x}\sigma_{y}$ and
time-reversal symmetry $\mathcal{T}=-i\sigma_{y}\mathcal{K}$ of the underlying
lattice. Here, the Pauli matrices $\sigma$ ($\tau$) act on the spin
(sublattice) degree of freedom and $\mathcal{K}$ is the operator of complex-
conjugation. In particular, $\widetilde{\mathcal{C}}_{2y}$ exchanges
sublattices, i.e. $A\leftrightarrow B$, such that hopping amplitudes that
connect same sublattices, i.e. two $A(B)$ sites with connecting vector
$\bm{r}_{AA(BB)}$, must be chosen identical to the hopping amplitude between
two $B(A)$ sites if their connecting vectors are mapped onto each other under
$\widetilde{\mathcal{C}}_{2y}$. This procedure is exemplified in Fig. S4 (c)
showing the hopping amplitude between nearest-neighbor atoms in sublattice
$A(B)$. To break the additional $\mathcal{C}_{2y}$ symmetry that is not
present in the relaxed atomic structure of tSnS and to account for the
anisotropy in $x/y$ that manifests due to the presence of the effective
rectangular moiré unit cell, we allow for anisotropic hopping amplitudes to
the right/left from each reference site as indicated by $+/-$ in Fig. S4 (b).

Furthermore, we model the strong intrinsic spin-orbit coupling of tSnS by
Kane-Mele and Rashba SOC terms. The latter particularly break inversion and
$SU(2)$ symmetry completely. The symmetry-allowed terms of our tight-binding
fit are listed in Table 1. To accurately capture the bandstructure and spin
texture obtained from DFT, we set up a 13-parameter tight-binding model (the
mass term $m_{0}$ may be absorbed into the chemical potential) including
nearest-neighbor SOC terms and up to 5th nearest-neighbor kinetic energy
hopping terms as sketched in Fig. S4 (b).

Figure S4: Tight-binding model capturing SOC non-symmorphic symmetry and spin texture in twisted SnS. (a) Comparison between the low-energy bandstructure obtained from DFT calculations and our 13-parameter TB fit. Band sets I/II are shown separately in the upper (lower) panel suggesting good agreement of the TB model with ab-initio results. In particular, the hourglass crossing point is preserved indicating that the non-symmorphic symmetry $\widetilde{\mathcal{C}}_{2y}$ remains exact within our modeling approach. (b) Schematic sketch of the hopping amplitudes used in the 13-parameter tight-binding approach. Colors indicate the distance to the reference atom ($A$ site, orange sphere). The TB model takes up to 5th nearest-neighbor (nn) sites into account. (c) Schematic sketch of the impact of the non-symmorphic symmetry $\widetilde{\mathcal{C}}_{2y}$ on lattice sites and hopping amplitudes. As $\widetilde{\mathcal{C}}_{2y}$ consist of a shift by half a lattice vector in $y$ direction followed by a two-fold rotation around the $y$ axis (upper and middle panel), sublattices $A(B)$ are mapped onto each other. Therefore, hopping terms connecting same sublattices must be chosen identical to preserve the symmetry, i.e. $t_{AA}^{x}=t_{BB}^{x}$. (d), (e) Comparison of the spin texture obtained from DFT (cross) and TB (continuous color) calculations. Spin textures are plotted for different bands $n_{b}=1\dots 4$, where bands are labeled from the bottom to the top according to panel (a). The excellent agreement between DFT/TB model justifies the choice of nearest-neighbor Rahsba/Kane-Mele terms chosen in the manuscript. | $m_{0}$ | $t_{AB}^{+}$ | $t_{AB}^{-}$ | $t_{AA}^{x}$ | $t_{AA}^{y}$ | $t_{AB}^{y+}$ | $t_{AB}^{y-}$ | $t_{AA}^{+}$ | $t_{AA}^{-}$ | $t_{AA}^{2x}$ | $t_{AA}^{2y}$ | $t_{AB}^{R+}$ | $t_{AB}^{R-}$ | $\phi_{AB}$
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
Bandset I | -281.60 | 3.97 | 3.06 | -0.10 | -4.02 | -1.25 | -0.89 | -1.26 | 0.85 | 0.00 | -0.71 | -0.56 | -0.45 | $\pi/30$
Bandset II | -320.45 | 2.06 | 1.86 | 0.09 | 5.57 | 0.66 | 0.55 | -0.29 | -0.29 | 0.00 | 0.68 | -2.12 | -1.79 | $\pi/8$

Table 1: Hopping parameters (in meV) for the 13-parameter tight-binding fit
capturing the top valence band manifold (VBM) of twisted SnS. According to
first-principle calculations, the 8 bands belonging to the VBM can be
separated into two groups (Bandset I/II) with negligible residual coupling as
suggested by the wave function profile in Fig. S3.

The two-particle Hamiltonian consists of kinetic energy terms $t^{\text{kin}}$
that are spin-independent, i.e. $\propto\sigma_{0}$, Rashba SOC terms $t^{R}$
and Kane-Mele SOC terms causing $S_{z}$ polarization as indicated by the phase
$e^{i\phi_{ij}s}$

$H^{0}=\sum_{ijs}t_{ij}^{\text{kin}}e^{i\phi_{ij}s}c^{\dagger}_{is}c^{\phantom{\dagger}}_{js}+i\sum_{ijss^{\prime}}t_{ij}^{R}c^{\dagger}_{is}\left(\bm{\sigma}\times\bm{d}_{ij}\right)_{z}c^{\phantom{\dagger}}_{js^{\prime}}=H^{\text{kin}}+H^{\text{SOC}}.$
(1)

Here, $c^{(\dagger)}_{is}$ creates (annihilates) an electron with spin $s$ on
moiré site $\bm{r}_{i}$ that belongs to one of the sublattices
$o\in\\{A,B\\}$. As the rectangular lattice possesses translational
invariance, a description of the non-interacting theory is done most
conveniently in Bloch momentum space. As the 4-band Hilbert space arises from
$\hat{\bm{c}}^{\dagger}=\\{c^{\dagger}_{A\uparrow},c^{\dagger}_{B\uparrow},c^{\dagger}_{A\downarrow},c^{\dagger}_{B\downarrow}\\}$
this fixes our basis choice for the Bloch Hamiltonian. Defining the phase
factors $\phi_{lm}:=e^{-i\bm{k}\cdot(l\bm{a}_{1}+\bm{a}_{2})}$ relative to the
lattice vectors $\bm{a}_{1(2)}$ of the rectangular lattice, the nearest-
neighbor SOC terms of the Bloch Hamiltonian read

$\begin{split}H^{\text{SOC}}(\bm{k})=\tau_{x}&\left[\frac{i}{2}t^{+R}_{AB}\left\\{\phi_{00}(-\sigma_{x}-\sigma_{y})+\phi_{0\bar{1}}(-\sigma_{x}+\sigma_{y})\right\\}\right.\\\
&+\frac{i}{2}t^{-R}_{AB}\left\\{\phi_{\bar{1}0}(\sigma_{x}-\sigma_{y})+\phi_{1\bar{1}}(\sigma_{x}+\sigma_{y})\right\\}\\\
&+t_{AB}^{+}\sigma^{\pm}(\phi_{AB})\left\\{\phi_{00}+\phi_{0\bar{1}}\right\\}+t_{AB}^{-}\sigma^{\pm}(-\phi_{AB})\left\\{\phi_{10}+\phi_{1\bar{1}}\right\\}\Bigg{]}+h.c.\end{split}$
(2)

The appearance of the diagonal matrix
$\sigma^{\pm}(\phi_{AB})=\text{diag}(e^{i\phi_{AB}},e^{-i\phi_{AB}})$ is
reminiscent of the general Kane-Mele spin-orbit interaction, while the Rashba
terms are proportional to $\sigma_{x(y)}$. We further use the notation
$\bar{l}=-l$ for negative numbers. The vector connecting the sublattices
$A(B)$ within the unit cell is given by
$\bm{d}_{AB}^{\text{intra}}=(-\frac{1}{2},\frac{1}{2})$ and the three
remaining vectors can be constructed by rotating by $\theta=\pi/2$. The
kinetic energy terms that couple same sublattices read

$\begin{split}H^{\text{kin}}_{\tau_{0}}(\bm{k})=\sigma_{0}&\tau_{0}\left[m_{0}+t_{AA}^{x}\phi_{10}+t_{AA}^{y}\phi_{01}\right.\\\
&+\left.t_{AA}^{2x}\phi_{20}+t_{AA}^{2y}\phi_{02}\right]\\\
+\sigma_{0}&\tau_{AA}^{\pm}\left[\phi_{11}+\phi_{\bar{1}1}\right]+h.c.\end{split}$
(3)

The appearance of the diagonal matrix
$t_{AA}^{\pm}=\text{diag}(t_{AA}^{+},t_{AA}^{-})$ with nonequivalent hopping
elements for sublattices $A(B)$ is a direct consequence of the non-symmorphic
symmetry $\widetilde{\mathcal{C}}_{2y}$. The longer-ranged kinetic hopping
elements connecting different sublattices read

$H^{\text{kin}}_{\tau_{x}}(\bm{k})=\sigma_{0}\tau_{x}\left[t_{AB}^{y+}(\phi_{01}+\phi_{0\bar{2}})+t_{AB}^{y-}(\phi_{11}+\phi_{1\bar{2}})\right].$
(4)

Altogether, the Hamiltonian for the band sets I/II is given by

$H^{0}(\bm{k})=H^{\text{kin}}_{\tau_{x}}(\bm{k})+H^{\text{kin}}_{\tau_{1}}(\bm{k})+H^{\text{SOC}}(\bm{k})$
(5)

The success of fitting the flat bands in twisted SnS within our low-energy
tight-binding model is demonstrated in panel (a). By fitting the hopping
parameters to the full ab-initio band structure for different angles, almost
perfect agreement is achieved. In particular, the spin texture mandated by DFT
calculations is captured accurately within our modeling approach, see Fig. S4
(d), (e) for band sets I/II. This shows that nearest-neighbor Rashba/Kane-Mele
spin-orbit interactions are sufficient to reproduce the spin texture given by
ab initio calculations. A simple Python code to generate the Bloch Hamiltonian
and the bandstructure of tSnS given the hopping parameters in table 1 is
available online at https://git.rwth-aachen.de/ammon.fischer/tight-binding-
model-twisted-sns

##  VI Multi-orbital random-phase approximation

In this section, we summarize the random-phase approximation (RPA) formalism
applied in the main text that captures the collective spin-/charge excitations
(DW) and superconducting instabilities in twisted SnS. In the absence of spin
rotational $SU(2)$ symmetry caused by the strong Rashba-type spin-orbit
coupling (SOC) in the material, the electrons’ spin remains no longer a well-
defined quantum number when transforming the multi-orbital Bloch Hamiltonian

$H^{0}_{\alpha,\alpha^{\prime}}(\bm{k})=u_{\alpha
b}^{\phantom{\dagger}}(\bm{k})e_{b}(\bm{k})u_{\alpha^{\prime}b}^{\dagger}(\bm{k})$
(6)

to band space $(\alpha,b)$, where $\alpha=(o,s)$ denotes the orbital
(sublattice)- and spin degrees of freedom. It is therefore that spin- and
charge excitation generally mix in the absence of $SU(2)$ symmetry for
arbitrary momentum transfer $\bm{q}$ and a description beyond the decoupling
in longitudinal and transverse fluctuations sufficient in the case of $SU(2)$
symmetry is needed [7, 8, 9, 10, 11]. Before discussing details of the weak-
coupling expansion as given by the RPA, we may define the free Matsubara
Green’s function in orbital-momentum (frequency) space that connects different
interactions vertices appearing in the diagrammatic expansion

$g_{\alpha,\alpha^{\prime}}(i\omega,\bm{k})=\left[i\omega-(H^{0}(\bm{k})))\right]_{\alpha,\alpha^{\prime}}^{-1}=\sum_{b}u_{\alpha
b}(\bm{k})g_{b}(i\omega,\bm{k})u_{b\alpha^{\prime}}^{*}(\bm{k})=\leavevmode\hbox
to70.74pt{\vbox to33.99pt{\pgfpicture\makeatletter\hbox{\hskip
6.53151pt\lower-19.06601pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } \par{}{{}}{}
{}{}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.8pt}\pgfsys@invoke{
}{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@lineto{56.90552pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
}{\pgfsys@beginscope\pgfsys@invoke{ } {}{{}{}}{}{}{}{{}}{{}}{{}{}}{{}{}}
{{{{}{}{{}} }}{{}}}{{{{}{}{{}} }}{{}}{{}}} {}{}{}{}{{{{}{}{{}}
}}{{}}}{}{}{}{}{}{{}}{} {}{}{\pgfsys@beginscope\pgfsys@invoke{ }
{}{{}{}}{{}{}}{}{}{}{{}}{{}}{{}{}}{}{}{{}}{{}}{{}{}} {{{{}{}{{}}
}}{{}}}{{{{}{}{{}} }}{{}}{{}}} {{{{}{}{{}} }}{{}}}{{{{}{}{{}}
}}{{}}}{{{{}{}{{}} }}{{}}}{}{}{}{{}}{{}}{{}{}}{{}{}}{{{{}{}{{}}
}}{{}}\pgfsys@beginscope\pgfsys@invoke{ } {\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{0,0,0} {{}} {{{ {\pgfsys@beginscope{}
{} {} {}
\pgfsys@moveto{2.59995pt}{0.0pt}\pgfsys@lineto{-1.55997pt}{2.07996pt}\pgfsys@lineto{0.0pt}{0.0pt}\pgfsys@lineto{-1.55997pt}{-2.07996pt}\pgfsys@fill\pgfsys@endscope}}
}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{29.21712pt}{0.0pt}\pgfsys@invoke{
}\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}{{}}}} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}{}{{}} }}{{}}}{{{{}{}{{}} }}{{}}}{{{{}{}{{}} }}{{}}
{{}} }{{{{}{}{{}} }}{{}} {{}} } {{{{}{}{{}} }}{{}}{{}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope} {{{{}{}{{}}
}}{{}}}{{}{}}{{}{}}{{{{}{}{{}} }}{{}}}{} {{{{}{}{{}} }}{{}}{{}}}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}\hbox{\hbox{\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {
}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-3.1985pt}{5.733pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\alpha$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}}\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{52.93701pt}{5.733pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\alpha^{\prime}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}}\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{18.26872pt}{-13.233pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$(b,\bm{k})$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys<EMAIL_ADDRESS>(7)

Here, $u_{\alpha b}$ are the orbital-to-band transformations that render the
free Green’s function $g_{b}(i\omega,\bm{k})=(i\omega-e_{b}(\bm{k}))^{-1}$
diagonal.

It is the core of the random-phase approximation as single-channel
approximation of the effective two-particle interaction vertex $\Gamma^{(4)}$
to expand the two-particle Green’s function $\chi^{\text{RPA}}(\bm{q})$ in a
series of bubble- and ladder diagrams to infinite order in $U$ such to account
for all possible one-loop corrections as shown in Fig. S5. By rewriting the
renormalized interactions in the particle-hole (ph) and particle-particle (pp)
channel, tendencies towards either spin-/charge density wave order (DW) or
superconducting order (SC) are resolved. To this end, it is beneficial to
introduce the generalized (undressed) four-point correlation function
$\chi^{PH/PP}(\bm{q})$ in the particle-hole and particle-particle channel

$k$$k-q$$\alpha_{1}$$\alpha_{4}$$\alpha_{3}$$\alpha_{2}$$\alpha_{1}$$\alpha_{4}$$\alpha_{3}$$\alpha_{2}$$=$$+$$\alpha_{1}$$\alpha_{4}$$\alpha_{3}$$\alpha_{2}$$\alpha_{1}^{\prime}$$\alpha_{3}^{\prime}$$\alpha_{4}^{\prime}$$\alpha_{2}^{\prime}$$U$
Figure S5: Left: Loop diagram for the non-interacting 4-point correlation
function (susceptibility) $\chi_{\alpha_{1}\dots\alpha_{4}}^{PH}$ defined in
Eq. (8). The solid lines denote fermionic propagators with frequency and
momentum dependence $k=(ik_{0},\bm{k})$. The labels on the in-going and out-
going legs $\alpha_{1}\dots\alpha_{4}$ are ordered in standard notation and
refer to the electrons’ quantum numbers $\alpha=(o,s)$ in terms of orbital
(sublattice) $o\in\\{A,B\\}$ and spin $s$ degree of freedom. Right:
Diagrammatic representation of the RPA enhanced correlation function
(susceptibility) as defined in Eq. 8. The emerging Dyson equation denotes a
summation to infinite order in the interaction vertex
$U_{\alpha_{1}\dots\alpha_{4}}$. Internal indices connecting interaction
vertex and the (non-interacting) susceptibilities are summed over implicitly
and are denoted with small labels.

$\chi^{PH}_{\alpha_{1}..\alpha_{4}}(q)=-\frac{1}{N}\sum_{\bm{k}}\sum_{b,b^{\prime}}\left[M^{PH}(\bm{k},\bm{q})\right]_{\alpha_{1}..\alpha_{4}}^{b,b^{\prime}}\frac{n_{F}(\epsilon_{b}(\bm{k}))-n_{F}(\epsilon_{b^{\prime}}(\bm{k}-\bm{q}))}{iq_{0}+\epsilon_{b}(\bm{k})-\epsilon_{(b^{\prime}}(\bm{k}-\bm{q})}$
(8)
$\chi^{PP}_{\alpha_{1}..\alpha_{4}}(q)=-\frac{1}{N}\sum_{\bm{k}}\sum_{b,b^{\prime}}\left[M^{PP}(\bm{k},\bm{q})\right]_{\alpha_{1}..\alpha_{4}}^{b,b^{\prime}}\frac{n_{F}(\epsilon_{b}(\bm{k}))-n_{F}(1-\epsilon_{b^{\prime}}(-\bm{k}-\bm{q}))}{iq_{0}+\epsilon_{b}(\bm{k})+\epsilon_{(b^{\prime}}(-\bm{k}-\bm{q})}.$
(9)

Here, we adopt standard notation and label in-going legs
($\alpha_{1},\alpha_{2}$) and out-going ($\alpha_{3},\alpha_{4}$) legs
accordingly. The tensor $M^{PH/PP}(\bm{k},\bm{q})$ roots in the contributions
of the unitary orbital-to-band transformations Eq. (6) and are given by

$\left[M^{PH}(\bm{k},\bm{q})\right]_{\alpha_{1}..\alpha_{4}}^{b,b^{\prime}}=u_{\alpha_{1}b}(\bm{k})u^{*}_{\alpha_{3}b}(\bm{k})u_{\alpha_{2}b^{\prime}}(\bm{k}-\bm{q})u^{*}_{\alpha_{4}b^{\prime}}(\bm{k}-\bm{q})$
(10)
$\left[M^{PP}(\bm{k},\bm{q})\right]_{\alpha_{1}..\alpha_{4}}^{b,b^{\prime}}=u_{\alpha_{1}b}(\bm{k})u^{*}_{\alpha_{3}b}(\bm{k})u_{\alpha_{2}b^{\prime}}(-\bm{k}-\bm{q})u^{*}_{\alpha_{4}b^{\prime}}(-\bm{k}-\bm{q}).$
(11)

In numerical simulations it is favorable to achieve the highest possible
momentum resolution of the Fermi surface in order to capture nesting effects
that will determine the spin-/charge response of the system. Therefore, we
resort to a refinement procedure that relies on averaging the response
function for each momentum point $\bm{k}$ appearing in the sum of Eq. (15)
over a set of finer momentum points $\\{\bm{k}_{f}\\}_{\bm{k}}$

$\chi^{PH}_{\alpha_{1}..\alpha_{4}}(q)=-\frac{1}{N}\sum_{\bm{k}}\sum_{\\{\bm{k}_{f}\\}_{\bm{k}}}\sum_{b,b^{\prime}}\left[M^{PH}(\bm{k}_{f},\bm{q})\right]_{\alpha_{1}..\alpha_{4}}^{b,b^{\prime}}\frac{n_{F}(\epsilon_{b}(\bm{k}_{f}))-n_{F}(\epsilon_{b^{\prime}}(\bm{k}_{f}-\bm{q}))}{iq_{0}+\epsilon_{b}(\bm{k}_{f})-\epsilon_{(b^{\prime}}(\bm{k}_{f}-\bm{q})}.$
(12)

In practice, this is achieved by discretizing the 2D Brillouin zone with an
equidistant momentum mesh with $N_{\bm{k}}\times N_{\bm{k}}$ coarse momentum
points and averaging over a fine momentum mesh with $N_{\bm{k}_{f}}\times
N_{\bm{k}_{f}}$ point such that the electronic dispersion is effectively
resolved for $(N_{\bm{k}}N_{\bm{k}_{f}})^{2}$ points. For the phase diagram
presented in Fig. 3 (a) in the manuscript, we used $N_{\bm{k}}=48$ and
$N_{\bm{k}_{f}}=40$.

In terms of the generalized four-point susceptibility, the expansion of the
two-particle Greens function $\chi^{\text{RPA}}$ in bubble and ladder diagrams
is straight forward by using Hugenholtz diagrams representing symmetrized
interaction vertices, see Fig. S5. In the presence of only an repulsive
Hubbard interaction, i.e.

$U_{\alpha_{1}\dots\alpha_{4}}=\begin{cases}+U,&\text{if
}o_{1}=o_{2}=o_{3}=o_{4};\,s_{1}=s_{3},\,s_{2}=s_{4}\\\ -U,&\text{if
}o_{1}=o_{2}=o_{3}=o_{4};\,s_{1}=s_{2},\,s_{3}=s_{4}\\\
0,&\text{otherwise}\end{cases}$ (13)

we can resum this series to infinite order in $U$ to obtain the full RPA
corrected two-particle Greens function
$\overline{\chi^{PH}}=\chi^{\text{RPA}}$

$\begin{split}\overline{\chi^{PH}}_{\alpha_{1}..\alpha_{4}}(\bm{q})&=\chi^{PH}_{\alpha_{1}..\alpha_{4}}(\bm{q})+\chi^{PH}_{\alpha_{1},\alpha_{4}^{\prime},\alpha_{1}^{\prime},\alpha_{4}}(\bm{q})U_{\alpha_{1}^{\prime},\alpha_{2}^{\prime},\alpha_{3}^{\prime},\alpha_{4}^{\prime}}(\bm{q})\overline{\chi^{PH}}_{\alpha_{3}^{\prime},\alpha_{2},\alpha_{3},\alpha_{2}^{\prime}}(\bm{q}).\end{split}$
(14)

Here, we only focus on the static part of the effective interaction vertex,
i.e. $iq_{0}=0$. Einstein notation applies as double indices are summed over
implicitly. To solve this linear equation for $\overline{\chi^{PH}}$, it is
beneficial to re-order the legs of each rank-4 tensor according to the new
positions $(1,4,3,2)$ to express the tensor sums in Eq. (14) as batched
matrix-matrix multiplication in $\bm{q}$. This yields

$\begin{split}\overline{\chi^{PH}}_{(\alpha_{1},\alpha_{4})(\alpha_{3},\alpha_{2})}(\bm{q})&=\chi^{PH}_{(\alpha_{1},\alpha_{4})(\alpha_{3},\alpha_{2})}(\bm{q})+\chi^{PH}_{(\alpha_{1},\alpha_{4})(\alpha_{1}^{\prime},\alpha_{4}^{\prime})}(\bm{q})U_{(\alpha_{1}^{\prime},\alpha_{4}^{\prime})(\alpha_{3}^{\prime},\alpha_{2}^{\prime})}(\bm{q})\overline{\chi^{PH}}_{(\alpha_{3}^{\prime},\alpha_{2}^{\prime})(\alpha_{3},\alpha_{2})}(\bm{q})\\\
&=\left[\uuline{\chi}^{PH}+\uuline{\chi}^{PH}\cdot\uuline{U}\cdot\overline{\uuline{\chi}^{PH}}\right]_{(\alpha_{1},\alpha_{4})(\alpha_{3},\alpha_{2})}(\bm{q})\\\
&=\left[\frac{\mathds{1}}{\mathds{1}-\uuline{\chi}^{PH}\cdot\uuline{U}}\cdot\uuline{\chi}^{PH}\right]_{(\alpha_{1},\alpha_{4})(\alpha_{3},\alpha_{2})}(\bm{q})\end{split}$
(15)

To retain the standard notation, the legs need to be re-ordered accordingly.
From the expression above it is clear that (i) spin- and charge correlations
are generally mixed in the absence of $SU(2)$ symmetry and (ii) that the RPA
corrected susceptibility encounters divergences when the denominator becomes
singular. This ’generalized’ Stoner criterion for multi-orbital systems can be
used to estimate the critical interaction strength $U_{c}$ that marks the
onset of spin-/charge density wave (DW) order in the system. Divergences occur
first at the interaction value for which the maximal eigenvalue
$\lambda_{\text{max}}$ of the (non-hermitian) product
$\uuline{U}\cdot\uuline{\chi}^{PH}$ becomes $U_{c}=1/\lambda_{\text{max}}$.
This procedure is used to separate the phase diagram as function of filling
$\nu$ and interaction strength $U$ into paramagnetic and DW ordered regions.

$\alpha_{1},k$$\alpha_{4},-k^{\prime}$$\alpha_{2},-k$$\alpha_{3},k^{\prime}$$U$$U$$-$$\alpha_{1},k$$\alpha_{3},k^{\prime}$$\alpha_{2},-k$$\alpha_{4},-k^{\prime}$$U$$U$
Figure S6: Diagrams contributing to the pairing vertex within the fluctuation-
exchange approximation. The vertex must is anti-symmetrized to fulfill
fermionic anti-commutation relations, which can be achieved by swapping the
out-going legs $3\to 4$, starting from the simple RPA expansion.

For interaction values $U<U_{c}$, the effective coupling in the ph-channel did
not diverge yet and fluctuations around DW ordered phases may provide the
pairing glue for unconventional superconducting states in the system. To
capture these contributions from fluctuation-exchange [7], we rewrite the
effective interaction in the pp-channel
$\Gamma^{\text{PP}}(\bm{k},\bm{k}^{\prime})$ to further track possible pairing
instabilities. The diagrammatic contributions shown in Fig. S6 translate to

$\begin{split}\Gamma^{\text{PP}}(\bm{k},\bm{k}^{\prime},\alpha_{1}..\alpha_{4})&=U_{\alpha_{1},\alpha_{1}^{\prime},\alpha_{4}^{\prime},\alpha_{4}}(\bm{q})\overline{\chi}^{PH}_{\alpha_{1}^{\prime},\alpha_{3}^{\prime},\alpha_{2}^{\prime},\alpha_{4}^{\prime}}(\bm{q})U_{\alpha_{3}^{\prime},\alpha_{3},\alpha_{2},\alpha_{2}^{\prime}}(\bm{q})\delta_{\bm{q},\bm{k}-\bm{k}^{\prime}}\\\
&\overset{\mathclap{}}{=}U_{(\alpha_{1},\alpha_{4})(\alpha_{1}^{\prime},\alpha_{4}^{\prime})}(\bm{q})\overline{\chi}^{PH}_{(\alpha_{1}^{\prime},\alpha_{4}^{\prime})(\alpha_{3}^{\prime},\alpha_{2}^{\prime})}(\bm{q})U_{(\alpha_{3}^{\prime},\alpha_{2}^{\prime})(\alpha_{3},\alpha_{2})}(\bm{q})\delta_{\bm{q},\bm{k}-\bm{k}^{\prime}}\\\
&=\left[\uuline{U}\cdot\uuline{\overline{\chi}^{PH}}\cdot\uuline{U}\right]_{(\alpha_{1},\alpha_{4})(\alpha_{3},\alpha_{2})}(\bm{k}-\bm{k}^{\prime}).\end{split}$
(16)

From the first to the second line, we transposed each rank-4 tensor according
to the order $(1,4,2,3)$ to rewrite the tensor product as batched matrix-
matrix multiplication in $\bm{q}$. To account for all contributions from
bubble and ladder diagrams, we anti-symmetrize the pairing vertex by swapping
the outgoing legs $3\leftrightarrow 4$ such that we finally arrive at

$\Gamma^{\text{PP}}_{\sigma}=\frac{1}{2}\left[\Gamma^{\text{PP}}(\bm{k},\bm{k}^{\prime},\alpha_{1},\alpha_{2},\alpha_{3},\alpha_{4})-\Gamma^{\text{PP}}(\bm{k},-\bm{k}^{\prime},\alpha_{1},\alpha_{2},\alpha_{4},\alpha_{3})\right].$
(17)

##  VII Analyzing spin-/charge density wave and superconducting order

This section aims to establish the connection between (i) the dressed two-
particle Greens function $\chi^{\text{RPA}}(\bm{q})$ and the spin-/charge
correlation functions in the presence of broken $SU(2)$ symmetry and (ii) the
effective particle-particle interaction vertex $\Gamma^{\text{PP}}$ and
emerging superconducting instabilities and their symmetry.

First, to analyze spin- and charge excitations, we resort to the spin-spin
(charge-charge) correlation function in imaginary time

$\begin{split}\chi_{ij}(i\omega,\bm{q})&=\int_{0}^{\beta}d\tau
e^{i\omega\tau}\langle\mathrm{T}_{\tau}X_{i}(\bm{q},\tau)X_{j}(-\bm{q},0)\rangle,\end{split}$
(18)

where $X_{i}(\bm{q},\tau)=N(\bm{q},\tau)$ if $i=0$ describes the density-
density response of the system and $X_{i}(\bm{q},\tau)=S(\bm{q},\tau)$ if
$i\in\\{x,y,z\\}$ describes the spin-spin correlations associated to the
spatial directions of the lattice structure. Furthermore, $\tau\in[0,\beta]$
denotes the imaginary time argument with inverse temperature $\beta=1/T$ and
$T_{\tau}$ is the time-ordering operator. In this context, the spin (charge)
operators are defined as

$\begin{split}S_{i}(\bm{q},\tau)&=\frac{1}{N}\sum_{k}\sum_{o,s,s^{\prime}}c^{\dagger}_{o,s}(\bm{k},\tau)\frac{\left[\sigma_{i}\right]_{ss^{\prime}}}{2}c^{\phantom{\dagger}}_{o,s^{\prime}}(\bm{k}+\bm{q},\tau)\\\
N(\bm{q},\tau)&=\frac{1}{N}\sum_{k}\sum_{o,s,s^{\prime}}c^{\dagger}_{o,s}(\bm{k},\tau)\left[\sigma_{0}\right]_{ss^{\prime}}c^{\phantom{\dagger}}_{o,s^{\prime}}(\bm{k}+\bm{q},\tau),\end{split}$
(19)

where $\sigma_{i}$ denotes the $i$-th Pauli matrix and $\sigma_{0}$ refers to
the identity matrix. Comparing the expression of the spin-/charge correlation
function Eq. (18) with the dressed four-point susceptibility Eq. (14) being an
four-fermion expectation value shows that the correlation functions can be
recovered by forming appropriate linear combinations of the entries of
$\chi^{\text{RPA}}_{\alpha_{1}\dots\alpha_{4}}(\bm{q})$. The correct terms are
recovered by contraction with Pauli matrices on both sides

$\chi_{ij}(\bm{q})=\sum_{o_{1}\dots o_{4}}\sum_{s_{1}\dots
s_{4}}\left[\sigma_{i}\right]_{s_{1}s_{4}}\chi^{\text{RPA}}_{\begin{subarray}{c}s1\dots
s_{4}\\\ o_{1}\dots
o_{4}\end{subarray}}(\bm{q})\left[\sigma_{j}\right]_{s_{3}s_{2}},$ (20)

where we traced over the orbital degrees of freedom. This is sufficient when
analyzing in which channel the leading instability occurs. The leading channel
is identified by the maximum value of any $|\chi^{\text{RPA}}(\bm{q})|$ at
given wave vector $q$. In general, divergencies in multiple channel can occur
and the resulting DW instability will be a mixture of spin-/charge density
waves in the case of broken $SU(2)$ symmetry as mentioned in the beginning.

$\alpha_{1},k$$\alpha_{2},-k$$=$$\alpha_{1},k$$\alpha_{2},-k$$\alpha_{1}^{\prime},k^{\prime}$$\alpha_{3},k^{\prime}$$\alpha_{2}^{\prime},-k^{\prime}$$\alpha_{4},-k^{\prime}$
Figure S7: Linearized gap equation for the superconducting order parameter
$\Delta_{\alpha_{1}\alpha_{2}}(\bm{k})$. The hatched area denotes the
effective vertex in the particle-particle channel
$\Gamma_{\sigma}^{\text{PP}}$ as defined in Eq. (17)

Next, we turn to the discussion of the superconducting ordering tendencies.
Given the effective interaction vertex in the particle-particle channel
$\Gamma^{\text{PP}}$ Eq. (17), in the following we assume
$\Gamma^{\text{PP}}=\Gamma^{\text{PP}}_{\sigma}$ to be the symmetrized
interaction vertex implicitly, the symmetry of the leading superconducting
instabilities is further analyzed by solving the linearized gap equation in
the vicinity to the critical temperature $T_{c}$ of the superconducting phase.
For multi-orbital systems, the linearized gap equation as diagrammatically
shown in Fig. S7 takes the form of a generalized (non-hermitian) eigenvalue
problem

$\begin{split}\Delta_{\alpha_{1}\alpha_{2}}(\bm{k})&=\frac{1}{\beta
N}\sum_{k^{\prime}}\sum_{\alpha_{1}^{\prime}\alpha_{2}^{\prime}}\sum_{\alpha_{3}\alpha_{4}}\Gamma^{\text{PP}}_{\alpha_{1},\alpha_{2},\alpha_{3},\alpha_{4}}(\bm{k},\bm{k}^{\prime})G_{\alpha_{3}\alpha_{1}^{\prime}}(k^{\prime})G_{\alpha_{4}\alpha_{2}^{\prime}}(-k^{\prime})\Delta_{\alpha_{1}^{\prime}\alpha_{2}^{\prime}}(\bm{k}^{\prime})\\\
&=\frac{1}{N}\sum_{\bm{k}^{\prime}}\sum_{\alpha_{1}^{\prime}\alpha_{2}^{\prime}}\sum_{\alpha_{3}\alpha_{4}}\Gamma^{\text{PP}}_{\alpha_{1},\alpha_{2},\alpha_{3},\alpha_{4}}(\bm{k},\bm{k}^{\prime})\chi^{\text{PP}}_{\alpha_{3}\alpha_{4}\alpha_{1}^{\prime}\alpha_{2}^{\prime}}(\bm{k}^{\prime},\bm{q}=0)\Delta_{\alpha_{1}^{\prime}\alpha_{2}^{\prime}}(\bm{k}^{\prime})\\\
&=\frac{1}{N}\sum_{\bm{k}^{\prime}}\sum_{\alpha_{1}^{\prime}\alpha_{2}^{\prime}}\Pi^{\text{PP}}_{(\bm{k},\alpha_{1},\alpha_{2})(\bm{k}^{\prime},\alpha_{1}^{\prime},\alpha_{2}^{\prime})}\Delta_{(\bm{k}^{\prime},\alpha_{1}^{\prime}\alpha_{2}^{\prime})}\\\
&=\lambda_{\text{SC}}\left[\hat{\Pi}^{\text{PP}}\hat{\Delta}\right]_{(\bm{k},\alpha_{1},\alpha_{2})}.\end{split}$
(21)

From the first to the second line, we identified the particle-particle loop
Eq. (9) as the product of the two (free) Greens functions with momentum
dependence $(k,-k)$. As for the effective interaction we only consider zero-
momentum Cooper pairs, i.e. $\bm{q}=0$ in the particle-particle loop, as these
will give dominant contributions among all Fermi liquid instabilities. From
the second to the third line, we contracted the effective pairing vertex
$\Gamma^{\text{PP}}(\bm{k},\bm{k}^{\prime})$ and the particle-particle loop
$\chi^{\text{PP}}(\bm{k}^{\prime})$ by executing the sum over
($\alpha_{3},\alpha_{4}$) for each momentum $\bm{k}^{\prime}$. By reordering
indices as indicated in the third line underlines the character of the
linearized gap equation of being an effective (non-hermitian) eigenvalue
problem in orbital/spin-momentum space. The leading eigenvalue
$\lambda_{\text{SC}}$ indicates the superconducting solution with highest
transition temperature $\lambda_{\text{SC}}\propto T_{c}$ and the
corresponding eigenfunction $\Delta_{\alpha_{1}\alpha_{2}}(\bm{k})$ transforms
as one of the irreducible representations of the systems symmetry groups and
hence yields the symmetry of the underlying SC order parameter.

The disadvantage of solving the linearized gap equation in orbital space lies
in the numerical cost associated with the solution of the non-hermitian
eigenvalue problem imposed by Eq. (21). The joint index
$(\bm{k},\alpha_{1},\alpha_{2})$ indicating the dimension of the effective
matrix $\hat{\Pi}^{\text{PP}}$ scales as $N_{b}^{2}\times N_{\bm{k}}$. For the
$N_{b}=4$ bands in tSnS as well as $N_{\bm{k}}=48\times 48$ being the number
of (coarse) momentum points used to resolve the superconducting order
parameter in Fig. 4 of the manuscript, the resulting matrix has dimension
$\approx 37^{\prime}000\times 37^{\prime}000$. Thus, this approach is limited
to few band models as diagonalizing even larger non-hermitian matrices is
merely feasible.
On the other hand, the advantage of solving the linearized gap equation in
orbital space lies in its gauge invariance, which is crucial for determining
topological properties of symmetry broken phases as all information about
topology is encoded in the phase of the Bloch states. The reason for it is
that the solution of the linearized gap in orbital-space Eq. (21) only
contains the particle-particle loop $\chi^{\text{PP}}$, which is gauge
invariant as the orbital-to-band transformations Eq. (6) only appear in
complex-conjugated pairs and thus possible gauge phases cancel out. In
principle, only scattering of electrons in the immediate vicinity of the Fermi
surface will contribute notably to Fermi liquid instabilities with non-
vanishing order parameter $\Delta(\bm{k})$. Therefore, most approaches in
literature [9, 7] aim to first project the effective interaction
$\Gamma^{\text{PP}}(\bm{k},\bm{k}^{\prime})\to\Gamma^{\text{PP}}_{b_{1}\dots
b_{4}}(\bm{k}_{F},\bm{k}^{\prime}_{F})$ to band space such that the momenta
and corresponding bands are restricted to the Fermi surface sheets at each
respective filling. However, such a transformation sensitively depends on the
specific gauge of the orbital-to-band transformations $u_{\alpha
b}(\bm{k})e^{i\phi_{b}(\bm{k})}$ that in general will carry an arbitrary gauge
phase $\phi_{b}(\bm{k})$ due to numerical diagonalization of the Bloch
Hamiltonian Eq. (6) at each momentum point $\bm{k}$. Transforming the
effective particle-particle vertex $\Gamma^{\text{PP}}$ to band space the
projected vertex must hence be written as

$\begin{split}\Gamma^{\text{PP}}_{b_{1}\dots
b_{4}}(\bm{k}_{F},\bm{k}_{F}^{\prime})=&\sum_{\alpha_{1}\dots\alpha_{4}}u_{\alpha_{1}b_{1}}^{*}(\bm{k}_{F})u_{\alpha_{2}b_{2}}^{*}(-\bm{k}_{F})\Gamma^{\text{PP}}_{\alpha_{1}\alpha_{2}\alpha_{3}\alpha_{4}}(\bm{k}_{F},\bm{k}^{\prime}_{F})u_{\alpha_{3}b_{3}}^{\phantom{*}}(\bm{k}^{\prime}_{F})u_{\alpha_{4}b_{4}}^{\phantom{*}}(-\bm{k}^{\prime}_{F})\\\
&\times
e^{i(\phi_{b_{3}}(\bm{k}_{F}^{\prime})+\phi_{b_{4}}(-\bm{k}_{F}^{\prime})-\phi_{b_{1}}(\bm{k}_{F})-\phi_{b_{2}}(-\bm{k}_{F}))},\end{split}$
(22)

and is therefore not gauge invariant. In the presence of time-reversal
symmetry $\mathcal{T}$ and restricting the analysis to intraband pairing only,
i.e. $b_{1}=b_{2}$ and $b_{3}=b_{4}$, this can be cured by explicitly
constructing the time-reversal partners of the orbital-to-band transformations
$\mathcal{T}{|u_{\bm{k}}\rangle}=i\sigma_{y}\tau_{0}u^{*}_{os}(-\bm{k})$. This
way, the phase difference
$e^{i(\phi_{b}(\bm{k}_{F}^{\prime})-\phi_{b}(\bm{k}_{F}^{\prime}))}=1$ cancels
out and gauge invariance is recovered. Nevertheless, this still imposes issues
at points in momentum space with degenerate energies, e.g. the Weyl nodal
point in tSnS, as the gauge in the degenerate subspace is not uniquely defined
and furthermore interband processes become relevant, such that the approximate
intraband solution may not be reliable any more. Furthermore, in the presence
of arbitrary spin-orbit interactions, the electrons spin is no longer a well
defined quantum number as it mixes with the orbital degrees of freedom. This
makes it impossible to classify the superconducting order parameter with
respect to spin-singlet/triplet or orbital character. This is only possible in
certain situation, where one may define a smooth pseudo-spin basis such that
certain bands carry well-defined spin expectation value [7], which is not the
case for tSnS.

##  VIII Hourglass Superconductivity in twisted SnS

The eigenfunctions $\Delta_{\alpha_{1},\alpha_{2}}(\bm{k})$ obtained by
solving the linearized gap equation Eq.(21) can be classified according to
their transformation behaviour under the non-symmorphic symmetry group
$\widetilde{\mathcal{C}}_{2y}=\\{\mathcal{C}_{2y}|0\frac{1}{2}\\}$. As the
latter inherits from the point group symmetry $\mathcal{C}_{2y}$, solutions
can be labeled to whether they transform even/odd under $\widetilde{C}_{2y}$,
i.e. $U^{\dagger}(\bm{k})\Delta(\bm{k})U(\bm{k})=\pm\Delta(\bm{k})$ with the
unitary matrix
$U(\bm{k})=i\tau_{x}\sigma_{y}e^{ik_{y}/2}\mathcal{R}_{k_{x}\to-k_{x}}$. This
is because the action of the translation by half a Bravais vector in
$y$-direction $\tau=(0,\frac{1}{2})$ is included in the phase factor
$e^{i\bm{k}\cdot\bm{\tau}}=e^{ik_{y}/2}$, which cancels in the expression
$U^{\dagger}(\bm{k})\Delta(\bm{k})U(\bm{k})$. Using
$\mathcal{R}^{\dagger}_{k_{x}\to-
k_{x}}\Delta(k_{x},k_{y})\mathcal{R}_{k_{x}\to-k_{x}}=\Delta(-k_{x},k_{y})$,
we may further simplify the expression to
$U^{\dagger}(\bm{k})\Delta(\bm{k})U(\bm{k})=\widetilde{U}^{\dagger}(\bm{k})\Delta_{\alpha_{1},\alpha_{2}}(-k_{x},k_{y})\widetilde{U}(\bm{k})$.
The matrix $\widetilde{U}_{\alpha_{1},\alpha_{2}}(\bm{k})$ in the basis choice
$\hat{\bm{c}}^{\dagger}=\\{c^{\dagger}_{A\uparrow},c^{\dagger}_{B\uparrow},c^{\dagger}_{A\downarrow},c^{\dagger}_{B\downarrow}\\}$
then reads

$\widetilde{U}(\bm{k})=\begin{pmatrix}0&0&0&\phi_{\bar{1}0}(\bar{\bm{k}})\\\
0&0&\phi_{\bar{1}\bar{1}}(\bar{\bm{k}})&0\\\
0&-\phi_{\bar{1}0}(\bar{\bm{k}})&0&0\\\
-\phi_{\bar{1}\bar{1}}(\bar{\bm{k}})&0&0&0\end{pmatrix}$ (23)

where the phase factors $\phi(\bar{\bm{k}})$ need to be introduced in order to
ensure numerical equivalence and $\bar{\bm{k}}=(-k_{x},k_{y})$ is the
$\mathcal{C}_{2y}$ transformed momentum. The reason for it is that by applying
$\mathcal{C}_{2y}$ to entries of the Bloch Hamiltonian or SC order parameter
combining different sublattices, e.g.
$\Delta_{AB}^{\uparrow\downarrow}(\bm{k})$, bonds that lie originally in the
same unit cell (and therefore carry no phase $\phi(\bar{\bm{k}})$ resembling
their momentum dependence) are mapped to different unit cells under
$\mathcal{C}_{2y}$. Therefore, they pick up a phase dependence that needs to
be compensated when numerically comparing to non-transformed order parameter.

To further analyze the quasiparticle properties of the SC instability and
determine the existence of potential localized edge modes, we study the order
parameter within mean-field theory. The resulting mean-field Hamiltonian can
be rewritten in the Nambu spinor basis
$\psi^{\dagger}_{\bm{k}}=(\vec{c}^{\,\dagger}_{\bm{k}\uparrow}\,\,\,\vec{c}^{\,\dagger}_{\bm{k}\downarrow}\,\,\,\vec{c}^{\phantom{\dagger}}_{-\bm{k}\uparrow}\,\,\,\vec{c}^{\phantom{\dagger}}_{-\bm{k}\downarrow})^{\mathrm{T}}$.
The full $2N$-dimensional Hamiltonian is of Bogoliubov-de Gennes (BdG) form

$\mathsf{H}_{\text{MF}}=\sum_{\bm{k}}\psi^{\dagger}_{\bm{k}}\begin{pmatrix}\hat{H}_{0}(\bm{k})&\hat{\Delta}(\bm{k})\\\
\hat{\Delta}^{\dagger}(\bm{k})&-\hat{H}_{0}^{*}(-\bm{k})\\\
\end{pmatrix}\psi^{\phantom{\dagger}}_{\bm{k}}=\sum_{\bm{k}}\left(\hat{U}_{\bm{k}}\psi_{\bm{k}}\right)^{\dagger}\begin{pmatrix}\hat{E}_{\bm{k}}&0\\\
0&-\hat{E}_{\bm{k}}\end{pmatrix}\left(\hat{U}_{\bm{k}}\psi_{\bm{k}}\right)^{\phantom{\dagger}}\\\
\hat{U}^{\phantom{\dagger}}_{\bm{k}},$ (24)

and is diagonalized by a block-structured unitary transform $\hat{U}_{\bm{k}}$

$\hat{U}^{\phantom{\dagger}}_{\bm{k}}=\begin{pmatrix}\hat{u}_{\bm{k}}&-\hat{v}_{\bm{k}}\\\
\hat{v}^{*}_{\bm{k}}&\hat{u}_{\bm{k}}\\\
\end{pmatrix}\quad\text{and}\quad\hat{U}^{\dagger}_{\bm{k}}\hat{U}^{\phantom{\dagger}}_{\bm{k}}=\mathds{1}.$
(25)

The matrices $\hat{u}_{\bm{k}}\left(\hat{v}_{\bm{k}}\right)$ are $N_{b}\times
N_{b}$ matrices, which describe the particle- (hole) amplitudes of the
fermionic Bogoliubov quasiparticles $\gamma_{\bm{k}}$ with energies $\pm
E_{\bm{k}}$. The particle-hole symmetric BdG quasi-particle spectrum for the
sub-leading instability $\Delta_{u}$ is shown in Fig. S8 (a), whereas the
leading instability $\Delta_{g}$ is presented in the manuscript, see Fig. 4.
The inverse participation ration (IPR) in the superconducting phase
$\text{IPR}(\bm{k},b)=\sum_{o,s}|u_{os,b}(\bm{k})|^{4}+|v^{*}_{os,b}(\bm{k})|^{4}$
indicates strong localization of (i) Fermi arcs that are preserved in the sub-
leading solution due to the nodal line of the order parameter $\Delta_{u}$ at
the position of the Weyl nodal point at $\bm{k}=Y/2$ and (ii) zero-energy
Majorana modes that appear in the BdG quasi-particle spectrum. Analyzing the
wave function profiles of both topological modes demonstrates that these are
highly localized at the systems edge, see Fig. S8 (b). While the edge modes
have different spin polarization in case of the Fermi arcs, i.e.
$|u_{\uparrow}|^{2}$ and $|u_{\downarrow}|^{2}$ are enhanced at opposite
boundaries, the Majorana modes are characterized by identical amplitudes of
particle- and holes with different spin orientations due to the present of
particle-hole symmetry, i.e. $|u_{\uparrow}|^{2}=|v_{\downarrow}|^{2}$ at
$E=0$.

Figure S8: Sub-leading superconducting solution $\Delta_{u}$ appearing in the
phase diagram of tSnS. (a) Bogoliubov de-Gennes (BdG) quasi-particle
bandstructure of a slab geometry with open boundaries in $x$ direction. The
sub-leading SC instability preserves the Fermi arcs and features a Majorana
zero energy mode that is localized at the edge. The localization is visualized
by the inverse participation ratio (IPR) that is color-coded for each band in
(a). The corresponding wave function profiles are shown in panel (b). Due to
particle-hole symmetry, amplitudes of particle- and holes with different spin
orientations are identical, i.e. $|u_{\uparrow}|^{2}=|v_{\downarrow}|^{2}$.

## References

  * Blöchl [1994] P. E. Blöchl, Phys. Rev. B 50, 17953 (1994).
  * Kresse and Furthmüller [1996] G. Kresse and J. Furthmüller, Computational Materials Science 6, 15 (1996).
  * Kresse and Furthmüller [1996] G. Kresse and J. Furthmüller, Phys. Rev. B 54, 11169 (1996).
  * Perdew  _et al._ [1996] J. P. Perdew, K. Burke, and M. Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996).
  * Grimme  _et al._ [2010] S. Grimme, J. Antony, S. Ehrlich, and H. Krieg, The Journal of Chemical Physics 132, 154104 (2010), https://doi.org/10.1063/1.3382344 .
  * Momma and Izumi [2011] K. Momma and F. Izumi, Journal of Applied Crystallography 44, 1272 (2011).
  * Rømer  _et al._ [2021] A. T. Rømer, P. Hirschfeld, and B. M. Andersen, Physical Review B 104, 064507 (2021).
  * Xiong  _et al._ [2021] F. Xiong, X. Han, and C. Honerkamp, Physical Review B 104, 115151 (2021).
  * Graser  _et al._ [2009] S. Graser, T. Maier, P. Hirschfeld, and D. Scalapino, New Journal of Physics 11, 025016 (2009).
  * Wu  _et al._ [2021] X. Wu, T. Schwemmer, T. Müller, A. Consiglio, G. Sangiovanni, D. Di Sante, Y. Iqbal, W. Hanke, A. P. Schnyder, M. M. Denner, _et al._ , Physical review letters 127, 177001 (2021).
  * Scherer and Andersen [2018] D. D. Scherer and B. M. Andersen, Phys. Rev. Lett. 121, 037205 (2018).