# Comparing the Utility and Disclosure Risk of Synthetic Data with Samples of
Microdata

Claire Little
School of Social Sciences
University of Manchester
Manchester, M13 9PL, UK
<EMAIL_ADDRESS>
Mark Elliot
School of Social Sciences
University of Manchester
Manchester, M13 9PL, UK
<EMAIL_ADDRESS>
Richard Allmendinger
Alliance Manchester Business School
University of Manchester
Manchester, M13 9PL, UK
<EMAIL_ADDRESS>

###### Abstract

Most statistical agencies release randomly selected samples of Census
microdata, usually with sample fractions under 10% and with other forms of
statistical disclosure control (SDC) applied. An alternative to SDC is data
synthesis, which has been attracting growing interest, yet there is no clear
consensus on how to measure the associated utility and disclosure risk of the
data. The ability to produce synthetic Census microdata, where the utility and
associated risks are clearly understood, could mean that more timely and
wider-ranging access to microdata would be possible.

This paper follows on from previous work by the authors which mapped synthetic
Census data on a risk-utility (R-U) map. The paper presents a framework to
measure the utility and disclosure risk of synthetic data by comparing it to
samples of the original data of varying sample fractions, thereby identifying
the sample fraction which has equivalent utility and risk to the synthetic
data. Three commonly used data synthesis packages are compared with some
interesting results. Further work is needed in several directions but the
methodology looks very promising.

_Keywords_ Data Synthesis $\cdot$ Microdata $\cdot$ Disclosure Risk $\cdot$
Data Utility

##  1 Introduction

Many statistical agencies release randomly selected Census samples to
researchers (and sometimes publicly), usually with sample fractions under 10%
and with other forms of statistical disclosure control (SDC) [14] applied.
However, as noted by Drechsler et al. [8], intruders (or malicious users) are
becoming more sophisticated and agencies using standard SDC techniques may
need to apply them with higher intensity, leading to the released data being
of reduced quality for statistical analysis.

An alternative to SDC is data synthesis [38, 21], which takes original data
and produces an artificial dataset with the same structure and statistical
properties as the original, but that (in the case of fully synthetic data)
does not contain any of the original records. As the data is synthetic,
attributes which are normally suppressed, aggregated or top-coded (such as
geographical area or income) may then be included, allowing more complete
analysis. As no synthetic record should correspond to a real individual, fully
synthetic data should present very low disclosure risk – the risk of re-
identification is not meaningful, although there is still likely to be a
residual risk of attribution [41]. Interest in synthetic data is growing, yet
there is no clear consensus on how to measure the associated utility and
disclosure risk of the data, such that users may have an understanding of how
closely a synthetic dataset relates to the original data.

This paper follows on from previous work [20], which mapped synthetic Census
data on the risk-utility (R-U) map, and presents a framework to measure the
utility and disclosure risk of synthetic data by comparing it against random
samples of the original data of varying sample fractions, thereby identifying
the sample fraction equivalence of the synthetic dataset. For instance, a
particular synthetic dataset might be equivalent in terms of utility to a 20%
sample of the original data, and in terms of disclosure risk to a 10% sample.
Since Census microdata tends to be released with sample fractions between 1%
to 10%, the ability to determine how a synthetic dataset compares in terms of
utility and disclosure risk would allow data producers a greater understanding
of the appropriateness of their synthetic data. To test our framework, we
performed experiments using four Census microdata sets with synthetic data
generated using three state-of-the-art data synthesis methods (CTGAN [45],
Synthpop [25] and DataSynthesizer [29]).

Section 2 provides a brief introduction to the data synthesis problem,
particularly in terms of microdata, and an introduction to the data synthesis
methods. Section 3 outlines the design of the study, describing the methods
and the Census data used. Section 4 provides the results whilst Section 5
considers the findings, and Section 6 concludes with directions for future
research.

##  2 Background

###  2.1 Data Synthesis

Rubin [38] first introduced the idea of synthetic data as a confidentiality
protection mechanism in 1993, proposing using multiple imputation on all
variables such that none of the original data was released. In the same year,
Little [21] proposed an alternative that simulated only sensitive variables,
thereby producing partially synthetic data. Rubin’s idea was slow to be
adopted, as noted by Raghunathan et al. [32], who along with Reiter [35, 36,
37], formalised the synthetic data problem. Further work (e.g. [34, 8, 9]) has
involved using non-parametric data synthesis methods such as classification
and regression trees (CART) and random forests and more recently deep learning
methods such as Generative Adversarial Networks [12] have also been used to
generate synthetic data.

There are two competing objectives when producing synthetic data: high data
utility (i.e., ensuring that the synthetic data is useful, with a distribution
close to the original) and low disclosure risk. Balancing this trade-off can
be difficult, as, in general, reducing disclosure risk comes with a
concomitant cost for utility. This trade-off can be visualised using the R-U
confidentiality map developed by Duncan et al. [10]. There are multiple
measures of utility, ranging from comparing summary statistics, correlations
and cross-tabulations, to considering data performance using predictive
algorithms. However, for synthetic data there are fewer that measure
disclosure risk. As noted by Taub et al. [41], much of the SDC literature
focuses on re-identification risk, which is not meaningful for synthetic data,
rather than the attribution risk, which is relevant. The Targeted Correct
Attribution Probability (TCAP) [11, 41] can be used to assess attribution
risk.

###  2.2 Synthetic Census Microdata

Since Census microdata is predominantly categorical, it requires synthesis
methods that can handle categorical data. CART, a non-parametric method
developed by Breiman et al. [3], can handle mixed type (and missing) data, and
can capture complex interactions and non-linear relationships. CART is a
predictive technique that recursively partitions the predictor space, using
binary splits, into relatively homogeneous groups; the splits can be
represented visually as a tree structure, meaning that models can be
intuitively understood (where the tree is not too complex). Reiter [34] used
CART to generate partially synthetic microdata, as did Drechsler and Reiter
[8], who replaced sensitive variables in the data with multiple imputations
and then sampled from the multiply-imputed populations. Random forests,
developed by Breiman [2], is an ensemble learning method and an extension to
CART in that the method grows multiple trees. Random forests were used to
synthesise a sample of the Ugandan Census [9] and to generate partially
synthetic microdata [4].

Synthpop, an open source package written in the R programming language,
developed by Nowok et al. [25], uses CART as the default method of synthesis
(other options include random forests and various parametric alternatives).
Since CART is a commercial product, Synthpop uses an open source
implementation of the algorithm provided by the rpart package [43]. Synthpop
synthesises the data sequentially, one variable at a time; the first is
sampled, then the following are synthesised using the previous variables as
predictors. Whilst an advantage of Synthpop is that it requires little tuning
and performs very quickly, a disadvantage is that it (and tree-based methods
in general) can struggle computationally with variables that contain many
categories. As suggested by Raab et al. [31] methods to deal with this include
aggregation, sampling, changing the sequence order of the variables and
excluding variables from being used as predictors. Synthpop has been used to
produce synthetic longitudinal microdata [26] and synthetic Census microdata
[42, 30].

Another method that can process mixed type data is DataSynthesizer, developed
by Ping et al. [29], a Python package that implements a version of the
PrivBayes [46] algorithm. PrivBayes constructs a Bayesian network that models
the correlations in the data, allowing approximation of the distribution using
a set of low-dimensional marginals. Noise is injected into each marginal to
ensure differential privacy and the noisy marginals and Bayesian network are
then used to construct an approximation of the data distribution. PrivBayes
then draws samples from this to generate a synthetic dataset. DataSynthesizer
allows the level of differential privacy to be set by the user, or turned off.
It has been used to generate health data [33] and in exploratory studies [13,
7, 24].

In the field of deep learning [19], Generative Adversarial Networks (GANs)
have been generating much research interest and have been used for various
applications, although as detailed by Wang et al. [44] these are predominantly
in the image domain. GANs, developed by Goodfellow et al. [12], typically
train two neural network (NN) models: a generative model that captures the
data distribution and generates new data samples, and a discriminative model
that aims to determine whether a sample is from the model distribution or the
data distribution. The models are trained together in an adversarial zero-sum
game, such that the generator goal is to produce data samples that fool the
discriminator into believing they are real and the discriminator goal is to
determine which samples are real and which are fake. Training is iterative
with (ideally) both models improving over time to the point where the
discriminator can no longer distinguish which data is real or fake. From a
data synthesis perspective GANs are interesting in that the generative model
does not access the original (or training) data at all, and starts off with
only noise as input; in theory this might reduce disclosure risk.

GANs for image generation tend to deal with numerical, homogeneous data; in
general, they must be adapted to deal with Census microdata, which is likely
to be heterogeneous, containing imbalanced categorical variables, and skewed
or multimodal numerical distributions. Several studies have done this by
adapting the GAN architecture, these are often referred to as tabular GANs
(e.g. [5, 28, 47, 6]). CTGAN, or Conditional Tabular GAN, developed by Xu et
al. [45] uses “mode-specific normalisation” to overcome non-Gaussian and
multimodal distribution problems, and employs oversampling methods and a
conditional generator to handle class imbalance in the categorical variables.
In their study CTGAN outperformed Bayesian methods, and other GANs, for
generating mixed type synthetic data.

National statistical agencies have released synthetic versions of microdata
using forms of multiple imputation. The United States Census Bureau releases a
synthetic version of the Longitudinal Business Database (SynLBD) [18], the
Survey of Income and Program Participation (SIPP) Synthetic Beta [1] and the
OnTheMap application [22]. Whilst governmental organisations have not so far
released synthetic microdata created using deep learning methods, research in
this area is ongoing (e.g. [16, 15]).

##  3 Research Design

To determine the sample equivalence, the risk and utility of generated
synthetic Census data was compared to the risk and utility of samples of the
original Census data (of various sample fractions).111Note that, for
calculating the risk and utility, the sample data was treated in the same way
as the synthetic data, namely by comparing against the original data. However,
for simplicity, in the metric descriptions only synthetic data is mentioned.
Four different Census microdata sets were used to demonstrate results on
datasets from different underlying population data structures. Three state-of-
the-art data synthesis methods were used to generate the synthetic data, each
using the default parameters. To obtain consistent results, multiple datasets
were generated (using different random seeds) for the sample and synthetic
data, and the mean of the utility and risk metrics for each calculated. 222The
project code is available here:
https://github.com/clairelittle/psd2022-comparing-utility-risk

###  3.1 Data Synthesisers

