\def\xinf{{x_{inf}}}
\def\xpinf{{x^\prime_{inf}}}
\def\rbeta{{\sqrt{\beta}}}
\def\bxpinf{{\overline{x^\prime}_{inf}}}
\def\bthetak{{\overline{\theta_k}}}

\begin{center}
{\bf Spin and transverse coordinate correlation in the pion decay channel.}
\end{center}
\def\xinf{{x_{inf}}}
\def\xpinf{{x^\prime_{inf}}}
\subsection{Introduction}
Due to the V-A nature of weak interactions in the process in decay of a pion to a muon and a neutrino, (muon neutrinos are exclusively left handed), 
$\pi^+\rightarrow \mu^+ + nu_\mu$ the polarization of the decay muon is correlated with its transverse momentum\cite{crnkovic:IPAC2016-TUPMR028},
and subsequently with transverse displacement of the muon due to the resulting betatron oscillation in the beam line. 
Meanwhile, the momentum acceptance of the storage ring is correlated with transverse displacement at the inflector exit, due to the large dispersion mismatch.
The result is a spin-momentum correlation in the stored beam and an early to late effect in the time spectra of the muon decay positrons. 
The average shift in $\omega_a$ is given by
\begin{eqnarray}
\vev{\Delta \omega_a}&=&\der{\vev{\phi_a}}{\gamma}\der{\vev{\gamma}}{t}\\
&=&\left(\der{\vev{\phi_a}}{x}\der{\vev{x}}{\gamma}+\der{\vev{\phi_a}}{x^\prime}\der{\vev{x^\prime}}{\gamma}\right)\der{\vev{\gamma}}{t}\label{eq:derivchain}
\end{eqnarray}
where $\der{\vev{\phi_a}}{x}$ and $\der{\vev{\phi_a}}{x^\prime}$ describe the spin-transverse momentum correlation, $\der{\vev{x}}{\gamma}$ and $\der{\vev{x^\prime}}{\gamma}$
the transverse momentum - momentum acceptance correlation and $\der{\vev{\gamma}}{t}$ the correlation of momentum and time.
We show that shift in $\omega_a$ due to 
the spin-coordinate correlation is very small, less than a part per billion.     
\subsection{Pion decay}
Due to the V-A nature of weak interactions in the process in decay of a pion to a muon and a neutrino, (muon neutrinos are exclusively left handed), 
$\pi^+\rightarrow \mu^+ + nu_mu$ the polarization of the decay muon is correlated with its transverse momentum\cite{crnkovic:IPAC2016-TUPMR028}.
The correlation is illustrated in Figure~\ref{fig:MomentumSpinCorrelation}.
\begin{figure}[h]
\centering
  \includegraphics[width=0.4\linewidth]{figures/MomentumSpinCorrelation.pdf}
\caption{The correlation of spin $\vec\Sigma$ and momentum $\vec p$ of muon and neutrino in the rest frame of the pion. For the muon with positive
transverse momentum with respect to the direction of motion in the boosted (lab) frame, the muon spin angle lags, and for the muon with negative transverse momentum,
its spin angle leads.}
\label{fig:MomentumSpinCorrelation}
\end{figure}

