# Backtesting Trading Strategies with GAN To Avoid Overfitting

Ao Sun<EMAIL_ADDRESS>Yuh-Dauh Lyuu<EMAIL_ADDRESS>This paper is
an English version of [1] which was originally written in Chinese.

###### Abstract

Many works have shown the overfitting hazard of selecting a trading strategy
based only on good IS (in sample) performance. But most of them have merely
shown such phenomena exist without offering ways to avoid them. We propose an
approach to avoid overfitting: A good (meaning non-overfitting) trading
strategy should still work well on paths generated in accordance with the
distribution of the historical data. We use GAN with LSTM to learn or fit the
distribution of the historical time series . Then trading strategies are
backtested by the paths generated by GAN to avoid overfitting.(This paper is
an tanslated English version of [1] which was originally written in Chinese in
2018, where some statements and claims are outdated in 2022)

###### Index Terms:

Backtest, Backtest Overfitting, GAN, LSTM, Algorithm trading.

##  1 Introduction

In algorithm trading, strategy and backtesting are important elements. The so-
called strategy refers to the rules that determine when to buy, when to sell,
and the amount of the transaction[2]. When we have a strategy, the most common
practice is to do backtesting on historical data, meaning that we would apply
this strategy to past data to see how it performs, as a way of evaluation for
this strategy.

This sounds good: we use some methods to find strategies, then apply them to
historical stock prices and get an indicator such as Sharpe ratio to assess
the performance of strategies. We pick the strategies with good indicator
values, and finally adopt these strategies in the real world, and then we can
enjoy a good life.

However this barely happens in real life. The gap between the dream and the
reality is due to a phenomenon called backtest overfitting

The purpose of this study is to propose a backtesting framework, a data-
generation-based one where the data generating process is learned use the
generative adversarial network (GAN). This may extend the usage of GAN.

##  2 Related Work

There have been many studies on backtest overfitting. In [3], the authors
severely criticized some of the problems that were overlooked in the
backtesting, including excessive data mining without considering the
increasing probability of false positive. They proposed a concept , The
minimum Backtest length (MinBTL), to help to control this risk. The authors’
idea is as following: Suppose we chose N numbers i.i.d. from the standard
normal distribution, and they calculate $E[\max_{n}]$ which is the expected
value of the maximum of the N chosen numbers.

Then with a experiment which conducts N-number-choose (corresponding to the
number of times we try different configurations on the same data) and a null
hypothesis that the mean of the distribution is greater than zero, if the
value $E[\max_{n}]$ appears, we should treat it as not significant. From the
perspective of the annual Sharpe Ratio , $E_{annual}[\max_{n}]\approx
y^{(-1/2)}E[\max_{n}]$, where y is the length of the sample. If we increase y
we can increase $E_{annual}[max_{n}]$ so that the Sharpe Ratio of the
experiment becomes more convictive(for example, $E_{annual}[max_{n}]$ is close
to zero, then the Sharpe Ratio greater than zero is considered to be
significant result rather than an false positive result). More discussion on
this topic on be found in [4].

The concept of probability of backtest overfitting was proposed in [5].

$\sum_{n=1}^{N}E[\bar{r}_{n}|r\in\Omega_{n}^{*}]Prob[r\in\Omega_{n}^{*}]<N/2$

where $E[\bar{r}_{n}|r\in\Omega_{n}^{*}]$ refers to the ranking of the best
strategy $r$ in the sample outside the sample. The intuition of the formula
is: Overfitting is happening when the OOS(Out Of Sample) performance of the
strategy who owns the best IS(In Sample) performance is lower than the average
performance. More specially, the best-ranked strategy within the sample has a
lower rank outside the sample than the average. The author’s method is to
observe the strategy-representation matrix, where $M_{st}$ represents the
performance of strategy $s$ at time $t$ (such as how much profit or loss).
Given a constant $K$, then $M_{st}$ is divided into $K$ equal time blocks to
form a set, from which the method will to chose any two of them to form a
sample pair (in the sample, outside the sample), and then use these sample
pairs to do the backtesting and the selection. But note that this method only
applies to the situation that there are multiple strategies and you need to
choose one of these. The goal is to avoid the overfitting of selection
process.

In [6], this problem is discussed from a statistical point of view:when
searching the best configuration (hyperparameters) for a model on a single
data set, and evaluated by the Sharpe Ratio , the multiple-testing needs to
replace the original single test, which means an additional haircut is
required for the Sharpe Ratio obtained from the test. Although the adjustment
of the Sharpe Ratio has been used in practical applications, the author’s
result is that the adjustment of the Sharpe Ratio is not linear. Generally,
the larger Sharpe Ratios are the smaller the adjustment will be, because this
implies these related strategies are effective. Meanwhile, the smaller the
Sharpe Ratios are, the larger adjustments will be applied to them as they are
more likely to be a false positive result.

Finally, from the perspective of simulation, authors has discussed that the
backtest overfitting can be solved [2]. The authors first assume the stock
price process as the Ornsterin-Uhlenbeck (OU) process, and then get the
parameters in the OU process from the past data. Then through Monte Carlo’s
method to make the model generate a lot of paths which are used to backtest
some strategies, and discuss the factors affecting each strategy on these
generated paths.

##  3 Prerequisite

###  3.1 Strategy

There seems to be no standard in the definition of a strategy. The trading
rules defined in [2] represent the actual buying and selling. For the
convenience of later discussion, we also made a definition of the strategy: we
can think of it as a function that maps a time series (such as stock price) to
-1,0,1, where -1 is to short, 0 is to not operate, 1 is to long as shown in
eq. 1

$S_{\theta}:\\{p_{t}\\}^{T}\times\\{-1,0,1\\}^{T}\rightarrow R$ (1)

And there’s two strategies we will use to disscuss next:

####  3.1.1 MAC strategy

The MAC strategy is moving average cross [7]. This model accepts two
parameters $p_{1}$ and $p_{2}$. The strategy calculates the mean $MA_{1}$ of
the last $p_{1}$ periods stock prices and taht of the last $p_{2}$ periods. If
$p_{1}>p_{2}$, let the position become 1 and vice versa. For more specific
information, refer to table I

MAC | Parameters
---|---
$p_{1}$ | $p_{2}$
Range | 1$\sim$50 | 1$\sim$50
Exp. |  $p_{1}$ average price |  $p_{2}$ average price

TABLE I: MAC strategy

Parameters space for Moving Average Cross Strategy

####  3.1.2 BH strategy

The buy and hold strategy (buy and hold, referred to as BH) will accept four
parameters entry, hold, stop-loss and side. The logic of the strategy is to
divide the trading day into months, and the transaction is carried out in each
month: enter on the entry (eg: 1-31) day, hold for hold days and then sell
[8]. And if the loss during the holding period exceeds the stop-loss, sell it
in advance. For more specific information, refer to table II

BH | Parameters
---|---
entry | hold | stop-loss | side
Range | 1$\sim$30 | 1$\sim$30 | 0$\sim$20 | {-1,1}
Exp. | entry day | holding days | stop loss | long/short
TABLE II: BH strategy

###  3.2 Backtesting

The so-called backtesting refers to simulating a trading strategy in history,
and then calculating a certain indicator to help judge the pros and cons of
the trading strategy. Define a backtesting function B as eq. 2

$B:\\{p_{t}\\}^{T}\times\\{-1,0,1\\}^{T}\rightarrow R$ (2)

The outcomes of a stategy S are mapped to a real value as a measure of the
quality of strategy S. The specific B will vary according to different trading
goals, but we stipulate that the larger the value of B is, the better the
strategy is (otherwise, it is multiplied by -1), and we call the value of B
the performance of the strategy.

The common Sharpe Ratio used in our study:

$\text{SR}:\\{p_{t}\\}^{T}\times\\{-1,0,1\\}^{T}\rightarrow\frac{\operatorname*{\mathbb{E}}[X]-R_{f}}{\sigma_{X}}$
(3)

where $X$ is defined as gain or loss calculated by each pair if $\\{p_{t}\\}$
and $\\{-1,0,1\\}^{T}$

###  3.3 Objective function of backtesting

Under the defintion of eq. 1 and eq. 2, we can define the object of a trader
to eq. 4

$\theta^{*}=\mathop{\arg\max}_{\theta}E_{\mu}\Big{[}B\big{[}S(p_{\mu};\theta)\big{]}\Big{]}$
(4)

where $p_{\mu}$ are the paths sampled from the distribution $\mu$.

That is we want to maximize the expected performance of the strategy with
sampled paths. And here is the reason: we may easily move the which is similar
to the bagging in the machine learning. That is we let the paths vote whether
this strategy is good or bad. In the experiment we use the mean to

$\theta^{*}=\mathop{\arg\max}_{\theta}\frac{1}{N}\sum_{\mu\in
A_{N}}B\big{[}S(p_{\mu};\theta)\big{]}$ (5)

where $A_{N}$ refers to the set of sampled paths.

###  3.4 Backtesting Overfitting

The process of solving eq. 5 is likely to cause the most troublesome problem
in quantitative trading: overfitting. For a detailed discussion, please refer
to the following chapters.

Here is an example to illustrate. Suppose we have a buy-and-hold strategy,
call it $S^{\prime}$. We assume that the generation of stock prices is a
random walk:

$P(t+1)=P(t)+\epsilon(t)$ (6)

where

$\epsilon(t)\sim N(0,1)$

Let us generate a 600-day data with eq. 6 and take the first 300 days as
historical data and the last 300 days as future data. So our goal is to find
the best ${\theta^{\prime}}^{*}$ on historical data to get a strategy
${S^{\prime}}^{*}$ then apply ${S^{\prime}}^{*}$ to future data and examine
its performance.

First, one consequence is that the expected value of strategy
${S^{\prime}}^{*}$ should theoretically not be greater than 0 on the paths
generated by eq. 6. This is because if strategy ${S^{\prime}}^{*}$ leaves the
market early, the profit and loss must be negative. However, if there is no
early exit, the profit and loss is only related to the price of entry and
exit. Suppose that the market is entered at time $t$ and held for $L$ days,
and because

$\operatorname*{\mathbb{E}}[P(t+L)-P(t)]=\operatorname*{\mathbb{E}}\left[\sum_{k=t}^{t+L}\epsilon(k)\right]=0$
(7)

so trhe expected value should be zero.

But if we go through all the parameter combinations in table II, and pick the
configuration that has the best performance on historical data, fig. 1 will be
the result. The green part is the equity curve (equity curve, which records
the change of funds during the investment process) obtained on the historical
data, and the red part is the equity curve obtained on the future data. The
green equity curve clearly has a non-zero return. In addition, if we do not
consider the above conclusion that the expected value is 0, we can also see an
obvious result from the graph: although the historical performance is very
good, the future performance is far from the historical performance.

The reason for this result is very simple: the configuration of this strategy
performs so well in the sample because the configuration of this strategy fits
the noise in the sample, for example, the backtest data happens to be on the
12th of each month On the 17th, it is all rising, and the parameters of the
strategy happen to be buying and holding on the 12th for 5 days, but eq. 5
indicates that the probability of rising and falling from the next 12th to
17th is the same, so the strategy will be on the 12th to 17th. The 17th
doesn’t actually make money.

Figure 1: IS vs OOS performance

Corresponding to the Y-axis on the right, the green part is the equity curve
in the sample, and the red part is the equity curve of the same strategy
outside the sample. Corresponding to the left Y-axis, the solid black line is
the in-sample price, and the black dashed line is the out-of-sample price.

###  3.5 Anti Backtesting Overfitting

To illustrate further, since we know the stock price generation formula eq. 5,
we use Monte Carlo simulation to do another experiment: we apply $S^{\prime*}$
to 2000 stock-price-time-series generated with eq. 5 and get backtest results
(for each generated path).

The results are shown in fig. 2. The blue frequency plot represents the
distribution of the Sharpe Ratio s of $S^{\prime*}$ on all generated paths,
where the green vertical line corresponds to the in-sample performance, which
we can see is clearly an outlier, and we can see that the mean value in the
frequency map of this approximate normal distribution falls near 0, which is
consistent with the expected value of 0 we said earlier.

From this small experiment we can feel that perhaps referencing the results of
backtesting on multiple paths as a distribution is a better goal for
backtesting, see below for a further discussion.

Figure 2: IS vs OOS performance