The methods used were Synthpop [25], DataSynthesizer [29] and CTGAN [45].
These were selected as they are established, open-source methods that should
produce good quality data. Whilst the focus of these experiments was on
evaluating the resulting utility and risk of the generated data, rather than
the individual methods, for DataSynthesizer the differential privacy parameter
was varied in order to understand how the use of differential privacy affects
the quality and risk of the synthetic data and how such differentially private
synthetic datasets compare to samples. For each parameter setting, five fully
synthetic datasets were generated, each using a different random seed.

Synthpop Version 1.7-0 of Synthpop was used with default parameters. As
described in Section 2.2, Synthpop allows the sequence order of the variables
to be set by the user, however there is no default for this (other than the
ordering the data is in). Since the Census microdata used for these
experiments is predominantly categorical, with many variables containing many
categories, and it is known that Synthpop can struggle with variables
containing many categories, the visit sequence was set such that variables
were ordered by the minimum to maximum number of categories, with numerical
variables first (and a tie decided by ordering alphabetically). Moving
variables with many categories to the end of the sequence is suggested by Raab
et al. [31].

DataSynthesizer Version 0.1.9 of DataSynthesizer (described in Section 2.2)
was used with Correlated Attribute mode (which implements the PrivBayes [46]
algorithm). Default parameters were used, whilst differing the Differential
Privacy (DP) parameter. DP is controlled by the $\epsilon$ parameter and a
value of zero turns DP off. Four different values were used (DP = off,
$\epsilon=0.1$, 1, and 10). Lower values of $\epsilon$ tend to be used in
practise, but the range of values aims to understand the effect at both the
higher and lower end, as well as turning off DP altogether.

CTGAN Version 0.4.3 of CTGAN was used for all experiments. CTGAN as described
in Section 2.2, is a Conditional GAN implemented in Python. There are many
hyperparameters that might be altered for a GAN; the default values were used,
with the number of epochs set at 300.

###  3.2 Data

Four Census microdatasets were used, each from a different continent. Each
dataset contains individual records, pertaining to adults and children. The
variables include demographic information such as age, sex and marital status
(i.e., variables that are often considered key identifiers) and a broad
selection of variables pertaining to employment, education, ethnicity, family,
etc. Each dataset contained the same key variables, and target variables that
broadly cover the same overall themes. The purpose of using multiple datasets
was not to directly compare the countries, but rather to determine whether any
patterns uncovered during the experiments were replicated on similar (but not
identical) datasets. Table 1 describes the data in terms of sample size and
features.

Table 1: Census Data Summary Dataset | Sample size |  $\\#$Total Variables |  $\\#$Categorical |  $\\#$Numerical
---|---|---|---|---
Canada 2011 | 32149 | 25 | 21 | 4
Fiji 2007 | 84323 | 19 | 18 | 1
Rwanda 2012 | 31455 | 21 | 20 | 1
UK 1991 | 104267 | 15 | 13 | 2

The data was minimally preprocessed and missing values were retained. Three of
the datasets (UK [27], Canada [23] and Rwanda [23]) were subsetted on a
randomly selected geographical region; this was to reduce data size and also
to naturally reduce the categories for some of the variables. The entire Fiji
sample [23] was used. Appendix A contains a summary of the datasets.

Creating the Census Data Samples For each Census dataset, random samples
(without replacement) of increasing sizes were drawn (0.1%, 0.25%, 0.5%, 1%,
2%, 3%, 4%, 5%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 95%, 96%, 97%,
98%, 99%). A focus was placed on those sample fractions closer to zero since
released Census samples tend to be relatively small, and closer to 100% to map
the data as it became closer in size to the original. For each sample fraction
100 datasets were generated (with different random seeds), and the results of
the individual risk and utility measures averaged.

###  3.3 Measuring Disclosure Risk Using TCAP

Elliot [11] and Taub et al. [41] introduced a measure for the disclosure risk
of synthetic data called the Correct Attribution Probability (CAP) score. The
disclosure risk is calculated using an adaptation used in Taub et al. [40]
called the Targeted Correct Attribution Probability (TCAP). TCAP is based on a
scenario whereby an intruder has partial knowledge about a particular
individual. That is, they know the values for some of the variables in the
dataset (the keys) and also that the individual is in the original
dataset333This is a strong assumption, which has the benefit of then
dominating most other scenarios, the one possible exception is a presence
detection attack. However, for Census data, presence detection is vacuous, and
the response knowledge assumption is sound by definition., and wish to infer
the value of a sensitive variable (the target) for that individual. The TCAP
metric is then the probability that those matched records yield a correct
value for the target variable (i.e. that the adversary makes a correct
attribution inference).

TCAP has a value between 0 and 1; a low value would indicate that the
synthetic dataset carries little risk of disclosure whereas a TCAP score close
to 1 indicates a higher risk. However, a baseline value can be calculated
(this is essentially the probability of the intruder being correct if they
drew randomly from the univariate distribution of the target variable) and
therefore a TCAP value above the baseline might indicate some disclosure risk.
Given this, we have chosen to scale the TCAP value between the baseline and a
value of 1. This does create the possibility of a synthetic dataset receiving
a negative TCAP score (which can still be plotted on the R-U map) but that
simply indicates a risk level below that of the baseline. We refer to the
scaled TCAP value as the marginal TCAP; i.e. it is the increase in risk above
the baseline.

For each Census dataset, three target and six key variables were identified
and the corresponding TCAP scores calculated for sets of 3, 4, 5 and 6 keys.
The overall mean of the TCAP scores was then calculated as the overall
disclosure risk score. Where possible, the selected key/target variables were
consistent across each country. Full details of the target and key variables
are in Appendix B.

###  3.4 Evaluating Utility

Following previous work by Little et al. [20] and Taub et al. [42], the
utility of the synthetic and sample data was assessed using multiple measures.
The confidence interval overlap (CIO) and ratio of counts/estimates (ROC) were
calculated. This was to provide a more complete picture of the utility, rather
than relying upon just one measure. The propensity score mean squared error
(pMSE) [39] was not used as, whilst it is suitable for analysing the synthetic
data it is not suited to the analysis of sample data as it is structurally
tied to the original data (since the sample data is a subset of the original
data).

To calculate the CIO (using 95% confidence intervals), the coefficients from
regression models built on the original and synthetic datasets are used. The
CIO, proposed by Karr et al. [17], is defined as:

${\textrm{CIO}}=\frac{1}{2}\bigg{\\{}\frac{\mbox{min}(u_{o},u_{s})-\mbox{max}(l_{o},l_{s})}{u_{o}-l_{o}}+\frac{\mbox{min}(u_{o},u_{s})-\mbox{max}(l_{o},l_{s})}{u_{s}-l_{s}}\bigg{\\}},$
(1)

where $u_{o}$, $l_{o}$ and $u_{s}$, $l_{s}$ denote the respective upper and
lower bounds of the confidence intervals for the original and synthetic data.
This can be summarised by the average across all regression coefficients, with
a higher CIO indicating greater utility (maximum value is 1 and a negative
value indicating no overlap). For each synthetic Census dataset, two logistic
regressions were performed, with the CIO for each calculated. The mean of
these two results (where a negative, or no overlap was counted as zero) was
taken as the overall CIO utility score for that dataset. Details of the
regression models for each dataset are presented in Appendix C.

Frequency tables and cross-tabulations are evaluated using the ROC, which is
calculated by taking the ratio of the synthetic and original data estimates
(where the smaller is divided by the larger one). Thus, given two
corresponding estimates (for example, the number of records with sex = female
in the original dataset, compared to the number in the synthetic dataset),
where $y_{orig}$ is the estimate from the original data and $y_{synth}$ is the
corresponding estimate from the synthetic data, the ROC is calculated as:

${\textrm{ROC}}=\frac{\mbox{min}(y_{orig},y_{synth})}{\mbox{max}(y_{orig},y_{synth})}.$
(2)

If $y_{orig}=y_{synth}$ then the ROC = 1. Where the original and synthetic
datasets are of different sizes (as is the case when calculating the ROC for
the various sample datasets) the proportion, rather than the count can be
used. The ROC was calculated over univariate and bivariate cross-tabulations
of the data, and takes a value between 0 and 1. For each variable the ROC was
averaged across categories to give an overall score.

To create an overall utility score for comparing against the overall
disclosure risk score (marginal TCAP), the mean of the ROC scores and the CIO
was calculated – a score closer to zero indicates lower utility; a score
closer to 1 indicates higher utility.444We recognise that averaging different
utility metrics may not be optimal and in future work we will consider an
explicitly multi-objective approach to utility optimisation. The results for
the synthetic and sample data were plotted on the R-U map for each country
separately.

##  4 Results

Fully synthetic datasets of the same size as the original were generated, and
no post-processing was performed on the data. For Synthpop and CTGAN five
different models were created (using different random seeds) and a synthetic
dataset generated for each. The mean utility and risk over the five datasets
is plotted on the R-U map. For DataSynthesizer five different models for each
value of $\epsilon$ were created and a point (the mean over the 5) is plotted
for each of a series of values for $\epsilon$. Fig. 1 illustrates the R-U map
for the UK 1991 Census data. The sample fractions form a curved line, with a
point representing each increasing sample fraction (from left to right). The
utility starts to drop quite steeply once the sample fraction drops below
about 3%. Both the risk and utility of the data at 100% (i.e. the whole
original sample) is necessarily 1. The synthetic datasets are plotted
alongside the different sample fractions to illustrate how they compare with
the sample data. Considering Fig. 1 the Synthpop point falls almost on the
sample curve, meaning it has utility and disclosure risk equivalence of
between a 10% and 20% sample of the original data. Plots for the other three
Census datasets are contained in Appendix D.

Figure 1: Risk-Utility map plotting the mean synthetic data and sample
fraction results for UK 1991 Census data. DP stands for Differential Privacy.

Table 6 provides detail on the utility and risk (mean over five datasets) of
the synthetic data for each of the Census datasets together with the
associated sample fraction equivalence.555Standard deviation not included for
clarity as this was generally small, $<$0.01 A synthetic dataset with higher
sample fraction equivalence for utility but lower sample fraction equivalence
for risk would be optimal from the point of view of synthetic data producers.
For all four data sets Synthpop has higher sample fraction equivalence for
utility than for risk. CTGAN has mixed results with two outcomes of higher
risk equivalence than utility (although all equivalences are low compared to
the other methods). The effect of different $\epsilon$ values can be observed
for DataSynthesizer. For $\epsilon$ = 0.1 the risk and utility equivalence is
less than a 0.1% sample (across all Census datasets); and all but the UK
dataset have a negative value for risk (meaning the risk is below the
baseline). Considering Figures 1 and D1 the DataSynthesizer points have a
curvilinear relationship with each other, although where they fall in relation
to the sample fractions equivalence varies between the four different Census
datasets.