In the lab frame the component of the polarization transverse to the pion momentum is given by\cite{crnkovic:IPAC2016-TUPMR028}
\begin{equation}
\Sigma^T=\left(\frac{2m_\mu}{m_\pi^2-m_\mu^2}\right)p_\pi\sin\theta
\end{equation}
where $m_\pi$ and $m_\mu$ are the masses of pion and muon respectively, $p_\pi$ is the muon momentum, and $\theta$ is the lab frame muon momentum polar angle.
The net spin-transverse coordinate correlation in the beam at the end of the M5 line (just upstream of the hole in the backleg iron of the storage ring magnet 
is evaluated in simulation and shown in Figure~\ref{fig:phasevsxxp}. The correlation of spin angle with displacement ($x$) and angle ($x^\prime$) at the endpoint of the 
simulation (end of M5 line) is approximately linear with
\begin{equation}
\der{\vev{\phi_a}}{x_{m5}}=-0.2509\pm 0.0448\ {\rm mrad/mm}\ {\rm and} \der{\vev{\phi_a}}{x_{m5}^\prime} = 0.7705\pm 0.1472\ {\rm mrad/mrad}\label{eq:phim5}.
\end{equation}

\begin{figure}[h]
\centering
  \includegraphics[width=0.8\linewidth]{figures/SpinVsPhaseSpace.pdf}
\caption{Monte Carlo simulation of average z-x spin angle at end of M5\cite{crnkovic3477}} 
\label{fig:phasevsxxp}
\end{figure}

In the next section we discuss the dependence of momentum acceptance of the storage ring on the offset $x$ and angle $x^\prime$ at the inflector exit.  
It is therefore convenient to propagate the spin coordinate correlation that is estimated by the simulation at the end of the M5 line, into and through the injection channel to
the inflector exit. To that end we note that
\begin{eqnarray}
\der{\vev{\phi_a}}{\xinf} &=& \der{\vev{\phi_a}}{x_{m5}}\der{x_{m5}}{\xinf}+\der{\vev{\phi_a}}{x^\prime_{5m}}\der{x^\prime_{m5}}{\xinf}\nonumber\\
\der{\vev{\phi_a}}{\xpinf} &=& \der{\vev{\phi_a}}{x_{m5}}\der{x_{m5}}{\xpinf}+\der{\vev{\phi_a}}{x^\prime_{5m}}\der{x^\prime_{m5}}{\xpinf}\label{eq:propdphi}
\end{eqnarray}
where $x_{m5},x^\prime_{m5}$ and $\xinf,\xpinf$ are the transverse phase space coordinates of the trajectory at the end of the M5 line and the inflector exit respectively.
The phase space coordinates are related by the transfer matrix that propagates the trajectory through the injection channel according to
\begin{eqnarray*}
\begin{pmatrix}\xinf\cr\xpinf\end{pmatrix} &=& T\begin{pmatrix}x_{m5}\cr x^\prime_{m5}\end{pmatrix}
\end{eqnarray*}
Then
\begin{eqnarray}
\der{\xinf}{x_{m5}}&=&\der{}{x_{m5}}(T_{11}x_{m5}+T_{12}x^\prime_{m5}) = T_{11} + T_{12}\der{x^\prime_{m5}}{x_{m5}} \nonumber\\
\der{\xinf}{x^\prime_{m5}}&=&\der{}{x^\prime_{m5}}(T_{11}x_{m5}+T_{12}x^\prime_{m5}) = T_{11}\der{x_{m5}}{x^\prime_{m5}} + T_{12} \nonumber\\
 & \label{eq:propxxp}\\
\der{\xpinf}{x_{m5}}&=&\der{}{x_{m5}}(T_{21}x_{m5}+T_{22}x^\prime_{m5}) = T_{21} + T_{22}\der{x^\prime_{m5}}{x_{m5}} \nonumber\\
\der{\xpinf}{x^\prime_{m5}}&=&\der{}{x^\prime_{m5}}(T_{21}x_{m5}+T_{22}x^\prime_{m5}) = T_{21}\der{x_{m5}}{x^\prime_{m5}} + T_{22}\nonumber 
\end{eqnarray}
Finally, the dependence of offset and angle can be written in terms of the local twiss parameters $\alpha_{m5},\beta_{m5},\gamma_{m5}$.
\begin{eqnarray}
\vev{\der{x_{m5}}{x^\prime_{m5}}} &=& -\alpha_{m5}/\gamma_{m5}\nonumber\\
\vev{\der{x^\prime_{m5}}{x_{m5}}} &=& -\alpha_{m5}/\beta_{m5}\label{eq:xoverxp}
\end{eqnarray}
The transfer matrix is computed with BMAD using field maps of fringe and inflector fields in the injection channel. The twiss parameters are based on measurements\cite{brynn26665-v1}. (See ~\ref{sec:appendix} for details.)
Substitution of \ref{eq:phim5}, \ref{eq:propxxp}, and \ref{eq:xoverxp} into \ref{eq:propdphi} gives 
\begin{eqnarray}
\der{\vev{\phi_a}}{\xinf}&=& -0.2659,-0.2754,-0.270  \pm 0.005\label{eq:dphidx}\\
\der{\vev{\phi_a}}{\xpinf}&=& 0.2321, 0.2343, 0.233\pm 0.001\label{eq:dphidxp}
\end{eqnarray}
The error reflects the statistical uncertainty in the MC simulation and the uncertainty in the precise location of the end point of the simulation with respect to the start of the injection channel. For details
see ~\ref{sec:appendix}.
\subsection{Momentum acceptance}
The plan is to estimate the $\omega_a$ frequency shift in term of the correlations in Equation~\ref{eq:derivchain}. $\der{\vev{\phi_a}}{\xinf}$ and $\der{\vev{\phi_s}}{\xpinf}$ are
given in Equations~\ref{eq:dphidx} and~\ref{eq:dphidxp}. For $\der{\vev{\gamma}}{t}$ (the rate of change of the average stored momentum) we refer to \cite{crnkovic}.
It remains for us to evaluate
\begin{eqnarray*}
\der{\vev{\xinf}}{\gamma} = \frac{1}{\gamma}\der{\vev{\xinf}}{\delta}\\
\der{\vev{\xpinf}}{\gamma} = \frac{1}{\gamma}\der{\vev{\xpinf}}{\delta}
\end{eqnarray}
where we use $\delta = {\gamma-\gamma_0}/\gamma$.
For a particular displacement and angle of the particle trajectory at the inflector exit, and for a particular kick angle, the momenta acceptance is within a well defined range.
Modeling the ring with the continuous quad approximation it can be shown\cite{rubin2747} that that accepted momentum range is given by 
\begin{eqnarray}
-\onehalf\left(A-(x_{inf}  - \bthetak\beta)-\frac{(\bxpinf\beta)^2} {A+ (x_{inf}-\bthetak\beta)}\right)&<& \eta\delta
<\onehalf\left(A+(x_{inf}  - \bthetak\beta)-\frac{(\bxpinf\beta)^2} {A- (x_{inf}-\bthetak\beta)}\right)\label{eq:momentumconstraint}
\end{eqnarray}
where $\bxpinf=\xpinf+\theta_k\cos\phi_k$ and $\bthetak = \theta_k\sin\phi_k$. $\theta_k$ is the change in the angle of the trajectory due to the pulsed kicker
and $\phi_k$ is the betatron phase advance from the injection point (inflector exit) to the effective point of the kick.
%The middle of the range is
%\begin{eqnarray}
%\vev{\eta\delta}&=& \onehalf (x_{inf}-\theta_k\beta)-\onehalf (x^\prime_{inf}\beta)^2\left(\frac{x_{inf}-\theta_k\beta}{A^2-(x_{inf}-\theta_k\beta)^2}\right)\\
%&=& \onehalf(x_{inf}-\theta_k\beta)\left(1 -\frac{(x^\prime_{inf}\beta)^2}{A^2-(x_{inf}-\theta_k\beta)^2}\right)\label{eq:averagecaptured}
%\end{eqnarray}
The dependence of the momentum acceptance on kick angle and transverse displacement are shown in Figure~\ref{fig:acceptance} for the case where the injection angle
$\xpinf=0$, and with the approximation that the width of the kick is less than the revolution period and so applied on a single turn.
\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/EnergyVsKick.pdf}
  \includegraphics[width=0.45\linewidth]{figures/EnergyVsxinf.pdf}