The distribution of the Sharpe Ratio of the strategy in fig. 1 on the
generated 2000 paths, the green dashed line represents the distribution of the
Sharpe Ratio of the IS in fig. 1, and the red dashed line represents the OOS

Another angle to examine over-fitting can be examined from the smoothness of
the parameter configuration corresponding to the performance, we use MAC and
eq. 6 and white noise:

$P(t)=\epsilon(t)$ (8)

where

$\epsilon(t)\sim N(0,1)$

It should be noted that MAC has an expected value of 0 on the random walk
procedure of eq. 6, while there is a strategy with an expected value greater
than 0 on eq. 8, the results refer to fig. 3b and fig. 3a.

The figures show the performance of traversing all the configurations of the
two parameters: the more blue it is, the higher the Sharpe Ratio is, the
better the backtesting effect is; and the more red it is, the opposite is
true.

On random walk, the dark blue part (that is, the of the corresponding
configuration is significantly greater than 0) is not presented smoothly but
jumps, while the result on white noise is much smoother.

(a) MAC’s Sharpe Ratio on a random walk

(b) MAC’s Sharpe Ratio on a white noise

This example shows that if a configuration of a strategy is found to perform
well in the backtest, but the backtest of its surrounding configurations is
poor as shown in fig. 3b, then we should be concerned that this may be an
overfitting result . Conversely, if the backtest function is smoother, it
indicates that the probability of configuration overfitting will be smaller as
shown in fig. 3a.

###  3.6 LSTM with GAN

Long-and-short term memory model neural network (LSTM) was first proposed by
[9]. Different from the traditional neural network , LSTM not only uses the
current input and output, but also uses the results calculated by the previous
time steps, as shown in Figure 2.9, where $\sigma$ represents the sigmoid
function.Q

The concept of Generative Adversarial Networks, proposed by Ian Goodfellow in
[10] in 2014, has sparked a wave of research in recent years. There are
countless papers appearing, all of which are various variants.

Almost all versions of GAN have the same idea: there is a generator G, which
is responsible for mapping from the distribution Z on a latent space to the
distribution T we want. The trick is to extract a sample from the potential
space and throw it to the generator, which will generate a sample of the
distribution T. In the process, a discriminator D is also needed, which is
responsible for distinguishing whether the data is generated from the T
distribution or the generator is generated from the Z distribution.

RGAN was proposed in [11] earlier this year. The purpose of RGAN was to solve
the privacy problem when real patient data was used as research data.

The R in RGAN corresponds to the meaning that both the generator and the
discriminator are recurrent neural networks. RGAN was proposed in [11] earlier
this year. The purpose of RGAN is to solve the privacy problem when real
patient data is used as research data.

In [11], the target data is a time series with four dimensions: pulse
oximetry, heart rate, respiratory rate, and mean arterial pressure. It can be
seen that if we don’t care about the specific physical meaning of the value,
we can completely replace the data with the opening price, the highest price,
the lowest price and the closing price and bring it into the framework of
RGAN. In addition, in this study, we changed the discriminator part of RGAN
from LSTM to bidirectional LSTM, the purpose of which is to enhance the
discriminator’s ability.

###  3.7 Model

First, let’s take a look at the performance of GAN on the common data
generation model: whether it can learn this model, the requirements for the
amount of data, and so on. From a verification point of view, we use the stock
price model GBM, which is often assumed in the financial field.

fig. 3 is an overview of our model: data sampled from the latent space is
thrown to a generator. The output of the generator has the same shape as the
real data, so they will be thrown to the discriminator respectively. Since the
produced data and the real data are time series, the discriminator at each
moment will also have a corresponding output. When After all the time data is
input, we summarize the output of the discriminator for the generated data and
the output of the discriminator for the real data separately, and finally put
them together to calculate the cross entropy as loss.

Figure 3: Architecture of the network

Where the yellow parts for generated data; blue parts for real data; red parts
for the data sampled from latent space

fig. 3 is the overall architecture of the model. From a separate point of
view, in the latent space part, we choose 5 dimensions, and each dimension is
an independent standard normal distribution. In the generator part, we use the
LSTM model, in which the number of hidden layer nodes, we have tested
different numbers in the experimental part for comparison. The activation
function passed by the hidden layer uses sigmoid, and the activation function
of the output layer uses tanh. In the discriminator part, we tried a single
RGAN and a two-way RGAN. The activation function passed by the hidden layer
uses sigmoid and the activation function of the output layer uses tanh, and
the number of hidden layer nodes is that we did another experiment. to
compare.

The part that has the greatest impact on the model is the number of hidden
layer nodes of LSTM, and its impact on parameters is shown in table III

# hidden units # parameters | generator | discrimator | total
---|---|---|---
100 | 42,901 | 82,800 | 125,701
50 | 11,451 | 21,400 | 32,851
10 | 691 | 1,080 | 1,771
TABLE III: Number of parameters and that of hidden units

##  4 Experiment: Learning a underlying model

###  4.1 Underlying Model Selection

The target random process we choose RGAN chooses is GBM as shown in eq. 9:

$dy_{t}=\mu y_{t}dt+\sigma y_{t}dW_{t}$ (9)

where $W_{t}$ is Brownian motion. Solveing eq. 9 we can optain

$y_{t}=y_{0}\exp\left(\left(\mu-\sigma^{2}/2\right)t+\sigma W_{t}\right)$ (10)

where

$\ln y_{t}\sim N\left(\left(\mu-\sigma^{2}/2\right)t,\sigma^{2}W_{t}\right)$
(11)

This stochastic process was chosen for the following reasons: The evaluation
of GANs and the verification of whether the time series came from a certain
sample has always been an open question ([11],[13]). Especially in the image
field commonly used by GAN, the judgment conditions are mostly the human eye,
but it is difficult to use the same standard for time series.

With eq. 10 we can do a statistical test:

When we have a collection of model-generated time series
$\\{\widetilde{y}^{T}\\}^{N}$

we can test the distribution of $\ln\widetilde{y}_{t,*}$:

######  Hypothesis 1:

for each $t$, is

$\ln\widetilde{y}_{t,*}$

follow the normal distribution where the mean value is

$\left(\mu-\sigma^{2}/2\right)t$

and the variance value is

$\sigma^{2}t$

###  4.2 Preprocessing

In addition, since the final activation function of the generator is tanh,
which means that the value range is (-1, 1), we need to normalize the samples
to the interval of (-1, 1), here we use:

$\text{sp}_{new}=2\times\left(\frac{\text{sp}_{raw}-\text{sp}_{min}}{\text{sp}_{max}-\text{sp}_{min}}\right)$
(12)

Among which, $\text{sp}_{new}$ generally refers to the samples generated by
the model, $\text{sp}_{min}$ and $\text{sp}_{max}$ represent the minimum and
maximum values of the samples generated by the model, and samplenew represents
the samples we really use for RGAN.

In addition, since eq. 12 will make the maximum (small) value in the sample 1
(-1), when RGAN wants to generate a time series longer than T, it will
encounter a problem: the generated maximum value is limited. So our data
preprocessing changed from eq. 12 to eq. 13

$\text{sp}_{new}=\frac{1}{\text{scaling}}\times\left(2\times\left(\frac{\text{sp}_{raw}-\text{sp}_{min}}{\text{sp}_{max}-\text{sp}_{min}}\right)\right)$
(13)

where scaling is a constant of our choosing.

###  4.3 Evaluation

The evaluation for different models should be different, because it is quite
difficult to test the distribution of time series [11], [13], but because of
our choice of GBM, we can take the natural logarithm of its value in each
period, then The distribution of each period will be a normal distribution,
and its expected value and variance on the time scale will be linear with
time.

In training, the criteria for judging whether a GAN is good at learning is
vague [11], but since the characteristics of the time series we choose are
obvious (expected value and variance increase linearly in time),

(a) $R^{2}$ for generated and expected mean value

(b) $R^{2}$ for generated and expected variance value

Figure 4: $R^{2}$ for generaeted data’s mean and variance and its expected
values

The expected mean/variance of the generated time series (10,000) at each
moment.
The horizontal axis is the time point of the time series, and the vertical
axis is the expected value. The fitting situation (GBM model) of the
theoretical value (red line) and the actual value (blue dotted line) is
displayed. The display here is quite good, and the learning can be stopped at
this time.

thus we use the theoretical The linear equation is used as our goal to
calculate $R^{2}$ with the data generated by GAN, as shown in fig. 4a and fig.
4b, and the discussion of the entire training process, including the amount of
data, the amount of parameters, etc., will be discussed in the experimental
results and analysis. .

###  4.4 Result

####  4.4.1 Statistical

fig. 5a shows what the samples generated by the GBM model look like. fig. 5b
shows the generated frequency plot of the distribution of these samples at
each moment. Just like eq. 11, the distribution of each period is close to the
normal distribution.

From fig. 5b, it seems that the distribution is moving and the standard
deviation of the distribution is increasing over time, which can be seen more
clearly in From fig. 5c and From fig. 5d. fig. 5c and From fig. 5d show the
expected value and variance at each time of the GBM time series, which, as in
theory, have a linear relationship with time. As mentioned earlier, this
linear relationship is very helpful in our training, one of the goals of our
training is to observe whether the expected value of the time series generated
by RGAN at each time point is linear with time.

fig. 6a shows what the path generated by the (trained) RGAN looks like. As we
said, it is difficult to compare it with the naked eye to Figure 4.1. It is
easier to refer to fig. 6b, the distribution of fig. 6b does seem to have
learned some of the properties of fig. 5b compared to fig. 5b: symmetry,
increasing expected value over time, increasing variance over time in
Increase. For the latter two, it would be more helpful to compare fig. 6c and
fig. 6d and fig. 5c and fig. 5d. We can see that both fig. 5c and fig. 5d
indeed exhibit the property of linear inertia with time. The red line in fig.
5c and fig. 5d represents the theoretical line: reference (3.3). It can be
seen that the blue one has a fairly high fit, where the $R^{2}$ of the
expected value is 0.994935 and the $R^{2}$ of the variance is 0.9946425.

(a) Simulated data path

(b) Distribution for each time t

(c) Mean value for each time t

(d) Variance value for each time t

Figure 5: Characteristic of Monte Carlos Simulation (as benchmark)

(a) Generated data path

(b) Distribution for each time t

(c) Mean value for each time t

(d) Variance value for each time t

Figure 6: Characteristic of GAN generated data

####  4.4.2 Data size and Number of Parameters

In the previous section, we realized that RGAN can indeed learn the results of
GBM quite well from some interpretations, but as mentioned earlier, the
training of RGAN is not easy. The choice of hyperparameters (learning rate,
etc.) has a relatively strong relationship [14]. In this section, we further
experiment the influence of the following parameters on the results of RGAN,
including the angle of the model and the angle of the data. The data
perspective has been discussed in Research Methods.

First, we compare the impact of the number of hidden layer nodes and the
amount of data on training. fig. 7a and fig. 7b show the performance of
different configurations over time.

(a) Data size and parameters vs training time on Mean

(b) Data size and parameters vs training time on Variance

Figure 7: (input size, network size) versus train time

The horizontal axis represents the number of batches fed to the model, the
fixed batch size is 50, and the vertical axis is the expected value and theory
of the model trained at that time. The $R^{2}$ of the expected value straight
line corresponds to the variance, and the meaning of $R^{2}$ can be referred
to fig. 4a and fig. 4b.

As can be seen from the figure, the learning effect of the model with too few
hidden layer nodes is not ideal, and the $R^{2}$ performance of the model with
10 hidden layer nodes is poor. This is actually very reasonable. The huge
number of parameters is a characteristic of deep learning. As for the further
discussion of the number of parameters, model complexity and model
generalization ability, please refer to [15].

Surprisingly, RGAN does not require a high number of samples in this
experiment! When the number of samples is only 100, the ideal training state
can still be achieved. However, this may be caused by overfitting. Overfitting
in GAN means that GAN completely memorizes the sample instead of generating
the distribution of the sample.

##  5 Experiment:Backtesting on generated paths