Table 2: Synthetic data risk and utility (mean of 5 datasets), and comparable sample equivalence for each of the Census datasets.666Note that the values of $\epsilon$ indicated here are per dataset created, not for the whole synthesis process which will be five times as large given that m=5 Data | Synthesizer | Overall | Risk | Sample Equiv. | Sample Equiv.
---|---|---|---|---|---
|  | Utility | (marginal TCAP) | for Utility | for Risk
| CTGAN | 0.514 | 0.371 | 0.25% - 0.5% | 2% - 3%
| Synthpop | 0.774 | 0.516 | 10% - 20% | 10% - 20%
|  DataSynthesizer: |  |  |  |
UK 1991 | $\epsilon=0.1$ | 0.330 | 0.043 |  $<$0.1% |  $<$0.1%
| $\epsilon=1$ | 0.416 | 0.303 |  $<$0.1% | 0.1% - 0.25%
| $\epsilon=10$ | 0.536 | 0.424 | 0.25% - 0.5% | 5% - 10%
| No DP | 0.643 | 0.440 | 1% - 2% | 5% - 10%
| CTGAN | 0.495 | 0.165 | 0.25% - 0.5% |  $<$0.1%
| Synthpop | 0.830 | 0.294 | 20% - 30% | 2% - 3%
Canada |  DataSynthesizer: |  |  |  |
2011 | $\epsilon=0.1$ | 0.342 | -0.102 |  $<$0.1% |  $<$0.1%
| $\epsilon=1$ | 0.425 | 0.011 | 0.1% - 0.25% |  $<$0.1%
| $\epsilon=10$ | 0.521 | 0.126 | 0.25% - 0.5% |  $<$0.1%
| No DP | 0.688 | 0.231 | 3% - 4% | 1% - 2%
| CTGAN | 0.469 | 0.439 | 0.1% - 0.25% | 3% - 4%
| Synthpop | 0.816 | 0.555 | 20% - 30% | 10% - 20%
Fiji |  DataSynthesizer: |  |  |  |
2007 | $\epsilon=0.1$ | 0.301 | -0.173 |  $<$0.1% |  $<$0.1%
| $\epsilon=1$ | 0.360 | 0.233 |  $<$0.1% |  $<$0.1%
| $\epsilon=10$ | 0.477 | 0.414 | 0.1% - 0.25% | 2% - 3%
| No DP | 0.727 | 0.526 | 5% - 10% | 5% - 10%
| CTGAN | 0.430 | 0.412 | 0.5% - 1% | 0.25% - 0.5%
| Synthpop | 0.752 | 0.437 | 20% - 30% | 1% - 2%
Rwanda |  DataSynthesizer: |  |  |  |
2012 | $\epsilon=0.1$ | 0.203 | -0.404 |  $<$0.1% |  $<$0.1%
| $\epsilon=1$ | 0.259 | -0.045 |  $<$0.1% |  $<$0.1%
| $\epsilon=10$ | 0.373 | 0.230 | 0.1% - 0.25% |  $<$0.1%
| No DP | 0.720 | 0.413 | 10% - 20% | 0.25% - 0.5%

##  5 Discussion

The initial results are very interesting in several respects. Firstly the
risk-utility relationship for sample data is curvilinear. With risk dropping
fast at first as the sample reduces before utility declines rapidly with
smaller sample fractions. This is of course ideal and if repeated on larger
trial would be a vindication of the use of sampling as a default disclosure
control for Census microdata. The curve also indicates a sweet spot sample
fraction is around 2-3%, below this level there is little risk benefit and a
large decrease in utility. There is a big caveat to place on this finding,
which we will come to shortly. Second, the results are mixed when comparing
synthetic data and samples, with outcomes appearing to vary by country.
Synthpop generally performs well with the datasets it produced in each country
(other than UK) falling to the right of the risk utility curve for the
samples. CTGAN produced two results on the curve and two to the left of the
curve as did DataSynthesiser. This would need a more thorough investigation
before conclusions could be reached but the driver is presumably variations in
data structure.

Third, the impact of varying $\epsilon$ in data synthesiser was also
curvilinear but in the opposite less favourable direction (utility decreasing
first). Simply switching the differential privacy option on (but with a high
value of $\epsilon$) causes a substantial decrease in utility with little
appreciable impact on risk. The often advised level of $\epsilon=0.1$ produces
datasets that are right down in the left hand corner, with little utility and
no risk. This result if validated through larger scale studies would vindicate
that impression analysts have about the impact of differential privacy. The
above findings must be strongly caveated on three points.

  1. 1.

The experiments were conducted using samples of microdata. The experimental
samples were in fact sub-samples. The results may not generalise to full
population data (i.e. we should not assume that sub sample to sample
relationships will be replicated in sample to population ones). The true test
will be to compare synthetic populations with microdata samples.

  2. 2.

The study underestimates the risk of samples relative to synthetic data in
general. While we might reasonably assume that synthetic data do not contain
identification risk, this is not true for samples (by virtue of them being
drawn from real data).

  3. 3.

The risk measure employed here uses a response knowledge attribution
disclosure. This is sound for Census data but for other datasets, presence
detection might be a significant risk that would need to be taken account of.
In further work we will be examining this issue further.

##  6 Conclusion

This paper has introduced the notion of sample fraction equivalence risk and
utility. With experiments using Census data from four countries, we have
demonstrated a mechanism for comparison of data synthesis and sampling for
microdata. A second subsidiary aim was to bring differential privacy into the
same evaluation framework.

The results of the experiments are quite compelling and illustrate the value
of the approach. In future work we will be aiming to extend this initial study
in three ways: (i) to run experiments on full population data, (ii) to assess
other disclosure control methods for sample fraction equivalence, and (iii) to
integrate a measure of re-identification disclosure risk into the framework.

Acknowledgements The authors wish to acknowledge IPUMs International and the
statistical offices that provided the underlying data making this research
possible: Statistics Canada; Bureau of Statistics, Fiji; National Institute of
Statistics, Rwanda; and the Office for National Statistics, UK.

