The SIE Lens Hans Georg Schaathun
NTNU---Norwegian University of Science and Technology
Ben David Normann
NTNU---Norwegian University of Science and Technology
SIE (Singular isothermal ellipsoid) ¶ For SIS it is possible to find high order derivatives by brute force
computer algebra. For SIE, this approach is prohibitively expensive,
and a tailor-made algorithm is required.
We will show the first and second order derivatives explicitly.
At the second order, the inverse trigonometric functions disappear,
and the problem becomes simpler, at least in some sense.
The lens potential of SIE is given as (see SIE ):
ψ SIE R ( θ E , f , λ L ; θ , ϕ ) = θ E f 1 − f 2 θ ⋅ ( [ sin ( ϕ − λ L ) ] ⋅ sin − 1 ( 1 − f 2 ⋅ sin ( ϕ − λ L ) ) + [ cos ( ϕ − λ L ) ] ⋅ sinh − 1 ( 1 − f 2 f cos ( ϕ − λ L ) ) ) . \begin{aligned}
\begin{split}
\psi^R_\textrm{SIE}(\theta_E,f,\lambda_L;\theta,\phi) & =
\theta_E\sqrt{\frac{f}{1-f^2}}\theta
\\
& \cdot \Bigg([\sin(\phi-\lambda_L)]\cdot\sin^{-1}\left(\sqrt{1-f^2}\cdot \sin{(\phi-\lambda_L)}\right)
\\&
+[\cos(\phi-\lambda_L)]\cdot\sinh^{-1}\left(\frac{\sqrt{1-f^2}}{f}\cos(\phi-\lambda_L)\right)\Bigg).
\end{split}
\end{aligned} ψ SIE R ( θ E , f , λ L ; θ , ϕ ) = θ E 1 − f 2 f θ ⋅ ( [ sin ( ϕ − λ L )] ⋅ sin − 1 ( 1 − f 2 ⋅ sin ( ϕ − λ L ) ) + [ cos ( ϕ − λ L )] ⋅ sinh − 1 ( f 1 − f 2 cos ( ϕ − λ L ) ) ) . where ( θ , ϕ ) (\theta,\phi) ( θ , ϕ ) are the polar coordinates in the lens plane,
whereas λ L \lambda_L λ L is the orientation of the ellipse.
That is, the major axis of the ellipse is θ \theta θ from the x x x -axis,
counter-clockwise.
Thus λ L \lambda_L λ L is constant across the image.
In the following, we write
f ′ = 1 − f 2 f' =\sqrt{1-f^2} f ′ = 1 − f 2 as a shorthand.
See Proof of the SIE Deflection .
The second order derivative ¶ When we proved Theorem 1 , we rotated the co-ordinate by
an angle λ L \lambda_L λ L , and this rotated frame remains important.
Given a point ( x , y ) (x,y) ( x , y ) , we write ( x ′ , y ′ ) (x',y') ( x ′ , y ′ ) for the co-ordinates in the rotated
frame, i.e.
x ′ = cos λ L ⋅ x + sin λ L ⋅ y y ′ = − sin λ L ⋅ x + cos λ L ⋅ y \begin{aligned}
x' & = \cos{\lambda_L}\cdot x+\sin{\lambda_L}\cdot y \\
y' & = -\sin{\lambda_L}\cdot x +\cos{\lambda_L}\cdot y
\end{aligned} x ′ y ′ = cos λ L ⋅ x + sin λ L ⋅ y = − sin λ L ⋅ x + cos λ L ⋅ y We also define the following shorthands:
R = x 2 + y 2 R ′ = x ′ 2 + f 2 y ′ 2 \begin{aligned}
R & =\sqrt{x^2+y^2} \\
R'& = \sqrt{x'^2+f^2y'^2}
\end{aligned} R R ′ = x 2 + y 2 = x ′2 + f 2 y ′2 We will need the following lemma.
R ′ = x ′ 2 + f 2 y ′ 2 = f 2 R 2 + f ′ 2 x ′ 2 = R 2 − f ′ 2 y ′ 2 R' = \sqrt{x'^2+f^2y'^2}
=\sqrt{f^2R^2+f'^2x'^2}=\sqrt{R^2-f'^2y'^2} R ′ = x ′2 + f 2 y ′2 = f 2 R 2 + f ′2 x ′2 = R 2 − f ′2 y ′2 Since ( x ′ , y ′ ) (x',y') ( x ′ , y ′ ) is a rotation of ( x , y ) (x,y) ( x , y ) , the vector norms
are equal, and thus
R 2 = x 2 + y 2 = x ′ 2 + y ′ 2 . R^2 = x^2 + y^2 = x'^2 + y'^2. R 2 = x 2 + y 2 = x ′2 + y ′2 . It follows that
f 2 R 2 + f ′ 2 x ′ 2 = f 2 x ′ 2 + f 2 y ′ 2 + x ′ 2 − f 2 x ′ 2 = x ′ 2 + f 2 y ′ 2 , f^2R^2 + f'^2x'2 = f^2x'^2 + f^2y'^2 + x'^2 - f^2x'^2
= x'^2 + f^2y'^2, f 2 R 2 + f ′2 x ′ 2 = f 2 x ′2 + f 2 y ′2 + x ′2 − f 2 x ′2 = x ′2 + f 2 y ′2 , which proves the middle equality.
Similarly,
R 2 − f ′ 2 y ′ 2 = x ′ 2 + y ′ 2 − y ′ 2 + f 2 y ′ 2 = x ′ 2 + f 2 y ′ 2 , R^2 - f'^2y'2 = x'^2 + y'^2 - y'^2 + f^2y'^2
= x'^2 + f^2y'^2, R 2 − f ′2 y ′ 2 = x ′2 + y ′2 − y ′2 + f 2 y ′2 = x ′2 + f 2 y ′2 , which proves the last equality.
Now we can formulate the second derivatives, as follows.
We start by finding ∂ 1 2 ψ ( x , y ) \partial_1^2\psi(x,y) ∂ 1 2 ψ ( x , y ) .
Rewriting the first derivative using ( x ′ , y ′ ) (x',y') ( x ′ , y ′ ) , we have
∂ ∂ x ψ R ( x , y ) = θ E f f ′ ⋅ ( cos λ L ⋅ sinh − 1 ( f ′ f ⋅ x ′ R ) − sin λ L ⋅ sin − 1 ( f ′ ⋅ y ′ R ) ) \begin{aligned}
\frac{\partial}{\partial x}\psi^{\mathrm{R}}(x,y) =
\theta_E\frac{\sqrt{f}}{f'}\cdot
& \bigg(
\cos\lambda_L\cdot\sinh^{-1}\left(\frac{f'}{f}\cdot\frac{x'}{R}\right)
\\& -\sin\lambda_L\cdot\sin^{-1}\left(f'\cdot\frac{y'}{R}\right)
\bigg)
\end{aligned} ∂ x ∂ ψ R ( x , y ) = θ E f ′ f ⋅ ( cos λ L ⋅ sinh − 1 ( f f ′ ⋅ R x ′ ) − sin λ L ⋅ sin − 1 ( f ′ ⋅ R y ′ ) ) Differentiating, we have
∂ 2 ∂ x 2 ψ R ( x , y ) = θ E f f ′ ⋅ ( cos λ L ⋅ ∂ ∂ x sinh − 1 ( f ′ f ⋅ x ′ R ) − sin λ L ⋅ ∂ ∂ x sin − 1 ( f ′ ⋅ y ′ R ) ) \begin{aligned}
\frac{\partial^2}{\partial x^2}\psi^{\mathrm{R}}(x,y) =
\theta_E\frac{\sqrt{f}}{f'}\cdot
& \bigg(
\cos\lambda_L\cdot\frac{\partial}{\partial x}
\sinh^{-1}\left(\frac{f'}{f}\cdot\frac{x'}{R}\right)
\\& -\sin\lambda_L\cdot\frac{\partial}{\partial x}\sin^{-1}\left(f'\cdot\frac{y'}{R}\right)
\bigg)
\end{aligned} ∂ x 2 ∂ 2 ψ R ( x , y ) = θ E f ′ f ⋅ ( cos λ L ⋅ ∂ x ∂ sinh − 1 ( f f ′ ⋅ R x ′ ) − sin λ L ⋅ ∂ x ∂ sin − 1 ( f ′ ⋅ R y ′ ) ) Let’s differentiate one term at a time.
For the sinh − 1 \sinh^{-1} sinh − 1 term (using (8) , we have
∂ ∂ x sinh − 1 ( f ′ f ⋅ x ′ R ) = 1 1 − ( f ′ f ⋅ x ′ R ) 2 ⋅ f ′ f ⋅ ∂ ∂ x x ′ R \frac{\partial}{\partial x}
\sinh^{-1}\left(\frac{f'}{f}\cdot\frac{x'}{R}\right) =
\frac1{\sqrt{1 - \left(\frac{f'}{f}\cdot\frac{x'}{R}\right)^2}}\cdot
\frac{f'}{f}\cdot\frac{\partial}{\partial x}\frac{x'}{R} ∂ x ∂ sinh − 1 ( f f ′ ⋅ R x ′ ) = 1 − ( f f ′ ⋅ R x ′ ) 2 1 ⋅ f f ′ ⋅ ∂ x ∂ R x ′ Expanding and rearranging, we have
∂ ∂ x sinh − 1 ( f ′ f ⋅ x ′ R ) = f ′ ⋅ 1 f 2 − f ′ 2 x ′ 2 R 2 ⋅ ∂ x ′ ∂ x R − x ′ ∂ R ∂ x R 2 = f ′ ⋅ 1 f 2 − f ′ 2 x ′ 2 R 2 ⋅ cos λ L ⋅ R − x ′ x R R 2 \begin{aligned}
\frac{\partial}{\partial x}
\sinh^{-1}\left(\frac{f'}{f}\cdot\frac{x'}{R}\right)
&=
f'\cdot
\frac1{\sqrt{f^2 - f'^2\frac{x'^2}{R^2}}}\cdot
\frac{\frac{\partial x'}{\partial x}R - x' \frac{\partial R}{\partial x}}{R^2}
\\&=
f'\cdot
\frac1{\sqrt{f^2 - f'^2\frac{x'^2}{R^2}}}\cdot
\frac{\cos\lambda_L\cdot R - x' \frac{x}{R}}{R^2}
\end{aligned} ∂ x ∂ sinh − 1 ( f f ′ ⋅ R x ′ ) = f ′ ⋅ f 2 − f ′2 R 2 x ′2 1 ⋅ R 2 ∂ x ∂ x ′ R − x ′ ∂ x ∂ R = f ′ ⋅ f 2 − f ′2 R 2 x ′2 1 ⋅ R 2 cos λ L ⋅ R − x ′ R x Similarly, the sin − 1 \sin^{-1} sin − 1 term (using (9) gives,
∂ ∂ x sin − 1 ( f ′ ⋅ y ′ R ) = 1 1 + ( f ′ ⋅ y ′ R ) 2 ⋅ f ′ ⋅ ∂ ∂ x y ′ R = f ′ ⋅ 1 1 + f ′ 2 ⋅ y ′ 2 R 2 ⋅ − sin λ L ⋅ R − y ′ x R R 2 \begin{aligned}
\frac{\partial}{\partial x}
\sin^{-1}\left(f'\cdot\frac{y'}{R}\right)
&=
\frac1{\sqrt{1 + \left(f'\cdot\frac{y'}{R}\right)^2}}\cdot
f'\cdot\frac{\partial}{\partial x}\frac{y'}{R}
\\ &=
f'\cdot
\frac1{\sqrt{1 + f'^2\cdot\frac{y'^2}{R^2}}}\cdot
\frac{-\sin\lambda_L\cdot R - y' \frac{x}{R}}{R^2}
\end{aligned} ∂ x ∂ sin − 1 ( f ′ ⋅ R y ′ ) = 1 + ( f ′ ⋅ R y ′ ) 2 1 ⋅ f ′ ⋅ ∂ x ∂ R y ′ = f ′ ⋅ 1 + f ′2 ⋅ R 2 y ′2 1 ⋅ R 2 − sin λ L ⋅ R − y ′ R x Combining the two terms into (12) , we have
∂ 2 ∂ x 2 ψ R ( x , y ) = θ E f ⋅ ( cos λ L ⋅ 1 f 2 − f ′ 2 x ′ 2 R 2 ⋅ cos λ L ⋅ R − x ′ x R R 2 + sin λ L ⋅ 1 1 + f ′ 2 ⋅ y ′ 2 R 2 ⋅ sin λ L ⋅ R + y ′ x R R 2 ) \begin{aligned}
\frac{\partial^2}{\partial x^2}\psi^{\mathrm{R}}(x,y) =
\theta_E\sqrt{f}\cdot
& \bigg(
\cos\lambda_L\cdot
\frac1{\sqrt{f^2 - f'^2\frac{x'^2}{R^2}}}\cdot
\frac{\cos\lambda_L\cdot R - x' \frac{x}{R}}{R^2}
\\&+
\sin\lambda_L\cdot
\frac1{\sqrt{1 + f'^2\cdot\frac{y'^2}{R^2}}}\cdot
\frac{\sin\lambda_L\cdot R + y' \frac{x}{R}}{R^2}
\bigg)
\end{aligned} ∂ x 2 ∂ 2 ψ R ( x , y ) = θ E f ⋅ ( cos λ L ⋅ f 2 − f ′2 R 2 x ′2 1 ⋅ R 2 cos λ L ⋅ R − x ′ R x + sin λ L ⋅ 1 + f ′2 ⋅ R 2 y ′2 1 ⋅ R 2 sin λ L ⋅ R + y ′ R x ) Rearranging, we get
∂ 2 ∂ x 2 ψ R ( x , y ) = θ E f ⋅ ( cos 2 λ L f 2 R 2 − f ′ 2 x ′ 2 − cos λ L f 2 R 2 − f ′ 2 x ′ 2 ⋅ x ′ x R 2 + sin 2 λ L R 2 + f ′ 2 y ′ 2 + sin λ L R 2 + f ′ 2 y ′ 2 ⋅ y ′ x R 2 ) \begin{aligned}
\frac{\partial^2}{\partial x^2}\psi^{\mathrm{R}}(x,y) =
\theta_E\sqrt{f}\cdot
& \bigg(
\frac{\cos^2\lambda_L}{\sqrt{f^2R^2 - f'^2x'^2}}
-
\frac{\cos\lambda_L}{\sqrt{f^2R^2 - f'^2x'^2}}\cdot
x' \frac{x}{R^2}
\\&+
\frac{\sin^2\lambda_L}{\sqrt{R^2 + f'^2 y'^2}}
+
\frac{\sin\lambda_L}{\sqrt{R^2 + f'^2 y'^2}}\cdot
y' \frac{x}{R^2}
\bigg)
\end{aligned} ∂ x 2 ∂ 2 ψ R ( x , y ) = θ E f ⋅ ( f 2 R 2 − f ′2 x ′2 cos 2 λ L − f 2 R 2 − f ′2 x ′2 cos λ L ⋅ x ′ R 2 x + R 2 + f ′2 y ′2 sin 2 λ L + R 2 + f ′2 y ′2 sin λ L ⋅ y ′ R 2 x ) According to Lemma 1 , the square roots in the denominators
are all equal to R ′ R' R ′ . Furthermore, cos 2 λ + sin 2 λ = 1 \cos^2\lambda+\sin^2\lambda=1 cos 2 λ + sin 2 λ = 1 , hence
∂ 2 ∂ x 2 ψ R ( x , y ) = θ E f ⋅ ( 1 R ′ + sin λ L ⋅ y ′ − cos λ L ⋅ x ′ R ′ ⋅ x R 2 ) \begin{aligned}
\frac{\partial^2}{\partial x^2}\psi^{\mathrm{R}}(x,y) =
\theta_E\sqrt{f}\cdot
& \bigg(
\frac{1}{R'}
+
\frac{\sin\lambda_L\cdot y'-\cos\lambda_L\cdot x'}{R'}
\cdot
\frac{x}{R^2}
\bigg)
\end{aligned} ∂ x 2 ∂ 2 ψ R ( x , y ) = θ E f ⋅ ( R ′ 1 + R ′ sin λ L ⋅ y ′ − cos λ L ⋅ x ′ ⋅ R 2 x ) Now
sin λ L ⋅ y ′ − cos λ L ⋅ x ′ = x \sin\lambda_L\cdot y'-\cos\lambda_L\cdot x' = x sin λ L ⋅ y ′ − cos λ L ⋅ x ′ = x because it is the inverse rotation by λ L \lambda_L λ L ,
Thus we get
∂ 2 ∂ x 2 ψ R ( x , y ) = θ E f ⋅ R 2 − x 2 R ′ R 2 = θ E f ⋅ y 2 R ′ R 2 \begin{aligned}
\frac{\partial^2}{\partial x^2}\psi^{\mathrm{R}}(x,y)
= \theta_E\sqrt{f}\cdot \frac{R^2 - x^2}{R'R^2}
= \theta_E\sqrt{f}\cdot \frac{y^2}{R'R^2}
\end{aligned} ∂ x 2 ∂ 2 ψ R ( x , y ) = θ E f ⋅ R ′ R 2 R 2 − x 2 = θ E f ⋅ R ′ R 2 y 2 q.e.d.
The other two cases can be proved analogously.
Higher-order derivatives ¶ To find higher order derivatives we use the 2ne order derivatives
as a starting point.
We see that all these derivatives have the form
θ E f ⋅ g ( x , y ) R 2 R ′ \theta_E\sqrt{f}\cdot\frac{g(x,y)}{R^2R'} θ E f ⋅ R 2 R ′ g ( x , y ) where g ( x , y ) g(x,y) g ( x , y ) is a monomial in x x x and y y y .
The following generalisation of this observation is proved under
Proof for the SIE derivatives .
For all i , j ≥ 0 i,j\ge0 i , j ≥ 0 and i + j > 1 i+j>1 i + j > 1 , we have
∂ i + j ∂ x i ∂ y j ψ R ( x , y ) = θ E f ⋅ g ( x , y ) ( R 2 R ′ ) 2 ( i + j ) − 3 \frac{\partial^{i+j}}{\partial x^i\partial y^j}\psi^{\mathrm{R}}(x,y)
= \theta_E\sqrt{f}\cdot\frac{g(x,y)}{(R^2R')^{2(i+j)-3}} ∂ x i ∂ y j ∂ i + j ψ R ( x , y ) = θ E f ⋅ ( R 2 R ′ ) 2 ( i + j ) − 3 g ( x , y ) for some function g ( x , y ) g(x,y) g ( x , y ) of the polynomial form
with non-negative exponents i , j , k , l , m , n , p , q i,j,k,l,m,n,p,q i , j , k , l , m , n , p , q .
Having this carefully described form of each derivative helps speeding
up the computer implementation.
While computer algebra is computationally expensive in the general
case, the transformation from g ( ) g() g ( ) to its derivative is comparatively
fast, and only a very few possible simplifications have to be concidered.
The implementation is documented under Implementation of SIE .
Historical notes ¶ Several attempts were made to device a computationally viable
differentiation strategy.
CosmoSim v3.2 used sympy for differentiation at canonical orientation
combined with the chain rule to map the result into the global co-ordinate
frame. This worked up to order 5, and is documented under Implementation of SIE .
The approach outlined above is computationally more efficient.