Welcome to ShgPy!¶
What is ShgPy?¶
ShgPy is a simple toolkit for analyzing rotational-anisotropy second harmonic generation (RA-SHG) data. It depends mainly on three packages, NumPy, SciPy, and SymPy – as well as (optionally) Matplolib for some basic plotting capability – to simulate, manipulate, and fit RA-SHG data in a (hopefully!) intuitive way.
Fitting RA-SHG data involves solving a complex global minimization problem with many degrees of freedom. Moreover, the fitting functions naively involve a degree of complexity due to the trigonometric nature of the problem. This software therefore takes a dual approach to fitting RA-SHG data – first of all, all of the fits are done in Fourier space, which significantly reduces the complexity of the fitting formulas, and second of all, ShgPy makes heavy use of the scipy.optimize.basinhopping algorithm, which is particularly useful for these types of global optimization problems. In some ways, ShgPy is just a wrapper around scipy.optimize.
What ShgPy is not¶
Right now, ShgPy is narrowly suited for a particular RA-SHG geometry (i.e. this one). Other implementations of RA-SHG (e.g. where the angle of incidence can vary, etc.) are not currently supported. However, this software is always evolving and support may come in the future if there’s enough interest (see how to contribute).
Installation¶
Installation of ShgPy is easy! Just install the shgpy
package:
$ pip install shgpy
You’ll also need to install numpy
, scipy
, sympy
, and, optionally, matplotlib
; refer to the corresponding documentation for more information about these packages. Additionally, you’ll need a working installation of gcc
.
Getting started¶
After installing ShgPy, familiarize yourself with the basic routines by reading the tutorials and FAQs.
To follow along, you’ll want to download the example files.
Documentation¶
For further details, consult the auto-generated API documentation:
How to contribute¶
See how to contribute.
Cite this software¶
If you use ShgPy in your project, please let me know! I’m interested to see who is using this software and in what form.
To cite this software in a publication, use
Bryan Fichera. ShgPy. https://bfichera.github.io/shgpy/, 2020. doi:10.5281/zenodo.3873755
Alternatively, use the following BibTex entry:
@misc{shgpy,
author = {Bryan Fichera},
title = {Shg{P}y},
year = {2020},
howpublished = {\url{https://bfichera.github.io/shgpy/}},
doi = {10.5281/zenodo.3873755}
}
Contact me¶
Other questions or concerns? Please contact me!