## References

  * Benedetto et al. [2018] G. Benedetto, M. H. Stinson, and J. M. Abowd.  The Creation and Use of the SIPP Synthetic Beta.  Technical Report November, U.S. Census Bureau, 2018.
  * Breiman [2001] L. Breiman.  Random forests.  _Machine Learning_ , 45(1):5–32, 2001.  ISSN 0885-6125.  doi:10.1023/A:1010933404324.
  * Breiman et al. [1984] L. Breiman, J. Friedman, C. J. Stone, and R. A. Olshen.  _Classification and Regression Trees_.  Wadsworth International Group, Belmont, California, 1984.  doi:10.1201/9781315139470.
  * Caiola and Reiter [2010] G. Caiola and J. P. Reiter.  Random forests for generating partially synthetic, categorical data.  _Trans. Data Privacy_ , 3(1):27–42, 2010.  ISSN 1888-5063.
  * Camino et al. [2018] R. Camino, C. Hammerschmidt, and R. State.  Generating multi-categorical samples with generative adversarial networks.  _arXiv preprint arXiv:1807.01202_ , 2018.
  * Chen et al. [2019] H. Chen, S. Jajodia, J. Liu, N. Park, V. Sokolov, and V. S. Subrahmanian.  Faketables: Using GANs to generate functional dependency preserving tables with bounded real data.  In _IJCAI_ , pages 2074–2080, 2019.  ISBN 9780999241141.  doi:10.24963/ijcai.2019/287.
  * Dankar et al. [2022] F. K. Dankar, M. K. Ibrahim, and L. Ismail.  A multi-dimensional evaluation of synthetic data generators.  _IEEE Access_ , 10:11147–11158, 2022.  doi:10.1109/ACCESS.2022.3144765.
  * Drechsler and Reiter [2010] J. Drechsler and J. P. Reiter.  Sampling with synthesis: A new approach for releasing public use census microdata.  _Journal of the American Statistical Association_ , 105(492):1347–1357, 2010.  ISSN 01621459.  doi:10.1198/jasa.2010.ap09480.
  * Drechsler and Reiter [2011] J. Drechsler and J. P. Reiter.  An empirical evaluation of easily implemented, nonparametric methods for generating synthetic datasets.  _Computational Statistics and Data Analysis_ , 55(12):3232–3243, 2011.  ISSN 01679473.  doi:10.1016/j.csda.2011.06.006.
  * Duncan et al. [2004] G. T. Duncan, S. A. Keller-McNulty, and S. L. Stokes.  Database Security and Confidentiality: Examining Disclosure Risk vs. Data Utility through the R-U Confidentiality Map.  Technical report, National Institute of Statistical Sciences, 2004.
  * Elliot [2014] M. Elliot.  Final Report on the Disclosure Risk Associated with the Synthetic Data Produced by the SYLLS Team.  Technical report, University of Manchester, 2014.  URL http://hummedia.manchester.ac.uk/institutes/cmist/archive-publications/reports/2015-02%20-Report%20on%20disclosure%20risk%20analysis%20of%20synthpop%20synthetic%20versions%20of%20LCF_%20final.pdf.
  * Goodfellow et al. [2014] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio.  Generative adversarial nets.  In _Advances in Neural Information Processing Systems_ , volume 27. Curran Associates, Inc., 2014.  URL https://proceedings.neurips.cc/paper/2014/file/5ca3e9b122f61f8f06494c97b1afccf3-Paper.pdf.
  * Hittmeir et al. [2019] M. Hittmeir, A. Ekelhart, and R. Mayer.  Utility and privacy assessments of synthetic data for regression tasks.  In _2019 IEEE International Conference on Big Data (Big Data)_ , pages 5763–5772, 2019.  doi:10.1109/BigData47090.2019.9005476.
  * Hundepool et al. [2012] A. Hundepool, J. Domingo-Ferrer, L. Franconi, S. Giessing, E. Schulte Nordholt, K. Spicer, and P.-P. de Wolf.  _Statistical disclosure control_.  Wiley series in survey methodology. John Wiley & Sons, Incorporated, 2012\.  ISBN 9781118348222.  doi:10.1002/9781118348239.
  * Joshi [2019] C. Joshi.  Generative adversarial networks (GANs) for synthetic dataset generation with binary classes, 2019.  URL https://datasciencecampus.ons.gov.uk/projects/generative-adversarial-networks-gans-for-synthetic-dataset-generation-with-binary-classes/.
  * Kaloskampis et al. [2020] I. Kaloskampis, C. Joshi, C. Cheung, D. Pugh, and L. Nolan.  Synthetic data in the civil service.  _Significance_ , 17(6):18–23, 2020.  ISSN 17409713.  doi:10.1111/1740-9713.01466.
  * Karr et al. [2006] A. F. Karr, C. N. Kohnen, A. Oganian, J. P. Reiter, and A. P. Sanil.  A framework for evaluating the utility of data altered to protect confidentiality.  _American Statistician_ , 60(3):224–232, 2006\.  doi:10.1198/000313006X124640.
  * Kinney et al. [2011] S. K. Kinney, J. P. Reiter, A. P. Reznek, J. Miranda, R. S. Jarmin, and J. M. Abowd.  Towards Unrestricted public use business microdata: The synthetic longitudinal business database.  _International Statistical Review_ , 79(3):362–384, 2011.  doi:10.1111/j.1751-5823.2011.00153.x.
  * LeCun et al. [2015] Y. LeCun, Y. Bengio, and G. Hinton.  Deep learning.  _Nature_ , 521(7553):436–444, 2015.  doi:10.1038/nature14539.
  * Little et al. [2021] C. Little, M. Elliot, R. Allmendinger, and S. S. Samani.  Generative Adversarial Networks for Synthetic Data Generation: A Comparative Study.  In _Joint UNECE/Eurostat Expert Meeting on Statistical Data Confidentiality_ , 2021.  URL https://unece.org/sites/default/files/2021-12/SDC2021_Day2_Little_AD.pdf.
  * Little [1993] R. J. A. Little.  Statistical Analysis of Masked Data.  _Journal of Official Statistics_ , 9(2):407–426, 1993.
  * Machanavajjhala et al. [2008] A. Machanavajjhala, D. Kifer, J. Abowd, J. Gehrke, and L. Vilhuber.  Privacy: Theory meets practice on the map.  In _2008 IEEE 24th International Conference on Data Engineering_ , pages 277–286, 2008.  ISBN 9781424418374.  doi:10.1109/ICDE.2008.4497436.
  * Minnesota Population Center. Integrated Public Use Microdata Series, International: Version 7.3 [dataset]. Minneapolis, MN: IPUMS [2020] Minnesota Population Center. Integrated Public Use Microdata Series, International: Version 7.3 [dataset]. Minneapolis, MN: IPUMS.  IPUMs Census Data, 2020.
  * Nixon et al. [2022] M. P. Nixon, A. F. Barrientos, J. P. Reiter, and A. Slavković.  A latent class modeling approach for generating synthetic data and making posterior inferences from differentially private counts, 2022.
  * Nowok et al. [2016] B. Nowok, G. M. Raab, and C. Dibben.  Synthpop: Bespoke creation of synthetic data in R.  _Journal of Statistical Software_ , 74(11), 2016.  ISSN 15487660.  doi:10.18637/jss.v074.i11.
  * Nowok et al. [2017] B. Nowok, G. M. Raab, and C. Dibben.  Providing bespoke synthetic data for the UK Longitudinal Studies and other sensitive data with the synthpop package for R.  _Statistical Journal of the IAOS_ , 33(3):785–796, 2017.  ISSN 18747655.  doi:10.3233/SJI-150153.
  * Office for National Statistics, Census Division, University of Manchester, Cathie Marsh Centre for Census and Survey Research [2013] Office for National Statistics, Census Division, University of Manchester, Cathie Marsh Centre for Census and Survey Research.  Census 1991: Individual Sample of Anonymised Records for Great Britain (SARs), 2013.
  * Park et al. [2018] N. Park, M. Mohammadi, K. Gorde, S. Jajodia, H. Park, and Y. Kim.  Data synthesis based on generative adversarial networks.  _Proceedings of the VLDB Endowment_ , 11(10):1071–1083, 2018.  ISSN 21508097.  doi:10.14778/3231751.3231757.
  * Ping et al. [2017] H. Ping, J. Stoyanovich, and B. Howe.  DataSynthesizer: Privacy-Preserving Synthetic Datasets.  In _Proceedings of the 29th International Conference on Scientific and Statistical Database Management_ , New York, NY, USA, 2017. ACM.  ISBN 9781450352826.  doi:10.1145/3085504.3091117.
  * Pistner et al. [2018] M. Pistner, A. Slavković, and L. Vilhuber.  Synthetic data via quantile regression for heavy-tailed and heteroskedastic data.  In J. Domingo-Ferrer and F. Montes, editors, _Privacy in Statistical Databases_ , pages 92–108. Springer International Publishing, 2018\.  ISBN 978-3-319-99771-1.  doi:10.1007/978-3-319-99771-1_7.
  * Raab et al. [2017] G. M. Raab, B. Nowok, and C. Dibben.  Guidelines for producing useful synthetic data, 2017.
  * Raghunathan et al. [2003] T. E. Raghunathan, J. P. Reiter, and D. B. Rubin.  Multiple Imputation for statistical disclosure limitation.  _Journal of Official Statistics_ , 19(1):1–16, 2003.
  * Rankin et al. [2020] D. Rankin, M. Black, R. Bond, J. Wallace, M. Mulvenna, and G. Epelde.  Reliability of supervised machine learning using synthetic data in health care: Model to preserve privacy for data sharing.  _JMIR Medical Informatics_ , 8(7), 2020.  ISSN 22919694.  doi:10.2196/18910.
  * Reiter [2005] J. Reiter.  Using CART to generate partially synthetic public use microdata.  _Journal of Official Statistics_ , 21(3):441–462, 2005.  ISSN 2001-7367.
  * Reiter [2002] J. P. Reiter.  Satisfying disclosure restrictions with synthetic data sets.  _Journal of Official Statistics_ , 18(4):531, 2002\.
  * Reiter [2003a] J. P. Reiter.  Inference for Partially Synthetic, Public Use Microdata Sets.  _Survey Methodology_ , 29(2):181–188, 2003a.
  * Reiter [2003b] J. P. Reiter.  Releasing multiply imputed, synthetic public use microdata: An illustration and empirical study.  _Journal of the Royal Statistical Society. Series A: Statistics in Society_ , 168(1):185–205, 2003b.  ISSN 09641998.  doi:10.1111/j.1467-985X.2004.00343.x.
  * Rubin [1993] D. B. Rubin.  Statistical Disclosure Limitation.  _Journal of Official Statistics_ , 9(2):461–468, 1993.  doi:10.1007/978-0-387-39940-9_3686.
  * Snoke et al. [2018] J. Snoke, G. M. Raab, B. Nowok, C. Dibben, and A. Slavkovic.  General and specific utility measures for synthetic data.  _Journal of the Royal Statistical Society. Series A: Statistics in Society_ , 181(3):663–688, 2018.  ISSN 1467985X.  doi:10.1111/rssa.12358.
  * Taub and Elliot [2019] J. Taub and M. Elliot.  The synthetic data challenge.  Joint UNECE/Eurostat Work Session on Statistical Data Confidentiality, https://unece.org/fileadmin/DAM/stats/documents/ece/ces/ge.46/2019/mtg1/SDC2019_S3_UK_Synthethic_Data_Challenge_Elliot_AD.pdf, 2019\.
  * Taub et al. [2018] J. Taub, M. Elliot, M. Pampaka, and D. Smith.  Differential Correct Attribution Probability for Synthetic Data: An Exploration.  In _Privacy in Statistical Databases_ , pages 122–137, 2018.  doi:10.1007/978-3-319-99771-1.
  * Taub et al. [2020] J. Taub, M. Elliot, and J. W. Sakshaug.  The impact of synthetic data generation on data utility with application to the 1991 UK samples of anonymised records.  _Transactions on Data Privacy_ , 13(1):1–23, 2020\.  ISSN 20131631.
  * Therneau et al. [2019] T. Therneau, E. Atkinson, and B. Ripley.  _Package ‘rpart’_ , 2019.  URL https://cran.r-project.org/package=rpart.
  * Wang et al. [2020] L. Wang, W. Chen, W. Yang, F. Bi, and F. R. Yu.  A State-of-the-Art Review on Image Synthesis with Generative Adversarial Networks.  _IEEE Access_ , 8:63514–63537, 2020.  ISSN 21693536.  doi:10.1109/ACCESS.2020.2982224.
  * Xu et al. [2019] L. Xu, M. Skoularidou, A. Cuesta-Infante, and K. Veeramachaneni.  Modeling tabular data using conditional GAN.  In _Advances in Neural Information Processing Systems_ , volume 32, Vancouver, Canada, 2019.  URL https://proceedings.neurips.cc/paper/2019/file/254ed7d2de3b23ab10936522dd547b78-Paper.pdf.
  * Zhang et al. [2017] J. Zhang, G. Cormode, C. M. Procopiuc, D. Srivastava, and X. Xiao.  PrivBayes: Private data release via Bayesian networks.  _ACM Transactions on Database Systems_ , 42(4), 2017.  doi:10.1145/3134428.
  * Zhao et al. [2021] Z. Zhao, A. Kunar, R. Birke, and L. Y. Chen.  Ctab-gan: Effective table data synthesizing.  In _Proceedings of 13th Asian Conference on Machine Learning_ , volume 157, pages 97–112. PMLR, 2021.  URL https://proceedings.mlr.press/v157/zhao21a.html.

## Appendices

### Appendix A

A brief summary of the Census microdata:

Canada 2011: Subsetted on the province of Manitoba, containing 32,149 records
(3.47% of the total available dataset, which was a 2.78% sample of the 2011
Census). Downloaded from IPUMs [23], courtesy of Statistics Canada.

Fiji 2007: The entire 10% sample (n=84,323) of the 2007 Fiji Census.
Downloaded from IPUMs [23] courtesy of the Bureau of Statistics, Fiji.

Rwanda 2012: Subsetted on the Karongi region, containing 31,455 records (3.03%
of the total available dataset, which was a 10% sample of the 2012 Census).
Downloaded from IPUMs [23] courtesy of the National Institute of Statistics,
Rwanda.

UK 1991: Subsetted on the region of West Midlands, containing 104,267 records
(9.34% of total available dataset, which was a 2% sample of the 1991
Individual Sample of Anonymised Records for the British Census). Downloaded
from UK Data Service [27].

### Appendix B

Summary of TCAP key/target variables. The six key variables are listed
together; the first three were used in the case of 3 keys, first four for 4
keys, etc.

Canada 2011: For target variables (RELIG, CITIZEN and TENURE) the key
variables were: AGE, SEX, MARST (marital status), MINORITY (part of a visible
minority), EMPSTAT (labour force status), BPL (birthplace).

