arXiv:astro-ph/0102340v120Feb2001SubmittedtoApJComputationalMethodsforGravitationalLensingCharlesR.KeetonStewardObservatory,UniversityofArizona,933N.CherryAve.,Tucson,AZ85721ABSTRACTModernapplicationsofstronggravitationallensingrequiretheabilitytousepreciseandvariedobservationaldatatoconstraincomplexlensmodels.Idiscusstwosetsofcomputationalmethodsforlensingcalculations.Thefirstisanewalgorithmforsolvingthelensequationforgeneralmassdistributions.Thisalgorithmmakesitpossibletoapplyarbitrarilycomplicatedmodelstoobservedlenses.Thesecondisanevaluationoftechniquesforusingobservationaldataincludingpositions,fluxes,andtimedelaysofpoint-likeimages,aswellasmapsofextendedimages,toconstrainmodelsofstronglenses.Thetechniquespresentedhereareimplementedinaflexibleanduser-friendlysoftwarepackagecalledgravlens,whichismadeavailabletothecommunity.1.IntroductionGravitationallensingisanimportantastrophysicaltoolbecauseitdirectlyprobesmass(asopposedtoluminosity)distributions,andbecauseitbrightensandenlargestheimagesofdistantsources.Themorethan60knownstronglenses1producedbygalaxiesconstituteamass-selectedsampleofgalaxiesatintermediateredshifts.Lensingprovidesprecisemassmeasurementsforthesegalaxies,andtherebyoffersapowerfulprobeofthephysicalpropertiesofintermediate-redshiftgalaxiesandtheevolutionofearly-typegalaxiesinlow-densityenvironments(e.g.,Keeton,Kochanek&Falco1998;Kochaneketal.2000).Thelensescanbeusedtoprobegalaxymassdistributions(e.g.,Kochanek1991a;Rusin&Tegmark2000;Rusin&Ma2000;andreferencestherein).TheycanalsobeusedfordirectmeasurementsoftheHubbleconstantindependentofthedistanceladder(e.g.,Koopmans&Fassnacht1999;Witt,Mao&Keeton2000;andreferencestherein),toconstrainthecosmologicalmodel(e.g.,Falco,Kochanek&Mu˜noz1998;Helbigetal.1999;andreferencestherein),andfordetailedstudiesofthehostgalaxiesofhigh-redshiftquasars(e.g.,Rixetal.2000;Kochanek,Keeton&McLeod2001a).Stronglensesproducedby1Stronglensesaresystemswithmultipleimagesofabackgroundsource,andtheyarethefocusofthispaper.Weaklensing,orshapedistortionswithoutmultipleimaging,alsoprobesmassdistributionsbutwithdifferenttechniques.Forrecentreviewsofweaklensing,seeMellier(1999)andBartelmann&Schneider(2001).–2–clustersprobetheradialmassdistributionofclustersandrevealtheclumpygalaxydistributionsuperimposedonthesmoothclusterbackground,andtherebytestmodelsofstructureformationinthecolddarkmatterparadigm(e.g.,Tyson,Kochanski&Dell’Antonio1998;Williams,Navarro&Bartelmann1999;Shapiro&Iliev2000).Inmanyoftheseeclecticlensingapplicationsanessentialstepisfittingmassmodelstoobservedlenses.Therearetwokeyingredientstomodernlensmodels.Thefirstistheabilitytousethepreciseandvariedobservationaldatanowavailableformanylenses.Opticalandnear-infraredastrometrywiththeHubbleSpaceTelescopeachievesaprecisionofafewmilli-arcseconds(e.g.,Leh´aretal.2000).RadioastrometryfromVLBIorVLBAmapscanachieveaprecisionof10micro-arcsecondsorbetter,andmayresolvefinesubstructureintheimages(e.g.,Patnaik,Porcas&Browne1995;Trotter,Winn&Hewitt2000).Deepopticalandespeciallynear-infraredimagesoftenrevealextendedstructureduetothehostgalaxyofthesource,andevensomecompleteEinsteinrings(e.g.,Bernsteinetal.1997;Impeyetal.1998;Kochaneketal.2001a).Photometryatmanywavelengthsandmanyepochscanrevealevidenceforreddeningand/ormicrolensingoftheimages(e.g.,Gottetal.1981;Falcoetal.1999;Wambsganssetal.2000;Wozniaketal.2000),andthemonitoringcanbeusedtomeasuretimedelaysbetweenthelensedimages(e.g.,Kundi´cetal.1997a;Schechteretal.1997).Withthepropertechniques,allofthedifferentkindsofdatacanbeusedtoconstrainlensmodels.Thesecondimportantingredientistheabilitytostudycomplexmassmodels.Reproducingqualitativefeaturesofalens(thenumberandconfigurationoftheimages)canoftenbedonewithverysimplemodels,butfittingthedataquantitativelyrequiresmodelsthatincludedetailedstructureinthelensgalaxyanditsenvironment.Forexample,themodelsrequireanellipticaldensitydistributionforearly-typelensgalaxies(e.g.,Keeton&Kochanek1997),orathindiskandarounderhaloforspirallensgalaxies(e.g.,Maller,Flores&Primack1997),andperhapsevensubstructureinthegalaxy(e.g.,Mao&Schneider1998;Bernstein&Fischer1999).Themodelsusuallymustincludetidalperturbationsfromobjectsnearthelensgalaxyoralongthelineofsight(e.g.,Youngetal.1981;Keeton,Kochanek&Seljak1997;Witt&Mao1997).Whiletidalperturbationsareoftenapproximatedasanexternalshearforconvenience,thissimplificationmayberuledoutbydataofsufficientquality(e.g.,Impeyetal.1998).SeverallensesareevenfoundtohavemultiplegalaxiesthatlieinsidetheEinsteinringandmustbeexplicitlymodeled(e.g.,Koopmans&Fassnacht1999;Rusinetal.2000).Theproblemisthatsuchcomplicatedmodelscanbehardtostudyduetothedifficultyofsolvingthelensequation.Formodelswithsphericalorellipsoidalsymmetryallclassesofsolutionstothelensequationareknown(see,e.g.,Schneider,Ehlers&Falco1992).Formodelswithoutsuchsymmetry,however,itmaynotevenbeclearwhatthemaximumnumberofimagesis,muchlesshowtheyarearranged.Theneedtousecomplexmodelstofitthedatameansthatweneedageneralalgorithmforsolvingthelensequationwithoutrequiringsimplifyingassumptions