Package: lasy
lasyOverviewlasyis a Python library that facilitates the initialization of complex laser pulses, in simulations of laser-plasma interactions.More specifically,lasyoffers many ways to define complex laser pulses (e.g. from commonly-known analytical formulas, from experimental measurements, etc.) and offers pre-processing functionalities (e.g. propagation, re-normalization, geometry conversion). The laser field is then exported in a standardized file, that can be read by external simulation codes.DocumentationLASY manipulates laser pulses, and operates on the laser envelope. In 3D (x,y,t) Cartesian coordinates, the definition used is:\begin{aligned}
   E_x(x,y,t) = \mathrm{Re}\left( \mathcal{E}(x,y,t) e^{-i\omega_0t}p_x\right)\\
   E_y(x,y,t) = \mathrm{Re}\left( \mathcal{E}(x,y,t) e^{-i\omega_0t}p_y\right)\end{aligned}where $\mathrm{Re}$ stands for real part,  $E_x$ (resp. $E_y$) is the laser electric field in the x (resp. y) direction, $\mathcal{E}$ is the complex laser envelope stored and used in lasy, $\omega_0 = 2\pi c/\lambda_0$ is the angular frequency defined from the laser wavelength $\lambda_0$ and $(p_x,p_y)$ is the (complex and normalized) polarization vector.In cylindrical coordinates, the envelope is decomposed in $N_m$ azimuthal modes ( see Ref. [A. Lifschitz et al., J. Comp. Phys. 228.5: 1803-1814 (2009)]). Each mode is stored on a 2D grid (r,t), using the following definition:\begin{aligned}
   E_x (r,\theta,t) = \mathrm{Re}\left( \sum_{-N_m+1}^{N_m-1}\mathcal{E}_m(r,t) e^{-im\theta}e^{-i\omega_0t}p_x\right)\\
   E_y (r,\theta,t) = \mathrm{Re}\left( \sum_{-N_m+1}^{N_m-1}\mathcal{E}_m(r,t) e^{-im\theta}e^{-i\omega_0t}p_y\right).\end{aligned}WorkflowHow to contributeAll contributions are welcome! For a new contribution, we use pull requests from forks. Below is a very rough summary, please have a look at the appropriate documentation athttps://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forksand around.First, setup your fork workflow (only once):Fork the repo by clicking the Fork button on the top right, and follow the prompts. This will create your own (remote) copy of the mainhttps://github.com/LASY-org/LASYrepo, located athttps://github.com/[yourusername]/LASY.Make your local copy aware of your fork: from your local repository, dogit remote add [some-name] https://github.com/[your username]/LASY. For[some-name]it can be convenient to use e.g. your username.Then, for each contribution:Get the last version of branchdevelopmentfrom the main repo (e.g.git checkout development && git pull).Create a new branch (e.g.git checkout -b my_contribution).Do usualgit addandgit commitoperations.Push your branch to your own fork:git push -u [some-name] my_contributionWhenever you're ready, open a PR from branchmy_contributionon your fork to branchdevelopmenton the main repo. Github typically suggests this very well.Style conventionsDocstrings are written using the Numpy style.Functions inutils/laser_utils.pyonly depend on standard types (Python & Numpy) and on theGridclass. That way, they are relatively stand-alone and can be used on different data structures. A simple Grid factory is provided for that purpose.A PR should be open for any contribution: the description helps to explain the code and open dicussion.Installpython3 -m pip install lasyFor tests, you need to have a few extra packages, such aspytestandopenpmd-viewerinstalled:python3-mpipinstall-rtests/requirements.txtTestAfter successful installation, you can run the unit tests:# Run all testspython3-mpytesttests/# Run tests from a single filepython3-mpytesttests/test_laser_profiles.py# Run a single test (useful during debugging)python3-mpytesttests/test_laser_profiles.py::test_profile_gaussian_3d_cartesian# Run all tests, do not capture "print" output and be verbosepython3-mpytest-s-vvvvtests/Creating DocumentationInstall sphinx (https://www.sphinx-doc.org/en/master/usage/installation.html)cddocs
python-mpipinstall-rrequirements.txt
sphinx-build-bhtmlsource_build