How do I compute a Mueller matrix for a refracted ray? When I consult most resources, I get a set of equations for Fresnel reflection and transmission which look like this:
$$
  r_\text{s} = \frac{n_1 \cos \theta_\text{i} - n_2 \cos \theta_\text{t}}
                    {n_1 \cos \theta_\text{i} + n_2 \cos \theta_\text{t}} \\
  t_\text{s} = \frac{2 n_1 \cos \theta_\text{i}}
                    {n_1 \cos \theta_\text{i} + n_2 \cos \theta_\text{t}} \\
  r_\text{p} = \frac{n_2 \cos \theta_\text{i} - n_1 \cos \theta_\text{t}}
                    {n_2 \cos \theta_\text{i} + n_1 \cos \theta_\text{t}} \\
  t_\text{p} = \frac{2 n_1 \cos \theta_\text{i}}
                    {n_2 \cos \theta_\text{i} + n_1 \cos \theta_\text{t}}
$$
Where,

*

*$r_\text{s/p}$ are the reflected intensities of perpendicular/parallel polarised light

*$t_\text{s/p}$ are the reflected transmissions of perpendicular/parallel polarised light

*$n_1$ and $n_2$ are the (potentially complex) indices of refraction

*$\theta_\text{i}$ is the angle of incidence

*$\theta_\text{t}$ is the angle of transmission

My aim is to convert these to usable Mueller matrices so that I can use them to transform Stokes vectors, which would determine the amount of light of each polarisation type which is refracted.
A ray tracer project I found had done this for reflection only, but their equations look considerably different:
$$
2a^2 = \sqrt{(n^2 - \kappa^2 - \sin^2 \theta)^2 + 4 n^2 \kappa^2} + n^2 - \kappa^2 - \sin^2 \theta \\
2b^2 = \sqrt{(n^2 - \kappa^2 - \sin^2 \theta)^2 + 4 n^2 \kappa^2} - n^2 + \kappa^2 + \sin^2 \theta \\
\\
F_\text{s} = \frac{a^2 + b^2 - 2 a \cos \theta + \cos^2 \theta}
                  {a^2 + b^2 + 2 a \cos \theta + \cos^2 \theta} \\
F_\text{p} = \frac{a^2 + b^2 - 2 a \sin \theta \tan \theta + \sin^2 \theta \tan^2 \theta}
                  {a^2 + b^2 + 2 a \sin \theta \tan \theta + \sin^2 \theta \tan^2 \theta} \\
δ_\text{s} = \arctan{\frac{2b \cos \theta}
                          {\cos^2 \theta - a^2 - b^2}} \\
δ_\text{p} = \arctan{\frac{2 \cos \theta((n^2 - \kappa^2) b - (2 n \kappa) a}
                          {(n^2 + \kappa^2)^2 \cos^2 \theta - a^2 - b^2}} \\
\\
A = \frac {F_\text{s} + F_\text{p}}{2}\\
B = \frac {F_\text{s} - F_\text{p}}{2}\\
C = \cos(\delta_\text{s} - \delta_\text{p})\sqrt{F_\text{s} F_\text{p}}\\
S = \sin(\delta_\text{s} - \delta_\text{p})\sqrt{F_\text{s} F_\text{p}}\\
\\
M = \begin{bmatrix}
A & B & 0 & 0\\
B & A & 0 & 0\\
0 & 0 & C & S\\
0 & 0 & -S & S\\
\end{bmatrix}
$$
Where,

*

*$\tilde{n} = n + i \kappa$ is the relative index of refraction ($= \frac{n_2}{n_1}$)

*$\theta$ is the angle of incidence

I guess the real question is,
How do I compute a Mueller matrix for the transmitted (refracted) ray?
Subtracting the reflected result from the incoming Stokes vector doesn't appear to be correct unless $\kappa = 0$.
Alternatively, how do I get from the two Fresnel equations for reflectance $r_\text{s}$ and $r_\text{p}$, to the four equations for reflectance $F_\text{s}$, $F_\text{p}$, $\delta_\text{s}$ and $\delta_\text{p}$? If I figure out how to do that, then I think I could apply the same logic to the equations for transmission and get a result from there.
Parts of this which I don't have issue with:

*

*The second set of equations only use the angle of incidence so they are clearly using Snell's Law and trigonometric identities to remove the angle of transmission from the equations. This does mean that the angles it's dealing with are complex angles, but I guess that's fine.

*The second set of equations splits the complex index of refraction into two parts so it has probably done that and then expanded the result. But there is no $i$ anywhere in the result so I assume they're doing something to the complex values when they get them back. Is it something like, converting to polar coordinates? 

I attempted to follow the trail of sources to see if some paper spelled it out, but it really seems like it's papers all the way down. (The best lead I have is an expensive textbook which I can't confirm actually contains the answer.)
 A: In this publication you find the Müller Matrices for Reflection and Transmission  :  H. Lindqvist et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 217 (2018) 329–337.
