Click the green "Use this template" button at the top of the page, then choose "Create a new repository".
This will create your own copy of this project, which you can modify freely — no need to fork!
| Term | Definition |
|---|---|
| SHG | Second Harmonic Generation |
| PW | Pulsed Wave |
| G | Gaussian |
Article title:
Thermally Induced Phase Mismatching in a Repetitively Gaussian Pulsed Pumping KTP Crystal: a Spatio-Temporal Treatment
Table of Contents
This repository contains the Toolkit for Modeling Thermally Induced Phase Mismatching in KTP Crystal: Pulsed-Wave Gaussian Second Harmonic Generation, an open-source toolkit for modeling the spatiotemporal phase mismatching effects that occur in pulsed-wave second-harmonic generation (PW SHG), using KTP as a case study.
The toolkit provides comprehensive modules for modeling thermally induced phase mismatching (TIPM) in KTP crystals under repetitively pulsed Gaussian pumping, including spatiotemporal temperature field computation and phase mismatch calculations.
The toolkit implements a numerical procedure for solving repetitively pulsed pumped crystals using finite difference methods, enabling computation on home-used computing machines. It supports parameterized scenario sweeps including temperature-dependent versus constant thermal conductivity, realistic cooling mechanisms (conduction, convection, and radiation), and heat-transfer coefficients spanning 6.5–2.0×10⁴ W·m⁻²·K⁻¹. The toolkit features compiled Fortran kernels with built-in benchmark reporting, reproducible pipelines with versioned code repository, and exportable datasets with spatiotemporal temperature and phase mismatch fields. It generates both radial and axial profiles for temperature and phase mismatch analysis.
The implementation has been validated by reproducing phase mismatching behaviors and trends for KTP under repetitively pulsed Gaussian pumping, including the effects of temperature-dependent conductivity and boundary conditions. The toolkit demonstrates accumulative behaviors of temperature and TIPM (with its reverse sign) when the number of pulses is increased, along with fluctuations attributed to the offtime between successive pulses. This toolkit was used to solve the phase mismatch modeling problem described in the research article "Thermally Induced Phase Mismatching in a Repetitively Gaussian Pulsed Pumping KTP Crystal: a Spatio-Temporal Treatment".
Folder PATH listing
+---citation <-- Research papers and documentation
│ 1_Heat-Equation_Continu… <-- Heat equation continuous wave analysis
│ 2_Heat-Equation_Continu… <-- Heat equation continuous wave study
│ 3_Heat-Equation_Pulsed-… <-- Heat equation pulsed wave analysis
│ 4_Phase-Mismatch_Pulsed… <-- Phase mismatch pulsed wave study
│ 5_Ideal_Continuous-Wave… <-- Ideal continuous wave analysis
│ 6_Ideal_Pulsed-Wave_Bes… <-- Ideal pulsed wave Bessel-Gaussian
│ 7_Coupled_Continuous-Wa… <-- Coupled continuous wave analysis
│ README.md <-- Citation guidelines and references
│
+---images <-- Visual assets and graphics
│ SHG-banner.png <-- Project banner image
│
+---results <-- Output data and analysis results
│ E_009_f_500_Np_1_tp_50… <-- Phase mismatch radial profile data
│ E_009_f_500_Np_1_tp_50… <-- Phase mismatch transverse profile
│ E_009_f_500_Np_1_tp_50… <-- Phase mismatch axial profile data
│ E_009_f_500_Np_1_tp_50… <-- Temperature radial profile data
│ E_009_f_500_Np_1_tp_50… <-- Temperature transverse profile
│ E_009_f_500_Np_1_tp_50… <-- Temperature axial profile data
│
+---src <-- Source code and implementation
│ Code_SHG-PW-G-Phase-Mi… <-- Main Fortran implementation
│
│ Article_SHG-PW-G-Phase… <-- Main research article PDF
│ CITATION.cff <-- Citation metadata file
│ LICENSE <-- Project license information
│ README.md <-- Project documentation
- Fortran Compiler (gfortran, Intel Fortran, or similar)
- Text Editor (VS Code, Cursor, or any Fortran-capable editor)
- PDF Reader (for accessing research papers)
- Git (for cloning the repository)
-
Clone the repository
git clone https://github.com/Second-Harmonic-Generation/SHG-PW-G-Phase-Mismatch.git cd SHG-PW-G-Phase-Mismatch -
Explore the Research Papers
- Navigate to the
citation/folder - Read the main research paper:
Article_SHG-PW-G-Phase-Mismatch.pdf - Review additional papers for comprehensive understanding
- Navigate to the
-
Compile and Run the Toolkit
cd src gfortran -o phase_mismatch Code_SHG-PW-G-Phase-Mismatch.f90 ./phase_mismatch -
Analyze Results
- Check the
results/folder for output files and benchmark data - Examine
.pltfiles for both temperature and phase mismatch profiles (radial, transverse, axial) - Use plotting software (Gnuplot, Python matplotlib, etc.) to visualize results
- Check the
Please refer to the citation folder for accurate citations. It contains essential guidelines for accurate referencing, ensuring accurate acknowledgement of our work.
For questions not addressed in the resources above, please connect with Mostafa Rezaee on LinkedIn for personalized assistance.
