\section{Probing the top quark vertices at the ILC}~\label{sec:top-elweak}

At higher energy, the study of $t\bar t$ pair production concentrates on the precise measurements of the couplings
of the $t$~quark to the $Z^0$~boson and the photon.
 In contrast to the situation  at hadron colliders, the leading-order pair production process
$\ee\to t\bar t$ goes directly through the $t\bar{t} Z^0$ and
$t\bar{t} \gamma$ vertices.  There is no concurrent QCD production
of $\ttbar$ pairs, which increases greatly the potential for a clean measurement.
A commonly used expression to describe the  the current at the $t\bar{t} X$ vertex is~\cite{Juste:2006sv}

\begin{equation}\label{eq:gordon}
\Gamma_\mu^{ttX}(k^2,\,q,\,\bar{q}) = ie \left\{
  \gamma_\mu \, \left(  \widetilde{F}_{1V}^X(k^2)
                      + \gamma_5\widetilde{F}_{1A}^X(k^2) \right)
+ \frac{(q-\bar{q})_\mu}{2m_t}
    \left(  \widetilde{F}_{2V}^X(k^2)
          + \gamma_5\widetilde F_{2A}^X(k^2) \right)
\right\} .
\end{equation}
where $X = \gamma,Z$ and the  $\widetilde{F}$ are related to the usual
form factors $F_1$, $F_2$ by
\begin{equation}
\label{eq:rel1}
\widetilde F^X_{1V} = -\left( F^X_{1V}+F^X_{2V} \right) \, , \qquad
\widetilde F^X_{2V}  =  F^X_{2V} \, , \qquad
\widetilde F^X_{1A} = -F^X_{1A} \, , \qquad
\widetilde F^X_{2A} =  -iF^X_{2A} \, .
%\label{eq:rel4}
\end{equation}
In the Standard Model the only form factors which are different
from zero are $F_{1V}^\gamma(k^2),\,F_{1V}^{Z}(k^2)$ and $F_{1A}^{Z}(k^2)$.  The
quantities $F_{2V}^{\gamma,Z}(k^2)$ are the electric and weak magnetic dipole
moment (EDM and MDM) form factors. The presence of the $\gamma/Z^0$ interference in electro-weak production gives sensitivity to the actual sign of the coupling constants. This is a distinct difference to the associated vector boson production at the LHC, which is only sensitive to their absolute values.

In the following section, we will review the importance of measuring these couplings precisely.   Then we will describe studies of the experimental  capabilities of the ILC to perform these measurements. A great asset to test the chiral structure is the availability of polarized beams at the ILC. The studies presented in the following exploit this potential. For a full overview on the physics potential with polarised beams the reader is referred to~\cite{MoortgatPick:2005cw}.

\subsection{Top quark and new physics -  A brief motivation}

Neither the Standard Model of particle physics nor its super-symmetric extensions deliver an explanation for the striking mass hierarchy in the fermion sector. On the other hand, the mass hierarchy can be accommodated in models featuring extra dimensions, which are dual to models in which the $t$~quark and the Higgs Boson are composited objects.
An example model with extra dimensions is that by Randall and Sundrum~\cite{Randall:1999ee}.  New physics will modify the electro-weak $\Zzero \ttbar$ vertex and modify the couplings $Q_L$ and $Q_R$ to the left- and right-chiral parts of the $\tpq$-quark wave-function. New physics may also entail the existence of a new $Z^{0'}$~boson or Kaluza-Klein excitations of the Standard Model $\Zzero$~boson. The modified vertex gives rise to different forward backward asymmetries $\afb$ than those predicted by the Standard Model. For this quantity a 3$\sigma$ discrepancy of the effective electro-weak mixing angle ${\rm sin}^{2}\theta_{eff}$ obtained in $b\bar{b}$ production at LEP has yet to be resolved~\cite{ALEPH:2005ab}. If this  effect is real, it is likely to be larger for the heavy $t$~quark.
Please note that tensions with the Standard Model are also reported for the Tevatron results on $\afb$ in $\ttbar$ final states.
The Standard Model prediction of the weak mixing angle is also challenged by the about  3$\sigma$ discrepancy observed in the
left right asymmetry $A_{LR}$ at the linear collider SLC, which featured linearly polarized electron beams. This measurement is the most precise measurement of $sin^{2}\theta_{eff}$ as of today.
%If this  effect is real, it is likely to be larger for the heavy $t$ quark.

%Polarised beams will allow allow for the measurement of e.g. cross sections with different initial electron (positron) polarization.  This in turn permits also to measure the left-right asymmetry $\alr$, i.e. the change in cross-section for different beam polarisations. Here, too, a tension with Standard Model predictions has been observed at SLC~\cite{elwfits}.

% deviations have been measured for $\bottom$-quark at LEP~\cite{ALEPH:2005ab}.  The ILC will allow for polarised electron and positron beams.
% for the $b$ quark at LEP result in

%\subsection{Models with top and Higgs compositeness}

%There are several classes of models that seek to answer the question of
%where the Higgs boson comes from and why it acquires a symmetry-breaking
%vacuum expectation value.  Among these is supersymmetry, which will have
%its own discussion in Section~7 of this report.  An alternative point of
%view is that the Higgs boson is a composite state within a larger, strongly
%interacting theory at the TeV scale. Though the first models of this
%type contained no light Higgs bosons, there are now many models that
%naturally contain a light Higgs boson very similar to
%the Higgs boson of the Standard Model coupling to new heavy particles at the
%TeV mass scale.  In Sections 2 and 4, we have described
%tests of models of this type at the ILC in the Higgs boson
%and $W$ boson sectors.

%The top quark is the heaviest known particle that derives its mass
%entirely from electro-weak symmetry breaking.
%Due to its high mass the top quark couples to  the Higgs with a Yukawa
%coupling of strength $\lambda_t \approx 1$.
%It is therefore likely that any composite structure
%of the Higgs boson must be reflected in composite structure or non-Standard
%interactions of the top quark.  While such interactions may exist, they
%may not be easy to find.   The coupling of the top quark to the gluon and
%the photon are constrained at $Q^2 = 0$ by requirements from exact QCD
%and QED gauge invariance.   However, the low-energy $t\bar{t} Z$ vertex is
%much less constrained.   It is then likely that this is the crucial place
%to look for deviations from the Standard Model induced by a strongly
%interacting Higgs sector.

%Models of composite Higgs bosons can be constructed in three ways that
%seem at first sight to be distinctly different.  The Higgs bosons may be
%Goldstone bosons associated with strong-interaction symmetry breaking at
%the 10 TeV energy scale, as in Little Higgs models.   They may arise as
%partners of gauge bosons in theories with an extra space dimension, as in
%Gauge-Higgs Unification.  Or, they may arise in extra-dimensional theories
%as states confined to a lower-dimensional subspace or `brane'.   Randall
%and Sundrum constructed a model of the last type~\cite{Randall:1999ee}
% but also argued that
%all three classes of models are related by strong coupling-weak coupling
%duality~\cite{ArkaniHamed:2000ds}.   That is, it is possible to view the
%extra-dimensional models as tools that allow weak coupling calculations of
%effects that are intrinsically manifestations of strong coupling and
%composite state dynamics.

%The Randall-Sundrum approach also includes a model explanation of the
%hierarchy of Higgs-fermion Yukawa couplings.  This is one of the
%most mysterious aspects of the Standard Model, reflected in the fact
%that the top quark and the up quark have exactly the same quantum numbers
%but differ in mass by a factor of $10^5$.  The extra dimension
%offers the possibility that the different flavors of fermion have
%wavefunction of different shape in the full space, and therefore
%different overlap with the wavefunction of the Higgs boson.  In general,
%also, the right and left chiral components of each quark and lepton
%may have wavefunctions with different dependence on the extra
%dimensions.   It is a typical prediction of Randall-Sundrum theories
%that the chiral components of the top quark have wavefunctions in the
%fifth dimension significantly different from those of the other quarks,
%and significant different from one another, with the wavefunction of the
%right-handed top quark shifted significantly toward the low-energy
%boundary of the space, called the `TeV brane', where the Higgs field is
%located.   These difference of the wavefunction are reflected directly
%in couplings of the top quark to the $Z^0$ that are shifted from the
%values predicted in the Standard Model, with larger shifts specifically
%for the right-handed top quark.  Figure~\ref{fig:cartoon-rs} collects a
%number of predictions of the fractional shift in the $t_L$ and $t_R$
%coupling to the $Z^0$ in a variety of models proposed in the literature.

%\begin{figure}
%\centering
%\includegraphics[width=0.7\columnwidth]{cartoon-rs.pdf}
%\caption{\sl Predictions of various groups~\cite{Djouadi:2006rk,Hosotani:2005nz,Cui:2010ds,Carena:2006bn}
% on deviations from Standard Model couplings of the t quark within
%Randall-Sundrum Models. The cartoon is taken from~\cite{ild:bib:benchmark:doublet}.}
%\label{fig:cartoon-rs}
%\end{figure}

%Models with extra-dimensions may also be suited to explain the tensions
% observed at the Tevatron discussed in
% Section~\ref{sec:asym-had}.   The top forward-backward asymmetry
%may, for example, be explained by a new color octet vector boson
% $G_{\mu}$, which couples weakly to light quarks but strongly to the
% $t$~quark.  This difference is required
% in order to suppress ordinary dijet production from the new colour-octet
% state. The difference in the coupling can be realised by the
%arrangement of the $t$~quark wavefunction along the
%extra-dimension~\cite{AguilarSaavedra:2012ma}.

\subsection{ILC measurements}

In the previous section, theories with extra dimensions and/or in which the
$t$~quark and the Higgs boson are composite were briefly introduced. Compositeness is an
essential element of the physics of electro-weak symmetry breaking.
A key test of this idea would come from the measurement of the $t\bar
t Z$ couplings, where significant deviations from the predictions of
the Standard Model would be expected. The ILC provides an ideal environment to measure these couplings.
At the ILC $\ttbar$ pairs would be copiously produced, several 100,000 events
for an integrated luminosity of $500\,\invfb$.  The production is by
$s$-channel $\gamma$ and $\Zzero$~boson exchange, so the couplings to the $\Zzero$ enter the
cross section in order 1.  It is possible  to almost entirely eliminate the background from other Standard Model processes.
%The ILC will
% allow for polarized electron and positron beams. This allows us
%to measure not only the total cross section for $t\bar t $ production
%but also  the left-right asymmetry $\alr$, the change in
%cross-section for different beam polarizations.
%For the $b$ quark, The most precise measurements of $\alr$ at SLC and the
%forward-backward asymmetry for the $b$ quark at LEP result in a 3 $\sigma$ discrepancy of
%the effective electro-weak mixing angle $sin^{2}\theta_{eff}$ that has yet to be
%resolved~\cite{ALEPH:2005ab}.  If this  effect is real, it is likely to be larger for the heavy $t$ quark.

With the use of polarized beams, $t$ and $\bar t$ quarks oriented
toward different angular regions in the detector are enriched
in left-handed or right-handed $t$~quark
polarization~\cite{Parke:1996pr}.
This means that the experiments can independently access the
couplings of left- and right-handed polarized quarks to the $\Zzero$~boson.
In principle, the measurement of the  cross section and forward-backward
asymmetry for two different polarization settings measures both the
photon and $\Zzero$~boson couplings of the $t$~quark for each handedness.
New probes of the $t$~quark  decay vertices are also available, although we expect that
these will already be highly constrained by the LHC measurements of
the $W$ polarization in $t$~quark decay.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}
\centering
%\includegraphics[width=0.5\columnwidth, angle=270]{Top/AngDistTop.pdf}
\includegraphics[width=0.7\columnwidth]{AFB_wbkg_chi2cut.pdf}
\caption{Reconstruction of the direction of the $t$ quark for two
different beam polarization~\cite{Amjad:2013hca}. The population in the two different
hemispheres w.r.t. the polar angle $\theta_{top}$ allows for the measurement of the forward-backward asymmetry $A_{FB}$.
The residual Standard Model background is very small.}
%The plot shown is an update of one
%presented in~\cite{top-lal}. Note that the figure does not include
%background; however, it is known from the studies
%in~\cite{ild:bib:benchmark:doublet} that the background is negligible.}
\label{fig:topangle}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Recent studies based on full simulation of ILC detectors for a center of mass
 energy of $\roots=500\,\GeV$ demonstrate that a precision on the
