This is a simple program that solves the quadruple image configurations of source lensed by Singular Isothermal Elliptical Potential with parallel eXternal Shear (SIEP+XS
- Python 3.6 or later
- pytorch 2.0 or later
To utilize the code, one needs to import the SIEP_plus_XS
class from potentials.py
. Then, one can create an object of this class by passing the lens parameters: b, x_g, y_g, eps, eps_theta, gamma, gamma_theta
. Here, eps_theta
and gamma_theta
are in degrees and they should be equal to each other.
Then, from this object, one can call the function get_image_configuration
by passing the source position: x_s, y_s
. This will return the image positions and magnifications. One can also call the function get_all_derivations
with source position to get the derivatives of the image positions and magnifications with respect to the lens parameters and source position. The output of these functions will be dictionary objects. The keys of the dictionary are the names of the parameters and the values are the corresponding values of the parameters.
The main.py
script gives the skeleton code to run the program. The potential parameters and source position can be modified in the main.py
script. The output is a dictionary containing the image positions, magnifications, and all the derivatives with respect to the input parameters.
The SIEP+XS
The code is organized as follows:
-
quartic_solver.py
: This file contains the function to solve the ACLE quartic equation. The function_get_quartic_solution
takes in a complex parameter$W$ and returns the angular image configuration. -
potentials.py
: This file contains the base classPotential
. It contains the main classSIEP_plus_XS
which inherits fromPotential
and is specific to the SIEP+XS potential. It has the functionsget_image_configuration
andget_all_derivations
. -
main.py
: This script uses the classSIEP_plus_XS
frompotentials.py
to compute the image positions and magnifications from the lens parameters and source position.
- Known issues:
- Currently, the code always outputs four images even when the potential might just produce two images. This will be fixed by checking if the solutions of the ACLE quartic lie on the unit circle.
- The code needs non-zero ellipticity or shear and crashes for asymptotically spherical potential. This can be fixed by interpolation for small eccentricity.