In order to derive them, you just assume that for each mode (parallel = TM, perpendicular = TE), you have a linear relationship between the R ot T field and the incident field, and the ratio are precisely the Fresnel coefficient.  Then you use the definition of the Stokes vector ( I = E_p * Ep_s' + E_s * E_s' ,  etc [where I use ' for complex conjugate]).   Then express the square terms in the fields in terms of the incident Stokes parameters :
E_p * E_p' = 0.5*(I+Q)
E_s * E_s' = 0.5*(I-Q)
E_p * E_s* = 0.5 * (U - j * V)
E_s * E_p* = 0.5 * (U + j * V)
You easily get the results as given in the above reference.
A: An interesting paper about the  same issue can be found here.  Same formula as the Lindqvist Paper I've already cited :
https://inis.iaea.org/collection/NCLCollectionStore/_Public/47/072/47072985.pdf?r=1
Reflection and transmission coefficients:
(subscript l for parallel, r for perpendicular)
$$
R_l = {n_b\cos\theta_a - n_a\cos\theta_b
          \over n_b\cos\theta_a + n_a\cos\theta_b}
$$
$$
R_r = {n_a\cos\theta_a - n_b\cos\theta_b
          \over n_a\cos\theta_a + n_b\cos\theta_b}
$$
$$
T_l = {2n_a\cos\theta_a
          \over n_b\cos\theta_a + n_a\cos\theta_b}
$$
$$
T_r = {2n_a\cos\theta_a
           \over n_a\cos\theta_a + n_b\cos\theta_b}
$$
Forming the Mueller matrices:
$$
R_\text{ab} = \begin{pmatrix}
{\frac 1 2}(R_l R_l^* + R_r R_r^*) &
{\frac 1 2}(R_l R_l^* - R_r R_r^*) ​& 0 & 0 \\
{\frac 1 2}(R_l R_l^* - R_r R_r^*) &
{\frac 1 2}(R_l R_l^* + R_r R_r^*) & 0 & 0 \\
0 & 0 & {\mathfrak R}\{R_l R_r^*\} & {\mathfrak I}\{R_l R_r^*\} \\
0 & 0 & -{\mathfrak I}\{R_l R_r^*\} & {\mathfrak R}\{R_l R_r^*\} \\
\end{pmatrix}
$$
$$
T_\text{ab} = f_T \begin{pmatrix}
{\frac 1 2}(T_l T_l^* + T_r T_r^*) &
{\frac 1 2}(T_l T_l^* - T_r T_r^*) ​& 0 & 0 \\
{\frac 1 2}(T_l T_l^* - T_r T_r^*) &
{\frac 1 2}(T_l T_l^* + T_r T_r^*) & 0 & 0 \\
0 & 0 & {\mathfrak R}\{T_l T_r^*\} & {\mathfrak I}\{T_l T_r^*\} \\
0 & 0 & -{\mathfrak I}\{T_l T_r^*\} & {\mathfrak R}\{T_l T_r^*\} \\
\end{pmatrix}
$$
where the transmission factor
$$
f_T = n_\text{ba}^3 \left( {\cos\theta_b \over \cos\theta_a} \right)
$$