\caption{(left)Momentum acceptance vs kick angle. Minimum and maximum accepted momenta are bounded by the dashed lines. 
The displacement $x_{inf}=77\ {\rm mm}$ (the midpoint of the inflector aperture).
(right)Momentum acceptance vs displacement for kick angle $\theta_k = 10.2\ {\rm mrad}$.
The {\it perfect} kick angle $\theta_k=10.2$ mrad steers the magic momentum particle onto its closed orbit.}
\label{fig:acceptance}
\end{figure}
Figure~\ref{fig:acceptance} (left) shows how the average momentum decreases with increasing kick and (right) that the average accepted momentum increases with
increasing offset.
The dependence of momentum acceptance on offset is reproduced in Figure~\ref{acceptanceboudnaries} but here with dashed lines
marking the range of acceptance where there is no clearly no correlation with offset in at the inflector. We anticipate a weak correlation of momentum acceptance and
offset. 
\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/EnergyVsxinf_bounds.pdf}
\caption{Momentum acceptance vs displacement for kick angle $\theta_k = 10.2\ {\rm mrad}$.
For all momenta bounded by the dashed lines at $\delta=\pm 0.227\%$ there is no correlation with offset in the inflector}
\label{fig:acceptanceboundaries}
\end{figure}
The design
trajetory nominally exits the center of the inflector with zero angle.
The trajectories comprising the beam at the inflector exit are a distribution of offsets and angles about the the design trajectory.
The angle and offset are correlated. The beam is diverging (see Figure~\ref{fig:beta}) so that trajectories with large positive (negative) offset will have
large positive (negative) angle, and more generally, $$\der{\xpinf}{\xinf} = -\alpha_/\beta_i.$$ 
The aceptance defined in Equation~\ref{eq:momentumacceptance} depends on both offset and angle. For illustrative purposes assume that $\xpinf=-\frac{\alpha_i}{\beta_i}\xinf$
and so that we can develop some intuition about dependence of $\xinf,\xpinf$ on stored momentum.
Then ~\ref{eq:momentumacceptance} becomes