Fiji 2007: For target variables (RELIGION, WORKTYPE and TENURE) the key
variables were: PROVINCE (of residence), AGE, SEX, MARST (marital status),
ETHNIC (part of a visible minority), CLASSWKR (employment status).

Rwanda 2012: For target variables (RELIGION, EMPSECTOR and OWNERSH (tenure))
the key variables were: AGE, SEX, MARST (marital status), CLASSWK (employment
status), URBAN (urban/rural area), BPL (birthplace).

UK 1991: For target variables (LTILL (long-term illness), FAMTYPE and TENURE)
the key variables were: AREAP, AGE, SEX, MSTATUS (marital status), ETHGROUP
(ethnic group), ECONPRIM (economic status).

### Appendix C

Description of regression models used to calculate the CIO. For each dataset
two logistic regressions were performed using marital status and housing
tenure as the targets (a binary target was created). Eight predictors were
used, these were the same for both models (with tenure/marital status removed
accordingly):

Canada predictors: ABIDENT (aboriginal identity), AGE, CLASSWK, DEGREE,
EMPSTAT, SEX, URBAN, TENURE/MARST

Fiji predictors: AGE, CLASSWKR, ETHNIC, RELIGION, EDATTAIN (educational level
attained), SEX, PROVINCE, TENURE/MARST

Rwanda predictors: AGE, DISAB1, EDCERT (highest educational qualification),
CLASSWK, LIT (languages spoken), RELIG, SEX, TENURE/MARST

UK predictors: AGE, ECONPRIM, ETHGROUP, LTILL, QUALNUM, SEX, SOCLASS,
TENURE/MSTATUS

### Appendix D

Figure D1: Risk-Utility map plotting the mean synthetic data and sample
fraction results for Fiji 2007, Canada 2011 and Rwanda 2012 Census data.


# Different forms of first order spin-orbit motion and their utility in spin
matching in electron storage rings††thanks: This work was supported in part by
the U.S. Department of Energy, Office of Science, Office of Workforce
Development for Teachers and Scientists under the Science Undergraduate
Laboratory Internships Program, and by Brookhaven Science Associates, LLC
under Contract Nos. DE-SC0012704 and DE-SC0018370 with the U.S. Department of
Energy.

M. G. Signorelli<EMAIL_ADDRESS>Cornell University, Ithaca, NY 14853 G. H.
Hoffstaetter  Cornell University, Ithaca, NY 14853 Brookhaven National
Laboratory, Upton, NY 11973

###### Abstract

We derive the first order phase space dependence of spin-orbit motion of a
particle in an accelerator by expanding the Thomas-BMT equation. Different
forms can be found in the literature and we show how these are related, and
care is taken to include fringe fields. The advantages of using these
different forms is demonstrated by two examples: a detailed re-derivation of
the spin matching conditions by V. I. Ptitsyn for the spin rotators in the
Electron Storage Ring (ESR) of the Electron-Ion Collider (EIC) at Brookhaven
National Laboratory, and a discussion of the spin matching conditions by D. P.
Barber for the anti-symmetric solenoidal spin rotators in the eRHIC Zeroth
Order Design.

##  1 First Order Spin-Orbit Motion

###  1.1 Thomas-BMT Equation

To specify the equation of motion for polarized particles, the right-handed,
co-moving orthonormal basis $(\hat{x},\hat{y},\hat{s})$ is used, where
$\hat{x}=\hat{x}(s)$ points in the horizontal, $\hat{y}=\hat{y}(s)$ in the
vertical, and $\hat{s}=\hat{s}(s)$ in the longitudinal, all at some position
$s$ along the trajectory of the particle. Whenever first order approximations
are made, an “$\approx$” sign is used. A subscript $0$ specifies a quantity
defined on the design orbit, which is assumed to be the zero orbit. We start
with the Thomas-BMT equation, which defines the rest-frame spin dynamics given
laboratory frame electromagnetic fields and momentum [1, 2, 3]. $\vec{S}$ is a
3-vector of the spin expectation values in each direction of the co-moving
coordinate system, and $\vec{\kappa}$ is a vector of the path curvatures in
the $x$ and $y$ directions [4]. The term $\vec{\kappa}\times\hat{s}$ in
$\vec{\Omega}_{t}$ accounts for the rotation of the coordinate system. The
equation of spin precession has the form

$\frac{d\vec{S}}{dt}=\vec{\Omega}_{t}\times\vec{S}\ ,\ \
\vec{\Omega}_{t}=-\frac{q}{\gamma
m}\left[(1+G\gamma)\vec{B_{\perp}}+(1+G)\vec{B_{\parallel}}+\left(G\gamma+\frac{\gamma}{1+\gamma}\right)\frac{\vec{E}\times\vec{\beta}}{c}\right]-\frac{ds}{dt}\vec{\kappa}\times\hat{s}\
.$ (1)

The time derivative of a particle’s position $\vec{r}$ gives the particle’s
velocity, where ′ denotes differentiation w.r.t. the position along the
trajectory $s$.

$\vec{r}=\vec{r}_{0}+x\hat{x}+y\hat{y}\ ,\ \
\vec{v}=\frac{d\vec{r}}{dt}=\frac{ds}{dt}\left[x^{\prime}\hat{x}+y^{\prime}\hat{y}+\left(1+\kappa_{x}x+\kappa_{y}y\right)\hat{s}\right]$
(2)

The phase space coordinates in which we subsequently linearize are the
deviations in position and slope from the reference trajectory, $x$, $y$,
$x^{\prime}$, $y^{\prime}$, and the relative momentum deviation
$\delta=\frac{p-p_{0}}{p_{0}}$. The velocity $v$ is

$v=\frac{ds}{dt}\sqrt{\left(1+\kappa_{x}x+\kappa_{y}y\right)^{2}+x^{\prime
2}+y^{\prime 2}}\approx\frac{ds}{dt}\left(1+\kappa_{x}x+\kappa_{y}y\right)\ .$
(3)

Making the substitution $\frac{d\vec{S}}{ds}=\frac{d\vec{S}}{dt}\frac{dt}{ds}$
and $\frac{q}{\gamma
m}=\frac{vq}{p}\approx\frac{q}{p}\frac{ds}{dt}\left(1+\kappa_{x}x+\kappa_{y}y\right)$,
the equation can be rewritten as
$\frac{d\vec{S}}{ds}=\vec{\Omega}\times\vec{S}$ with

$\vec{\Omega}\approx-\frac{q}{p}(1+\kappa_{x}x+\kappa_{y}y)\left[(1+G\gamma)\vec{B_{\perp}}+(1+G)\vec{B_{\parallel}}+\left(G\gamma+\frac{\gamma}{1+\gamma}\right)\frac{\vec{E}\times{\vec{\beta}}}{c}\right]-\vec{\kappa}\times\hat{s}\
.$ (4)

For the magnetic rigidity we linearize
$\frac{q}{p}\approx\frac{q}{p_{0}}\left(1-\delta\right)$. Next, expanding
$\gamma$ to first order around the design energy gives

$\displaystyle\gamma\approx\gamma_{0}+\Delta
p\left.\frac{d\gamma}{dp}\right\rvert_{p=p_{0}}=\gamma_{0}\left(1+\delta\frac{p_{0}}{\gamma_{0}}\left.\frac{d\gamma}{dp}\right\rvert_{p=p_{0}}\right)=\gamma_{0}\left(1+\beta_{0}^{2}\delta\right)\
,$ (5)

where $\gamma=\sqrt{1+(\frac{p}{mc})^{2}}$ was used. To first order, similarly

$\displaystyle\gamma\beta=\frac{p}{mc}\approx\gamma_{0}\beta_{0}\left(1+\delta\right)\
,$ (6)

and

$\frac{\gamma\beta}{1+\gamma}=\frac{\gamma_{0}\beta_{0}(1+\delta)}{1+\gamma_{0}}(1-\frac{\gamma_{0}\beta_{0}^{2}}{1+\gamma_{0}}\delta)=\frac{\gamma_{0}\beta_{0}}{1+\gamma_{0}}\left(1+\frac{\delta}{\gamma_{0}}\right)\
.$ (7)

Substituting these values into Eq. (4) gives the spin precession vector to
first order, with the unit vector $\hat{\beta}$ in the flight direction.

$\displaystyle\vec{\Omega}$
$\displaystyle\approx-\frac{q}{p_{0}}\Biggl{\\{}\left[\left(1+G\gamma_{0}\right)\left(1+\kappa_{x}x+\kappa_{y}y\right)-\left(1+\frac{G}{\gamma_{0}}\right)\delta\right]\vec{B}_{\perp}+\left(1+G\right)\left(1+\kappa_{x}x+\kappa_{y}y-\delta\right)\vec{B}_{\parallel}\Biggr{.}$
$\displaystyle\quad\quad\quad\quad\quad\Biggl{.}+\left[\left(G\gamma_{0}\beta_{0}+\frac{\gamma_{0}\beta_{0}}{1+\gamma_{0}}\right)\left(1+\kappa_{x}x+\kappa_{y}y\right)+\frac{\gamma_{0}\beta_{0}}{1+\gamma_{0}}\left(\frac{1}{\gamma_{0}}-1\right)\delta\right]\frac{\vec{E}\times\hat{\beta}}{c}\Biggr{\\}}-\vec{\kappa}\times\hat{s}$
(8)

The strengths of the horizontal bending, vertical bending, solenoidal,
quadrupole, and skew quadrupole magnetic fields are defined as functions of
$s$.

###  1.2 Magnetostatic Multipole Fields

The horizontal bending, vertical bending, solenoidal, quadrupole, and skew
quadrupole magnetic field strengths are defined as functions of $s$.

$\displaystyle\kappa_{x}$
$\displaystyle=\frac{q}{p_{0}}\left.B_{y}(x,y,s)\right\rvert_{(x,y)=(0,0)}$
(9a) $\displaystyle\kappa_{y}$
$\displaystyle=-\frac{q}{p_{0}}\left.B_{x}(x,y,s)\right\rvert_{(x,y)=(0,0)}$
(9b) $\displaystyle K_{s}$
$\displaystyle=\frac{q}{p_{0}}\left.B_{s}(x,y,s)\right\rvert_{(x,y)=(0,0)}$
(9c) $\displaystyle K_{1}$
$\displaystyle=\frac{q}{p_{0}}\left.\partial_{y}B_{x}(x,y,s)\right\rvert_{(x,y)=(0,0)}=\frac{q}{p_{0}}\left.\partial_{x}B_{y}(x,y,s)\right\rvert_{(x,y)=(0,0)}$
(9d) $\displaystyle\tilde{K}_{1}$
$\displaystyle=\frac{q}{2p_{0}}\left[\partial_{x}B_{x}(x,y,s)-\partial_{y}B_{y}(x,y,s)\right]_{(x,y)=(0,0)}$
(9e)

