% ****** Start of file apssamp.tex ******
%
%   This file is part of the APS files in the REVTeX 4.2 distribution.
%   Version 4.2a of REVTeX, December 2014
%
%   Copyright (c) 2014 The American Physical Society.
%
%   See the REVTeX 4 README file for restrictions and more information.
%
% TeX'ing this file requires that you have AMS-LaTeX 2.0 installed
% as well as the rest of the prerequisites for REVTeX 4.2
%
% See the REVTeX 4 README file
% It also requires running BibTeX. The commands are as follows:
%
%  1)  latex apssamp.tex
%  2)  bibtex apssamp
%  3)  latex apssamp.tex
%  4)  latex apssamp.tex
%\documentclass[preprint,...]{revtex4-2} is supposed to be 1 column

%\documentclass[10pt,aps,prd,twocolumn,superscriptaddress,showpacs,altaffilletter]{revtex4-2}
\documentclass[%
%twocolumn,
superscriptaddress,
showpacs,
altaffilletter,
%preprint,
preprintnumbers,
nofootinbib,
%nobibnotes,
%bibnotes,
 amsmath,
 amssymb,
aps,
prd,
%floatfix,
]{revtex4-2}
%\usepackage}% add hypertext capabilities
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math

%\hypersetup{colorlinks=true, citecolor=blue, urlcolor=blue, linkcolor=blue}
%\usepackage[mathlines]{lineno}% Enable numbering of text and display math
%\linenumbers\relax % Commence numbering lines

%\usepackage[showframe,%Uncomment any one of the following lines to test
%%scale=0.7, marginratio={1:1, 2:3}, ignoreall,% default settings
%%text={7in,10in},centering,
%%margin=1.5in,
%%total={6.5in,8.75in}, top=1.2in, left=0.9in, includefoot,
%%height=10in,a5paper,hmargin={3cm,0.8in},
%]{geometry}

\usepackage[alsoload=hep]{siunitx} % use \SI{}{} % use hep to get the right c

\usepackage{xcolor} % use \textcolor{}{}
%%%\usepackage{subfigure}
\usepackage{subcaption}% For use with subfigures
\usepackage{comment} % to comment out large sections but not remove them from these files

\usepackage{tikz}% A graphics class used to overlay text on images
\usepackage[printwatermark]{xwatermark}% Print a DRAFT watermark on every page
%%%\newsavebox\mybox\savebox\mybox{\tikz[color=green!50,opacity=0.5]\node{DRAFT};}
%%\newwatermark*[allpages,angle=45,scale=16,xpos=-54,ypos=57]{\usebox\mybox}% Print a DRAFT watermark on every page.

\usepackage[ampersand]{easylist} % Use nested bullet points.
%\usepackage[doublespacing]{setspace}
\usepackage{cancel}
\usepackage{enumitem}
\usepackage[bottom]{footmisc}
%\usepackage[symbol]{footmisc}
%\renewcommand{\thefootnote}{\fnsymbol{footnote}}

% g-2:
\newcommand{\gm}{\ensuremath{(g-2)}}
\newcommand{\wa}{\mbox{\ensuremath{\omega_a}}}
\renewcommand{\wp}{\mbox{\ensuremath{\omega_p}}}
%\renewcommand{\amu}{\ensuremath{a_\mu}}
%\newcommand{\gmtwo}{\ensuremath{g-2}}
\newcommand{\gmtwo}{\ensuremath{g\!-\!2}}
% Magic Radius:
\newcommand{\rmagic}{\ensuremath{R_{0}}}
% Magic Circumference:
\newcommand{\cmagic}{\ensuremath{C_{0}}}
% Magic Momentum:
\newcommand{\pmagic}{\ensuremath{p_{0}}}
%\newcommand{\pmagic}{\ensuremath{p_{\textnormal{mag}}}}
% Magic Lorentz Factor:
\newcommand{\gammamagic}{\ensuremath{\gamma_{0}}}
% Magic Beta:
\newcommand{\betamagic}{\ensuremath{\beta_{0}}}
% Dipole magnetic field
\newcommand{\dipbfield}{\ensuremath{B_{0}}}
% Run-1
\newcommand{\runone}{Run-1}
% Run-2
\newcommand{\runtwo}{Run-2}
% Run-3
\newcommand{\runthree}{Run-3}
\newcommand\runonea{Run 1a}
\newcommand\runoneb{Run 1b}
\newcommand\runonec{Run 1c}
\newcommand\runoned{Run 1d}
%\input{/Users/dlr10/papers/macros.tex}
%\input{/Users/dlr10/papers/Definitions}
\input{/Users/dlr/papers/Definitions}
%\input{/Users/david/papers/Definitions}
\def\oneonr2{{  \frac{1}{\sqrt{2}} }}
\def\bmhr{{\hat{\bm\rho}}}
\def\bmhp{{\hat{\bm\phi}}}
\def\bmbetahat{{\hat{\bm\beta}}}
\def\bfs{{\bf s}}
\def\bfhz{{\hat{\bf z}}}
\def\bfhx{{\hat{\bf x}}}
\def\bfhy{{\hat{\bf y}}}
\graphicspath{{./fig/}}