determination of the couplings the left and the right chiral parts of
the $t$~quark wave function to the $\Zzero$~boson of up to 1\% can be
achieved~\cite{ild:bib:benchmark:doublet,Devetak:2010na,Doublet:2012wf}. The most recent example for such a study of semi-leptonic $\ttbar$ decays with full detector simulation is shown in Figure~\ref{fig:topangle}~\cite{Amjad:2013hca}.
The figure demonstrates the clean reconstruction of the $t$~quark direction, which allows for the precise determination of the
forward-backward asymmetry, which is nearly free of Standard Model background.   It has to be noted however, that the final state gives rise to ambiguities in the correct association
of the $b$~quarks to the $W$~bosons, see~\cite{Amjad:2013hca} for an explanation. These ambiguities can be nearly eliminated by requiring
a high quality of the event reconstruction. The control of the ambiguities however requires an excellent detector performance and event reconstruction.
Another solution is the use of the vertex charge to separate the $t$ and $\bar t$~quark decays. It is shown in~\cite{Devetak:2010na} and confirmed in~\cite{bib:ilc-tdr-dbd} that the high efficiency of vertex tagging in the ILC detectors will make this strategy available.
%The expected percent level independent measurements of the left- and right-handed top quark couplings will
%clearly discriminate the models shown in Fig.~\ref{fig:cartoon-rs}.

Even more incisive measurements than presented using optimized
observables are investigated in~\cite{Amjad:2013hca}.
These observables are the $\ttbar$ pair production cross-section for left-
and right-handed polarized beams and the fraction of right-handed ($t_R$)
and left handed $t$~quarks ($t_L$).
Following a suggestion by~\cite{Berger:2012nw} for the Tevatron, the fraction
of $t_L$ and $t_R$ in a given sample can be determined with the helicity
asymmetry.  In the $t$~quark rest frame the distribution of the polar angle
$\theta_{hel}$ of a decay lepton is
\beq
\frac{1}{\Gamma} \frac{d\Gamma}{d\cthel} = \frac{1+ a_t \cthel}{2}
\eeq{costhel}
where $a_t$ varies between $+1$ and $-1$ depending on the
fraction of right-handed ($t_R$) and left handed $t$~quarks ($t_L$).
 The observable $\cthel$ can easily be measured at the ILC.
This observable is much less sensitive to ambiguities in the
event reconstruction than the forward backward asymmetry. The
slope of the resulting linear distribution provides a very
robust measure of the net polarization of a $t$~quark sample. The result of a full
simulation study is shown in the top part of Fig.~\ref{fig:hel-coupl}.
 It is demonstrated that over a range in $\cthel$ the generated
distribution is retained after event reconstruction. The
reconstruction is nearly perfect for initial right handed electron beams. Remaining discrepancies in case of
 left handed electron beams can be explained by reconstruction
inefficiencies for low energetic final state leptons.

The introduced observables, i.e. $\afb$, cross sections and helicity asymmetry are used to disentangle the coupling of the $t$~quark to the photon and to the $\Zzero$.
In the bottom part of  Fig.~\ref{fig:hel-coupl}, the precision on the form factors expected
from the LHC and that from the ILC are compared with each other.

Numerical values for the expected accuracies at linear $e^+e^-$ colliders, ILC and earlier on TESLA~\cite{AguilarSaavedra:2001rg}, on seven $t$~quark form factors (due to QED gauge invariance the coupling $\widetilde F^\gamma_{1A}$ is fixed to 0), taken from the studies \cite{Abe:2001nq,AguilarSaavedra:2001rg,Amjad:2013hca},
are given in Tabs.~\ref{tab:tab1} and~\ref{tab:tab2}, along with comparisons to the expectations from
the LHC experiments. Note in passing, that the replacement of TESLA results of Tab.~\ref{tab:tab2} by an ILC study is in preparation.

From the comparison of the numbers it is justified to assume that the measurements at an electron positron collider lead to a spectacular improvement and thanks to the $\gamma/Z^0$ interference a $\epem$ collider can fix the sign the form factors. At the LHC the $t$~quark couples either to the photon or to the $Z^0$. In that case the cross section is proportional to e.g. $ (F^Z_{1V})^2 +  (F^Z_{1A})^2$. The precision expected at the LHC cannot exclude a sign flip of neither  $F^Z_{1V}$ nor of $F^Z_{1A}$. On the hand the LEP bounds can exclude a sign flip for $F^Z_{1A}$~\cite{Baur:2004uw}, which renders a much better precision for  $\widetilde F^Z_{1A}$ compared with $\widetilde F^Z_{1V}$. Clearly, the precisions that can be obtained at the LHC are to be revisited in the light of the real LHC data. A first result on associated production of vector boson and $\ttbar$ pairs is published in~\cite{Chatrchyan:2013qca}.

\begin{figure}
\centering
%\includegraphics[width=0.53\columnwidth]{Top/ThetaHelicity_Peskin.pdf}
\includegraphics[width=0.63\columnwidth]{Helicity_wbkg.pdf}
\includegraphics[width=0.63\columnwidth]{couplings.pdf}
\caption{
Top: Generated and reconstructed distribution of the helicity angle $\cthel$;
Bottom: Comparison of precisions on $CP$ conserving form factors
of the $t$~quark to $\gamma$ and $Z$, $\widetilde F^{\gamma,Z}_{1V,A}$,
expected at the LHC, taken from~\cite{Juste:2006sv}, and at the ILC.
The LHC results assume an integrated luminosity of $\mathcal{L}=300~\invfb$.
The results for ILC~\cite{Amjad:2013hca} assume an integrated luminosity of $\mathcal{L}=500~\invfb$ at
$\roots=500\,\GeV$ and a beam polarization  $P_{e^-} =\pm0.8,P_{e^+} = \mp0.3$.}
\label{fig:hel-coupl}
\end{figure}

\begin{table}[t]
\begin{center}
\begin{footnotesize}
%\begin{tabular}{ccc|ccc}
\begin{tabular}{|cccc|}
\hline
 Coupling & LHC~\protect\cite{Juste:2006sv}  & $e^+e^-$~\protect\cite{Abe:2001nq}&
           $e^+e^-$~\protect\cite{Amjad:2013hca}\\
 & $\mathcal{L}=300~\invfb$ & $P_{e^-}=\pm0.8$ & $\mathcal{L}=500~\invfb$,\, $P_{e^{-,+}} =\pm0.8,\mp0.3$
\\
\hline
$\Delta\widetilde F^\gamma_{1V}$ &
$\begin{matrix} +0.043 \\[-4pt] -0.041\end{matrix}$ &
$\begin{matrix} +0.047 \\[-4pt] -0.047 \end{matrix}$ ,
$\mathcal{L}=200~\invfb$&
%$\Delta\widetilde F^Z_{1V}$ &
%$\begin{matrix} +0.24 \\[-4pt]  -0.62\end{matrix}$ &
$\begin{matrix} +0.002 \\[-4pt] -0.002 \end{matrix}$
\\
%$\Delta\widetilde F^\gamma_{1A}$ &
%$\begin{matrix} +0.051 \\[-4pt] -0.048\end{matrix}$ &
%$\begin{matrix} +0.011 \\[-4pt] -0.011\end{matrix}$ ,
%    $\mathcal{L}=100~\invfb$ &
%$\Delta\widetilde F^Z_{1A}$ &
%$\begin{matrix} +0.052 \\[-4pt]  -0.060\end{matrix}$ &
%$\begin{matrix} +0.009 \\[-4pt] -0.009\end{matrix}$   \\
%$\Delta\widetilde F^\gamma_{2V}$ & $\begin{matrix} +0.038 \\[-4pt]
%-0.035\end{matrix}$ & $\begin{matrix} +0.038 \\[-4pt]
%-0.038\end{matrix}$ , 200~fb$^{-1}$  & $\Delta\widetilde F^Z_{2V}$ &
%$\begin{matrix} +0.27 \\[-4pt]
%-0.19\end{matrix}$ & $\begin{matrix} +0.009 \\[-4pt]
%-0.009\end{matrix}$ , 200~fb$^{-1}$
%\\
%$\Delta\widetilde F^\gamma_{2A}$ & $\begin{matrix} +0.16 \\[-4pt]
%-0.17\end{matrix}$ & $\begin{matrix} +0.014 \\[-4pt]
%-0.014\end{matrix}$ , 100~fb$^{-1}$   & $\Delta\widetilde F^Z_{2A}$ &
%$\begin{matrix} +0.28 \\[-4pt]
%-0.27\end{matrix}$ & $\begin{matrix} +0.052 \\[-4pt]
%-0.052\end{matrix}$ , 100~fb$^{-1}$
%\\
$\Delta\widetilde F^Z_{1V}$ &
$\begin{matrix} +0.24 \\[-4pt]  -0.62\end{matrix}$ &
$\begin{matrix} +0.012 \\[-4pt] -0.012\end{matrix}$ , $\mathcal{L}=200~\invfb$ &
%$\Delta\widetilde F^\gamma_{1V}$ &
%$\begin{matrix} +0.043 \\[-4pt] -0.041\end{matrix}$ &
$\begin{matrix} +0.002 \\[-4pt] -0.002\end{matrix}$
\\
$\Delta\widetilde F^Z_{1A}$ &
$\begin{matrix} +0.052 \\[-4pt]  -0.060\end{matrix}$ &
$\begin{matrix} +0.013 \\[-4pt] -0.013\end{matrix}$ , $\mathcal{L}=100~\invfb$ &
%$\Delta\widetilde F^\gamma_{1A}$ &
%$\begin{matrix} +0.051 \\[-4pt] -0.048\end{matrix}$ &
$\begin{matrix} +0.006 \\[-4pt] -0.006\end{matrix}$
\\
$\Delta\widetilde F^\gamma_{2V}$ &
$\begin{matrix} +0.038 \\[-4pt] -0.035\end{matrix}$ &
$\begin{matrix} +0.038 \\[-4pt] -0.038\end{matrix}$ , $\mathcal{L}=200~\invfb$&
%$\Delta\widetilde F^Z_{2V}$ &
%$\begin{matrix} +0.27 \\[-4pt]  -0.19\end{matrix}$ &
$\begin{matrix} +0.001 \\[-4pt] -0.001\end{matrix}$
\\
$\Delta\widetilde F^Z_{2V}$ &
$\begin{matrix} +0.27 \\[-4pt] -0.19\end{matrix}$ &
$\begin{matrix} +0.009 \\[-4pt] -0.009\end{matrix}$ , $\mathcal{L}=200~\invfb$  &
%$\Delta\widetilde F^Z_{2A}$ &
 $\begin{matrix} +0.002 \\[-4pt] -0.002\end{matrix}$