By Maxwell’s equations, $\vec{\nabla}\times\vec{B}=0$ and
$\vec{\nabla}\cdot\vec{B}=0$. This implies that $\vec{B}=-\vec{\nabla}\psi$
and $\nabla^{2}\psi=0$ where $\psi=\psi(x,y,s)$ is some scalar potential.
Expanding around the design orbit for first order magnetic fields, this gives

$\psi\approx\frac{p_{0}}{q}\left[-\int
K_{s}ds+\frac{x^{2}+y^{2}}{4}K_{s}^{\prime}-\kappa_{x}y+\kappa_{y}x-K_{1}xy+\frac{\tilde{K}_{1}}{2}\left(x^{2}-y^{2}\right)\right]\
,$ (10) $\displaystyle\vec{B}\approx$
$\displaystyle-\frac{p_{0}}{q}\left[\left(\frac{1}{2}K_{s}^{\prime}x+\kappa_{y}-K_{1}y+\tilde{K}_{1}x\right)\hat{x}+\left(\frac{1}{2}K_{s}^{\prime}y-\kappa_{x}-K_{1}x-\tilde{K}_{1}y\right)\hat{y}+\left(-K_{s}-\kappa_{x}^{\prime}y+\kappa_{y}^{\prime}x\right)\hat{s}\right]\
.$ (11)

The parallel field is

$\displaystyle\vec{B}_{\parallel}$
$\displaystyle=\frac{1}{v^{2}}\left(\vec{v}\cdot\vec{B}\right)\vec{v}$
$\displaystyle\approx-\frac{p_{0}}{q}\left[-K_{s}x^{\prime}\hat{x}-K_{s}y^{\prime}\hat{y}+\left(-K_{s}+\kappa_{y}x^{\prime}-\kappa_{x}y^{\prime}-\kappa_{x}^{\prime}y+\kappa_{y}^{\prime}x\right)\hat{s}\right]\
,$ (12)

and thus the perpendicular

$\displaystyle\vec{B}_{\perp}$ $\displaystyle=\vec{B}-\vec{B}_{\parallel}$
$\displaystyle\approx-\frac{p_{0}}{q}\left[\left(\frac{1}{2}K_{s}^{\prime}x+\kappa_{y}-K_{1}y+\tilde{K}_{1}x+K_{s}x^{\prime}\right)\hat{x}\right.$
$\displaystyle\quad\quad\quad\quad\quad\left.+\left(\frac{1}{2}K_{s}^{\prime}y-\kappa_{x}-K_{1}x-\tilde{K}_{1}y+K_{s}y^{\prime}\right)\hat{y}+\left(\kappa_{x}y^{\prime}-\kappa_{y}x^{\prime}\right)\hat{s}\right]\
.$ (13)

Subsituting Eq. (1.2) and Eq. (1.2) into Eq. (8) gives one form for
$\vec{\Omega}$ to first order. The two solenoid and dipole cross terms that
appear, $K_{s}\kappa_{x}x$ and $K_{s}\kappa_{y}y$, are assumed to be zero to
first order; that is, when there are overlapping solenoid and dipole fields,
one of them is small. Letting $\vec{\Omega}_{0}$ specify the zero orbit spin
precession and $\vec{\omega}$ the perturbative spin precession for first order
orbit motion, we obtain

$\displaystyle\Omega_{0x}$ $\displaystyle\approx G\gamma_{0}\kappa_{y}$ (14a)
$\displaystyle\Omega_{0y}$ $\displaystyle\approx-G\gamma_{0}\kappa_{x}$ (14b)
$\displaystyle\Omega_{0s}$ $\displaystyle\approx-\left(1+G\right)K_{s}\ ,$
(14c) $\displaystyle\omega_{x}$
$\displaystyle\approx\left(1+G\gamma_{0}\right)\left(\frac{1}{2}K_{s}^{\prime}x+\kappa_{y}^{2}y-K_{1}y+\tilde{K}_{1}x+\kappa_{x}\kappa_{y}x\right)+\left(G\gamma_{0}-G\right)K_{s}x^{\prime}-\left(1+\frac{G}{\gamma_{0}}\right)\kappa_{y}\delta$
(15a) $\displaystyle\omega_{y}$
$\displaystyle\approx\left(1+G\gamma_{0}\right)\left(\frac{1}{2}K_{s}^{\prime}y-\kappa_{x}^{2}x-K_{1}x-\tilde{K}_{1}y-\kappa_{x}\kappa_{y}y\right)+\left(G\gamma_{0}-G\right)K_{s}y^{\prime}+\left(1+\frac{G}{\gamma_{0}}\right)\kappa_{x}\delta$
(15b) $\displaystyle\omega_{s}$
$\displaystyle\approx-\left(1+G\right)\left(\kappa_{x}^{\prime}y-\kappa_{y}^{\prime}x-K_{s}\delta\right)+\left(G\gamma_{0}-G\right)\left(\kappa_{x}y^{\prime}-\kappa_{y}x^{\prime}\right)\
.$ (15c)

This form is used in the fast first-order spin tracking method Sprint, which
is implemented in Bmad using quarternions [5]. An equivalent form for
$\vec{\omega}$ can be obtained by substituting in the equations of motion,
defined by $\frac{d\vec{p}}{dt}=q\vec{v}\times\vec{B}$. The kinetic momentum
and its time derivative are

$\displaystyle\vec{p}$ $\displaystyle\approx
p_{0}\left[x^{\prime}\hat{x}+y^{\prime}\hat{y}+(1+\delta)\hat{s}\right]\ ,$
(16) $\displaystyle\frac{d\vec{p}}{dt}$
$\displaystyle\approx\frac{ds}{dt}p_{0}\left[\left(x^{\prime\prime}-\kappa_{x}(1+\delta)\right)\hat{x}+\left(y^{\prime\prime}-\kappa_{y}(1+\delta)\right)\hat{y}+\left(\kappa_{x}x^{\prime}+\kappa_{y}y^{\prime}\right)\hat{s}\right]\
.$ (17)

To first order, the equations of motion are thus

$\displaystyle x^{\prime\prime}-K_{s}y^{\prime}-\kappa_{x}\delta$
$\displaystyle\approx\frac{1}{2}K_{s}^{\prime}y-\kappa_{x}^{2}x-K_{1}x-\tilde{K}_{1}y-\kappa_{x}\kappa_{y}y\
\ ,$ (18) $\displaystyle-y^{\prime\prime}-K_{s}x^{\prime}+\kappa_{y}\delta$
$\displaystyle\approx\frac{1}{2}K_{s}^{\prime}x+\kappa_{y}^{2}y-K_{1}y+\tilde{K}_{1}x+\kappa_{x}\kappa_{y}x\
\ .$ (19)

Substituting Eq. (18) and Eq. (19) into Eq. (15) gives a different form of the
precession vector

$\displaystyle\omega_{x}$
$\displaystyle\approx-\left(1+G\gamma_{0}\right)y^{\prime\prime}-\left(1+G\right)K_{s}x^{\prime}+\left(G\gamma_{0}-\frac{G}{\gamma_{0}}\right)\kappa_{y}\delta$
(20a) $\displaystyle\omega_{y}$
$\displaystyle\approx\left(1+G\gamma_{0}\right)x^{\prime\prime}-\left(1+G\right)K_{s}y^{\prime}-\left(G\gamma_{0}-\frac{G}{\gamma_{0}}\right)\kappa_{x}\delta$
(20b) $\displaystyle\omega_{s}$
$\displaystyle\approx-\left(1+G\right)\left(\kappa_{x}^{\prime}y-\kappa_{y}^{\prime}x-K_{s}\delta\right)+\left(G\gamma_{0}-G\right)\left(\kappa_{x}y^{\prime}-\kappa_{y}x^{\prime}\right)\
.$ (20c)

In this form of $\vec{\omega}$, it is clear that the spin of a particle moving
through perpendicular fields precesses at rate of $(1+G\gamma_{0})$ greater
than that of the velocity vector precession $x^{\prime\prime}$ and
$y^{\prime\prime}$. This form proves useful for deriving spin matching
conditions, as shown in the next section.

##  2 Spin Matching Conditions

This section entirely follows the derivation and implementation of first order
spin matching methods by A. Chao in his SLIM formalism [6]. The right handed
orthonormal coordinate system $(\hat{n}_{0},\hat{m}_{0},\hat{l}_{0})$ is
defined, where $\hat{n}_{0}$ is the 1-turn periodic spin solution on the
closed orbit and $(\hat{m}_{0},\hat{l}_{0})$ precess around $\hat{n}_{0}$. The
number of precessions of $(\hat{m}_{0},\hat{l}_{0})$ around $\hat{n}_{0}$ on
the closed orbit per turn is the spin tune $\nu_{spin}$. By applying a further
rotation to “wind back” the spin tune each turn, the 1-turn periodic
coordinate system $(\hat{n}_{0},\hat{m},\hat{l})$ is constructed [7] where

$\hat{m}+i\hat{l}=e^{-i2\pi\nu_{spin}}\left(\hat{m}_{0}+i\hat{l}_{0}\right)\
.$ (21)

An individual particle’s spin can be expanded around the closed orbit periodic
spin direction as

$\displaystyle\vec{S}$
$\displaystyle=\sqrt{1-\alpha^{2}-\beta^{2}}\hat{n}_{0}+\alpha\hat{m}+\beta\hat{l}$
$\displaystyle\approx\hat{n}_{0}+\alpha\hat{m}+\beta\hat{l}\ ,$ (22)

where $\alpha$ and $\beta$ are small. Substitution of Eq. (22) into
$\frac{d\vec{S}}{ds}=\left(\vec{\Omega}_{0}+\vec{\omega}\right)\times\vec{S}$
and retaining only first order terms gives two differential equations for
$\alpha$ and $\beta$.

$\displaystyle\frac{d\alpha}{ds}$
$\displaystyle\approx\vec{\omega}\cdot\hat{l}$ (23a)
$\displaystyle\frac{d\beta}{ds}$
$\displaystyle\approx-\vec{\omega}\cdot\hat{m}$ (23b)

Letting $\vec{k}=\hat{l}-i\hat{m}$, first order spin matching may be achieved
by demanding that the 1-turn spin-orbit integral be equivalent to zero.