\begin{eqnarray}
-\onehalf\left(A-(x_{inf}  - \bthetak\beta)-\frac{((\alpha_i/\beta_i)\xinf\beta)^2} {A+ (x_{inf}-\bthetak\beta)}\right)&<& \eta\delta
<\onehalf\left(A+(x_{inf}  - \bthetak\beta)-\frac{((\alpha_i/\beta_i)\xinf\beta)^2} {A- (x_{inf}-\bthetak\beta)}\right)\label{eq:momentumconstraintnoxp}
\end{eqnarray}

where $\alpha_i = -1.058$ and $\beta_i=3.172\ {\rm m}$ are the twiss parameters of the injection channel at the inflector exit. ($\beta=R_0/\sqrt(1-n)$ is the $\beta$-function of the closed ring.)


%\begin{eqnarray*}
%\der{\delta}{\xinf}&=&\frac{1}{2\eta}\left[1-(\bxpinf\beta)^2\left(\frac{1}{A^2-(\xinf-\bthetak\beta)^2}+\frac{2(\xinf-\bthetak\beta)^2}{(A^2-(\xinf-\bthetak\beta)^2)^2}\right)\right]
%\end{eqnarray*}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DA_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DA_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit for case I. (Right) averge offset as a function of captured momentum and fitted slope}
\label{fig:caseI}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DB_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DB_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit for case II. (Right) averge offset as a function of captured momentum and fitted slope}
\label{fig:case2}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DC_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DC_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit for case III. (Right) averge offset as a function of captured momentum and fitted slope}
\label{fig:case3}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DD_sim_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DD_sim_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit for case 19. (Right) averge offset as a function of captured momentum and fitted slope}
\label{fig:case4x}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DD_sim_xpvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DD_xp_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit for case 19. (Right) averge offset as a function of captured momentum and fitted slope}
\label{fig:case4xp}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit for case 21. (Right) averge offset as a function of captured momentum and fitted slope}
\label{fig:case5x}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_xpvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_xp_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit for case 21. (Right) averge offset as a function of captured momentum and fitted slope}
\label{fig:case5xp}
\end{figure}






%\begin{eqnarray*}
%\epsilon&=& \gamma_i x^2 -2\alpha_i x\xp +\beta_i {\xp}^2\\
%\rightarrow\xp&=& \frac{2\alpha_i x\pm \sqrt{(2\alpha_i x)^2-4\beta_i(\gamma_i x^2-\epsilon)} }{2\beta_i}\\
%&=& \frac{\alpha_i x\pm\sqrt{(\alpha_i x)^2-\beta_i(\gamma_i x^2-\epsilon)} }{\beta_i}\\
%&=& \frac{\alpha_i x\pm \sqrt{\beta_i\epsilon- x^2 }}{\beta_i}
%\end{eqnarray*}
%where in that last step we use $\beta_i\gamma_i=\alpha_i^2+1$ and $\beta_i,\gamma_i,\alpha_i$ are the twiss parameters at the exit of the inflector
%so that $\xp\rightarrow\xpinf$ and $x\rightarrow\xinf-x_0$ and
%$x_0$ is the coordinate at the center of inflector $x_0=77$ mm. $\epsilon$ is an invariant emitance.
%Then
%\begin{eqnarray*}
%\der{\xpinf}{\xinf}&=& -\frac{\alpha_i}{\beta_i} \mp\frac{(\xinf-x_0)}{\beta_i\sqrt{\beta_i\epsilon-(\xinf-x_0)^2}}\\
%\end{eqnarray*}
%The 'invariant amplitude' is very roughly gaussian distributed.
%\begin{figure}
%\centering
%  \includegraphics[width=0.75\linewidth]{figures/phase_space_inf_exit.pdf}
%\caption{Horizontal phase space at inflector exit and superimposed ellipse}
%\label{fig:phasespace}
%\end{figure}
 