\\
%$\Delta\widetilde F^\gamma_{2V}$ &
%$\begin{matrix} +0.038 \\[-4pt] -0.035\end{matrix}$ &
%$\begin{matrix} +0.038 \\[-4pt] -0.038\end{matrix}$ , 200~fb$^{-1}$  &
%$\Delta\widetilde F^Z_{2V}$ &
%$\begin{matrix} +0.27 \\[-4pt]  -0.19\end{matrix}$ &
%$\begin{matrix} +0.009 \\[-4pt] -0.009\end{matrix}$ , $\mathcal{L}=200~\invfb$  &
%n.a.
%\\
%$\Delta\widetilde F^\gamma_{2A}$ &
%$\begin{matrix} +0.16 \\[-4pt] -0.17\end{matrix}$ &
%$\begin{matrix} +0.014 \\[-4pt] -0.014\end{matrix}$ , 100~fb$^{-1}$   &
%$\Delta\widetilde F^Z_{2A}$ &
%$\begin{matrix} +0.28 \\[-4pt]  -0.27\end{matrix}$ &
%$\begin{matrix} +0.052 \\[-4pt] -0.052\end{matrix}$ , $\mathcal{L}=100~\invfb$  &
%n.a.
%\\
\hline

\end{tabular}
\end{footnotesize}
\caption{Sensitivities achievable at $68.3\%$ CL for the
CP-conserving $t$~quark form factors $\widetilde F^X_{1V,A}$ and $\widetilde F^X_{2V}$ defined in \leqn{eq:gordon}, at LHC and at
the ILC.  The assumed luminosity samples and, for ILC, beam polarization,
 are indicated.
In the LHC studies and in the study
  \cite{Abe:2001nq}, only one form factor at a time is
allowed to deviate from its SM value.
In study~\cite{Amjad:2013hca} the form factors are allowed to vary independently. }
\label{tab:tab1}
\end{center}
\end{table}

\begin{table}[ht]
\begin{center}
\begin{footnotesize}
%\begin{tabular}{ccc|ccc}
\begin{tabular}{|ccc|}
\hline
 Coupling & LHC~\protect\cite{Juste:2006sv}  &
           $e^+e^-$~\protect\cite{AguilarSaavedra:2001rg}\\
 & $\mathcal{L}=300~\invfb$ &
$\mathcal{L}=300~\invfb$,\, $P_{e^{-,+}} =-0.8$
\\
\hline
%$\Delta\widetilde F_{2V}^{\gamma}$& $\begin{matrix} +0.038 \\[-4pt] -0.035\end{matrix}$ &  $\begin{matrix} +0.011 \\[-4pt] -0.011\end{matrix}$\\
%$\Delta\widetilde F_{2V}^{Z}$& $\begin{matrix} +0.27 \\[-4pt]  -0.19\end{matrix}$ &  $\begin{matrix} +0.011 \\[-4pt] -0.011\end{matrix}$\\
$\Delta {\mbox Re}\, \widetilde F_{2A}^{\gamma}$& $\begin{matrix} +0.17 \\[-4pt] -0.17\end{matrix}$ &$\begin{matrix} +0.007 \\[-4pt] -0.007\end{matrix}$   \\
$\Delta {\mbox Re}\, \widetilde F_{2A}^{Z}$& $\begin{matrix} +0.35 \\[-4pt] -0.35\end{matrix}$ &$\begin{matrix} +0.008 \\[-4pt] -0.008\end{matrix}$  \\
$\Delta {\mbox Im}\, \widetilde F_{2A}^{\gamma}$& $\begin{matrix} +0.17 \\[-4pt] -0.17\end{matrix}$  &$\begin{matrix} +0.008 \\[-4pt] -0.008\end{matrix}$  \\
$\Delta {\mbox Im}\, \widetilde F_{2A}^{Z}$& $\begin{matrix} +0.035 \\[-4pt] -0.035\end{matrix}$ & $\begin{matrix} +0.015 \\[-4pt] -0.015\end{matrix}$ \\
\hline
\end{tabular}
\end{footnotesize}
\caption{Sensitivities achievable at $68.3\%$ CL for the $t$~quark
CP-violating magnetic and electric dipole
form factors
$\widetilde F^X_{2A}$ defined in \leqn{eq:gordon}, at the  LHC and at
linear $e^+e^-$ colliders as published in the TESLA TDR.  The assumed luminosity samples and, for TESLA, the beam polarization,
 are indicated. In the LHC studies and in the TESLA studies, only one form factor at a time is
allowed to deviate from its SM value. }
\label{tab:tab2}
\end{center}
\end{table}

The expected high precision at a linear $\epem$ collider allow for a profound discussion of effects of new physics. The findings can be confronted with predictions in the framework of Randall-Sundrum models and/or compositeness models such as~\cite{Pomarol:2008bh,Djouadi:2006rk,Hosotani:2005nz,Cui:2010ds,Carena:2006bn,Grojean:2013qca} or Little Higgs models as e.g.~\cite{Berger:2005ht}. All these models entail deviations from the Standard Model values of the $t$~quark couplings to the $Z^0$ boson that will be measurable at the ILC. The interpretation of the results presented in Tables~\ref{tab:tab1} and~\ref{tab:tab2} in terms of the cited and maybe other models is in preparation and left for a future publication. {\em Comments and contributions from theory groups are highly welcome.}

%\begin{table}[ht!]
%\begin{center}
%\begin{tabular}{|l|c||cc|cc|} \hline
%begin{tabular}{|cc|}\hline
%Form factor  & $\sqrt{s}$  = 500\,GeV  \\
%\hline
%\hline
%&  $p$ = -- 0.8 \\
%\hline
% $F_{1V}^{\gamma}$ &\rule[-3mm]{0mm}{8mm} 1
% &  &   &   &    \\
%$F_{1V}^{Z}$ &\rule[-3mm]{0mm}{8mm} 1 &  & 0.019 &  &     \\
%$F_{1A}^{Z}$ &\rule[-3mm]{0mm}{8mm} 1 &  & 0.016  &  &     \\
% $F_{1A}^{\gamma}$ &\rule[-3mm]{0mm}{8mm} 0
% &  &  &   &     \\
%$F_{2V}^{\gamma,Z}={(g-2)^{\gamma,Z}}_t$ &0.011  \\
%${\mbox Re}\, F_{2A}^{\gamma}$ &0.007   \\
%${\mbox Re}\, d_t^{\gamma}$ [10$^{-19}$ e cm] &\rule[-3mm]{0mm}{8mm} 0 & 20  & 4  & 8  &  2  \\
%${\mbox Re}\, F_{2A}^{Z}$ &0.008  \\
%${\mbox Re}\, d_t^{Z}$ [10$^{-19}$ e cm] &\rule[-3mm]{0mm}{8mm} 0 & 7  & 5  & 5  &  4  \\
%${\mbox Im}\, F_{2A}^{\gamma}$ &0.008  \\
%${\mbox Im}\, F_{2A}^{Z}$ & 0.015 \\
%\hline
%$F_{1R}^{W}$ &\rule[-3mm]{0mm}{8mm} 0 & 0.030 & 0.012 &   &     \\
%${\mbox Im} F_{2R}^{W}$ &\rule[-3mm]{0mm}{8mm} 0 & 0.025  &0.010 &  &     \\
%\hline
%\end{tabular}
%\caption[]{
%{1 s.d. statistical sensitivities to some (non) SM form factors
%in $t\bar t$ production \cite{top_18A,top_N24,top_rfrey} and in $t$ decay
%to $Wb$
%\cite{top_18A,top_Bernreuther:1992be}.
%The second column contains
%the respective SM value to lowest order, $p$ denotes the
%polarisation of the electron beam.
%For the c.m. energy $\sqrt s$  = 500\GeV (800\GeV) an
%integrated luminosity of 300 fb$^{-1}$
%(500 fb$^{-1}$) was used.
%$F_{1R}^{W}$ measures $(V+A)/(V-A)$.} \label{fig:top_topform} }
%\end{center}
%\end{table}

\subsubsection{Theory uncertainties on form factors - A brief outline}

The extraction of form factors requires precise predictions of the inclusive $\ttbar$ production rate and several differential distributions.
As of today the QCD corrections are known to $N^3LO$ accuracy for the cross section and to $NNLO$ accuracy for $\afbt$. It is shown in~\cite{Amjad:2013hca} and references therein that the uncertainty on these corrections for the cross section are below 1\% with an even smaller scale uncertainty. Uncertainties for $\afbt$ yield about the same values.

Electro-weak corrections are known to NLO accuracy. The correction for the cross section is about 5\% at $\roots=500\,\GeV$. The correction for $\afbt$ is between 10\% and 15\%~\cite{Fleischer:2003kk,Khiem:2012bp}. It is a major task for the future to estimate the size of the two-loop-correction and ultimately to calculate this contributions.

At this point it should also be noted that all of the studies on form factors are based on the WHIZARD event generator~\cite{Kilian:2007gr,Moretti:2001zz}.  This generator provides the final state in terms of six fermion events.
In particular the $\ttbar$ final state is indistinguishable from the final state of single $t$~quark production which give rise to interference terms. The contribution from single top events can be reduced by adequate kinematic cuts. Still, future studies will have to consider the residual contribution.

%\subsubsection{An example: the Randall-Sundrum scenario}

%The sensitivity new physics can be paramerised by general dimension
%six operators contributing to the $t\bar{t} \gamma $ and
%$t\bar{t} Z $ vertex~\cite{AguilarSaavedra:2012vh}.  However, the potential of the ILC
%might be demonstrated more clearly by presenting a concrete example with
%one particular model.  In the original model of Randall and Sundrum~\cite{Randall:1999ee} there are additional
%massive gauge bosons in an assumed extra dimension. The model
%predicts increased couplings of the top quark, and perhaps
%also the $b$ quark, to these Kaluza Klein particles. Following the analysis in ~\cite{Djouadi:2006rk,Djouadi:2009nb,Djouadi:2011aj}, one can
%fix the parameters of the model so that these enhancements fit the
%two anomalies observed in the forward-backward asymmetry for $b$ quarks
%$A_{FB,b}$ at LEP1 and for
%top quarks  $A_{FB,t}$ at the Tevatron.  This gives a viable model of
%top quark interactions associated with top and Higgs compositeness.
%Figure \ref{fig:hel-rs} shows the expected modifications of the
%helicity angle distributions within this scenario.

%\begin{figure}
%\centering
%\includegraphics[width=0.7\columnwidth]{hel-rs.pdf}
%\caption{
%Distributions of the helicity angle
%$\cthel$ expected from the Standard Model (thick lines)
%and their modifications by the Randall-Sundrum framework
%(thin lines) described in the text~\cite{Djouadi:2009nb}. The results are
%shown for a beam polarization  $P_{e^-} =\pm 0.8,P_{e^+} = \mp 0.3$.}
%\label{fig:hel-rs}
%\end{figure}