$\int_{s_{0}}^{s_{0}+C}\vec{\omega}\cdot\vec{k}\,ds=0$ (24)

Following the 6D SLIM formalism, the vector
$\vec{X}=(x,p_{x},y,p_{y},z,\delta)^{T}$ defines a particle’s phase space
coordinates. Any $\vec{X}$ can be defined as a linear combination of the
orbital eigenvectors $\vec{e}_{k}$, where $k=\pm I,\pm II,\pm III$ and
$\left(\vec{e}_{k}\right)^{*}=\vec{e}_{-k}$, of the 6D 1-turn transfer matrix.

$\vec{X}=\begin{pmatrix}x\\\ p_{x}\\\ y\\\ p_{y}\\\ z\\\
\delta\end{pmatrix}=\begin{pmatrix}e_{Ix\ }&e_{Ix\ }^{*}&e_{IIx\ }&e_{IIx\
}^{*}&e_{IIIx}&e_{IIIx\ }^{*}\\\
e_{Ip_{x}}&e_{Ip_{x}}^{*}&e_{IIp_{x}}&e_{IIp_{x}}^{*}&e_{IIIp_{x}}&e_{IIIp_{x}}^{*}\\\
e_{Iy\ }&e_{Iy\ }^{*}&e_{IIy\ }&e_{IIy\ }^{*}&e_{IIIy\ }&e_{IIIy\ }^{*}\\\
e_{Ip_{y}}&e_{Ip_{y}}^{*}&e_{IIp_{y}}&e_{IIp_{y}}^{*}&e_{IIIp_{y}}&e_{IIIp_{y}}^{*}\\\
e_{Iz\ }&e_{Iz\ }^{*}&e_{IIz\ }&e_{IIz\ }^{*}&e_{IIIz\ }&e_{IIIz\ }^{*}\\\
e_{I\delta\ }&e_{I\delta\ }^{*}&e_{II\delta\ }&e_{II\delta\
}^{*}&e_{III\delta\ }&e_{III\delta\ }^{*}\\\
\end{pmatrix}\begin{pmatrix}A_{I}\\\ A_{I}^{*}\\\ A_{II}\\\ A_{II}^{*}\\\
A_{III}\\\ A_{III}^{*}\end{pmatrix}$ (25)

Spin matching for one of the three modes of oscillation is achieved when the
spin orbit integral is zero for terms proportional to the amplitudes of that
particular eigenmode. For example, in the uncoupled storage ring where the
$I$-mode is the horizontal direction, a horizontal spin match is obtained by
requiring that the spin-orbit integral be zero for terms proportional to
$A_{I}$, $A_{I}^{*}$. Letting the notation $(...)_{\propto A_{I}}$ denote
taking only terms proportional to $A_{I}$, that is

$\left(\int_{s_{0}}^{s_{0}+C}\vec{\omega}\cdot\vec{k}\,ds\right)_{\propto
A_{I}}=0\ .$ (26)

This can be achieved in many different ways. For example, if $\vec{\omega}$ is
fully anti-symmetric but the spin precession of $\vec{k}$ is fully symmetric,
the integral is automatically zero.

###  2.1 EIC-ESR

Figure 1: Graphic of the spin rotator section in the ESR from [8].

The spin matching conditions for the Electron Storage Ring of the Electron Ion
Collider, derived by V. I. Ptitsyn [9], are now re-derived in detail to show
the utility of the precession vector expressions in Eq. (20). The ESR employs
four “solenoid modules” and “bend modules” to rotate the spin to longitudinal
at the interaction point and back to vertical in the arc. Each solenoid module
consists of two equivalent solenoids with some number of quadrupoles in
between. These quadrupoles are varied so that there is no coupling outside of
the solenoid module and so that spin matching can be achieved. The bend
modules consist of quadrupoles and horizontal bends. Evaluating the integrand
in Eq. (24) using Eq. (20) with the convention for electrons $G\rightarrow a$
gives

$\displaystyle\vec{\omega}\cdot\vec{k}$
$\displaystyle=K_{s}\left[-(1+a)(x^{\prime}k_{x}+y^{\prime}k_{y}-\delta
k_{s})\right]+\kappa_{x}\left[(a\gamma_{0}-a)y^{\prime}k_{s}-\left(a\gamma_{0}-\frac{a}{\gamma_{0}}\right)\delta
k_{y}\right]$
$\displaystyle\quad\quad\quad\quad\quad-\kappa_{x}^{\prime}(1+a)yk_{s}+(1+a\gamma_{0})(x^{\prime\prime}k_{y}-y^{\prime\prime}k_{x})$
$\displaystyle=K_{s}\left[-(1+a)(x^{\prime}k_{x}+y^{\prime}k_{y}-\delta
k_{s})\right]+\kappa_{x}\left[(a\gamma_{0}-a)y^{\prime}k_{s}-\left(a\gamma_{0}-\frac{a}{\gamma_{0}}\right)\delta
k_{y}\right]$
$\displaystyle\quad\quad\quad\quad\quad-\kappa_{x}^{\prime}(1+a)yk_{s}+(1+a\gamma_{0})\left[(x^{\prime}k_{y})^{\prime}-x^{\prime}k_{y}^{\prime}-(y^{\prime}k_{x})^{\prime}+y^{\prime}k_{x}^{\prime}\right]\
.$ (27)

Substitution of $\vec{k}$ into
$\frac{d\vec{S}}{ds}=\vec{\Omega}_{0}\times\vec{S}$ using Eq. (14) gives
$\vec{k}^{\prime}$.

$\displaystyle k_{x}^{\prime}$
$\displaystyle=(1+a)K_{s}k_{y}-a\gamma_{0}\kappa_{x}k_{s}$ (28a)
$\displaystyle k_{y}^{\prime}$ $\displaystyle=-(1+a)K_{s}k_{x}$ (28b)
$\displaystyle k_{s}^{\prime}$ $\displaystyle=a\gamma_{0}\kappa_{x}k_{x}$
(28c)

With these equations, the integrand is

$\displaystyle\vec{\omega}\cdot\vec{k}$
$\displaystyle=K_{s}(1+a)\left[a\gamma_{0}\left(x^{\prime}k_{x}+y^{\prime}k_{y}\right)+\delta
k_{s}\right]-\kappa_{x}\left[(a^{2}+a^{2}\gamma_{0}^{2})y^{\prime}k_{s}+\left(a\gamma_{0}-\frac{a}{\gamma_{0}}\right)\delta
k_{y}\right]$
$\displaystyle\quad\quad\quad\quad\quad-\kappa_{x}^{\prime}(1+a)yk_{s}+(1+a\gamma_{0})\left[(x^{\prime}k_{y})^{\prime}-(y^{\prime}k_{x})^{\prime}\right]\
.$ (29)

The spin matching conditions are satisfied by requiring that the integrand of
the spin-orbit integral evaluate to zero everywhere in the ring. This is
already satisfied in the arcs, because $\hat{n}_{0}$ is vertical and there is
no betatron coupling, and thus leaves an integral only over the rotator
region.

####  2.1.1 Horizontal Spin Match

Taking only terms proportional to $A_{I}$ in Eq. (2.1), integrals over the
$(y^{\prime}k_{x})^{\prime}$ and $(x^{\prime}k_{y})^{\prime}$ terms are zero:
right at the start and exit of the spin rotator region there is no transverse
coupling and $\hat{n}_{0}$ is vertical. Thus, $y^{\prime}(s_{in})$ and
$y^{\prime}(s_{out})$ have no terms proportional to $A_{I}$, and
$k_{y}(s_{in})=k_{y}(s_{out})=0$. This leaves only integrals over the
solenoids and the horizontal bends in the rotator region.

$\displaystyle\left(\int_{s_{in}}^{s_{out}}\vec{\omega}\cdot\vec{k}\,ds\right)_{\propto
A_{I}}=\left(\int_{sol}K_{s}(1+a)\left[a\gamma_{0}\left(x^{\prime}k_{x}+y^{\prime}k_{y}\right)+\delta
k_{s}\right]\,ds\right)_{\propto A_{I}}$
$\displaystyle-\left(\int_{bends}\kappa_{x}\left[(a^{2}+a^{2}\gamma_{0}^{2})y^{\prime}k_{s}+\left(a\gamma_{0}-\frac{a}{\gamma_{0}}\right)\delta
k_{y}\right]+\kappa_{x}^{\prime}(1+a)yk_{s}\,ds\right)_{\propto A_{I}}$ (30)

Because there is no transverse coupling in the bends and $(\delta)_{\propto
A_{I}}=0$, this leaves

$\displaystyle\left(\int_{s_{in}}^{s_{out}}\vec{\omega}\cdot\vec{k}\,ds\right)_{\propto
A_{I}}=\left(\int_{sol}K_{s}(1+a)a\gamma_{0}\left(x^{\prime}k_{x}+y^{\prime}k_{y}\right)\,ds\right)_{\propto
A_{I}}\ .$ (31)

Solving the equations of motion in Eq. (18) and Eq. (19) for a solenoid
reveals that $x^{\prime}$ and $y^{\prime}$ rotate together at a rate of
$K_{s}$ radians per unit length. Likewise, solving the equations of motion in
Eq. (28a) and Eq. (28b) for a solenoid shows that the transverse spin
components $k_{x}$ and $k_{y}$ rotate and at a rate of $(1+a)K_{s}$ radians
per unit length. For electrons, $a\approx 0.00116$. In the ESR spin matching
conditions derivation, it is assumed that $a$ is sufficiently small so that
$(1+a)\approx 1$. With this assumption,
$\left(x^{\prime}k_{x}+y^{\prime}k_{y}\right)$ is constant within each
solenoid, as both the spin and velocity precess at the same rate. Letting $L$
be the length of an individual solenoid, this leaves a sum over each of the 8
individual solenoids in the rotator region given by

$\displaystyle\left(\int_{s_{in}}^{s_{out}}\vec{\omega}\cdot\vec{k}\,ds\right)_{\propto
A_{I}}$ $\displaystyle\approx
a\gamma_{0}\left(\sum_{j=1}^{8}\left(K_{s}L\right)_{j}\left(x^{\prime}k_{x}+y^{\prime}k_{y}\right)_{j}\right)_{\propto
A_{I}}$
$\displaystyle=a\gamma_{0}\left\\{\sum_{j=1}^{8}\left(K_{s}L\right)_{j}\left[\left(p_{x}+\frac{1}{2}K_{s}y\right)k_{x}+\left(p_{y}-\frac{1}{2}K_{s}x\right)k_{y}\right]_{j}\right\\}_{\propto
A_{I}}$
$\displaystyle=a\gamma_{0}\sum_{j=1}^{8}\left(K_{s}L\right)_{j}\left[\left(e_{Ip_{x}}+\frac{1}{2}K_{s}e_{Iy}\right)k_{x}+\left(e_{Ip_{y}}-\frac{1}{2}K_{s}e_{Ix}\right)k_{y}\right]_{j}\
.$ (32)