\begin{document}
%\preprint{doc \# ?}
\title{Contribution to polarization tilt angle from EDM and radial B-field}
\author{D. Rubin}
%\input{tex/00_title_and_authors}

\date{\today}% It is always \today, today,
             %  but any date may be explicitly specified

%\input{abstract}

\maketitle % call abstract environment before \maketitle

%\tableofcontents

%% tex these
%\begin{flushright}
%D. Rubin\phantom{septemb}\\
%December 1, 2020
%\end{flushright}
%\begin{center}
%{\bf \Large Pion decay}
%\end{center}
%\input{differentialdecay}
%\input{NoteToPaul}



\noindent
The polarization ${\bf S}$ of the muon evolves along its trajectory according to
\begin{eqnarray*}
\frac{d}{ds}{\bf S} &=& \left\{\frac{1+{\bf r\cdot g})}{c\beta_z}(\bm \Omega_{BMT}+\Omega_{EDM})-({\bf g\times \hat z}\right\}\times {\bf S}
\end{eqnarray*}
where
\begin{eqnarray*}
{\bm \Omega}_{BMT} &=&-\frac{q}{mc}\left[\left(\frac{1}{\gamma}+a\right)c{\bf B}-\frac{a\gamma c}{1+\gamma}({\bm \beta}\cdot{\bf B}){\bm \beta}-\left(a+\frac{1}{1+\gamma}\right){\bm\beta}\times{\bf E}\right]\\ 
{\bm \Omega}_{EDM} &=& -\frac{q\eta}{2mc}\left[{\bf E}-\frac{\gamma}{1+\gamma}({\bm\beta}\cdot{\bf E}){\bm \beta}+c{\bm\beta}\times{\bf B}\right]
\end{eqnarray*}
The contribution to ${\bm\Omega}_{BMT}$ due to the radial component of the  magnetic field is
\begin{equation}
{\bm\Omega}^{rad}_{BMT} = -\frac{q}{mc}\left(\frac{1}{\gamma}+a\right)c B_{rad}{\bf\hat x}\label{eq:bmt}
\end{equation}
Meanwhile, an EDM contributes
$${\bm \Omega}_{EMD} = -\frac{q\eta}{2mc}c{\bm\beta}\times{\bf B}$$
Now according to the Lorentz force law, the force on the particle is given by $$F = q({\bm\beta}\times{\bf B})$$
The direction of the force is radially inward (by definition), that is, in the $-{\bf \hat x}$ direction.
Therefore the contributon from the EDM is
\begin{equation}
{\bm \Omega}^{rad}_{EMD} = -\frac{q\eta}{2mc}c(-\beta B_z) {\bf\hat x}\label{eq:edm}
\end{equation}
Sure enough the contribution to the rate of change of the polarization in the radial direction,($\frac{d}{ds}{\bf S}$) due a magnetic field in the +x direction (radially outward) (~\ref{eq:bmt}) and an EDM with $\eta>0$ (~\ref{eq:edm}) are in opposite directions.  

\section{Longitudinal field}
Suppose there is a longitudinal field along the magic circumference of the form
\begin{equation}
B_l(\phi) = B_{l0}\sin(m\phi)\label{eq:long}
\end{equation}
and $m=1$.
The general solution to the Laplacian in cylindrical coordinates is
$$\psi=\sum_{m=0}^\infty\sum_{n=1}^\infty J_m(k_{mn}\rho)(\sinh(k_{mn}z)(A_{mn}\sin m\phi+B_{mn}\cos m\phi)+\cosh(k_{mn}z_(C_{mn}\sin m\phi+D_{mn}\sin m\phi))$$ 
Then ${\bf B}={\bf \nabla}\psi \rightarrow$
\begin{eqnarray*}
B_z&=&\sum_{m=0}^\infty \sum_{n=1}^\infty J_m(k_{mn}\rho)k_{mn}(\cosh(k_{mn} z)(A_m\sin m\phi+B_m\cos m\phi)-\sinh(k_{mn} z)(C_m\sin m\phi + D_m \cos m\phi))\\
B_\rho&=&\sum_{m=0}^\infty \sum_{n=1}^\infty\partder{J_m}{\rho}(k_{mn}\rho)(\sinh(k_{mn} z)(A_m\sin m\phi+B_m\cos m\phi)+\cosh(k_{mn} z)(C_m\sin m\phi + D_m \cos m\phi))\\
B_\phi&=&\sum_{m=0}^\infty\sum_{n=1}^\infty \frac{J_m(k_{mn}\rho)}{\rho}m(\sinh(k_{mn} z)(A_m\cos m\phi-B_m\sin m\phi)+\cosh(k_{mn} z)(C_m\cos m\phi - D_m \sin m\phi))
\end{eqnarray*}
For the form of longitudinal field in Equation~\ref{eq:long}, $m=1$. Then

\begin{eqnarray}
B_z&=& \sum_{n=1}^\infty J_1(k_{1n}\rho)k_{1n}(\cosh(k_{1n} z)(A_{1n}\sin \phi+B_{1n}\cos \phi)-\sinh(k_{1n} z)(C_{1n}\sin \phi + D_{1n} \cos \phi))\label{eq:Bz}\\
B_\rho&=&\sum_{n=1}^\infty \partder{J_1}{\rho}(k_{1n}\rho)(\sinh(k_{1n} z)(A_{1n}\sin \phi+B_{1n}\cos \phi)+\cosh(k_{1n} z)(C_{1n}\sin \phi + D_{1n} \cos \phi))\label{eq:Brho}\\
B_\phi&=&\sum_{n=1}^\infty\frac{J_1(k_{1n}\rho)}{\rho}(\sinh(k_{1n} z)(A_{1n}\cos \phi-B_{1n}\sin \phi)+\cosh(k_{1n} z)(C_{1n}\cos \phi - D_{1n} \sin\phi))\label{eq:Bphi}
\end{eqnarray}
Consider boundary conditions such that when $z=0$  (where $\rho_0=\rho_{magic}$), $B_z=0$  and when $\rho=\rho_{bl}$, $B_z=0$ for all $z$. 
Then $A_{1n}=B_{1n}=0$, and $k_{11}\rho_0 = x_{11}$  (the first zero of $J_1$).
\begin{eqnarray*}
B_z&=& J_1(k_{11}\rho)k_{11}(\sinh(k_{11}z)(C_{11}\sin \phi+D_{11}\cos \phi)\\
B_\rho&=& \partder{J_1}{\rho}(k_{11}\rho)(\cosh(k_{11}z)(C_{11}\sin \phi + D_{11} \cos \phi))\\
B_\phi&=&\frac{J_1(k_{11}\rho)}{\rho}\cosh(k_{11}z)(C_{11}\cos \phi - D_{11} \sin \phi))
\end{eqnarray*}
where $k_{11} = x_{11}/\rho_{bl}$
And let's chose the phase so that $C_{1n}=0$
\begin{eqnarray*}
B_z&=& J_1(k_{11}\rho)k_{11}(\sinh(k_{11}z)(D_{11}\cos \phi)\\
B_\rho&=& \partder{J_1}{\rho}(k_{11}\rho)(\cosh(k_{11}z)(D_{11}\cos \phi))\\
B_\phi&=&-\frac{J_1(k_{11}\rho)}{\rho}\cosh(k_{11}z)(D_{11}\sin \phi)
\end{eqnarray*}

Evidently 
$$B_{l0}=-\frac{J_1(k_{11}\rho_0)}{\rho_0}D_{11}$$ and
$$D_{11} = -B_{l0}\frac{\rho_0}{J_1(k_{11}\rho_0)}$$
Then
\begin{eqnarray*}
B_\rho(z=0) &=& D_1\partder{J_1}{\rho}(k_{11}\rho)\cos\phi\\
B_z(z=0) &=& 0
\end{eqnarray*}
We really should sum over all $n$.

In general
\begin{eqnarray*}
B_z&=& \sum_n J_1(k_{1n}\rho)k_{1n}(\sinh(k_{1n}z)(C_{1n}\sin \phi+D_{1n}\cos \phi)\\
B_\rho&=& \sum_n \partder{J_1}{\rho}(k_{1n}\rho)(\cosh(k_{1n}z)(C_{1n}\sin \phi + D_{1n} \cos \phi))\\
B_\phi&=&\sum_n \frac{J_1(k_{1n}\rho)}{\rho}\cosh(k_{1n}z)(C_{1n}\cos \phi - D_{1n} \sin \phi))
\end{eqnarray*}
where $k_{1n} = x_{1n}/\rho_{bl}$
And let's chose the phase so that $C_{1n}=0$
\begin{eqnarray*}
B_z&=& \sum_n J_1(k_{1n}\rho)k_{1n}(\sinh(k_{1n}z)(D_{1n}\cos \phi)\\
B_\rho&=& \sum_n \partder{J_1}{\rho}(k_{1n}\rho)(\cosh(k_{1n}z)(D_{1n}\cos \phi))\\
B_\phi&=&-\sum_n \frac{J_1(k_{1n}\rho)}{\rho}\cosh(k_{1n}z)(D_{1n}\sin \phi)
\end{eqnarray*}

If only a single $n$ contributes

$$B_{l0}=-\frac{J_1(k_{1n}\rho_0)}{\rho_0}D_{1n}$$ and
$$D_{1n} = -B_{l0}\frac{\rho_0}{J_1(k_{1n}\rho_0)}$$
Then
\begin{eqnarray*}
B_\rho(z=0) &=& D_1\partder{J_1}{\rho}(k_{1n}\rho)\cos\phi\\
B_z(z=0) &=& 0
\end{eqnarray*}

\subsection{Boundary conditions revisited}
The g-2 c-shaped magnet imposes boundary conditions on the fields.
Tangential fields are zero at the surfaces of the iron, including the pole faces, and the back leg.
As discussed above, we insure that the vertical and longitudinal fields are zero on the back leg by choosing $k$ such that $k\rho_{bl}$ is a zero of the Bessel function.
On the pole faces the tangential fields are the longitudinal and the radial components. 

Returning to Equations ~\ref{eq:Bz}-\ref{eq:Bphi}
\begin{eqnarray}
B_z&=& \sum_{n=1}^\infty J_1(k_{1n}\rho)k_{1n}(\cosh(k_{1n} z)(A_{1n}\sin \phi+B_{1n}\cos \phi)-\sinh(k_{1n} z)(C_{1n}\sin \phi + D_{1n} \cos \phi))\label{eq:Bz0}\\
B_\rho&=&\sum_{n=1}^\infty \partder{J_1}{\rho}(k_{1n}\rho)(\sinh(k_{1n} z)(A_{1n}\sin \phi+B_{1n}\cos \phi)+\cosh(k_{1n} z)(C_{1n}\sin \phi + D_{1n} \cos \phi))\label{eq:Brho0}\\
B_\phi&=&\sum_{n=1}^\infty\frac{J_1(k_{1n}\rho)}{\rho}(\sinh(k_{1n} z)(A_{1n}\cos \phi-B_{1n}\sin \phi)+\cosh(k_{1n} z)(C_{1n}\cos \phi - D_{1n} \sin\phi))\label{eq:Bphi0}
\end{eqnarray}
we see that we will need both $\cosh$ and $\sinh$ terms to force $B_\rho$ and $B_\phi$ to vanish on the poles. Again choose the phase such that $C_{11}=A_{11}=0$. Now
\begin{eqnarray}
B_z&=& \sum_{n=1}^\infty J_1(k_{1n}\rho)k_{1n}(\cosh(k_{1n} z)B_{1n}-\sinh(k_{1n} z) D_{1n}) \cos \phi\label{eq:Bz0}\\
B_\rho&=&\sum_{n=1}^\infty \partder{J_1}{\rho}(k_{1n}\rho)(\sinh(k_{1n} z)B_{1n}+\cosh(k_{1n} z) D_{1n}) \cos \phi\label{eq:Brho0}\\
B_\phi&=&-\sum_{n=1}^\infty\frac{J_1(k_{1n}\rho)}{\rho}(\sinh(k_{1n} z)B_{1n}+\cosh(k_{1n} z) D_{1n}) \sin\phi\label{eq:Bphi0}
\end{eqnarray}

Then $B_\rho(z=\pm g/2)=B_\phi(z=\pm g/2)=0$ implies
\begin{eqnarray*}
  0&=&  \pm \sinh(k_{1n}g/2)B_{1n}+\cosh(k_{1n}g/2)D_{1n}\\
  &\rightarrow& \frac{D_{1n}}{B_{1n}}=\pm \tanh(k_{1n}g/2)
\end{eqnarray*}
which can not be. It seems that we can not satisfy the boundary conditions with a single Bessel term.
\begin{eqnarray*}
B_z&=& \sum_{n=1}^\infty J_1(k_{1n}\rho)k_{1n}(B_{1n}\cos \phi)\\
B_\rho&=&\sum_{n=1}^\infty \partder{J_1}{\rho}(k_{1n}\rho) D_{1n} \cos \phi\\
B_\phi&=&\sum_{n=1}^\infty\frac{J_1(k_{1n}\rho)}{\rho}(- D_{1n} \sin\phi))
\end{eqnarray*}

As before
$$B_{l0}=-\frac{J_1(k_{11}\rho_0)}{\rho_0}D_{11}$$ and
$$D_{11} = -B_{l0}\frac{\rho_0}{J_1(k_{11}\rho_0)}$$

and $B_{1n}=D_{1n}coth(k_{1n}g/2)$
Evidently the finite longitudinal $m=1$ field implies the existence of an $m=1$ vertical field in the midplane.

\subsection{Basics}
Let
\begin{eqnarray*}
  B_\phi &=& f(\rho,z)\cos\phi\\
  \frac{d B_\phi}{d\phi} &=& -f(\rho,z)\sin\phi = -\left(\frac{d B_\rho}{d\rho}+\frac{ d B_z}{dz}\right)\\
  &\rightarrow& f = \frac{df}{d\rho}+\frac{df}{dz}\\
  \frac{d B_\phi}{d\rho} &=& \frac{df(\rho,z)}{d\rho}\cos\phi = -\frac{d B_\rho}{d\phi}\rightarrow B_\rho = -\frac{df(\rho,z)}{d\rho}\sin\phi\\
  \frac{d B_\phi}{dz} &=& \frac{df(\rho,z)}{dz}\cos\phi = -\frac{d B_z}{d\phi}\rightarrow B_z=\frac{df}{dz}\sin\phi\\
  \frac{d B_\rho}{dz}&=&\frac{d B_z}{d\rho} = \frac{d^2 f}{dz d\rho}\sin\phi=\frac{d^2 f}{d\rho dz}\sin\phi
  \end{eqnarray*}

If seperaple $f(\rho,z)=g(\rho)h(z)$
then
\begin{eqnarray*}
  gh &=& \frac{dg}{d\rho}h +g\frac{dh}{dz}\\
  &\rightarrow& 1= \frac{1}{g}\frac{dg}{d\rho}+\frac{1}{h}\frac{dh}{dz}
\end{eqnarray*}
Maybe then $$c_\rho d\rho=\frac{dg}{g}\rightarrow c_\rho \rho + d_\rho = \ln g$$ and $$c_zdz = \frac{dh}{h}\rightarrow c_z z+d_z = \ln{h}$$

Then try
\begin{eqnarray*}
  f(\rho,z) &=& (A\cosh k_\rho \rho+B\sinh k_\rho \rho) (C\cosh k_z z + D\sinh k_z z)\\
   B_\phi &=& (A\cosh k_\rho \rho+B\sinh k_\rho \rho) (C\cosh k_z z + D\sinh k_z z)\cos\phi\\
  B_\rho &=& \frac{1}{\rho}k_z(A\cosh k_\rho \rho + B\sinh k_\rho \rho)(-C\sinh k_z z+ D\cosh k_z z)\sin\phi\\
  B_z &=& k_\rho(-A\sinh k_\rho \rho+B\cosh k_\rho \rho)k_z (-C\sinh k_z z + D\cosh k_z z)\sin\phi
\end{eqnarray*}

\subsection{Vector Operators}
\begin{eqnarray*}
  \nabla\cdot {\bf A}&=& \frac{1}{\rho}\partder{(\rho A_\rho)}{\rho}+\frac{1}{\rho}\partder{A_\phi}{\phi}+\partder{A_z}{z}\\
  \nabla\times {\bf A}&=& \left(\frac{1}{\rho}\partder{A_z}{\phi}-\partder{A_\phi}{z}\right){\bf\hat\rho}+\left(\partder{A_\rho}{z}-\partder{A_z}{\rho}\right){\bf\hat\phi}+\frac{1}{\rho}\left(\partder{(\rho A_\phi)}{\rho}-\partder{A_\rho}{\phi}\right){\bf\hat z}
  \end{eqnarray*}

\begin{eqnarray*}
  \nabla\cdot {\bf B} &=&\frac{1}{\rho}k_\rho(-A\sinh k_\rho \rho + B\cosh k_\rho \rho)(-C\sinh k_z z+ D\cosh k_z z)\sin\phi\\
  &+& -\frac{1}{\rho}(A\cosh k_\rho \rho+B\sinh k_\rho \rho) (C\cosh k_z z + D\sinh k_z z)\sin\phi\\
&+& 
\end{eqnarray*}
\bibliography{header}% Produces the bibliography via BibTeX.

\end{document}
%
% ****** End of file apssamp.tex ******
 =-