%Both the slopes and total cross sections are deeply
%modified in this scenario for the two polarizations. As explained
%previously, these observables are directly measured at the ILC, and the
%measurements allow one to fully disentangle the individual modifications
%of the $Z$ and photon couplings to top
%quarks. It can also be shown
%that by running at two energies, for instance 500\,GeV and 1\,TeV,
%one can fully extract the
%parameters of the model, for instance, the Kaluza Klein boson masses, which
%can be measured with about 1\% precision.

%When the Kaluza Klein particles become very heavy, ILC at 500\,GeV can
%observe deviations in  top
%couplings at greater than 3 $\sigma$
%for masses which, depending on the details of the model,
%typically range between 4 and 48\,TeV

%\subsubsection{Remarks on $(g-2)_t$}
%The determination of $\widetilde F^\gamma_{2V}$ gives access to anomalous magnetic moment $(g-2)_t$ in a rather simple way. For instance $\widetilde F^\gamma_{2V}=Q_t (g-2)_t /2$. $(g-2)_t$ receives Standard Model contributions from QED, QCD and EW~\cite{Grozin:2007fh}. One sees that this quantity will be measured to about 10\% accuracy.

%What is known about $(g-2)_t$ ? In Ref.~\cite{Labun:2012fg} it said that that the limits on $g_t$ come from the
%reaction $b \rightarrow s\gamma$  giving a very crude constraint :
%\beq
%                            -3.5 <  g_t < 3.6
%\eeqn
%Ref.~\cite{Brodsky:1980zm} points out that $(g-2)_t$ is a very sensitive measurement for compositeness. For leptons one can
%constrain compositeness at the 10000 TeV (~$10^{-18}\,\mathrm{cm}$) level. In other words e and $\mu$ are elementary
%objects. This needs not be true for $t$~quarks. The expected precision on $(g-2)_t /2$ of 0.1\% is proportional to $m_t/M$ where $M$
%is the scale of compositeness. It follows hence that with the accuracy expected at the ILC the compositeness of the $t$~quark can be tested up to about 100\,TeV.


\section{Explain Platonic-Idealism}
Platonic-idealism is a tactic for explaining the nature of things in
relationship to the forms which they are images of. Take, for example, a circle.
No one has ever actually \textit{seen} a circle, only images of one. No perfect
circle has ever actually been created. Yet, the idea of a perfect circle does
exist.

Plato says that these two are distinct. The perfect circle, the one represented
by $x^2+y^2=1$ is truly perfect: it is a circle of the truest sense. It exists
in a higher realm. Yet the circle that one can see or draw themselves, is only
in the form of a circle. It is attempting to be the perfect circle, but it is
not.

This realm, in which is contained all "perfect" things, represents the "good".
The good, which cannot be described, is an idea that, once seen, enables you to
recognize all other forms. All forms can be represented within the good.