The four solenoid modules each consist of two equal strength solenoids with
length $L$. Letting the total spin precession through the $i$-th solenoid
module be $\phi_{i}=2(K_{s}L)_{i}(1+a)\approx 2(K_{s}L)_{i}$, the conditions
can be expressed as

$\sum_{i=1}^{4}H_{i}\left(\vec{e}_{I}\right)=0$ (33) $\displaystyle
H_{i}\left(\vec{e}_{I}\right)=\frac{\phi_{i}}{2}\left\\{\left[\left(e_{Ip_{x}}+\frac{1}{2}K_{s}e_{Iy}\right)k_{x}+\left(e_{Ip_{y}}-\frac{1}{2}K_{s}e_{Ix}\right)k_{y}\right]_{in}\right.$
$\displaystyle\quad\quad\quad+\left.\left[\left(e_{Ip_{x}}+\frac{1}{2}K_{s}e_{Iy}\right)k_{x}+\left(e_{Ip_{y}}-\frac{1}{2}K_{s}e_{Ix}\right)k_{y}\right]_{out}\right\\}_{i}=0\
.$ (34)

For the ESR, horizontal spin matching is achieved by letting the above summand
be equivalent to zero for each of the four solenoid modules. This constraint
gives the required transfer matrix form over each solenoid module that the
quadrupoles in between must be varied to satisfy. As an example, consider the
case where $\hat{n}_{0}$ is initially vertical, as it is when it enters the
rotator from the arc. In this case, without loss of generality, we can let
$\left(k_{x}\right)_{in}=1$, $\left(k_{y}\right)_{in}=0$,
$\left(k_{x}\right)_{out}=\cos{\phi}$, and
$\left(k_{y}\right)_{out}=-\sin{\phi}$. With no coupling outside the solenoid
modules,
$(e_{Iy})_{in}=(e_{Iy})_{out}=(e_{Ip_{y}})_{in}=(e_{Ip_{y}})_{out}=0$, and the
transfer matrix over a solenoid module is given by

$\displaystyle(e_{Ix})_{\text{out}}=(e_{Ix})_{\text{in}}m_{11}+(e_{Ip_{x}})_{\text{in}}m_{12}\
,$ (35a)
$\displaystyle(e_{Ip_{x}})_{\text{out}}=(e_{Ix})_{\text{in}}m_{21}+(e_{Ip_{x}})_{\text{in}}m_{22}\
.$ (35b)

Substituting all of these into the summand in Eq. (2.1.1), we require

$(e_{Ix})_{\text{in}}\left(m_{11}\frac{1}{2}K_{s}\sin{\phi}+m_{21}\cos{\phi}\right)+(e_{Ip_{x}})_{\text{in}}\left(1+m_{22}\cos{\phi}+m_{12}\frac{1}{2}K_{s}\sin{\phi}\right)=0\
.$ (36)

Finally, for non-trivial $(e_{Ix})_{\text{in}}\neq 0$ and
$(e_{Ip_{x}})_{\text{in}}\neq 0$ the spin matching conditions for initially-
vertical $\hat{n}_{0}$ are obtained.

$\displaystyle m_{11}\frac{1}{2}K_{s}\sin{\phi}+m_{21}\cos{\phi}$
$\displaystyle=0$ (37) $\displaystyle
1+m_{22}\cos{\phi}+m_{12}\frac{1}{2}K_{s}\sin{\phi}$ $\displaystyle=0$ (38)

####  2.1.2 Longitudinal Spin Match

Considering only terms proportional to $A_{III}$ in Eq. (2.1), the integrals
over the terms $(y^{\prime}k_{x})^{\prime}$ and $(x^{\prime}k_{y})^{\prime}$
are once again zero; right at the start and exit of the spin rotator region
there is no vertical dispersion and $\hat{n}_{0}$ is vertical. Thus,
$y^{\prime}(s_{in})$ and $y^{\prime}(s_{out})$ have no terms proportional to
$A_{III}$, and $k_{y}(s_{in})=k_{y}(s_{out})=0$. Furthermore, in the bends
$(y)_{\propto A_{III}}=(y^{\prime})_{\propto A_{III}}=0$ since $y$ and
$y^{\prime}$ are not dependent on energy in horizontal bends. This gives

$\displaystyle\left(\int_{s_{in}}^{s_{out}}\vec{\omega}\cdot\vec{k}\,ds\right)_{\propto
A_{III}}=\left(\int_{sol}K_{s}(1+a)\left[a\gamma_{0}\left(x^{\prime}k_{x}+y^{\prime}k_{y}\right)+\delta
k_{s}\right]\,ds\right)_{\propto A_{III}}$
$\displaystyle-\left(\int_{bends}\kappa_{x}\left(a\gamma_{0}-\frac{a}{\gamma_{0}}\right)\delta
k_{y}\,ds\right)_{\propto A_{III}}\ .$ (39)

As in the horizontal spin matching case, $a$ is assumed to be “small”, so that
$\left(x^{\prime}k_{x}+y^{\prime}k_{y}\right)$ is constant within a solenoid,
$(1+a)\approx 1$, and $a/\gamma_{0}\approx 0$.

$\displaystyle\left(\int_{s_{in}}^{s_{out}}\vec{\omega}\cdot\vec{k}\,ds\right)_{\propto
A_{I}}$ $\displaystyle\approx
a\gamma_{0}\sum_{i=1}^{4}H_{i}\left(\vec{e}_{III}\right)+\int_{sol}K_{s}k_{s}e_{III\delta}\,ds-\int_{bends}\kappa_{x}a\gamma_{0}k_{y}e_{III\delta}\,ds$
(40)

Per Eq. (28), $k_{s}$ is constant within a solenoid and $k_{y}$ is constant
within a bend. Since the energy deviation is assumed to be constant to first
order in these elements, $e_{III\delta}\approx 1$ Thus, letting $\psi_{j}$ be
the spin precession in the $j$-th bend module, the longitudinal spin matching
conditions are

$a\gamma_{0}\sum_{i=1}^{4}H_{i}\left(\vec{e}_{III}\right)+\sum_{i=1}^{4}k_{s,i}\phi_{i}-\sum_{i=j}^{4}k_{y,j}\psi_{j}=0\
.$ (41)

###  2.2 eRHIC Zeroth Order Design

Figure 2: Graphic of the antisymmetric rotators in the eRHIC Zeroth Order
Design from [10].

The eRHIC Zeroth Order Design features the solenoid spin rotator system shown
in Fig. 2. With this design, it is immediately evident that the precession of
$\vec{k}$ is symmetric about the interaction point. One way to spin match this
spin rotator is to require $\vec{\omega}$ be antisymmetric about the
interaction point, thus automatically making the spin-orbit integral in Eq.
(24) zero. By observation of Eq. (15), this can be achieved by making the beta
function left-right antisymmetric about the interaction point in the rotator
region with vanishing dispersion in the quadrupoles.

##  3 Conclusions

By expanding the Thomas-BMT equation around small phase space coordinates, the
first order spin-orbit motion of a particle in an accelerator including fringe
fields was derived. We showed how different forms of the spin precession
vector found in the literature are equivalent, related by substitution of the
equations of motion. The utility of the different forms was also discussed;
the form in Eq. (15) proves useful for fast first-order spin tracking, and the
form in Eq. (20) both elegantly shows the $(1+G\gamma_{0})$ amplified spin
rotation with velocity vector rotation and is useful for deriving the spin
matching conditions in the ESR of the EIC.

## References

  * [1] L.. Thomas  “I. The kinematics of an electron with an axis”  In _Phil. Mag._ 3.13 Taylor & Francis, 1927, pp. 1–22  DOI: 10.1080/14786440108564170
  * [2] V. Bargmann, L. Michel and V.. Telegdi  “Precession of the Polarization of Particles Moving in a Homogeneous Electromagnetic Field”  In _Phys. Rev. Lett._ 2 American Physical Society, 1959, pp. 435–436  DOI: 10.1103/PhysRevLett.2.435
  * [3] L.. Thomas  “Recollections of the discovery of the Thomas precessional frequency”  In _AIP Conference Proceedings_ 95.1, 1983, pp. 4–12  DOI: 10.1063/1.33853
  * [4] G.. Hoffstaetter  “High-Energy Polarized Proton Beams”  In _Springer Tracts in Modern Physics_ 218, 2006  DOI: 10.1007/978-0-387-34754-7
  * [5] J.. Asimow, G.. Hoffstaetter, D. Sagan and M.. Signorelli  “Fast first-order spin propagation for spin matching and polarization optimization with Bmad”  In _NAPAC22 Proc._ JACoW Publishing, 2022
  * [6] A.. Chao  “Evaluation of radiative spin polarization in an electron storage ring”  In _Nucl. Inst. and Meth._ 180.1, 1981, pp. 29–36  DOI: 10.1016/0029-554X(81)90006-9
  * [7] D.. Barber and G. Ripken  “Handbook Of Accelerator Physics And Engineering (2nd Edition)”  World Scientific Publishing Company, 2013  URL: https://books.google.com/books?id=We66CgAAQBAJ
  * [8] D. Marx  “Designing the EIC electron storage ring lattice for a wide energy range”  In _13th Int. Particle Acc. Conf._ JACoW Publishing, 2022, pp. 1946–1949  DOI: 10.18429/JACoW-IPAC2022-WEPOPT042
  * [9] V.. Ptitsyn  “Spin Matching derivation”, 2021  Brookhaven National Laboratory
  * [10] “eRHIC Zeroth Order Design Report”, BNL note C-A/AP/142, 2004
  * [11] V.. Ptitsyn, Yu.. Shatunov and S.. Mane  “Spin response formalism in circular accelerators”  In _Nucl. Inst. and Meth._ 608.2, 2009, pp. 225–233  DOI: 10.1016/j.nima.2009.06.066
  * [12] H. Mais and G. Ripken  “Theory of spin orbit motion in electron-positron storage rings”  In _DESY Report 83-062_ , 1983
  * [13] H. Mais and G. Ripken  “Theory of coupled synchro-betatron oscillations”  In _DESY Report M-82-05_ , 1982