Next, look at the results of GAN from the perspective of trading strategies.
In practice, the training of GAN is very difficult [16], and sometimes the
results learned by GAN are not completely ideal. In this case, is it really
not helpful for backtesting at all? Not so. To give a simple example, suppose
our real model is a random walk model, that is, the price of the next period
is equal to the price of this period plus a value derived from a standard
normal distribution, such as the mean and standard deviation of the normal
distribution of each period. The difference will not affect, even if it does
not pass the test of the normal distribution, it does not matter, the
important thing is that it is symmetrical and the mean is 0 (this means that
the expected value of the next period’s profit can be calculated and
guaranteed by the confidence interval), It can be seen that whether to learn
the complete generation distribution of stock prices may not be so important
for the strategy. The specific approach of this part is to use the generation
process of hypothetical stock prices, and we study the strategies that can
theoretically have positive expected values on these stock prices and
strategies with zero expected values (on OOS), so that we have an OOS on A
reference value for the performance of the strategy. Based on this reference
value, we can compare the methods of centrally generating strategies and
compare whose results are closer to the reference value.

###  5.1 Model selection

On the basis of GBM, a new process AR(2) is added to the experiment here:

$y_{t}=a+by_{t-1}+cy_{t-2}+\epsilon_{t}$ (14)

where

$\epsilon_{t}\sim N(0,1)$

In order to compare GBM, we selected $a=0,b=1.1,c=-0.5$. The reason for this
selection is that the absolute value of the root of the characteristic
polynomial of eq. 14 can be less than 1, which ensures that eq. 14 is
stationary. In addition, we have listed the theoretical results of each
theoretical strategy in each process at the bottom.

BH and GBM Since the logarithmic expected value of GBM increases linearly in
time (see eq. 11), the expected value held by BH should indeed be positive.

BH and AR(2) Since the expected value of our AR(2) is constant over time
(because our AR(2) is a stationary process), the expected value for how long
it is held is 0.

MAC and GBM Since the past of GBM has no effect on the future, and under our
model and parameters, the expected value of the GBM logarithm increases
linearly in time, so the expected value held by the MAC should indeed be
positive.

MAC and AR(2) Due to the stationary nature of our AR(2), the past mean can be
used as an estimate of the expected value. Therefore, when the strategy finds
that the current price is lower than this average value (that is, $p_{1}$ is
selected long enough and $p_{2}$ is 1, that is, the current period), choosing
to buy instead of selling can ensure that it is profitable online.

Strategy Model | GBM | AR(2)
---|---|---
BH | YES | NO
MAC | YES | YES
TABLE IV: Theorical strategyies has postive return on model

###  5.2 Evaluation

As mentioned in [11], how to evaluate the quality of the data generated by GAN
is challenging. Unlike traditional machine learning models, the loss of the
generator and discriminator has little significance for the evaluation of
model performance. In the image part, assessments that usually judge the
quality of images generated by GANs mostly rely on human ratings. TSTR (Train
on Synthetic, Test on Real) and TRTS (Train on Real, Test on Synthetic)
proposed in [20]. They consist in training a traditional classifier on a
generated (real) dataset, then testing the results on real (generated) data,
and if the two are close, the GAN is considered to have learned.

We made some adjustments to the algorithm, as indicated in algorithm 1 We now
use the training set to train a generator, and then we find a best-performing
strategy from the data generated on the training set, and get a strategy score
indicator (such as Sharpe Ratio ), preferably we apply this strategy to the
test. The score index on the test set is obtained on the set, and we compare
the two score indicators to score it.

1

2

3train_data, test_data $\leftarrow$ split(_data_)

4discriminator, generator $\leftarrow$ train_GAN (train_data)

5for  _config in configs_ do

6 strategy = argmax (backtest (synthetic_data, config))

7 synthetic_score = backtest (test_data, strategy)

8 test_score = backtest (test_data, strategy)

9 score = score (synthetic_score, test_score)

10 end for

11

Algorithm 1 Algorithm for backtesting strategies

Since there is a model, we first find the strategy, then use our model to
generate paths, and apply this strategy to these generated paths, so that we
get a distribution of backtest performance, which we become the target
backtest result distribution.

Secondly, we then apply the strategy found above to what we learned with the
GAN, so that we can also get a distribution.

Finally, we compare the distribution of target backtest results with the
distribution of experimental backtest results, including setting a confidence
interval for the distribution, comparing the results of Monte Carlo with the
results of GAN’s rejection, which becomes a classification problem.

###  5.3 Result

####  5.3.1 Perforamnce

As mentioned earlier, GANs can approximate common stock processes, but is such
an approximation enough for us to backtest? We did an experiment here.

(a) GBM-BAH-PDF

(b) GBM-BAH-CDF

(c) GBM-MAC-PDF

(d) GBM-MAC-CDF

Figure 8: Simulation results for the stationary GBM process.

fig. 8a and fig. 8b show the experimental results of BH-GBM. The choice of our
strategy is to pick the best within the sample. It can be seen that the red
and blue PDFs are quite close: this means that under the BH-GBM combination,
the reference value of the model learned by GAN in backtesting is similar to
that of the real model. fig. 8c and fig. 8d show the experimental results of
MAC-GBM. At this time, the P.D.Fs of red and blue are not so close, and the
mean of blue is obviously larger than that of red, but from the CDF, the
difference between the two is not large, so when we choose a reasonable
confidence interval to reject false positives.

fig. 9b and fig. 9b, and Figures fig. 9b and fig. 9b performed well, with
similar conclusions to fig. 8a fig. 8a.

(a) AR2-BAH-CDF

(b) AR2-BAH-PDF

(c) AR2-MAC-CDF

(d) AR2-MAC-PDF

Figure 9: Simulation results for the stationary AR2 process.

####  5.3.2 Confusion matrix

In addition, we also do tests, sample 100 for each (process, strategy)
combination and compare with Monte Carlo results. We define how effective the
strategy is: the frequency of $Sharpe>0$ exceeds 0.75 (while will be applied
for Monte Carlo and RGAN. We can also adjust this value to control our recall
and precision).

table V presents the results for strategy BH and process GBM. It can be seen
that the overall accuracy rate is good, only the part that RGAN thinks is
invalid and Monte Carlo thinks it is effective may be adjusted by adjusting
the threshold of RGAN.

table VI shows that the results of strategy MAC and process GBM are not very
satisfactory, which may be related to the performance of fig. 8c.

table VII shows the results of the strategy BH and the process AR(2). It can
be seen that the correct rate is 100%. As mentioned earlier, the expected
value of BH and AR(2) cannot be positive.

table VIII shows the results of strategy BH and process AR(2). It can be seen
that the correct rate is 100%. As mentioned earlier, the expected value of BH
and AR(2) is impossible to be positive.

Through the above results, we find that under these stock price models and
strategies, our method is quite close to the expected correct answer, that is,
in the backtesting part, the distribution learned by GAN can replace the real
distributed.

GBM-BH | Monte Carlo
---|---
positive | negative
RGAN | positive | 72 | 0
negative | 8 | 20
TABLE V: BH strategy and GBM GBM-MAC | Monte Carlo
---|---
positive | negative
RGAN | positive | 32 | 9
negative | 18 | 41
TABLE VI: MAC strategy and GBM AR(2)-BH | Monte Carlo
---|---
positive | negative
RGAN | positive | 0 | 0
negative | 0 | 100
TABLE VII: BH strategy and AR(2) AR(2)-MAC | Monte Carlo
---|---
positive | negative
RGAN | positive | 39 | 1
negative | 1 | 59
TABLE VIII: MAC strategy and AR(2)

##  6 Conclusions

This paper starts from the backtesting overfitting problem that is easily
encountered in quantitative trading, and hopes to use GAN to learn the
distribution of stock prices to alleviate this problem. From a machine
learning perspective, we study the nature of GAN learning, including the
generator and discriminator architectures and the number of parameters, as
well as the number of samples required by GANs for the task of mitigating
overfitting. From an application perspective, we investigate whether the
distributions learned by GANs help to mitigate backtest overfitting.

We obtained the following conclusions through experiments. Under our
hypothetical model and selection strategy: (1) GAN can learn some properties
of commonly used stock price models. (2) The importance of the sample size in
this experiment is not that great. (3) Scaling can alleviate some related
problems of its value range in the generation stage, but at the cost of
sacrificing some statistical properties of the variance. (4) The distribution
learned by GAN is enough to avoid the problem of overfitting to some extent
under some strategies we choose, which can help us to better screen
strategies.

## References

  * [1] A. Sun, “Backtesting trading strategies with gan to avoid overfitting,” Master’s thesis, National Taiwan University, 2018. [Online]. Available: https://tdr.lib.ntu.edu.tw/handle/123456789/1188?locale=en.
  * [2] P. Carr and M. Prado, “Determining optimal trading rules without backtesting.”
  * [3] D. Bailey, J. Borwein, M. Prado, and Q. Zhu, “Pseudo-mathematics and financial charlatanism: The effects of backtest overfitting on out-of-sample performance,” _Not. AMS_ , vol. 61, no. 5, pp. 458–471,.
  * [4] D. Bailey and M. Prado, “The deflated sharpe ratio: Correcting for selection bias, backtest overfitting and non-normality,” _J. Portf. Manag_ , vol. 40, no. 5, pp. 94–107,.
  * [5] M. Prado, D. Bailey, J. Borwein, M. Prado, and Q. Zhu, “The probability of backtest overfitting,” _J. Comput. Financ_.
  * [6] C. Harvey and Y. Liu, “Backtesting,” _SSRN Electron. J_.
  * [7] C. Investopedia, “Moving averages: Strategies,” available:. [Online]. Available: https://www.investopedia.com/university/movingaverage/movingaverages4.asp.
  * [8] Investopedia, “Buy and hold,” available:. [Online]. Available: https://www.investopedia.com/terms/b/buyandhold.asp.
  * [9] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” _Neural Comput_ , vol. 9, no. 8, pp. 1735–1780,.
  * [10] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, and S. Ozair, “Generative adversarial networks,” in _NIPS_ , p. 2672–2680.
  * [11] S. Hyland, C. Esteban, and F. Ratsch, “Real-valued (medical) time series generation with recurrent conditional gans.”
  * [12] S. Nowozin, B. Cseke, and R. Tomioka, “f-gan: Training generative neural samplers using variational divergence minimization.”
  * [13] L. Theis, A. Oord, and M. Bethge, “A note on the evaluation of generative models,” in _ICLR_ , p. 1–10.
  * [14] J. Bergstra and Y. Bengio, “Random search for hyper-parameter optimization,” _J. Mach. Learn. Res_ , vol. 13, pp. 281–305,.
  * [15] K. Kawaguchi, L. Kaelbling, and Y. Bengio, “Generalization in deep learning.”
  * [16] P. Bojanowski, A. Joulin, D. Lopez-Paz, and A. Szlam, “Optimizing the latent space of generative networks.”


11institutetext: Rensselaer Polytechnic Institute, Troy NY, USA 12180

# Geospatial Reasoning with Shapefiles for Supporting Policy Decisions

Henrique Santos  James P. McCusker  Deborah L. McGuinness

###### Abstract

Policies are authoritative assets that are present in multiple domains to
support decision-making. They describe what actions are allowed or recommended
when domain entities and their attributes satisfy certain criteria. It is
common to find policies that contain geographical rules, including distance
and containment relationships among named locations. These locations’ polygons
can often be found encoded in geospatial datasets. We present an approach to
transform data from geospatial datasets into Linked Data using the OWL,
PROV-O, and GeoSPARQL standards, and to leverage this representation to
support automated ontology-based policy decisions. We applied our approach to
location-sensitive radio spectrum policies to identify relationships between
radio transmitters coordinates and policy-regulated regions in Census.gov
datasets. Using a policy evaluation pipeline that mixes OWL reasoning and
GeoSPARQL, our approach implements the relevant geospatial relationships,
according to a set of requirements elicited by radio spectrum domain experts.

##  1 Introduction

Policies are commonly defined as decision-making assets that express one or
more actions allowed or recommended under certain conditions. In the radio
communications domain, policies are created to help manage the use of a
limited electromagnetic spectrum. Many policies are location-specific, meaning
that they are only applicable when the usage of the radio spectrum is to occur
in specific geographic locations, as dictated by the policy. In the United
States, the National Telecommunications and Information Administration Manual
of Regulations and Procedures for Federal Radio Frequency
Management111http://bit.ly/NTIA_Redbook (NTIA Redbook) is a compilation of
regulatory policies that define the conditions organizations, systems, and
devices must satisfy to compatibly share radio spectrum while minimizing
interference. Because policies in the NTIA Redbook regulate both commercial
and federal spectrum usage, it is common to find military facilities, as well
as regulations covering domestic and international locations.