%
% API Documentation for Peach - Computational Intelligence for Python
% Package peach.optm
%
% Generated by epydoc 3.0beta1
% [Mon Dec 21 08:51:37 2009]
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                          Module Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{peach \textit{(package)}!peach.optm \textit{(package)}|(}
\section{Package peach.optm}

    \label{peach:optm}

This package implements deterministic optimization methods. Consult:
\begin{quote}
\begin{description}
%[visit_definition_list_item]
\item[{optm}] %[visit_definition]

Basic definitions and interface with the optimization methods;

%[depart_definition]
%[depart_definition_list_item]
%[visit_definition_list_item]
\item[{linear}] %[visit_definition]

Basic methods for one variable optimization;

%[depart_definition]
%[depart_definition_list_item]
%[visit_definition_list_item]
\item[{multivar}] %[visit_definition]

Gradient, Newton and othe multivariable optimization methods;

%[depart_definition]
%[depart_definition_list_item]
%[visit_definition_list_item]
\item[{quasinewton}] %[visit_definition]

Quasi-Newton methods;

%[depart_definition]
%[depart_definition_list_item]
%[visit_definition_list_item]
\item[{stochastic}] %[visit_definition]

General stochastic methods;

%[depart_definition]
%[depart_definition_list_item]
%[visit_definition_list_item]
\item[{sa}] %[visit_definition]

Simulated Annealing methods;

%[depart_definition]
%[depart_definition_list_item]
\end{description}
\end{quote}

Every optimizer works in pretty much the same way. Instantiate the respective
class, using as parameter the cost function to be optimized and some other
parameters. Use \texttt{step()} to perform one iteration of the method, use the
\texttt{{\_}{\_}call{\_}{\_}()} method to perform the search until the stop conditions are met.
See each method for details.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Modules                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{Modules}

\begin{itemize}
\setlength{\parskip}{0ex}
\item \textbf{linear}:
This package implements basic one variable only optimizers.

  \textit{(Section \ref{peach:optm:linear}, p.~\pageref{peach:optm:linear})}

\item \textbf{multivar}:
This package implements basic multivariable optimizers, including gradient and
Newton searches.

  \textit{(Section \ref{peach:optm:multivar}, p.~\pageref{peach:optm:multivar})}

\item \textbf{optm}:
Basic definitons and base class for optimizers

  \textit{(Section \ref{peach:optm:optm}, p.~\pageref{peach:optm:optm})}

\item \textbf{quasinewton}:
This package implements basic quasi-Newton optimizers.

  \textit{(Section \ref{peach:optm:quasinewton}, p.~\pageref{peach:optm:quasinewton})}

\item \textbf{sa}:
This package implements two versions of simulated annealing optimization.

  \textit{(Section \ref{peach:optm:sa}, p.~\pageref{peach:optm:sa})}

\item \textbf{stochastic}:
General methods of stochastic optimization.

  \textit{(Section \ref{peach:optm:stochastic}, p.~\pageref{peach:optm:stochastic})}

\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               Variables                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsection{Variables}

\begin{longtable}{|p{.30\textwidth}|p{.62\textwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\raggedright \_\-\_\-d\-o\-c\-\_\-\_\- & \raggedright \textbf{Value:}
{\tt \texttt{...}}&\\
\cline{1-2}
\end{longtable}

    \index{peach \textit{(package)}!peach.optm \textit{(package)}|)}


\subsubsection{Broadcast time}\label{subsubsec:ld2krtime}

Since in all the experiments we have always reached a coverage of at least
\(99\%\), here we will only discuss the broadcast time needed to reach the 99th
percentile of the coverage.

We have a large unexplained variation (\(9.08\%\)), as in the case of the high
density scenario. The reason for this result is the same and it will be
discussed in \chref{ch:starting-node}.

We can see that the most important factor is the broadcast radius that accounts
for the \(58.90\%\) of the variation, followed by the size of the hear window
(\(30.43\%\)). Other factors and their combinations are irrelevant. These
results are aligned with those obtained for the high density scenario, so the
same considerations apply.

Also in this case we had to use a logarithmic transformation of the predicted
variable in order to meet the assumption of finite variance for the residuals.


\section{Control components}
\comp{output}
{A ``root'' component which simply runs all its inputs}
{4$\times$input:flow}{}
The patch runs by finding all \emph{output} components and running
their inputs. Therefore, this component must be present for the patch to run.

\comp{mixer}
{A component which simply runs all its inputs}
{6$\times$input:flow}{output:flow}
This component, when run, runs all its inputs.

\comp{switcher}
{Selects one input to pass through to the output}
{select:float, 6$\times$inputs:ANY}{output:ANY}
This component simply selects one of its inputs and executes it,
passing the obtained value to the output without interpreting it.
The output and inputs (apart from the selection value) may therefore
be of any type.

The selection value is typically in the range [0,1], and is
mapped onto [0,$n$] where $n$ is the number of the highest connected
\emph{any} input. For example, if only two \emph{any} inputs are connected,
values less than 0.5 will select the first choice, otherwise the
second choice will be selected.
\startparams
mul & float & select input is multiplied by this value before use \\
add & float & select input is then added to this value before use\\
unit & bool & determines whether or not the value is mapped onto [1,0]
or [0,$n-1$] for selection (true means the former)
\end{tabularx}

\clearpage
\comp{threshold}
{Outputs triggers when thresholds are crossed}
{input:float}{trigger$\times$6:int}
Contains 6 thresholding units, which detect when the input
crosses a boundary (rising or falling) and output a single pulse
trigger on the output for the unit; or alternatively a 1 or 0
depending on whether the value is below or above threshold.
\startparams
mul & float & input is multiplied by this value before use \\
add & float & input is then added to this value before use\\
&&\\
level $n$ & float & level of threshold\\
type $n$     & inactive, rising, falling, low, high& threshold type\\
\end{tabularx}

\comp{connectin}
{Connector (input)}
{input:ANY}{}
This is the input side of a connector, which can be used to
organise complex patches. The output comes out of an output
connector with the same number.

\comp{connectout}
{Connector (output)}
{output:ANY}{}
This is the output side of a connector, which can be used to
organise complex patches. The input comes from an input
connector with the same number.

\comp{runslow}
{Run components occasionally (useful for control data send,
such as midi CC)}
{input:$\times 6$:flow}{output:flow}
This will only run the flow inputs if the current number of
update ticks is a multiple of the \emph{steps} parameter.
\startparams
interval & int & interval at which to run inputs
\end{tabularx}

\clearpage
\comp{crossfade}
{Crossfader}
{select:float, input$\times$6:flow}{output:flow}
This changes the amplitude of the inputs depending on which one
is selected by modifying the global amplitude.
Inputs whose amplitude is nonzero will not run at all.
The select value determines which input is ``loudest''.
If the select value is an integer, only that input
will have a nonzero amplitude. If the select value is between
two inputs (it is a float), the two inputs either side will both
run, with their relative amplitudes dependent on how far between
them the select value is.
\[
amp(n) = \begin{cases}
1-|sel-n| & \quad\mathrm{if}\, 1-|sel-n|>0\\
0 & \quad\mathrm{otherwise}
\end{cases}
\]


\begin{figure}
\begin{center}
    \includegraphics[width=0.9\textwidth]{figs/corner.pdf}
    \caption{\label{fig:corner}
    A comparison of the posteriors of the 12 SED model parameters derived from
    standard MCMC sampling (black) and our \sedflow~(blue) for an arbitrarily
    selected NSA galaxy ($\mathtt{NSAID} = 72$; red in Figure~\ref{fig:data}).
    The posteriors are in excellent agreement for all of the SED parameters.
    In the bottom panel, we present the SEDs of the the best-fit parameter
    values from the \sedflow~(blue) and MCMC posteriors (black dotted), which
    are both in good agreement with the observed NSA photometric flux (red).
    Estimating the posterior using MCMC sampling requires $\sim$10 CPU hours.
    Even using neural emulators to accelerate likelihood evaluations, MCMC
    sampling requires $\sim$10 CPU minutes.
    \emph{With \sedflow, inferring the full posterior takes 1 second per
    galaxy.}
    }
\end{center}
\end{figure}

\section{Results} \label{sec:results}
Now that we have trained \sedflow, we can estimate the posterior,
$p(\btheta\given \bfi{x}_i)$, for any
$\bfi{x}_i = \{f_{X,i}, \sigma_{X,i}, z_i \}$.
In practice, we do this by drawing samples from the \sedflow~NDE model.
Since we use a normalizing flow, this is trivial:
we generate samples from the target distribution of the normalizing flow,  a
multivariate Gaussian distribution in our case, then we transform the samples
using the bijective transformation in Eq.~\ref{eq:normflow} that we trained.
The transformed samples follow $p_\phi(\btheta\given \bfi{x}_i)$ and
estimate the posterior, $p(\btheta\given \bfi{x}_i)$.

Next, we validate the accuracy of the \sedflow~posterior estimates.
As a first test, we compare the posterior from \sedflow~to the posterior derived
from MCMC sampling for a single arbitrarily chosen NSA galaxy in
Figure~\ref{fig:corner} ($\mathtt{NSAID} = 72$).
In the top, we present the the posterior distribution of the 12 SED model
parameters for the \sedflow~posterior (blue) and MCMC posterior (black).
\emph{The \sedflow~posterior is in excellent agreement with the MCMC posterior
for all of the SED parameters}.

In the bottom of Figure~\ref{fig:corner}, we compare the SEDs of the best-fit
parameter values from the \sedflow~(blue) and MCMC posteriors (black dotted).
We also include the NSA photometric flux of the selected galaxy (red).
The best-fit SED from the \sedflow~posterior is in good agreement with
both the MCMC best-fit SED and the NSA photometry.

% separate paragraph highlighting the computational advantage?
The key advantage of ANPE is that it enables accurate Bayesian inference
orders of magnitude faster than conventional methods.
We derive the MCMC posterior using the {\sc Zeus} ensemble
slice-sampler~\citep{karamanis2020} with 30 walkers and 10,000 iterations.
2,000 of the iterations are discarded for burn-in.
In total, the MCMC posterior requires >100,000 SED model evaluations.
Since each evaluation takes ${\sim}340$ ms, it takes ${\sim}10$ CPU hours for a
single MCMC posterior.
Recently, SED modeling has adopted neural emulators to accelerate SED model
evaluations~\citep{alsing2020}.
In \cite{hahn2022}, for instance, the PROVABGS emulator takes
only ${\sim}2.9$ ms to evaluate, >100$\times$ faster than the original model.
Yet, even with emulators, due to the number of evaluations necessary for
convergence, an MCMC posterior takes ${\sim}10$ CPU minutes.
Meanwhile, after training, \emph{the \sedflow~posterior takes $1$ second ---
>$10^4\times$ faster than MCMC}.

\begin{figure}
\begin{center}
    \includegraphics[width=0.45\textwidth]{figs/ppplot.pdf}
    \caption{\label{fig:pp}
    Probability-probability (p-p) plot of the \sedflow~posteriors for 1000
    synthetic test observations, with known true parameter values.
    We plot the CDFs of the percentile score of the true values within the
    marginalized \sedflow~posteriors for each SED parameter.
    For the true posteriors, the percentile score is uniformly distributed so
    the CDF is diagonal (black dashed).
    %The test data is constructed in the same way as the training data (Section~\ref{sec:training}).
    For reference, we include the p-p plot of the posterior estimated from MCMC
    sampling (gray).
    \emph{The \sedflow~posteriors are in excellent agreement the true
    posteriors.}
    }
\end{center}
\end{figure}
The posteriors from \sedflow~and MCMC are overall in excellent for NSA
galaxies, besides the one in Figure~\ref{fig:corner}.
However, we do not know the true SED parameters for these galaxies so to
further validate \sedflow, we use test synthetic photometry, where we know the
truth.
We sample 1000 SED parameters from the prior,
$\{\btheta^{\rm test}_i\} \sim p(\btheta)$,
and forward model synthetic NSA observations,
$\{\bfi{x}^{\rm test}_i\}$,
for them in the same way as the training data (Section~\ref{sec:training}).
Afterwards, we generate posteriors for each of $\bfi{x}^{\rm test}_i$ using
\sedflow: $\{ p(\btheta \given \bfi{x}^{\rm test}_i)\}$.

In Figure~\ref{fig:pp}, we present the probability-probability (p-p) plot of
the \sedflow~posteriors for the test data.
The p-p plot presents the cumulative distribution function (CDF) of the
percentile score of the true value within the marginalized posterior for each
parameter.
For true posteriors, the percentiles are uniformly distributed so the CDF is a
diagonal (black dashed).
Overall, the CDFs for \sedflow~lie close to the diagonal for each of the SED
parameters.
\emph{Hence, the \sedflow~posteriors are in excellent agreement with the true
posteriors}.

In Figure~\ref{fig:pp}, we also include the CDFs of the SED parameters for the
MCMC posteriors derived for a subset of 100 test observations (gray dotted).
Comparing the CDFs from the MCMC posteriors to those of \sedflow, we find that
the \sedflow~posteriors are actually in better agreement with the true
posteriors.
This is due to the fact that MCMC posteriors are also only estimates of the
true posterior and are subject to limitations in initialization, sampling, and
convergence.
Posteriors from \sedflow~are not impacted by these limations, so the comparison
highlights additional advantages of an ANPE approach besides the
${>}10^4\times$ performance improvement.

\begin{figure}
\begin{center}
    \includegraphics[width=0.85\textwidth]{figs/sbc.pdf}
    \caption{\label{fig:sbc}
    Simulation-based calibration plot of the \sedflow~posteriors for 1000
    synthetic test observations.
    The histogram in each panel represents the distribution of the rank
    statistic of the true value within the marginalized \sedflow~posterior
    (blue) for each SED parameter.
    For the true posterior, the rank statistics will have a uniform
    distribution (black dashed).
    For reference, we include the rank distribution of the MCMC posteriors for
    a subset of 100 test data (gray dotted).
    The rank statistic distribution of \sedflow~is nearly uniform for all of
    the SED parameters.
    Therefore, \emph{\sedflow~provides unbiased and accurate estimates of the
    true posteriors.}
    }
\end{center}
\end{figure}

We examine another validation of the \sedflow~posteriors using simulation-based
calibration~\citep[SBC;][]{talts2020}.
Rather than using percentile scores, SBC examines the distribution of the rank
statistics of the true parameter values within the marginalized posteriors.
It addresses the limitation that the CDFs only asymptotically approach the true
values and that the discrete sampling of the posterior can cause artifacts in
the CDFs.
In Figure~\ref{fig:sbc}, we present SBC of each SED parameter for the
\sedflow~posteriors (blue) using the 1000 test observations.
For comparison, we include the SBC for the MCMC posteriors (gray dotted).
Similar to the percentile score, the distribution of the rank statistic is
uniform for the true posterior (black dashed).
The rank statistic distribution for the \sedflow~posteriors are nearly uniform
for all SED parameters.
Hence, \emph{we confirm that the \sedflow~posteriors are in excellent agreement
with the true posterior}.

An advantage of SBC is that by examining the deviation of rank statistics
distribution from uniformity, we can determine how the posterior estimates
deviate from the true posteriors.
For instance, if the distribution has a U-shape where the true parameter values
are more often at the lowest and highest ranks, then the posterior estimates
are narrower than the true posteriors.
If the distribution has a $\cap$-shape, then the posterior estimates are
broader than the true posteriors.
Any asymmetry in the distribution implies that the posterior estimates are
biased.
For the \sedflow~posteriors, we find none of these features for any of the SED
parameters.
Hence, \sedflow~provides unbiased and accurate estimates of the true posteriors
for all SED parameters.

With the accuracy \sedflow~validated, we apply it to derive posteriors for all
of our NSA galaxies (Section~\ref{sec:obs}).
Analyzing all 33,884 NSA galaxies takes $\sim$12 CPU hours.
For each galaxy, we generate 10,000 samples of the 12-dimensional posterior,
$p(\btheta \given \bfi{x})$.
These posteriors on SED parameters represent posteriors on stellar mass, SFH,
ZH, and dust content of the NSA galaxies.
To maximize the utility of the posteriors further, we use them to derive
posteriors on the following additional galaxy properties: SFR averaged over
1Gyr, mass-weighted metallicity, and mass-weighted stellar age (see
Eq. 17 in \citealt{hahn2022} for the exact calculation).
We publicly release all of the posteriors for our NSA sample as well as all of
the software and data used to train and validate \sedflow~at
\url{https://changhoonhahn.github.io/SEDflow/}.


\section{Results and Discussion}
\label{sec:results}

\subsection{Inferred velocities}

In this section we assess the quality of the 3D stellar velocities we infer.
Figure \ref{fig:results} shows the distribution of stellar velocities inferred
for 5000 randomly selected Kepler stars.
The 2D distributions of inferred stellar velocities are plotted in the
lower-left panels, with black contours indicating the stellar number density.
The red contours in these panels show the marginal projections of the
Gaussian prior in 2D.
The diagonal panels show the 1D distributions (histograms) of stellar
velocities.
The black histogram shows the distribution of inferred velocities, the cyan
histogram shows the distribution of velocities calculated for stars with RVs
(on which the prior was based), and the red lines show the 1D prior
distributions.
The prior distribution was calculated using the velocities of stars with RVs.
If the velocity distributions of stars were Gaussian, the 1D red Gaussians
would look like the cyan histograms.
In other words, the differences between the red lines and cyan histograms
is caused by the non-Gaussianity of the velocity distributions.
This figure is intended to highlight the differences and similarities
between the inferred stellar velocities and the prior distributions.
In each panel, the distribution of inferred velocities is fairly similar to
the distribution of directly-measured velocities; the velocities of stars
calculated with and without RVs are broadly similar.
The inferred \vx\ and \vz\ velocities, and distances are relatively
precise, with median uncertainties of \vxprecision \kms, \vzprecision\ \kms,
and \dprecision\ kpc, respectively.
The inferred \vy\ velocities have a median uncertainty of \vyprecision\ \kms.

% Among stars with measured RVs, \vy\ and \vz\ are slightly positively
% correlated, \ie\ stars with larger \vy\ tend to have larger \vz.
There is a slight negative correlation between inferred \vy\ and \vz\
velocities, which is visible in the central panel of figure \ref{fig:results}.
This negative correlation is not seen in the prior, nor is it apparent in the
posteriors of individual stars: figure \ref{fig:posterior} shows that the \vy\
and \vz\ parameters are {\it positively} correlated for KIC \kicstar.
This negative correlation may be due to the specific orientation of the Kepler
field, which creates a slight degeneracy between \vy\ and \vz.
% , and could
% result in a negative correlation in the population of stars that is not
% apparent in the posteriors of individual stars.
% To an observer looking at Kepler field, a star with either a positive
% \vz\ or a {\it negative} \vy\ would appear to move in the direction of
% positive \vz, when projected onto the sky.
% In this sense, \vy\ and \vz\ are negatively correlated.
% However, the observed proper motions of a star without a measured RV could be
% equally well described by either increasing both \vy\ and \vz, or decreasing
% both \vy\ and \vz.
% For this reason, the star's posterior PDF over \vy\ and \vz\ will be
% positively correlated.
% This could result in a paradoxical result whereby the posteriors over vy and
% vz are positively correlated for individual stars, however the vy and vz
% velocities of the population are negatively correlated.
If this explanation is correct, this phenomenon highlights how apparent
correlations in stellar velocities could result from {\it missing}
information.
This point is interesting, but the effect is relatively small and we do not
expect that this observed correlation between \vz\ and \vy\ will significantly
affect kinematic age studies.

% could have {\it
% either} a positive \vz, or a postitive \vy. with a positive
% \vz\
% This difference is caused by the way the inaccuracies in inferred \vy\
% velocities manifest in the \vz\ velocity distribution.
% Although correlation patterns appear between the inferred velocities as a
% result of marginalizing over RV, the inferred velocities are still consistent
% with their `true' velocities.
% The proper motions of stars with a given \vy\ and \vz\ could be equally
% well-described with a slightly larger \vy\ and a smaller \vz\ or vice versa.

\begin{figure}[ht!]
\caption{
The distribution of inferred stellar velocities and distances.
    Figure \ref{fig:results} shows the inferred velocities of 5000 randomly
selected Kepler stars.
The 2D distributions of inferred stellar velocities are plotted in the
lower-left panels, with black contours indicating the stellar number density.
The red contours in the lower-left panels show the marginal projections of
    the Gaussian prior distribution in 2D.
The upper-right panels in the figure, lying on the plot's diagonal, show the
    1D distributions (histograms) of stellar velocities.
The black histogram shows the distribution of inferred velocities, the blue
histogram shows the distribution of velocities for stars with RVs,
and the red lines show the 1D marginal Gaussian prior distributions.
This figure shows that the distributions of inferred velocities are
    broadly similar to the distributions of velocities directly calculated
    using RVs, and the prior constructed from them.
}
  \centering
    \includegraphics[width=.7\textwidth]{results}
\label{fig:results}
\end{figure}
To further validate our method, we compare inferred velocities with
directly-calculated velocities for stars in our sample with measured RVs.
Figure \ref{fig:residuals} shows the \vx, \vy\ and \vz\ velocities, and
distances we inferred, compared with those calculated from measured RVs, for
5000 Kepler stars chosen at random.
\begin{figure}[ht!]
\caption{Velocities calculated with full 6D information compared with
    velocities inferred without RVs, for 5000 Kepler targets with RV
    measurements.}
  \centering
    \includegraphics[width=1\textwidth]{residuals}
\label{fig:residuals}
\end{figure}
The three velocity components, \vx, \vy\ and \vz\ were recovered with
differing levels of precision: \vx\ and \vz\ are inferred more precisely than
\vy.
This is because of the position of the \kepler\ field, shown in figure
\ref{fig:kepler_field}.
The velocities of low-\vy\ stars are overestimated and the velocities of
high-\vy\ stars are underestimated.
This is because there is little information to constrain the \vy\ velocities
and the prior pulls the \vy\ velocities toward the center of the distribution.
The \vx, \vy\ and \vz\ velocities of stars are correlated, which means that
stars with an inaccurate \vy\ also have slightly accurate \vz\ and \vx.
Despite slight systematic inaccuracies visible in the residual (bottom)
panels of figure \ref{fig:residuals}, around 68\% of the inferred velocities
are within 1$\sigma$ of their true velocities; the inferred velocities are
consistent with the true velocities.

We provide a table of the directly-calculated, and indirectly-inferred 3D
velocities of stars observed by Kepler, in addition to their positional and
velocity information from Gaia EDR3, LAMOST DR5 and APOGEE DR16.
A description of each column included in that table is provided in table
\ref{tab:columns}.
% A sample of this table is displayed here, and the full machine-readable table
% is available online.

{\bf
As briefly mentioned in the introduction, we have gone to the trouble of
inferring velocities in this paper because calculating velocities from proper
motions and distances alone, \ie\ assuming the RV is zero, will bias the
resulting velocities.
To demonstrate this, figure \ref{fig:inferred_vs_calc} shows the velocity
residuals for stars in our sample where we infer the velocities by
marginalizing over RV and where we ignore RV, \ie\ set it to zero.
In each panel, the green distributions show the residuals between the true
velocities and our inferred velocities, and the purple distributions show the
residuals between the true velocities and velocities calculated by setting the
RV to zero.
The median of each distribution is shown as a vertical line.
This figure shows that ignoring the RV dimension and assuming it can be set to
zero significantly biases the resulting velocities.
The correct way to de-bias velocity calculations is to marginalize over
missing RV measurements.
}
\begin{figure}[ht!]
\caption{
    \bf{
Residual velocity distributions calculated by marginalizing over missing RV
    measurements (green) or by assuming the RV can be set to zero (purple) for
    5000 stars in our sample.
Each distribution shows the residuals between the inferred/calculated
    velocities, and the velocities calculated using full 6D information:
    parallaxes, positions, proper motions, and RVs.
The vertical lines show the medians of each distribution.
This figure demonstrates that calculating stellar velocities using proper
    motions and distances alone will significantly bias the results.
Marginalizing over missing RV measurements ensures the resulting velocities
    will be unbiased.
    }
}
  \centering
    \includegraphics[width=1\textwidth]{inferred_vs_calc}
\label{fig:inferred_vs_calc}
\end{figure}

{\bf
Our intention in providing a table of stellar velocities, and outlining our
method for inferring velocities without RV measurements, is to facilitate
kinematic age-dating studies.
The vertical velocities we provide could be used as an age proxy, or to
calculate kinematic ages via an age-velocity dispersion relation
\citep[\eg][]{yu2018, mackereth2019, sharma2021}.
This kind of approach has been used many times to examine the kinematic ages
of cool stars to explore stellar and planetary evolution
\citep[\eg][]{newton2016, kiman2019, hamer2019, angus2020, lu2021}.
For example, \citet{kiman2019} used the vertical velocity dispersions of stars
as an age proxy to explore the evolution of H$\alpha$ equivalent width (a
magnetic activity indicator), in M dwarfs.
\citet{hamer2019} compared the vertical velocity dispersions of stars with and
without hot Jupiters to show that hot Jupiter hosts tend to be younger, on
average, than stars without detected hot Jupiters.
}

% \begin{table}[h!]
%   \begin{center}
%       \caption{
% The velocities and kinematic information for the \nstars\ Kepler targets in
%       our sample.
%       The full list of columns is provided in table \ref{tab:columns} and the
%       full version is published in its entirey online.
%       }
% \label{tab:data}
% \begin{tabular}{cccccccccc}
%     KIC ID & DR3 source ID & $\alpha$ & $\delta$ & $\bar{\omega}$
%     & Distance & $\mu_{\alpha}$ & $\mu_\delta$ & RV (Gaia) & ... \\
%     & & $(^\circ)$ & $(^\circ)$ & mas & kpc & mas/yr & mas/yr & km/s & \\
%     {\tt kic$\_$id} & {\tt source$\_$id} & {\tt ra} & {\tt dec} &
%     {\tt parallax} & {\tt r$\_$est} & {\tt pmra} & {\tt pmdec} \\
% \hline
% ... & ... & ... & ... & ... & ... \\
% \end{tabular}
% \end{center}
% \tablecomments{This table is published in its entirety in a machine-readable format.
%       A portion is shown here for guidance regarding its form and content.}
% \ref{tab:data}
% \end{table}

\begin{table}[h!]
  \begin{center}
      \caption{
The list of columns in the data table published online, which provides
      the velocities and kinematic information for stars in the Kepler field.
      }
\label{tab:columns}
\begin{tabular}{cc}
    Column name & Description \\
\hline
    {\tt kic$\_$id} & The Kepler Input Catalog ID number of the target. \\
    {\tt source$\_$id} & The Gaia DR3 ID number of the target. \\
    {\tt ra, ra$\_$error} & Gaia EDR3 right ascenscion ($^\circ$). \\
    {\tt dec, dec$\_$error} & Gaia EDR3 declination in degrees ($^\circ$). \\
    {\tt parallax, parallax$\_$error} & Gaia EDR3 parallax (mas). \\
    {\tt r$\_$med$\_$photogeo, r$\_$med$\_$photogeo$\_$err} & Distance
    (parsec), provided by \citet{bailer-jones2021}. \\
    {\tt pmra, pmra$\_$error} & Gaia EDR3 proper motion in right ascension (mas/yr). \\
    {\tt pmdec, pmdec$\_$error} & Gaia EDR3 proper motion in declination (mas/yr). \\
    {\tt gaia$\_$rv, gaia$\_$rv$\_$error} & Gaia DR2 radial velocity (km/s) \\
    {\tt apogee$\_$rv, apogee$\_$rv$\_$error} & APOGEE DR16 radial velocity (km/s) \\
    {\tt lamost$\_$rv, lamost$\_$rv$\_$error} & LAMOST DR5 radial velocity (km/s) \\
    {\tt vx$\_$calc} & The \vx\ velocity calculated using RV (km/s). \\
    {\tt vx$\_$inferred, vx$\_$inferred$\_$error} & The median and standard
    deviation of \vx\ velocity samples, inferred without RV (km/s). \\
    {\tt vy$\_$calc} & The \vy\ velocity calculated using RV (km/s). \\
    {\tt vy$\_$inferred, vy$\_$inferred$\_$error} & The median and standard
    deviation of \vy\ velocity samples, inferred without RV (km/s). \\
    {\tt vz$\_$calc} & The \vz\ velocity calculated using RV (km/s). \\
    {\tt vz$\_$inferred, vz$\_$inferred$\_$error} & The median and standard
    deviation of \vz\ velocity samples, inferred without RV (km/s). \\
    {\tt vxvy$\_$covar} & The covariance between \vx\ and \vy\ samples. \\
    {\tt vxvz$\_$covar} & The covariance between \vx\ and \vz\ samples. \\
    {\tt vxlnd$\_$covar} & The covariance between \vx\ and $\ln$(distance)
    samples. \\
    {\tt vyvz$\_$covar} & The covariance between \vy\ and \vz\ samples. \\
    {\tt vylnd$\_$covar} & The covariance between \vy\ and $\ln$(distance)
    samples. \\
    {\tt vzlnd$\_$covar} & The covariance between \vz\ and $\ln$(distance)
    samples. \\
\end{tabular}
\end{center}
\end{table}


% !TEX root = ../../manuscript-SI.tex

\section{Computational details}\label{si-computational-details}

\subsection{Force field parameters for D4}\label{force-field-parameters-for-d4}

D4 was modelled as a semi-flexible molecule with an all-atom atomistic model.
All intramolecular bonds, angles, dihedrals, and cross terms parameters for
methyl groups were taken from the consistent-valence force field (CVFF) reminded below.
\citep{dauber-osguthorpeStructureEnergeticsLigand1988}

\textbf{Harmonic Bond}

\begin{equation}
    U = \frac{1}{2}p_{0}{(r - p_{1})}^{2}
\end{equation}

where \(p_0 / \kappa_B\) in units K/Å², \(p_{1}\) in Å.

\begin{table}[H]
    \centering
    \caption{%
        D4 bonding potential parameters.
    }\label{tbl:ff-d4-bond}
    \begin{tabular}{@{}llll@{}}
        Pseudo atom & Type of bond & \(p_0 / \kappa_B\) (K/Å²) & \(p_{1}\) (Å) \\
        \midrule
        Si-O & RIGID\_BOND & - & -\\
        Si-C & HARMONIC\_BOND & 286248.126 & 1.809\\
        C3-H & HARMONIC\_BOND & 409668.576 & 1.105\\
        \bottomrule
    \end{tabular}
\end{table}

\textbf{Harmonic Bend}

\begin{equation}
    U = \frac{1}{2}p_{0}{(\theta_{\text{ijk}} - p_{1})}^{2}
\end{equation}

where \(p_0 / \kappa_B\) in units K/rad², \(p_{1}\) in degree.

\begin{table}[H]
    \centering
    \caption{%
        D4 bending potential parameters.
    }\label{tbl:ff-d4-bend}
    \begin{tabular}{@{}llll@{}}
        Pseudo atom & Type of angle & \(p_0 / \kappa_B\) (K/rad²) & \(p_1\) (°) \\
        \midrule
        Si-C-H & HARMONIC\_BEND & 41614.223 & 112.3\\
        C-Si-C & HARMONIC\_BEND & 53400.911 & 113.5\\
        C-Si-O & HARMONIC\_BEND & 53040.094 & 117.3\\
        H-C-H & HARMONIC\_BEND & 47507.567 & 106.4\\
        \bottomrule
    \end{tabular}
\end{table}

\textbf{CVFF Dihedral}

\begin{equation}
    U = p_{0}{(1 + cos(p_{1}\phi_{\text{ijk}} - p_{2}))}^{2}
\end{equation}

where \(p_0 / \kappa_B\) in units K, \(p_2\) in degree.

\begin{table}[H]
    \centering
    \caption{%
        D4 dihedral potential parameters.
    }\label{tbl:ff-d4-dihedral}
    \begin{tabular}{@{}lllll@{}}
        Pseudo atom & Type of torsion & \(p_0 / \kappa_B\) (K) & \(p_1\) (multiplicity) & \(p_2\) (°) \\
        \midrule
        H-C-Si-C & CVFF\_DIHEDRAL & 240.545 & 3 & 0\\
        H-C-Si-O & CVFF\_DIHEDRAL & -60.136 & 3 & 0\\
        C-Si-O-Si & CVFF\_DIHEDRAL & 240.545 & 3 & 0\\
        \bottomrule
    \end{tabular}
\end{table}

\textbf{CFF Bond Bond Cross}

\begin{equation}
    U = p_{0}(r - p_{1})(r\prime - p_{2})
\end{equation}

where \(p_0 / \kappa_B\) in units K/Å², \(p_1\) and \(p_2\) in Å

\begin{table}[H]
    \centering
    \caption{%
        D4 cross-term bonding potential parameters.
    }\label{tbl:ff-d4-cross-bond}
    \begin{tabular}{@{}lllll@{}}
        Pseudo atom & Type of bond-bond & \(p_0 / \kappa_B\) (K/Å²) & \(p_1\) (Å) & \(p_2\) (Å) \\
        \midrule
        Si-C-H & CFF\_BOND\_BOND\_CROSS & 14312.406 & 0 & 0\\
        C-Si-C & CFF\_BOND\_BOND\_CROSS & 7336.612 & 0 & 0\\
        C-Si-O & CFF\_BOND\_BOND\_CROSS & 25257.188 & 0 & 0\\
        \bottomrule
    \end{tabular}
\end{table}

\pagebreak

\textbf{CFF Bond Bend Cross}

\begin{equation}
    U = {(\theta - p}_{0}) [p_{1}(r - p_{2}) + p_{3}(r\prime - p_{4})]
\end{equation}

where \(p_0\) in degrees, \(p_1\) and \(p_3\) in units K/Å/rad, \(p_1\) and \(p_2\) in Å.

\begin{table}[H]
    \centering
    \caption{%
        D4 cross-term bonding-bending potential parameters.
    }\label{tbl:ff-d4-cross-bondbend}
    \begin{tabular}{@{}lllllll@{}}
        Pseudo atom & Type of bond-angle & po (°) & \(p_1\) (K/Å/rad) & \(p_2\) (Å) & \(p_3\) (K/Å/rad) & \(p_4\) (Å) \\
        \midrule
        Si-C-H & CFF\_BOND\_BEND\_CROSS & 0 & 14733.359 & 0 & 9742.06 & 0\\
        C-Si-C & CFF\_BOND\_BEND\_CROSS & 0 & 781.770 & 0 & 0 & 0\\
        C-Si-O & CFF\_BOND\_BEND\_CROSS & 0 & 11425.871 & 0 & 27061.27 & 0\\
        \bottomrule
    \end{tabular}
\end{table}

\textbf{D4 LJ parameters and charges}

The electronic potential (ESP) derived partial charges of D4 were computed by
density functional theory (DFT) calculations with PBE (Perdew-Burke-Ernzerhof)
functional \citep{perdewGeneralizedGradientApproximation1996} and DNP (double
numeric plus polarization) basis set
\citep{hehreSelfconsistentMolecularOrbital1972}, using DMol\textsuperscript{3}
\citep{delleyAllElectronNumerical1990} (\cref{tbl:ff-d4-charge}).

\begin{table}[H]
    \centering
    \caption{%
        Charges and LJ parameters for all atoms of D4.
    }\label{tbl:ff-d4-charge}
    \begin{tabular}{@{}llll@{}}
        Pseudo atom & Charge (e\textsuperscript{-}) & \(\epsilon / \kappa_B\) (K) & \(\sigma\) (Å) \\
        \midrule
        Si & 1.321 & 202.429 & 3.826\\
        O & -0.763 & 30.213 & 3.118\\
        C & -0.889 & 52.873 & 3.431\\
        H & 0.2032 & 22.156 & 2.571\\
        \bottomrule
    \end{tabular}
\end{table}

\subsection{Screening dataset}\label{si-screening-dataset}

\textbf{Material details.}

\begin{table}[H]
    \centering
    \caption{%
        Details of the 29 MOFs added to the COREMOF database.
    }\label{tbl:extra-mofs}
    \begin{tabular}{@{}llll@{}}
        MOFs & Reference & MOFs & Reference\\
        \midrule
        RAVWAO & \citep{gulcayBiocompatibleMOFsStorage2019} &
        DUT-5 & \citep{senkovskaNewHighlyPorous2009} \\
        RAVWES & \citep{gulcayBiocompatibleMOFsStorage2019} &
        DUT-51-Zr & \citep{bonZrIvHf2012}\\
        RAVWIW & \citep{gulcayBiocompatibleMOFsStorage2019} &
        DUT-67-Zr & \citep{bonZrHfBasedMetal2013}\\
        RAVWOC & \citep{gulcayBiocompatibleMOFsStorage2019} &
        MIL-68(Al) & \citep{yangProbingAdsorptionPerformance2012}\\
        RAVWUI & \citep{gulcayBiocompatibleMOFsStorage2019} &
        Cr-soc-MOF-1 & \citep{nandiRevisitingWaterSorption2019}\\
        RAVXAP & \citep{gulcayBiocompatibleMOFsStorage2019} &
        MIP\textsuperscript{{[}4{]}}-177 & \citep{wangPhaseTransformableUltrastable2018} \\
        RAVXET & \citep{gulcayBiocompatibleMOFsStorage2019} &
        MIP-200 & \citep{wangRobustLargeporeZirconium2018} \\
        RAVXIX & \citep{gulcayBiocompatibleMOFsStorage2019} &
        Zr-IPA\textsuperscript{{[}5{]}} & \citep{wangMesoporousZirconiumIsophthalateMultifunctional2020} \\
        MIL-125 & \citep{soaresComputationalEvaluationChemical2019} &
        Ni-BPM\textsuperscript{{[}6{]}} & \citep{zhengMolecularInsightFluorocarbon2020}\\
        MOF-808-acetate & \citep{soaresComputationalEvaluationChemical2019} &
        Ni-BPP\textsuperscript{{[}7{]}} & \citep{zhengMolecularInsightFluorocarbon2020}\\
        MOF-808-formate & \citep{soaresComputationalEvaluationChemical2019} &
        Ni-TPM\textsuperscript{{[}8{]}} & \citep{zhengMolecularInsightFluorocarbon2020}\\
        NU\textsuperscript{{[}1{]}}-1000 & \citep{soaresComputationalEvaluationChemical2019} &
        Ni-TPP\textsuperscript{{[}9{]}} & \citep{zhengMolecularInsightFluorocarbon2020}\\
        UiO\textsuperscript{{[}2{]}}-68 & \citep{soaresComputationalEvaluationChemical2019} &
        Ni-MOF-74 & \citep{zhengMolecularInsightFluorocarbon2020}\\
        Zr6-AzoBDC\textsuperscript{{[}3{]}} & \citep{soaresComputationalEvaluationChemical2019} &
        PCN\textsuperscript{{[}10{]}}-224(Ni) & \citep{fengConstructionUltrastablePorphyrin2013}\\
        \bottomrule
        \multicolumn{4}{l}{{[}1{]}NU: Northwestern University; {[}2{]}UiO: University of Oslo;}\\
        \multicolumn{4}{l}{{[}3{]}AzoBDC: azobenzenedicarboxylate;}\\
        \multicolumn{4}{l}{{[}4{]}MIP: Material of the Institute of Porous Materials from Paris;}\\
        \multicolumn{4}{l}{{[}5{]}IPA: isophatale; {[}6{]}BPM: biphenyl-meta;}\\
        \multicolumn{4}{l}{{[}7{]}BPP: biphenyl-para; {[}8{]}TPM: triphenyl-meta;}\\
        \multicolumn{4}{l}{{[}9{]}TPP: triphenyl-para; {[}10{]}PCN: Porous coordination network;}\\
    \end{tabular}
\end{table}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.8\textwidth]{dataset_geometric}
    \caption{%
        Overview of the diversity of the MOF database with PLD > 6 Å in terms of
        void fractions, N\textsubscript{2} accessible surface areas and PLDs. Data
        points are color coded by PLDs of MOFs. Pore volumes of all structures are
        represented by size.
    }\label{fig:d4-screening-geometric}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.8\textwidth]{dataset_hydrophobic}
    \caption{%
        Overview of the diversity of the hydrophobic MOFs database in terms of
        void fraction and N\textsubscript{2} accessible surface areas. Data
        points are color coded by PLDs of MOFs. Pore volumes of all structures
        are represented by size.
        }\label{fig:d4-screening-hydrophobic}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.8\textwidth]{dataset_gv}
    \caption{%
        The relation between the gravimetric D4 uptake of the 811 hydrophobic MOFs
        (g g\textsuperscript{-1}) and their pore volumes
        (cm\textsuperscript{3} g\textsuperscript{-1}), color coded by void fraction of the
        MOFs.
    }\label{fig:d4-screening-grav-volum}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.8\textwidth]{dataset_kh}
    \caption{%
        Predicted D4 uptake performance at 298 K for the hydrophobic MOFs
        database plotted as a function of their computed Henry constant of
        water, color coded by void fraction, \(\phi\). Top performing 10
        candidates are represented by different symbols in the legend to the
        right.
    }\label{fig:d4-screening-henryc}
\end{figure}

\pagebreak

{\footnotesize
\begin{longtable}[]{@{}p{5cm}p{12cm}@{}}
    \caption{Structural details of the top promising 10 hydrophobic materials which exhibit the highest D4 uptake.}\label{tbl:top-mofs-detail}\\
    \toprule
    \thead{MOF} & \thead{Details} \\
    \midrule
    \makecell{\textbf{FOTNIN (PCN-777)} \\ \includegraphics[height=3cm]{top10/image6.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} 4,4`,4`-s-triazine-2,4,6-triyl-tribenoic acid \\
        \textbf{Metal site:} Zr \\
        \textbf{PLD:} 28.36 Å \\
        \textbf{SA:} \SI{2990}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.27}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{3.31}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.90 \\
        \textbf{Gravimetric D4 uptake:} \SI{2.68}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.72}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{RUTNOK (IRMOF-76)} \\ \includegraphics[height=3cm]{top10/image7.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} \\
        4,7-bis(4-carboxylphenyl)-1,3-dimethylbenzimidazium-tetrafluoroborate \\
        \textbf{Metal site:} Zn \\
        \textbf{PLD:} 14.65 Å \\
        \textbf{SA:} \SI{6200}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.24}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{3.72}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.90 \\
        \textbf{Gravimetric D4 uptake:} \SI{2.57}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.62}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{CUSYAR (MOF-210)} \\ \includegraphics[height=3cm]{top10/image8.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} biphenyl-4,4'-dicarboxylate \\
        \textbf{Metal site:} Zn \\
        \textbf{PLD:} 12.18 Å \\
        \textbf{SA:} \SI{5700}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.25}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{3.65}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.90 \\
        \textbf{Gravimetric D4 uptake:} \SI{2.35}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.59}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{WUHDAG (NU-1104)} \\ \includegraphics[height=3cm]{top10/image9.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} meso-tetrakis-(4-((phenyl)ethynyl)benzoate) porphyrin \\
        \textbf{Metal site:} Zr \\
        \textbf{PLD:} 10.50 Å \\
        \textbf{SA:} \SI{5500}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.29}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{2.99}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.87 \\
        \textbf{Gravimetric D4 uptake:} \SI{2.01}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.58}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{HOHMEX} \\ \includegraphics[height=3cm]{top10/image10.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} 4,4'-carbonyldibenzoato - (\(\mu\)2-4,4'-bipyridine) \\
        \textbf{Metal site:} Cu \\
        \textbf{PLD:} 14.89 Å \\
        \textbf{SA:} \SI{5000}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.32}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{2.74}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.87 \\
        \textbf{Gravimetric D4 uptake:} \SI{1.97}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.63}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{ECOKAJ} \\ \includegraphics[height=3cm]{top10/image11.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} s-heptazine tribenzoate \\
        \textbf{Metal site:} Zn \\
        \textbf{PLD:} 17.58 Å \\
        \textbf{SA:} \SI{3600}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.33}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{2.68}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.87 \\
        \textbf{Gravimetric D4 uptake:} \SI{1.97}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.65}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{DAJWET} \\ \includegraphics[height=3cm]{top10/image12.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} tetrakis (4-carboxylatophenyl) porphyrin \\
        \textbf{Metal site:} Mg \\
        \textbf{PLD:} 26.59 Å \\
        \textbf{SA:} \SI{5000}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.28}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{3.06}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.87 \\
        \textbf{Gravimetric D4 uptake:} \SI{1.93}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.54}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{RUBDUP} \\ \includegraphics[height=3cm]{top10/image13.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} phenylene ethynylene macrocycle \\
        \textbf{Metal site:} Zn \\
        \textbf{PLD:} 19.25 Å \\
        \textbf{SA:} \SI{4200}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.30}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{2.90}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.87 \\
        \textbf{Gravimetric D4 uptake:} \SI{1.93}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.58}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{WUHCUZ (NU-1103)} \\ \includegraphics[height=3cm]{top10/image14.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} \\
        {\tiny 4,4`,4``,4```-((pyrene-1,3,6,8 tetrayltetrakis(benzene-4,1-diyl)) tetrakis(ethyne-2,1 diyl))tetrabenzoate} \\
        \textbf{Metal site:} Zr \\
        \textbf{PLD:} 12.21 Å \\
        \textbf{SA:} \SI{5500}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.30}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{2.91}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.87 \\
        \textbf{Gravimetric D4 uptake:} \SI{1.80}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.54}{\gram\per\centi\metre\cubed}}\\
    \midrule
    \makecell{\textbf{ADATAC} \\ \includegraphics[height=3cm]{top10/image15.jpeg}}
    & \makecell[l]{
        \textbf{Organic ligand:} \\
        5,5`,5``-(4,4`,4``-{[}1,3,5-phenyltris(methoxy){]} tris-phenylazo) tris-isophthalic acid \\
        \textbf{Metal site:} Zn \\
        \textbf{PLD:} 10.28 Å \\
        \textbf{SA:} \SI{5130}{\metre\squared\per\gram} \\
        \textbf{Density:} \SI{0.34}{\gram\per\centi\metre\cubed} \\
        \textbf{PV:} \SI{2.57}{\centi\metre\cubed\per\gram} \\
        \textbf{\(\phi\):} 0.87 \\
        \textbf{Gravimetric D4 uptake:} \SI{1.68}{\gram\per\gram} \\
        \textbf{Volumetric D4 uptake:} \SI{0.57}{\gram\per\centi\metre\cubed}}\\
    \bottomrule
\end{longtable}
}

\begin{table}[H]
    \centering
    \caption{%
        Discussion on MOF selection.
    }\label{tbl:mof-properties}
    \begin{tabular}{@{}llp{10cm}l@{}}

        Refcode & Given name & Observation & Reference\\

        \midrule

        RUTNOK & IRMOF-76 & Synthesis results in interpenetrated nets and the
        materials cannot be activated. & \citep{oisakiMetalOrganicFramework2010}\\

        CUSYAR & MOF-210 & Material requires supercritical \ce{CO2} activation,
        otherwise it collapses upon solvent removal. &
        \citep{furukawaUltrahighPorosityMetalOrganic2010}\\

        WUHDAG & NU-1104 & Complex tetratopic porphyrin linker, difficult to
        synthesize and scale, and supercritical \ce{CO2} activation is required.
        & \citep{wangUltrahighSurfaceArea2015}\\

        HOHMEX & SNU-6 & The difference between our predicted and as-synthesized
        pore volume for this MOF was found as 2.74 vs
        \SI{1.05}{\centi\meter\cubed\per\gram}, respectively. Moreover, air
        exposure was reported to reduce significantly its \ce{H2} capacity,
        highlighting water instability. & \citep{parkMixedLigandMetalOrganicFrameworks2008}\\

        WIHCUZ & NU-1103 & Complex tetratopic conjugated pyrene core linker,
        difficult to synthesize and scale and supercritical \ce{CO2} activation
        is required. & \citep{wangUltrahighSurfaceArea2015}\\

    \end{tabular}
\end{table}

\pagebreak

\subsection{Radial distribution functions for D4/PCN-777}\label{si-radial-distribution}

\textbf{Calculated at specified loading.}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.9\textwidth]{d4-rdf}
    \caption{%
        All-atom averaged radial distribution functions between (a) H atom from
        \ce{CH3} group of D4 molecules and H atom from coordinated water of the
        framework at 10\% total loading and (b) H atom from \ce{CH3} groups of D4 at
        100\% loading.
    }\label{fig:d4-rdf}
\end{figure}

\section{MOF samples}\label{mof-samples}

\subsection{MIL-101(Cr)}

The benchmark MIL-101(Cr) sample was taken from a previous work
\citep{pillaiCapturePerformancesHybrid2017}, with all textural characteristics
as stated in reference.

\subsection{DUT-4}

DUT-4 was purchased from Materials Center (TU Dresden, Germany).

\begin{figure}[H]
    \centering
    \includegraphics[width=\textwidth]{dut4_summary}
    \caption{%
        Characterization of the DUT-4 sample, in duplicates as black
        and blue: (a) PXRD, alongside simulated pattern in red (b) TGA curves
        and (c) \ce{N2} physisorption isotherms at 77 K.
    }\label{fig:dut4-summary}
\end{figure}

\subsection{PCN-777}

\textbf{Synthesis}

To synthesize the PCN-777, \ce{ZrOCl2*8H2O} (\SI{1.08}{\gram},
\SI{3.351}{\milli\mol}) and 4,4’,4’’-s-Triazine-2,4,6-triyl-tribenzoic acid
(\SI{0.270}{\gram}, \SI{0.612}{\milli\mol}) were put into \SI{36}{\milli\litre}
N,N-Diethylformamide (DEF) in a \SI{100}{\milli\litre} Teflon-lined autoclave
reactor, alongside an amount of trifluoroacetic acid (\SI{1.8}{\milli\litre}) to
form a reaction solution. After sonicating the reaction solution at room
temperature for 10 min, the reactor was transferred to a convection oven
followed by heating at \SI{423}{\kelvin} for 12 h. The PCN-777 crystalline solid
was recovered by filtration after purification with \SI{100}{\milli\litre}
N,N-Dimethylformamide (DMF) and acetone for 3 h at room temperature. The
collected crystalline solid was dried at \SI{393}{\kelvin} for 12 h.

\pagebreak

\textbf{Characterisation}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.8\textwidth]{pcn777_tga.png}
    \caption{%
        Thermogravimetric curve recorded on as-synthesised PCN-777.
    }\label{fig:tga}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.6\textwidth]{n2-phys}
    \caption{%
        Nitrogen sorption isotherms at 77 K for the pristine
        PCN-777, alongside with those measured on samples after D4 and water
        sorption.
    }\label{fig:n2-phys}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.8\textwidth]{n2-analysis}
    \caption{%
        BET and Rouquerol plots displaying selection of applicable
        isotherm points for the pristine PCN-777 isotherm.
    }\label{fig:n2-analysis}
\end{figure}

\pagebreak

\section{D4 sorption experiments}\label{d4-sorption-experiments}

\subsection{D4 benchmarking with known MOFs}\label{d4-benchmarking-with-known-mofs}

Isotherms were recorded on benchmark materials MIL-101(Cr) and DUT-4 using the
same methodology detailed in the main manuscript.

\begin{figure}[H]
    \centering
    \includegraphics[width=0.5\textwidth]{benchmark-d4}
    \caption{%
        D4 isotherms recorded on samples of MIL-101(Cr) (red) and
        DUT-4 (blue), used to validate our computational methodology for
        predicting total D4 capacity. Note the different desorption behavior
        (open symbols) of the two materials under secondary vacuum: partial
        desorption for MIL-101(Cr) and no desorption for DUT-4.
    }\label{fig:d4-benchmark}
\end{figure}

\subsection{Isosteric heat of sorption of D4}\label{isosteric-heat-of-sorption-of-d4}

A further isotherm was recorded at \SI{313}{\kelvin} (\SI{40}{\degreeCelsius})
to allow for the calculation of the isosteric heat of adsorption through the
Clausius-Clapeyron equation, as depicted in \cref{fig:isosteric-enth}.

\begin{figure}[H]
    \centering
    \includegraphics[width=\textwidth]{isosteric-enth}
    \caption{%
        D4 sorption isotherms on PCN-777 recorded at 303 K (blue)
        and at 313 K (green) in an absolute (a) and relative (b) pressure scale.
        (c) The calculated isosteric heat of adsorption as a function of D4
        uptake.
    }\label{fig:isosteric-enth}
\end{figure}


\subsection{Introduction}

As well as the Markov process \(X\), we have another process \(Y\) which depends on \(X\).