\begin{comment}
\subsection{Correlation of momentum acceptance and displacement $\xinf$}
Substituting for $\xpinf$ in terms of $\xinf$ as given by Equation~\ref{eq:xxpinf} into Equation~\ref{eq:averagecaptured}, 
gives the momentum acceptance in terms of the kick $\bthetak$ as well as 
the displacement ($\xinf$) as shown in Figure~\ref{fig:ddelta_dx}(left).
Substituting into Equation~\ref{eq:ddelta}, 
gives the differential of the momentum acceptance in terms of displacement $\xinf$  and kick. (see Figure~\ref{fig:ddelta_dx}(right)). 
\begin{eqnarray}
\der{\delta}{\xinf}&=&\frac{1}{2\eta}\left[1-(B(\xinf-x_0)\beta)^2\left(\frac{1}{A^2-(\xinf-\bthetak\beta)^2}+\frac{2(\xinf-\bthetak\beta)^2}{(A^2-(\xinf-\bthetak\beta)^2)^2}\right)
-2B^2\beta^2(\xinf-x_0)\frac{\xinf-\bthetak\beta}{A^2-(\xinf-\bthetak\beta)^2}\right]\nonumber\\
&=&\frac{1}{2\eta}\left[1-\frac{\beta^2 B^2(\xinf-x_0)}{A^2-(\xinf-\bthetak\beta)^2}\left((\xinf-x_0)\left(1+\frac{2(\xinf-\bthetak\beta)^2}{A^2-(\xinf-\bthetak\beta)^2}\right)
-2(\xinf-\bthetak\beta)\right)\right]
\end{eqnarray}
\end{comment}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/delta_vs_x.pdf}
  \includegraphics[width=0.45\linewidth]{figures/ddelta_dx.pdf}
\caption{(left)Momentum acceptance vs displacement at the inflector exit for various kick angles. 
(right) $d\delta/dx_{inf}$ versus $\xinf$ for various kick angles $\theta_k$.
The {\it perfect} kick angle $\theta_k=10.2$ mrad steers the magic momentum particle onto its closed orbit.}
\label{fig:ddelta_dx}
\end{figure}

\subsection{Early to Late}
The average shift in $\omega_a$ 
\begin{equation}
\vev{\Delta\omega_a}=\der{\vev{\phi_a}}{\gamma}\der{\vev{\gamma}}{t}=\der{\vev{\phi_a}}{\xinf}\der{\xinf}{\gamma}\der{\vev{\gamma}}{t}\label{eq:domega}
\end{equation}
and
\begin{eqnarray*}
\der{\vev{\phi_a}}{x_{inf}}&=&\left(\der{\vev{\phi_a}}{x_{M5}}\right)\left(\der{x_{M5}}{x_{inf}}\right)\\
&=&(-0.25\ {\rm mrad/mm})\times(\frac{1}{-0.1057}) = 2.37\ {\rm mrad/mm}
\end{eqnarray*}
Since $\delta = \frac{p-p_0}{p_0}\sim \frac{\gamma-\gamma_0}{\gamma_0}$, then $\der{\delta}{\gamma}=\frac{1}{\gamma_0}$ and  
~\ref{eq:domega} becomes
\begin{eqnarray*}
\vev{\Delta\omega_a}&=&\der{\vev{\phi_a}}{\xinf}\der{\xinf}{\delta}\der{\delta}{\gamma}\der{\vev{\gamma}}{t}\\
&=& \left(2.37\ {\rm mrad/mm}\right)\der{\xinf}{\delta}\frac{1}{\gamma}\der{\vev{\gamma}}{t}
\end{eqnarray*}
The rate of change of the average energy in the stored beam $\der{\vev{\gamma}}{t}$ depends on the initial distribution. Assuming that the 
energy distribution in E989 is the same as in 
E821, we use the result from Equation 15 in Crnkovic\cite{crnkovic:IPAC2016-TUPMR028}. Namely
$$\der{\vev{\gamma}}{t}= 5.6\times 10^{-7}\frac{1}{\mu s}.$$
Then
\begin{eqnarray*}
\Delta \omega &=& \left(2.37\ {\rm mrad/mm}\right)\left(\der{\xinf}{\delta}[{\rm mm}]\right)\frac{5.6\times 10^{-7}}{29.3}\frac{1}{\mu s}\\
&=& 0.45\times 10^{-7}\frac{\rm mrad}{\mu s-{\rm mm}}\left(\der{\xinf}{\delta}[{\rm mm}]\right)
\end{eqnarray*}
The fractional shifts in $\omega_a$ as a function of $\xinf$ for minimum, optimum, and maximum kicks are shown in Figure~\ref{fig:delta_omega}.
\begin{figure}[h]
\centering
  \includegraphics[width=0.55\linewidth]{figures/delta_omega.pdf}