The US Census Bureau publishes geospatial datasets about the United States,
its territories, and points of interest, in its Census.gov data portal. The
datasets contain high-definition polygons, usually in the shapefile [4]
format, of many locations referred by radio spectrum policies. Although this
format is a popular choice for encoding geographical entities, its main use-
case is to support data interchange among geographic information systems
(GIS). The shapefile format usually requires the use of a GIS to allow
operations over the data, including calculations and queries. Therefore, it is
not very suitable for integrating with ontology-based applications.

We present an approach to allow ontology-based applications to leverage
geospatial data in formats not easily accessible or referred from within
ontology constructs, and to use this data to perform geospatial calculations.
We implemented the approach to support automated radio spectrum policy
decisions. This is accomplished by representing Census.gov relevant polygons
in the GeoSPARQL [5] vocabulary, and by defining OWL [9] classes that encode
the policies’ location rules. A policy evaluation pipeline that mixes OWL
reasoning and GeoSPARQL leverages this model to elicit spatial relationships,
providing high-definition spatial calculations. This approach was evaluated to
perform well in terms of coverage of geospatial requirements, as elicited by
domain experts. It is implemented as part of the Dynamic Spectrum Access (DSA)
Policy Framework [14], which was developed to serve as a machine-readable
policy repository to support increased automation of policy evaluations.

##  2 Transforming Census.gov shapefiles

The majority of location-sensitive policies in the NTIA Redbook refer to these
types of locations: military facilities, States, or Country. Because the
policies are originally authored in natural language, and targeted at spectrum
managers, they refer to locations by their names (e.g. “Fairbanks”, “Camp
Parks”), without a comprehensive definition of the boundaries of such regions.
To support automation of policy decisions, it becomes crucial to encode and
leverage the polygons for these relevant locations.

The Census Bureau is the United States agency that serves as the nation’s
leading provider of quality data about its people and economy. Yearly, the
agency publishes updated and authoritative geospatial datasets to provide
meaning and context to statistical data the bureau produces. Largely published
in the shapefile format, the published data222https://www.census.gov/programs-
surveys/geography/geographies/mapping-files.html does include State boundaries
and military installations, conveniently supporting our policy use-case. The
State dataset is composed of 56 polygons, representing the 50 U.S. States,
District of Columbia, plus 5 U.S. territories. The military installation
dataset has 859 polygons, describing information about airports, laboratories,
training areas, etc. In addition to the polygons, the datasets contain some
minimal metadata about the locations, including a unique ID, and a legal name.

We have applied the Semantic Extract, Transform, and Load-r (SETLr [12]) to
these datasets. SETLr orchestrates ETL pipelines by the use of a script in
Turtle format that defines data sources, extract and transform processes, and
destination formats. SETLr was executed in both geospatial datasets to extract
shapes’ information and transform them into geographical features using the
PROV-O [3] (prov:Location) and GeoSPARQL (geo:Feature, sf:Geometry)
ontologies. Because each phase of the ETL pipeline in SETLr is defined as an
RDF resource, the complete provenance of how these geographical features came
to be is maintained, thereby supporting the explanation of policy decisions in
more complex scenarios where multiple locations sources are involved.

##  3 Geospatial Reasoning on Radio Spectrum Policies

Geospatial reasoning is a crucial capability when evaluating policies. Many
policies, including those that regulate radio spectrum usage, are only
applicable when their specified location rules are satisfied. These locations
include named locations that can be mapped to features from geospatial
datasets, and polygons defined directly in the policy’s rules. Either way,
location rules need to be correctly evaluated, taking into consideration which
polygons the policy regulates, as well as coordinates that are subject to
evaluation (e.g. where a radio transmission is to occur).

We designed the DSA Policy Framework [14] to serve as a machine-readable,
radio spectrum policy repository that can be used to automatically process
radio transmission requests. The framework utilizes the World Wide Web
Consortium’s (W3C) OWL 2 and PROV-O, and the Open Geospatial Consortium’s
(OGC) GeoSPARQL 1.0 standards as a modeling foundation of radio spectrum
policies and involved entities. Figure 1 shows the RDF model of a transmission
request within the DSA Policy Framework. Transmission requests are defined as
prov:Activity, with the associated requester as a prov:Agent. Attributes that
further characterize the transmission are represented using either PROV-O
(including the location attribute) or a domain ontology. Coordinates in which
requesters are located are represented as Well-Known Text (WKT) [2] string,
and expressed using the geo:asWKT predicate.

Figure 1: The DSA request model

To allow the evaluation of the relationships between coordinates from
transmissions and policy-regulated locations, we have pursued the
representation of these locations as an OWL ontology where classes represent
policy locations. To exemplify this approach, we will use the second provision
of the US91 policy from the NTIA Redbook, which reads (with adaptations):

> “In the sub-band 1761-1780 MHz, Federal earth stations in the space
> operation service may transmit at the following 25 sites and non-Federal
> base stations must accept harmful interference caused by the operation of
> these earth stations: Fairbanks, Camp Parks, … .”

Besides the policy text itself, which explicitly lists 25 sites where the
policy is applicable, US91 is listed in the NTIA Redbook under the United
States table, because it is only applicable in the US and not internationally.
Listing 1 shows the representation of the involved locations for supporting
this policy. Lines 1-7 define the USLocation class for expressing the entire
United States land. This class is defined as a prov:Location and is a union of
all States, District of Columbia, and territories from the appropriate
Census.gov dataset, using the geo:sfWithin predicate from GeoSPARQL.
Similarly, lines 9-16 extend this class to express the specific locations the
above policy regulates, this time using features from the military facilities
Census.gov dataset.

⬇

1Class: USLocation

2 EquivalentTo:

3 prov:Location and (geo:sfWithin STATE_01 or

4 geo:sfWithin STATE_02 or

5 ...

6 SubClassOf:

7 prov:Location

8

9Class: US91-2-c_Location

10 EquivalentTo:

11 USLocation and (

12 (geo:sfWithin value Fairbanks) or

13 (geo:sfWithin value CampParks) or

14 ...

15 SubClassOf:

16 USLocation

Listing 1: OWL expression of part of the US91 policy in Manchester syntax

###  3.1 Evaluating geospatial rules in policies

To evaluate coordinates in transmission requests with policy-regulated
locations, we used the GeoSPARQL function predicates embedded in SPARQL
queries, as seen in Listing 2. The implemented queries focus on the within and
distance relationships. The queries infer triples in the format :req_location
geo:sfWithin :NAMED_LOCATION, or as a distance attribute with the numerical
distance as a value and in relation to some named location.

⬇

1FILTER(geof:sfWithin({{WKT_STR}}^^geo:wktLiteral, ?wkt))

2BIND(geof:distance({{WKT_STR}}^^geo:wktLiteral, ?wkt,

3 units:kilometer) AS ?distance)

Listing 2: GeoSPARQL statements to elicit select geospatial relationships.

The inferred triples are asserted back into the transmission request RDF
model, which then gets reasoned over by an OWL reasoner. Using those inferred
assertions, the location specified in the request can now be correctly
reasoned to belong to one or more location classes, such as those in Listing
1. To exemplify this process, the coordinates for the request in Figure 1 are
located in Arizona. Because US91’s second provision does not include any
Arizona locations, no triple linking the request location to one of the
policy’s locations would be inferred. But, a triple linking the request
location to the State of Arizona would exist (:req_location geo:sfWithin
:STATE_04). In this setting, the request location would be reasoned to belong
to the USLocation class, but not to the US91-2-c_Location class, indicating
that the transmission is to occur in the United States, but the second
provision of US91 is not applicable.

Conversely, if the request in Figure 1 is modified to a coordinate within the
“Fairbanks” named location, a triple :req_location geo:sfWithin :Fairbanks
will exist. Therefore, the request location will be reasoned to belong to the
US91-2-c_Location class, making the second provision of US91 applicable.

##  4 Evaluation

We worked with radio spectrum domain experts to elicit a set of geographical
requirements that a machine-readable policy model needs to support. They
appear in bold in the first column of Table 1. The table contains columns for
Policy Representation and Request Evaluation. “Yes” indicates that the policy
construct is either _Relevant_ or it has been fully addressed and
_Implemented_. “Partial” indicates that the current implementation meets a
simplified requirement.

| Policy Representation | Request Evaluation
---|---|---
Locations | Relevant | Implemented | Relevant | Implemented
Named locations | yes | yes | yes | yes
Relative locations | yes | partial | yes | partial
Polygons/Circles | yes | yes | yes | yes
Geographical rules |  |  |  |
Specific location | yes | yes | yes | yes
List of locations | yes | yes | yes | yes

Table 1: Geospatial semantics coverage

Most policies refer to locations by names or by coordinates (points, polygons,
and circles), but sometimes a location is expressed in relation to another
location. Currently, relative locations have been constrained to the ones
expressed using the distance relationship. Geographical rules are defined in
terms of the requester being in a location or a list of locations. Our
approach implements these constructs using the geo:sfWithin predicate and OWL
unions.

##  5 Related Work

The works in [11, 13] proposed approaches for converting geospatial content to
RDF, using mapping languages and ETL pipelines. The work in [6] allows the
access of geospatial datasets, including shapefiles, using an ontology-based
data access approach. Our conversion relied on SETLr, which enables the data
conversion of geospatial data to RDF similar to the first two approaches, but
also allows the maintenance of data transformation provenance. This
maintenance is important in this use-case for supporting the explanation of
policy decisions.

XACML 3.0, the eXtensible Access Control Markup Language [1], is a well-known
policy language and de facto standard for representing attribute-based access
control (ABAC) [10] policies and requests. Importantly, XACML provides a
reference architecture for centralizing access control and a process model for
evaluating requests against existing policies that inform the design of access
control systems across domains and technologies. Thi [15] proposes an OWL-
based extension to XACML to support a generalized, context-aware, role-based
access control (RBAC) model, providing Spatio-temporal restrictions and
conforming with the NIST RBAC standard [8]. Their work augments the XACML
architecture with new functions and data types.

Our approach combines OWL, PROV-O, and GeoSPARQL to encode geospatial
features, and an OWL reasoner to realize location class memberships. Our
representation builds on previous work by matching the cross-domain policy
expression semantics of XACML, extending it with the capacity to express rich
Spatio-temporal restrictions, enabling the implementation of a wide variety of
attribute-based policies across domains.

##  6 Conclusion

This paper presents an approach for leveraging geographical features,
originally in shapefiles, to support policy decisions. In the radio spectrum
domain, it is commonplace for policies to regulate the usage of the spectrum
in specific locations, therefore requiring spatial reasoning to identify
relationships between radio transmitters’ coordinates and policy-regulated
regions. This approach is an integral part of the DSA Policy Framework, which
is functioning as a prototype policy management system in support of spectrum
sharing operations.

Future work involves the research and development of the application of more
spatial relationships, including relative locations. Besides, in other policy
publications, we have encountered locations that are expressed in unusual
shapes. These include paths, cones, and altitudes. More research is necessary
to assess the impact in both modeling and reasoning, should we pursue this
line of work. Finally, we are generalizing the approach to beyond radio
spectrum policies by initially supporting practitioners from multiple domains
in the creation of policies utilizing terminology and entities in domain
knowledge graphs [7].

Acknowledgements. This work is partially funded through the National Spectrum
Consortium (NSC) project number NSC-17-7030.

## References

  * [1] eXtensible Access Control Markup Language (XACML) Version 3.0. http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html
  * [2] ISO/IEC 13249-3:2016 Information technology — Database languages — SQL multimedia and application packages — Part 3: Spatial
  * [3] PROV-O: The PROV Ontology, https://www.w3.org/TR/prov-o/
  * [4] ESRI Shapefile Technical Description (1998), https://www.esri.com/Library/Whitepapers/Pdfs/Shapefile.pdf
  * [5] Battle, R., Kolas, D.: Enabling the geospatial Semantic Web with Parliament and GeoSPARQL. Semantic Web 3(4), 355–370 (2012)
  * [6] Bereta, K., Xiao, G., Koubarakis, M.: Ontop-spatial: Ontop of geospatial databases. Journal of Web Semantics 58, 100514 (2019)
  * [7] Falkow, M., Santos, H., McGuinness, D.L.: Towards a Domain-Agnostic Computable Policy Tool. In: ESWC 2021 Posters and Demos Track (2021)
  * [8] Ferraiolo, D.F., Kuhn, D.R.: Role-Based Access Controls. In: 15th National Computer Security Conference (2009)
  * [9] Grau, B.C., Horrocks, I., Motik, B., Parsia, B., Patel-Schneider, P., Sattler, U.: OWL 2: The next step for OWL. Journal of Web Semantics 6(4), 309–322 (2008)
  * [10] Hu, V.C., Kuhn, D.R., Ferraiolo, D.F., Voas, J.: Attribute-based access control. Computer 48(2), 85–88 (2015)
  * [11] Kyzirakos, K., Savva, D., Vlachopoulos, I., Vasileiou, A., Karalis, N., Koubarakis, M., Manegold, S.: GeoTriples: Transforming geospatial data into RDF graphs using R2RML and RML mappings. Journal of Web Semantics 52-53, 16–32 (2018)
  * [12] McCusker, J.P., Chastain, K., Rashid, S., Norris, S., McGuinness, D.L.: SETLr: the semantic extract, transform, and load-r. Tech. Rep. e26476v1, PeerJ Inc. (2018)
  * [13] Patroumpas, K., Alexakis, M., Giannopoulos, G., Athanasiou, S.: TripleGeo: an ETL Tool for Transforming Geospatial Data into RDF Triples. In: EDBT/ICDT Workshops. CEUR Workshop Proceedings, vol. 1133, pp. 275–278 (2014)
  * [14] Santos, H., Mulvehill, A., Erickson, J.S., McCusker, J.P., Gordon, M., Xie, O., Stouffer, S., Capraro, G., Pidwerbetsky, A., Burgess, J., Berlinsky, A., Turck, K., Ashdown, J., McGuinness, D.L.: A Semantic Framework for Enabling Radio Spectrum Policy Management and Evaluation. In: The Semantic Web – ISWC 2020
  * [15] Tran Thi, Q.N., Dang, T.K.: X-STROWL: A generalized extension of XACML for context-aware spatio-temporal RBAC model with OWL. In: Seventh International Conference on Digital Information Management (ICDIM). pp. 253–258 (2012)


One important property of the measure A.3, which we use in the main text, is
that if we shift $\check{A}$ and $\check{B}$ by some fixed $\check{\alpha}$
and $\check{\beta}$ respectively, the measure transforms as

$\differential{\mu}(\check{A}+\check{\alpha},\check{B}+\check{\beta})=\differential{\mu}(\check{A},\check{B})\
\mathrm{e}^{\mathrm{i}S_{\text{BF}}\quantity[\check{\alpha},\check{B}]}\
\mathrm{e}^{\mathrm{i}S_{\text{BF}}\quantity[\check{A},\check{\beta}]}\
\mathrm{e}^{\mathrm{i}S_{\text{BF}}\quantity[\check{\alpha},\check{\beta}]}.$
(A.6)

##  Appendix B Proofs for section 3.

### Proof of subregion electric-magnetic duality

Subregion electric-magnetic duality as described in subsection 3.1 is the
statement that the surface operators generating $\mathfrak{A}_{\text{mag}}[R]$
are in 1-1 correspondence with surface operators generating
$\mathfrak{A}_{\text{elec}}[R]$. Let us prove it. To do so, it suffices to
show the following:

######  Claim 1.

The pairing

$\displaystyle\mathbb{L}:\mathrm{H}_{p}(\Sigma)\times\mathrm{H}_{d-p-1}(\Sigma)$
$\displaystyle\longrightarrow\mathbb{R}$ $\displaystyle(\eta,\sigma)$
$\displaystyle\longmapsto\int_{\eta\cap\sigma}1$

is non-degenerate restricted to
$\opbraces{\operatorname{im}}i^{R}_{p}\times\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{d-p-1}$,
where, as explained in the main text
$i^{R}_{k}:\mathrm{H}_{k}(R)\to\mathrm{H}_{k}(\Sigma)$ is the pushforward in
homology of the map that embeds $R$ into $\Sigma$ and similarly for
${R}^{\mathsf{c}}$.

######  Proof B.1.

Let us assume the opposite of the claim. That is, either,

  1. (i)

There exists an $\hat{\eta}\in\opbraces{\operatorname{im}}i^{R}_{p}$, such
that $\mathbb{L}(\hat{\eta},\sigma)=0$, for all
$\sigma\in\opbraces{\operatorname{coker}}i^{R}_{d-p-1}$ or

  2. (ii)

There exists a $\hat{\sigma}\in\opbraces{\operatorname{coker}}i^{R}_{p}$, such
that $\mathbb{L}(\eta,\hat{\sigma})=0$, for all
$\eta\in\opbraces{\operatorname{im}}i^{R}_{d-p-1}$.

Note that since $\eta\in\opbraces{\operatorname{im}}i^{R}_{p}$, it can always
be homotopically deformed to lie entirely in $R$. We can therefore restrict
our attention to cycles restricted in $R$. Then
$\left.\eta\right|_{R}\in\mathrm{H}_{p}(R)$, while
$\left.\sigma\right|_{R}\in\mathrm{H}_{d-p-1}(R,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$.

Let us assume case (i). By Poincaré–Lefschetz duality,
$\mathrm{H}_{d-p-1}(R,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\cong\mathrm{H}^{p}(R\setminus{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$$\cong\mathrm{H}^{p}\quantity(\overline{R})$, we
have

$0=\int_{\left.\hat{\eta}\right|_{R}\cap\left.\sigma\right|_{R}}1=\int_{\left.\hat{\eta}\right|_{R}}\mathrm{PD}[\left.\sigma\right|_{R}],\qquad{{}^{\forall}\\!}\,\mathrm{PD}[\left.\sigma\right|_{R}]\in\mathrm{H}^{p}\quantity(\overline{R}),$
(B.1)

where $\mathrm{PD}[\cdot]$ denotes the Poincaré(–Lefschetz) dual of a cycle.
In words, there exists a $p$-cycle of $R$ that is orthogonal to all
$p$-cohomology classes of $\overline{R}$, which is impossible. The proof of
(ii) is wholly similar, with the difference being that the conclusion is that
there exists a $p$-cohomology class in $\overline{R}$ orthogonal to all
$p$-cycles of $R$, which is again impossible.

### Proof of claim 3.9

######  Claim 2.

${\quantity(\mathfrak{A}_{\text{mag}}[R])}^{\mathsf{c}}=\mathfrak{U}\quantity{\hat{\mathrm{W}}_{\eta^{\mathsf{i}}}^{\boldsymbol{w}_{\mathsf{i}}},\hat{\mathrm{V}}_{\sigma^{\mathsf{j}}}^{\boldsymbol{v}_{\mathsf{j}}}\;\middle|\;\eta^{\mathsf{i}},\sigma^{\mathsf{j}}\mathbin{\tilde{\in}}{R}^{\mathsf{c}}}\equiv\mathfrak{A}_{\text{mag}}\quantity[{R}^{\mathsf{c}}].$
(B.2)

######  Proof B.2.

Consider first the commutant of the operators
$\hat{\mathrm{V}}_{\sigma}^{\boldsymbol{v}}\in\mathfrak{A}_{\text{mag}}[R]$.
We want to show that $\hat{\mathrm{W}}_{\eta}^{\boldsymbol{w}}$ commutes with
all
$\hat{\mathrm{V}}_{\sigma}^{\boldsymbol{v}}\in\mathfrak{A}_{\text{mag}}[R]$
iff $\eta\in\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{p}$. Firstly
note that by the definition of the algebra, 2.34,
$\hat{\mathrm{W}}_{\eta}^{\boldsymbol{w}}$ commutes with
$\hat{\mathrm{V}}_{\sigma}^{\boldsymbol{v}}$ iff $\mathbb{L}(\eta,\sigma)=0$.
The statement we need to prove reduces, then, to the following:

$\mathbb{L}(\eta,\sigma)=0,\
{{}^{\forall}\\!}\sigma\in\opbraces{\operatorname{im}}i^{R}_{d-p-1}\mbox{\quad
iff\quad}\eta\in\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{p}.$ (B.3)

  * $(\Rightarrow)$

If $\eta\in\opbraces{\operatorname{im}}i_{p}^{{R}^{\mathsf{c}}}$, it is clear
that $\mathbb{L}(\eta,\sigma)=0,\
{{}^{\forall}\\!}\sigma\in\opbraces{\operatorname{im}}i^{R}_{d-p-1}$, since we
can homotopically move $\sigma$ and $\eta$ to lie within the interior of $R$
and ${R}^{\mathsf{c}}$ respectively.

  * $(\Leftarrow)$

We will prove the only if direction ad absurdum. For that, suppose that
$\eta\notin\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{p}$. Then, since
$\mathrm{H}_{p}(\Sigma)=\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{p}\oplus\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{p}$,
$\eta\in\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{p}$. Restricted
to $R$ then,
$\left.\eta\right|_{R}\in\mathrm{H}_{p}(R,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$ and
$\left.\sigma\right|_{R}\in\mathrm{H}_{d-p-1}(R)$. By Poincaré–Lefschetz
duality, $\mathrm{H}_{p}(R,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\cong\mathrm{H}^{d-p-1}(R\setminus{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)=\mathrm{H}^{d-p-1}\quantity(\overline{R})$ and we
have then,

$0\overset{!}{=}\mathbb{L}(\eta,\sigma)=\mathbb{L}\quantity(\left.\eta\right|_{R},\left.\sigma\right|_{R})=\int_{\left.\sigma\right|_{R}}\mathrm{PD}[\left.\eta\right|_{R}],\
{{}^{\forall}\\!}\sigma\in\opbraces{\operatorname{im}}i^{p}_{R}.$ (B.4)

where,
$\mathrm{PD}[\left.\eta\right|_{R}]\in\mathrm{H}^{d-p-1}\quantity(\overline{R})$
is the Poincaré–Lefschetz dual of $\left.\eta\right|_{R}$. That is to say,
$\mathrm{PD}[\left.\eta\right|_{R}]$ must be orthogonal to all
$(d-p-1)$-cycles of $R$, which is impossible. Therefore the assumption that
$\eta\notin\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{p}$ was absurd.

The proof for the commutant of operators
$\hat{\mathrm{W}}_{\eta}^{\boldsymbol{w}}\in\mathfrak{A}_{\text{mag}}[R]$ is
wholly similar, concluding thus the proof of the claim.

### Proof of claim 3.15

######  Claim 3.

${\left(\mathfrak{A}_{\text{elec}}[R]\right)}^{\mathsf{c}}=\mathfrak{U}\quantity{\hat{\mathrm{W}}_{\eta^{\mathsf{i}}}^{\boldsymbol{w}_{\mathsf{i}}},\hat{\mathrm{V}}_{\sigma^{\mathsf{j}}}^{\boldsymbol{v}^{\mathsf{j}}}\;\middle|\;\eta^{\mathsf{i}},\sigma^{\mathsf{j}}\mathbin{\cancel{\tilde{\in}}}R}=\mathfrak{A}_{\text{elec}}[{R}^{\mathsf{c}}].$
(B.5)

######  Proof B.3.

Consider first the commutant of the operators
$\hat{\mathrm{V}}_{\sigma}^{\boldsymbol{v}}\in\mathfrak{A}_{\text{elec}}[R]$.
We want to show that $\hat{\mathrm{W}}_{\eta}^{\boldsymbol{w}}$ commutes with
all
$\hat{\mathrm{V}}_{\sigma}^{\boldsymbol{v}}\in\mathfrak{A}_{\text{elec}}[R]$
iff $\eta\in\opbraces{\operatorname{coker}}i^{R}_{p}$. As before, by the
definition of the algebra, 2.34, the statement we need to prove reduces to:

$\mathbb{L}(\eta,\sigma)=0,\
{{}^{\forall}\\!}\sigma\in\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{d-p-1}\mbox{\quad
iff\quad}\eta\in\opbraces{\operatorname{coker}}i^{R}_{p}.$ (B.6)

  * $(\Leftarrow)$

We will first prove the only if direction. This we will prove again by
contradiction. For that, suppose that
$\eta\notin\opbraces{\operatorname{coker}}i^{R}_{p}$. Then,
$\eta\in\opbraces{\operatorname{im}}i^{R}_{p}$. Restricting to $R$ we have
$\left.\eta\right|_{R}\in\mathrm{H}_{p}(R)$ and
$\left.\sigma\right|_{R}\in\mathrm{H}_{d-p-1}(R,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$. By Poincaré–Lefschetz duality,
$\mathrm{H}_{d-p-1}(R,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\cong\mathrm{H}^{p}(R\setminus{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)=\mathrm{H}^{p}\quantity(\overline{R})$ hence,

$0\overset{!}{=}\mathbb{L}(\eta,\sigma)=\mathbb{L}\quantity(\left.\eta\right|_{R},\left.\sigma\right|_{R})=\int_{\left.\eta\right|_{R}}\mathrm{PD}[\left.\sigma\right|_{R}],\
{{}^{\forall}\\!}\sigma\in\opbraces{\operatorname{coker}}i^{p}_{R}.$ (B.7)

where,
$\mathrm{PD}[\left.\sigma\right|_{R}]\in\mathrm{H}^{p}\quantity(\overline{R})$
is the Poincaré–Lefschetz dual of $\left.\sigma\right|_{R}$. That is to say,
every $p$-cocycle in the interior of $R$ must be orthogonal to
$\left.\eta\right|_{R}$, which is impossible. Therefore the assumption that
$\eta\notin\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{p}$ was
absurd.

  * $(\Rightarrow)$

The if direction follows immediately from subregion electric-magnetic duality,
proven above, and the fact that the rank of $\mathbb{L}$ is
$\mathrm{b}_{p}(\Sigma)$ (since it is inverse to $\mathbb{G}_{p}$ as a
matrix). The restrictions of $\mathbb{L}$ to the subspaces
$\opbraces{\operatorname{im}}i^{R}_{p}\times\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{d-p-1}$
and
$\opbraces{\operatorname{coker}}i^{R}_{p}\times\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{d-p-1}$
saturate the rank of $\mathbb{L}$, hence the rank of $\mathbb{L}$ restricted
to
$\opbraces{\operatorname{coker}}i^{R}_{p}\times\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{d-p-1}$
is zero. In other words for any
$\eta\in\opbraces{\operatorname{coker}}i^{R}_{p}$,
$\mathbb{L}(\eta,\sigma)=0$,
${{}^{\forall}\\!}\sigma\in\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{d-p-1}$,
concluding the proof.

The proof for the commutant of operators
$\hat{\mathrm{W}}_{\eta}^{\boldsymbol{w}}\in\mathfrak{A}_{\text{elec}}[R]$ is
wholly similar, concluding thus the proof of the claim.

### Counting the magnetic and electric centers

Let us first focus on the magnetic center. Consider, as in the main text, the
pushout square that embeds ${\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R$ into $\Sigma$ through $R$ and ${R}^{\mathsf{c}}$:

${{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R}$${R}$${{R}^{\mathsf{c}}}$${\Sigma}$$\scriptstyle{j^{R}}$$\scriptstyle{i^{R}}$$\scriptstyle{i^{{R}^{\mathsf{c}}}}$$\scriptstyle{j^{{R}^{\mathsf{c}}}}$$\scriptstyle{\ell^{{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R}}$

Each of these maps induces a push-forward on the homology,

$\displaystyle j^{{R}^{(\mathsf{c})}}_{k}$
$\displaystyle:\mathrm{H}_{k}\quantity({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}{R}^{(\mathsf{c})})\to\mathrm{H}_{k}\quantity({R}^{(\mathsf{c})})$
(B.8) $\displaystyle i^{{R}^{(\mathsf{c})}}_{k}$
$\displaystyle:\mathrm{H}_{k}\quantity(R^{(\mathsf{c})})\to\mathrm{H}_{k}\quantity(\Sigma).$
(B.9)

The operators in the magnetic algebra of $R$, $\mathfrak{A}_{\text{mag}}[R]$,
are generated by surface operators whose cycles lie in the image of
$i^{R}_{p}$ and $i^{R}_{d-p-1}$ and similarly for
$\mathfrak{A}_{\text{mag}}[{R}^{\mathsf{c}}]$, replacing $R$ by
${R}^{\mathsf{c}}$. The cycles generating the center then lie in
$\opbraces{\operatorname{im}}i^{R}_{p}\cap\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{p}$
and
$\opbraces{\operatorname{im}}i^{R}_{d-p-1}\cap\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{d-p-1}$.
Since $R$ and ${R}^{\mathsf{c}}$ share only ${\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R$, it is evident that the cycles generating the
center lie in $\opbraces{\operatorname{im}}\quantity(i^{R}\circ
j^{R})_{k}\cong\opbraces{\operatorname{im}}\quantity(i^{{R}^{\mathsf{c}}}\circ
j^{{R}^{\mathsf{c}}})_{k}\eqqcolon\opbraces{\operatorname{im}}\ell^{{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R}_{k}$, as illustrated by the above pushout square.
Therefore, the dimension of the magnetic center is

$\absolutevalue{\mathfrak{Z}_{\text{mag}}[R]}=\absolutevalue{\det\mathbb{K}}^{\left(\mathrm{h}^{p}_{\text{mag}}+\mathrm{h}^{d-p-1}_{\text{mag}}\right)},\qquad\qquad\mathrm{h}^{k}_{\text{mag}}=\dim\opbraces{\operatorname{im}}\ell_{k}^{{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R}.$ (B.10)

Since ${\text{\scalebox{1.14}{\char 64\relax}}\mspace{1.0mu}}R\subset\Sigma$,
we can calculate
$\dim\opbraces{\operatorname{im}}\ell^{{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R}_{k}$ by the long exact sequence of relative
homology [53]:

$\cdots\to\mathrm{H}_{k}({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\overset{\ell_{k}}{\to}\mathrm{H}_{k}(\Sigma)\overset{r_{k}}{\to}\mathrm{H}_{k}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\overset{\delta_{k-1}}{\to}\mathrm{H}_{k-1}({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\to\cdots.$ (B.11)

Using exactness of the sequence, we find that

$\displaystyle\dim\opbraces{\operatorname{im}}\ell_{k}$
$\displaystyle=(-1)^{k-1}\sum_{n=0}^{k-1}(-1)^{n}\dim\mathrm{H}_{n}({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$
$\displaystyle\phantom{=~{}}+(-1)^{k}\sum_{n=0}^{k}(-1)^{n}\quantity\big(\dim\mathrm{H}_{n}(\Sigma)-\dim\mathrm{H}_{n}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)),$ (B.12)

which leads to 3.12.

It is useful to pause at this point and illustrate how the bulk dependent
terms of appendix B ensure the correct counting of operators when $\Sigma$ is
topologically trivial. For example, consider the case when
$\Sigma=\mathbb{S}^{2}$, $R$ is collection of $q$ disks such that
${\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R=\bigsqcup^{q}\mathbb{S}^{1}$, and let $k=1$. In
this case, since there are no non-trivial 1-cycles on $\mathbb{S}^{2}$, there
are no 1-cycle operators in $\mathfrak{A}[\Sigma]$ to count. We should find
$\dim\opbraces{\operatorname{im}}\ell_{1}=0$. Applying 3.12 we find

$\displaystyle\dim\opbraces{\operatorname{im}}\ell_{1}$
$\displaystyle=\dim\mathrm{H}_{0}({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)-\dim\mathrm{H}_{0}\quantity(\mathbb{S}^{2})+\dim\mathrm{H}_{0}\quantity(\mathbb{S}^{2},{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+\dim\mathrm{H}_{1}\quantity(\mathbb{S}^{2})-\dim\mathrm{H}_{1}\quantity(\mathbb{S}^{2},{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$
$\displaystyle=q-1+\dim\mathrm{H}_{0}\quantity(\mathbb{S}^{2},{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)-\dim\mathrm{H}_{1}\quantity(\mathbb{S}^{2},R)$
(B.13)

To calculate the dimensions of the relative homologies, we note that
$\mathrm{H}_{n}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\cong\widetilde{\mathrm{H}}_{n}(\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$ where $\widetilde{\mathrm{H}}_{n}(\cdot)$ denotes
reduced homology and $\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R$ is the quotient space. By definition of the
reduced homology
$\dim\widetilde{\mathrm{H}}_{0}\quantity(\mathbb{S}^{2}/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)=0$ and we can easily calculate
$\dim\widetilde{\mathrm{H}}_{1}\quantity(\mathbb{S}^{2}/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)=q-1$, as illustrated in figure 3. Thus indeed

$\dim\opbraces{\operatorname{im}}\ell_{1}=0$ (B.14)

in this case.

Figure 3: (Left) The setup of the above example: $\Sigma=\mathbb{S}^{2}$ and
$R=\bigsqcup^{q}\mathbb{B}^{2}$. (Right) $\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R$.

Coming back to the general case, we can now sum the
$\mathrm{h}_{\text{mag}}^{p}$ and $\mathrm{h}_{\text{mag}}^{d-p-1}$, to find

$\displaystyle\mathrm{h}_{\text{mag}}$
$\displaystyle\coloneqq\dim\opbraces{\operatorname{im}}\ell^{{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R}_{p}+\dim\opbraces{\operatorname{im}}\ell^{{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R}_{d-p-1}$
$\displaystyle=2\sum_{n=0}^{p-1}(-1)^{p-1-n}\dim\mathrm{H}_{n}({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+(-1)^{p-1}\upchi({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+\dim\mathrm{H}_{p}(\Sigma)+(-1)^{p}\upchi(\Sigma)$
$\displaystyle\qquad+\sum_{n=0}^{p}(-1)^{p-1-n}\dim\mathrm{H}_{n}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+\sum_{n=0}^{d-p-1}(-1)^{d-p-n}\dim\mathrm{H}_{n}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$
$\displaystyle=2\sum_{n=0}^{p-1}(-1)^{p-1-n}\dim\mathrm{H}_{n}({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+(-1)^{p-1}\upchi({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+\dim\mathrm{H}_{p}(\Sigma)+(-1)^{p}\upchi(\Sigma)$
$\displaystyle\qquad+(-1)^{p-1}\upchi(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)-\dim\mathrm{H}_{p}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+(-1)^{d-p-1}\left(\dim\mathrm{H}_{d-1}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)-\dim\mathrm{H}_{0}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\right)$
$\displaystyle=2\sum_{n=0}^{p-1}(-1)^{p-1-n}\mathrm{b}_{n}({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)+\left(\mathrm{b}_{p}(\Sigma)-\dim\mathrm{H}_{p}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\right)$
$\displaystyle\qquad+(-1)^{d-p-1}\left(\dim\mathrm{H}_{d-1}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)-\dim\mathrm{H}_{0}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\right).$ (B.15)

which leads to subsection 3.1.1. In the second line above we’ve used
$\mathrm{H}_{n}(\cdot)\cong\mathrm{H}_{D-n}(\cdot)$ for absolute homologies on
$D$-dimensional compact spaces. In the third line we’ve used the similar
relation for the relative homology
$\mathrm{H}_{n}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$ which holds for all degrees except the top and
bottom degrees, $\mathrm{H}_{d-1}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$ and
$\mathrm{H}_{0}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$, respectively181818To see that, we note again
that $\mathrm{H}_{n}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\cong\widetilde{\mathrm{H}}_{n}(\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$. For the reduced homology, it holds that
$\widetilde{\mathrm{H}}_{n}(\cdot)\cong\mathrm{H}_{n}(\cdot)$, whenever $n\neq
0$. On $\Sigma/{\text{\scalebox{1.14}{\char 64\relax}}\mspace{1.0mu}}R$, one
can define a non-degenerate pairing
$\mathbb{L}:\mathrm{H}_{n}(\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\times\mathrm{H}_{D-n}(\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\to\mathbb{R}$, as
$\mathbb{L}(\alpha,\beta)\coloneqq\int_{\alpha\cap\beta}1$. This renders
$\mathrm{H}_{n}(\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\cong\mathrm{H}_{D-n}(\Sigma/{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$ whenever $n\notin\quantity{0,D}$ and shows the
desired statement for relative homology.. Additionally,

$\upchi(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)\coloneqq\sum_{n=0}^{d-1}(-1)^{n}\dim\mathrm{H}_{n}(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)$

is the relative Euler characteristic of the pair
$(\Sigma,{\text{\scalebox{1.14}{\char 64\relax}}\mspace{1.0mu}}R)$, and
$\upchi({\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)-\upchi(\Sigma)+\upchi(\Sigma,{\text{\scalebox{1.14}{\char
64\relax}}\mspace{1.0mu}}R)=0$, as it is simply the rank-nullity relation of
B.11. Lastly, we’ve used
$\dim\mathrm{H}_{n}(\cdot)=\dim\mathrm{H}^{n}(\cdot)\equiv\mathrm{b}_{n}(\cdot)$
for absolute homologies on compact spaces.

For counting the dimension of $\mathfrak{Z}_{\text{elec}}[R]$, let us show

$\mathrm{h}_{\text{elec}}^{p}=\mathrm{h}_{\text{mag}}^{d-p-1}.$ (B.16)

That is, the number of $p$-cycles, $\eta$, such that
$\eta\mathbin{\cancel{\tilde{\in}}}R,\mathbin{\cancel{\tilde{\in}}}{R}^{\mathsf{c}}$
is equal to the number of $(d-p-1)$-cycles, $\sigma$ with
$\sigma\mathbin{\tilde{\in}}R,\mathbin{\tilde{\in}}{R}^{\mathsf{c}}$. To show
this we need is suffices to show the following.

######  Claim 4.

The pairing

$\mathbb{L}(\eta,\sigma)\coloneqq\int_{\eta\cap\sigma}1$ (B.17)

is non-degenerate restricted to
$(\opbraces{\operatorname{coker}}i^{R}_{p}\cap\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{p})\times(\opbraces{\operatorname{im}}i^{R}_{d-p-1}\cap\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{d-p-1})$.

######  Proof B.4.

Suppose not. That is either

  1. (i)

there exists a
$\hat{\eta}\in\opbraces{\operatorname{coker}}i^{R}_{p}\cap\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{p}$
such that $\mathbb{L}(\hat{\eta},\sigma)=0$,
for all
$\sigma\in\opbraces{\operatorname{im}}i^{R}_{d-p-1}\cap\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{d-p-1}$
or

  2. (ii)

there exists a
$\hat{\sigma}\in\opbraces{\operatorname{im}}i^{R}_{d-p-1}\cap\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{d-p-1}$
such that $\mathbb{L}(\eta,\hat{\sigma})=0$,
for all
$\eta\in\opbraces{\operatorname{coker}}i^{R}_{p}\cap\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{p}$.

If we suppose (i), then there is no homotopic obstruction to deforming
$\hat{\eta}$ to either entirely $R$ or ${R}^{\mathsf{c}}$ which contradicts it
lying in the cokernels of $i^{R}$ and $i^{{R}^{\mathsf{c}}}$. So let us
suppose (ii) and pick a $\hat{\sigma}$ satisfying (ii). Because $\mathbb{L}$
is a non-degenerate pairing on
$\mathrm{H}_{p}(\Sigma)\times\mathrm{H}_{d-p-1}(\Sigma)$ there exists a
$\check{\eta}\in\mathrm{H}_{p}(\Sigma)$ such that
$\mathbb{L}(\check{\eta},\hat{\sigma})\neq 0$. By assumption, $\check{\eta}$
must lie in either $\opbraces{\operatorname{im}}i^{R}_{p}$ or
$\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{p}$ and so is completely
deformable within $\Sigma$ to either $R$ or ${R}^{\mathsf{c}}$. But then
$\mathbb{L}(\check{\eta},\hat{\sigma})$ must actually vanish because
$\hat{\sigma}$, which lies in
$\opbraces{\operatorname{im}}i^{R}_{d-p-1}\cap\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{d-p-1}$,
can be deformed to the respective complementary region so that it has no
intersection with $\check{\eta}$. This contradiction completes the proof that
$\mathbb{L}$ is non-degenerate on
$(\opbraces{\operatorname{coker}}i^{R}_{p}\cap\opbraces{\operatorname{coker}}i^{{R}^{\mathsf{c}}}_{p})\times(\opbraces{\operatorname{im}}i^{R}_{d-p-1}\cap\opbraces{\operatorname{im}}i^{{R}^{\mathsf{c}}}_{d-p-1})$.

Similar arguments show that
$\mathrm{h}^{d-p-1}_{\text{elec}}=\mathrm{h}^{p}_{\text{mag}}$. As a
consequence

$\absolutevalue{\mathfrak{Z}_{\text{elec}}}=\absolutevalue{\mathfrak{Z}_{\text{mag}}}.$
(B.18)

##  Appendix C Decomposition of the reduced density matrix

Given a state

$\rho=\sum_{\mathfrak{v},\mathfrak{v}^{\prime}}\rho_{\mathfrak{v},\mathfrak{v}^{\prime}}\,\outerproduct{\mathfrak{v}}{\mathfrak{v}^{\prime}},\qquad\rho_{\mathfrak{v},\mathfrak{v}^{\prime}}^{\ast}=\rho_{\mathfrak{v}^{\prime},\mathfrak{v}},\qquad\sum_{\mathfrak{v}}\rho_{\mathfrak{v},\mathfrak{v}}=1,$
(C.1)

we wish to write down the reduced density matrix, $\rho_{R}$, corresponding to
the subregion algebra, $\mathfrak{A}_{\text{mag}}[R]$. The general ansatz for
this reduced density matrix is given by

$\rho_{R}=\sum_{\quantity{\boldsymbol{w}^{R}_{\mathsf{i}}}}\sum_{\quantity{\boldsymbol{v}^{R}_{\mathsf{j}}}}C_{\quantity{\boldsymbol{w}^{R}_{\mathsf{i}}},\quantity{\boldsymbol{v}^{R}_{\mathsf{j}}}}\prod_{\eta^{\mathsf{i}}\mathbin{\tilde{\in}}R}\,\hat{\mathrm{W}}_{\eta^{\mathsf{i}}}^{\boldsymbol{w}^{R}_{\mathsf{i}}}\,\prod_{\sigma^{\mathsf{j}}\mathbin{\tilde{\in}}R}\hat{\mathrm{V}}_{\sigma^{\mathsf{j}}}^{\boldsymbol{v}^{R}_{\mathsf{j}}},$
(C.2)

for some coefficients $C$. We notate the charges $\boldsymbol{w}^{R}$ and
$\boldsymbol{v}^{R}$ to indicate that they are for surface operators
deformable into $R$. Given that
$\hat{\mathrm{W}}_{\eta^{\mathsf{i}}}^{\boldsymbol{w}_{\mathsf{i}}=\boldsymbol{0}}$
and
$\hat{\mathrm{V}}_{\sigma^{\mathsf{j}}}^{\boldsymbol{v}_{\mathsf{j}}=\boldsymbol{0}}$
both act as the identity, it will be notationally useful to extend
$\quantity{\boldsymbol{w}^{R}_{\mathsf{i}}}$ and
$\quantity{\boldsymbol{v}^{R}_{\mathsf{j}}}$ to full charge vectors
$\mathfrak{w}^{R}\in(\Lambda_{A})^{\mathrm{h}}$ and
$\mathfrak{v}^{R}\in(\Lambda_{B})^{\mathrm{h}}$, respectively, with zero
entries for all cycles not deformable into $R$:

$\boldsymbol{w}_{\mathsf{i}}^{R}=\boldsymbol{v}_{\mathsf{j}}^{R}=0\qquad{{}^{\forall}\\!}\,\eta^{\mathsf{i}},\sigma^{\mathsf{j}}\mathbin{\cancel{\tilde{\in}}}R.$
(C.3)

We then write

$\rho_{R}=\sum_{\mathfrak{w}^{R}}\sum_{\mathfrak{v}^{R}}C_{\mathfrak{w}^{R},\mathfrak{v}^{R}}\,\hat{\mathrm{W}}^{\mathfrak{w}^{R}}\,\hat{\mathrm{V}}^{\mathfrak{v}^{R}}.$
(C.4)

Hermiticity and unit-trace (with respect to $\mathcal{H}_{\Sigma}$) imply

$C^{\ast}_{\mathfrak{w}^{R},\mathfrak{v}^{R}}=C_{-\mathfrak{w}^{R},-\mathfrak{v}^{R}}\,\mathrm{e}^{\mathrm{i}\Gamma\quantity(\mathfrak{v}^{R},\mathfrak{w}^{R})}$
(C.5)

and

$C_{\boldsymbol{0},\boldsymbol{0}}=\quantity(\text{dim}\mathcal{H}_{\Sigma})^{-1}=\absolutevalue{\det\mathbb{K}}^{-\mathrm{b}_{p}(\Sigma)}\equiv\mathcal{N}_{\Sigma}^{-1},$
(C.6)

respectively. We can solve for the coefficients
$C_{\mathfrak{w}^{R},\mathfrak{v}^{R}}$ in terms of the coefficients of the
state, $\rho_{\mathfrak{v},\mathfrak{v}^{\prime}}$, by enforcing

$\Tr\left(\rho_{R}\,\mathcal{O}_{R}\right)=\Tr\left(\rho\,\mathcal{O}_{R}\right)=\sum_{\mathfrak{v},\mathfrak{v}^{\prime}}\rho_{\mathfrak{v},\mathfrak{v}^{\prime}}\matrixelement{\mathfrak{v}^{\prime}}{\mathcal{O}_{R}}{\mathfrak{v}},$
(C.7)

for all $\mathcal{O}_{R}\in\mathfrak{A}_{\text{mag}}[R]$. By considering a
generic element
$\mathcal{O}_{R}=\hat{\mathrm{W}}^{\hat{\mathfrak{w}}^{R}}\hat{\mathrm{V}}^{\hat{\mathfrak{v}}^{R}}$
(for fixed $\hat{\mathfrak{w}}^{R}$ and $\hat{\mathfrak{v}}^{R}$) we can
easily work out

$C_{\mathfrak{w}^{R},\mathfrak{v}^{R}}=\mathcal{N}_{\Sigma}^{-1}\sum_{\bar{\mathfrak{v}}}\rho_{\bar{\mathfrak{v}},\bar{\mathfrak{v}}-\mathfrak{v}^{R}}\mathrm{e}^{-\mathrm{i}\Gamma\quantity(\bar{\mathfrak{v}},\mathfrak{w}^{R})}.$
(C.8)

Thus we can write a generic reduced density matrix as

$\rho_{R}=\mathcal{N}_{\Sigma}^{-1}\sum_{\mathfrak{w}^{R}}\sum_{\mathfrak{v}^{R}}\sum_{\bar{\mathfrak{v}}}\rho_{\bar{\mathfrak{v}},\bar{\mathfrak{v}}-\mathfrak{v}^{R}}\mathrm{e}^{-\mathrm{i}\Gamma\quantity(\bar{\mathfrak{v}},\mathfrak{w}^{R})}\,\hat{\mathrm{W}}^{\mathfrak{w}^{R}}\,\hat{\mathrm{V}}^{\mathfrak{v}^{R}}.$
(C.9)

In particular for a pure state (as in subsection 3.4),

$\rho=\psi_{\mathfrak{v}}\psi^{\ast}_{\mathfrak{v}^{\prime}}\,\outerproduct{\mathfrak{v}}{\mathfrak{v}^{\prime}},$
(C.10)

the reduced density matrix is written as

$\rho_{R}=\mathcal{N}_{\Sigma}^{-1}\sum_{\mathfrak{w}^{R}}\sum_{\mathfrak{v}^{R}}\sum_{\bar{\mathfrak{v}}}\psi_{\bar{\mathfrak{v}}}\psi^{\ast}_{\bar{\mathfrak{v}}-\mathfrak{v}^{R}}\mathrm{e}^{-\mathrm{i}\Gamma\quantity(\bar{\mathfrak{v}},\mathfrak{w}^{R})}\,\hat{\mathrm{W}}^{\mathfrak{w}^{R}}\,\hat{\mathrm{V}}^{\mathfrak{v}^{R}}.$
(C.11)

## References

  * [1] Thomas Faulkner, Thomas Hartman, Matthew Headrick, Mukund Rangamani and Brian Swingle  “Snowmass white paper: Quantum information in quantum field theory and quantum gravity”  In _Snowmass 2021_ , 2022  arXiv:2203.07117 [hep-th]
  * [2] Alexei Kitaev and John Preskill  “Topological entanglement entropy”  In _Phys. Rev. Lett._ 96, 2006, pp. 110404  DOI: 10.1103/PhysRevLett.96.110404
  * [3] Michael Levin and Xiao-Gang Wen  “Detecting Topological Order in a Ground State Wave Function”  In _Phys. Rev. Lett._ 96, 2006, pp. 110405  DOI: 10.1103/PhysRevLett.96.110405
  * [4] Sergey Bravyi, Bernhard Leemhuis and Barbara M. Terhal  “Topological order in an exactly solvable 3D spin model”  In _Annals of Physics_ 326.4, 2011, pp. 839–866  DOI: 10.1016/j.aop.2010.11.002
  * [5] Sergey Bravyi and Jeongwan Haah  “Quantum Self-Correction in the 3D Cubic Code Model”  In _Phys. Rev. Lett._ 111 American Physical Society, 2013, pp. 200501  DOI: 10.1103/PhysRevLett.111.200501
  * [6] Claudio Chamon  “Quantum Glassiness in Strongly Correlated Clean Systems: An Example of Topological Overprotection”  In _Phys. Rev. Lett._ 94 American Physical Society, 2005, pp. 040402  DOI: 10.1103/PhysRevLett.94.040402
  * [7] Peng Ye and Zheng-Cheng Gu  “Topological quantum field theory of three-dimensional bosonic Abelian-symmetry-protected topological phases”  In _Phys. Rev. B_ 93.20, 2016, pp. 205157  DOI: 10.1103/PhysRevB.93.205157
  * [8] Apoorv Tiwari, Xiao Chen and Shinsei Ryu  “Wilson operator algebras and ground states of coupled BF theories”  In _Phys. Rev. B_ 95.24, 2017, pp. 245124  DOI: 10.1103/PhysRevB.95.245124
  * [9] Liujun Zou and Jeongwan Haah  “Spurious long-range entanglement and replica correlation length”  In _Phys. Rev. B_ 94.7, 2016, pp. 075151  DOI: 10.1103/PhysRevB.94.075151
  * [10] Isaac H. Kim, Michael Levin, Ting-Chun Lin, Daniel Ranard and Bowen Shi  “Universal lower bound on topological entanglement entropy”, 2023  arXiv:2302.00689 [quant-ph]
  * [11] P.. Buividovich and M.. Polikarpov  “Entanglement entropy in gauge theories and the holographic principle for electric strings”  In _Phys. Lett. B_ 670, 2008, pp. 141–145  DOI: 10.1016/j.physletb.2008.10.032
  * [12] P.. Buividovich and M.. Polikarpov  “Numerical study of entanglement entropy in SU(2) lattice gauge theory”  In _Nucl. Phys. B_ 802, 2008, pp. 458–474  DOI: 10.1016/j.nuclphysb.2008.04.024
  * [13] P.. Buividovich and M.. Polikarpov  “Entanglement entropy in lattice gauge theories”  In _PoS_ CONFINEMENT8, 2008, pp. 039  DOI: 10.1088/1751-8113/42/30/304005
  * [14] Jennifer Cano, Taylor L. Hughes and Michael Mulligan  “Interactions along an Entanglement Cut in 2+1D Abelian Topological Phases”  In _Phys. Rev. B_ 92.7, 2015, pp. 075104  DOI: 10.1103/PhysRevB.92.075104
  * [15] Hui Li and F. Haldane  “Entanglement Spectrum as a Generalization of Entanglement Entropy: Identification of Topological Order in Non-Abelian Fractional Quantum Hall Effect States”  In _Phys. Rev. Lett._ 101.1, 2008, pp. 010504  DOI: 10.1103/PhysRevLett.101.010504
  * [16] Anushya Chandran, M Hermanns, N Regnault and B Andrei Bernevig  “Bulk-edge correspondence in entanglement spectra”  In _Physical Review B_ 84.20 APS, 2011, pp. 205136
  * [17] Brian Swingle and T. Senthil  “A Geometric proof of the equality between entanglement and edge spectra”  In _Phys. Rev. B_ 86, 2012, pp. 045117  DOI: 10.1103/PhysRevB.86.045117
  * [18] Xiao-Liang Qi  “General Relationship between the Entanglement Spectrum and the Edge State Spectrum of Topological Quantum States”  In _Physical Review Letters_ 108.19, 2012  DOI: 10.1103/PhysRevLett.108.196402
  * [19] William Donnelly  “Decomposition of entanglement entropy in lattice gauge theory”  In _Phys. Rev. D_ 85, 2012, pp. 085004  DOI: 10.1103/PhysRevD.85.085004
  * [20] Horacio Casini, Marina Huerta and Jose Alejandro Rosabal  “Remarks on entanglement entropy for gauge fields”  In _Phys. Rev. D_ 89.8, 2014, pp. 085012  DOI: 10.1103/PhysRevD.89.085012
  * [21] William Donnelly and Aron C. Wall  “Entanglement entropy of electromagnetic edge modes”  In _Phys. Rev. Lett._ 114.11, 2015, pp. 111603  DOI: 10.1103/PhysRevLett.114.111603
  * [22] Ronak M Soni and Sandip P. Trivedi  “Aspects of Entanglement Entropy for Gauge Theories”  In _JHEP_ 01, 2016, pp. 136  DOI: 10.1007/JHEP01(2016)136
  * [23] Jennifer Lin and Đorđe Radičević  “Comments on defining entanglement entropy”  In _Nucl. Phys. B_ 958, 2020, pp. 115118  DOI: 10.1016/j.nuclphysb.2020.115118
  * [24] Ðorđe Radičević  “Entanglement in Weakly Coupled Lattice Gauge Theories”  In _JHEP_ 04, 2016, pp. 163  DOI: 10.1007/JHEP04(2016)163
  * [25] Tarun Grover, Ari M. Turner and Ashvin Vishwanath  “Entanglement Entropy of Gapped Phases and Topological Order in Three dimensions”  In _Phys. Rev. B_ 84, 2011, pp. 195120  DOI: 10.1103/PhysRevB.84.195120
  * [26] Vijay Balasubramanian, Jackson R. Fliss, Robert G. Leigh and Onkar Parrikar  “Multi-Boundary Entanglement in Chern-Simons Theory and Link Invariants”  In _JHEP_ 04, 2017, pp. 061  DOI: 10.1007/JHEP04(2017)061
  * [27] Clement Delcamp, Bianca Dittrich and Aldo Riello  “On entanglement entropy in non-Abelian lattice gauge theory and 3D quantum gravity”  In _JHEP_ 11, 2016, pp. 102  DOI: 10.1007/JHEP11(2016)102
  * [28] Chris Akers, Ronak Soni and Annie Wei  “to appear”
  * [29] Jackson R. Fliss and Stathis Vitouladitis  “in preparation”
  * [30] Mario Bergeron, Gordon W. Semenoff and Richard J. Szabo  “Canonical bf type topological field theory and fractional statistics of strings”  In _Nucl. Phys. B_ 437, 1995, pp. 695–722  DOI: 10.1016/0550-3213(94)00503-7
  * [31] Matthias Blau and George Thompson  “Topological Gauge Theories of Antisymmetric Tensor Fields”  In _Annals Phys._ 205, 1991, pp. 130–172  DOI: 10.1016/0003-4916(91)90240-9
  * [32] J. Gegenberg and G. Kunstatter  “The Partition function for topological field theories”  In _Annals Phys._ 231, 1994, pp. 270–289  DOI: 10.1006/aphy.1994.1043
  * [33] Matthias Blau, Mbambu Kakona and George Thompson  “Massive Ray-Singer Torsion and Path Integrals”  arXiv, 2022  arXiv:2206.12268 [hep-th]
  * [34] Horacio Casini, Marina Huerta, Javier M. Magán and Diego Pontello  “Entanglement entropy and superselection sectors. Part I. Global symmetries”  In _JHEP_ 02, 2020, pp. 014  DOI: 10.1007/JHEP02(2020)014
  * [35] Karel Van Acoleyen, Nick Bultinck, Jutho Haegeman, Michael Marien, Volkher B. Scholz and Frank Verstraete  “The entanglement of distillation for gauge theories”  In _Phys. Rev. Lett._ 117.13, 2016, pp. 131602  DOI: 10.1103/PhysRevLett.117.131602
  * [36] Jackson R. Fliss, Xueda Wen, Onkar Parrikar, Chang-Tse Hsieh, Bo Han, Taylor L. Hughes and Robert G. Leigh  “Interface Contributions to Topological Entanglement in Abelian Chern-Simons Theory”  In _JHEP_ 09, 2017, pp. 056  DOI: 10.1007/JHEP09(2017)056
  * [37] Jackson R. Fliss and Robert G. Leigh  “Interfaces and the extended Hilbert space of Chern-Simons theory”  In _JHEP_ 07, 2020, pp. 009  DOI: 10.1007/JHEP07(2020)009
  * [38] Hong Chen Jiang, Zhenghan Wang and Leon Balents  “Identifying topological order by entanglement entropy”  In _Nature Phys._ 8.12, 2012, pp. 902–905  DOI: 10.1038/nphys2465
  * [39] Xueda Wen, Shunji Matsuura and Shinsei Ryu  “Edge theory approach to topological entanglement entropy, mutual information and entanglement negativity in Chern-Simons theories”  In _Phys. Rev. B_ 93.24, 2016, pp. 245140  DOI: 10.1103/PhysRevB.93.245140
  * [40] Javier M. Magan and Diego Pontello  “Quantum Complementarity through Entropic Certainty Principles”  In _Phys. Rev. A_ 103.1, 2021, pp. 012211  DOI: 10.1103/PhysRevA.103.012211
  * [41] Chao-Ming Jian, Isaac H. Kim and Xiao-Liang Qi  “Long-range mutual information and topological uncertainty principle”, 2015  arXiv:1508.07006 [cond-mat.str-el]
  * [42] Kevin Slagle  “Foliated Quantum Field Theory of Fracton Order”  In _Phys. Rev. Lett._ 126.10, 2021, pp. 101603  DOI: 10.1103/PhysRevLett.126.101603
  * [43] Davide Gaiotto, Anton Kapustin, Nathan Seiberg and Brian Willett  “Generalized Global Symmetries”  In _JHEP_ 02, 2015, pp. 172  DOI: 10.1007/JHEP02(2015)172
  * [44] Lakshya Bhardwaj and Yuji Tachikawa  “On finite symmetries and their gauging in two dimensions”  In _JHEP_ 03, 2018, pp. 189  DOI: 10.1007/JHEP03(2018)189
  * [45] Clay Cordova, Thomas T. Dumitrescu, Kenneth Intriligator and Shu-Heng Shao  “Snowmass White Paper: Generalized Symmetries in Quantum Field Theory and Beyond”  In _Snowmass 2021_ , 2022  arXiv:2205.09545 [hep-th]
  * [46] Daniel S. Freed, Gregory W. Moore and Constantin Teleman  “Topological symmetry in quantum field theory”, 2022  arXiv:2209.07471 [hep-th]
  * [47] Davide Gaiotto and Justin Kulp  “Orbifold groupoids”  In _JHEP_ 02, 2021, pp. 132  DOI: 10.1007/JHEP02(2021)132
  * [48] Fabio Apruzzi, Federico Bonetti, Iñaki Garcı́a Etxebarria, Saghar S. Hosseini and Sakura Schafer-Nameki  “Symmetry TFTs from String Theory”, 2021  arXiv:2112.02092 [hep-th]
  * [49] Daniel Harlow and Hirosi Ooguri  “Symmetries in quantum field theory and quantum gravity”  In _Commun. Math. Phys._ 383.3, 2021, pp. 1669–1804  DOI: 10.1007/s00220-021-04040-y
  * [50] Daniel Harlow and Edgar Shaghoulian  “Global symmetry, Euclidean gravity, and the black hole information problem”  In _JHEP_ 04, 2021, pp. 175  DOI: 10.1007/JHEP04(2021)175
  * [51] Chang-Tse Hsieh, Yuji Tachikawa and Kazuya Yonekura  “Anomaly Inflow and p-Form Gauge Theories”  In _Commun. Math. Phys._ 391.2, 2022, pp. 495–608  DOI: 10.1007/s00220-022-04333-w
  * [52] Araminta Amabel, Arun Debray and Peter J. Haine  “Differential Cohomology: Categories, Characteristic Classes, and Connections”, 2021  arXiv:2109.12250 [math.AT]
  * [53] Allen Hatcher  “Algebraic topology”  Cambridge University Press, 2002  URL: https://pi.math.cornell.edu/~hatcher/AT/ATpage.html