\caption{Dependence of $\Delta \omega_a/\omega_a$ on $\xinf$ and kick angle $\theta_k$}
\label{fig:delta_omega}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/phasespaceM5.pdf}
  \includegraphics[width=0.45\linewidth]{figures/phasespaceINF.pdf}
\caption{$x$ -$\xp$ correlation at the end of M5 (left) and at the inflector exit (right).}
\label{fig:phasespaceM5}
\end{figure}

\section{Appendix}
\label{sec:appendix}
The injection channel extends from 3mm upstread of IBMS1\cite{brynn26665-v1} to the downstream end of the inflector. The BMAD model is based on field maps of the residual field in the hole through the backleg iron,
the, dipole fringe field and the superposed inflector field. The inflector is rotated clockwise about its downstream end by 2 mrad. The 2X2 transfer matrix is defined by according to 
\begin{equation}
\begin{pmatrix}x\cr x^\prime\end{pmatrix}_{End} = T\begin{pmatrix}x\cr x^\prime\end{pmatrix}_{Start}
\begin{pmatrix}x\cr x^\prime\end{pmatrix}_{Start}
\end{equation}
where $x$ and $x^\prime$ are offset and angle with respect to the 'design' trajetory. The pathlength of the design trajectory is 4.4 m.
The 2X2 transfer matrix for the injection channel is 
\begin{equation}
 T=\begin{pmatrix}  2.4167 & 8.0280\ {\rm m}\cr  0.9970\ {\rm m^{-1}} &  3.7256\end{pmatrix}
\end{equation}
The derivatives $\der{\vev{\phi_a}}{x}$ and $\der{\vev{phi_a}}{x^\prime}$ are evaluated at the end point of the simulation. The end point of the simulation is not 
well defined. It is presumed to be somewhere between the downstream end of Q025 (the last quad in the M5 beam line)(A), and 33mm downstream of IBMS1 (B). We refer to the
extremes as end point A and endpoint B respectively. The downstream end of Q025 (endpoint A) is 909 mm upstream from 
the start of the injection channel, and  endpoint B is 36mm downstream from the start. 
The transfer matrices from points A and B to the end of the injection channel are
\begin{eqnarray}
T_{A-End} &=& \begin{pmatrix}  2.4149 &  10.307 \ {\rm m}\cr  0.9959\ {\rm m^{-1}} &  4.6649\end{pmatrix}\\
T_{B-End} &=& \begin{pmatrix}  2.4149 &  8.0250\ {\rm m}\cr   0.9594\ {\rm m^{-1}} &  3.7238\end{pmatrix}
\end{eqnarray}
The twiss parameters at the endpoint are used to compute the derivatives in Equation~\ref{eq:xoverxp}.
We assume the measured twiss parameters\cite{brynn26665-v1} 10cm upstream of IBMS1 and propagate to endpoints A or B as needed. For reference, the $\beta$-function from endpoint A through the injecton channel is
shown in Figure~\ref{fig:beta}. 
\begin{figure}[h]
\centering
  \includegraphics[width=0.8\linewidth]{figures/injection_line_twiss.pdf}
\caption{$\beta$-function from the end of Q025 (last quad in M5 line) to inflector exit.}
\label{fig:beta}
\end{figure}
