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 |
| BG | Bessel-Gaussian |
Article title:
Pulsed Bessel–Gauss beams: a depleted wave model for type II second-harmonic generation
Table of Contents
This repository contains the Toolkit for Pulsed Bessel-Gauss Second Harmonic Generation Modeling, an open-source toolkit for modeling three-dimensional and time-dependent nonlinear wave interactions in type II second-harmonic generation (SHG) using KTP crystals.
The toolkit provides comprehensive modules for solving three coupled nonlinear wave equations (two for fundamental waves and one for second-harmonic waves) in type II SHG processes. It implements a depleted wave model that accounts for the depletion of fundamental waves during the nonlinear interaction, providing accurate modeling of pulsed Bessel-Gauss beam propagation and frequency conversion.
The toolkit supports parameterized scenario analysis including pulse energy variations, beam spot size effects, and interaction length optimization. It features compiled Fortran kernels with built-in numerical solvers, reproducible simulation pipelines with versioned code repository, and exportable datasets with electric field components and phase information. The toolkit generates comprehensive analysis of second-harmonic generation efficiency and beam characteristics.
The implementation has been validated by reproducing the nonlinear interaction dynamics described in the research, demonstrating that for pulses with spot sizes of 80 µm and energy of 0.8 J, nonlinear interaction occurs over approximately 5 mm. This toolkit was used to solve the modeling problem described in the research article "Pulsed Bessel-Gauss beams: a depleted wave model for type II second-harmonic generation".
Folder PATH listing
+---citation <-- Contains citation materials and research papers
│ 1_Heat-Equation_Continu… <-- Heat equation analytical paper
│ 2_Heat-Equation_Continu… <-- Heat equation continuous wave paper
│ 3_Heat-Equation_Pulsed-… <-- Heat equation pulsed wave paper
│ 4_Phase-Mismatch_Pulsed… <-- Phase mismatch pulsed wave paper
│ 5_Ideal_Continuous-Wave… <-- Ideal continuous wave paper
│ 6_Ideal_Pulsed-Wave_Be… <-- Ideal pulsed wave Bessel paper
│ 7_Coupled_Continuous-Wa… <-- Coupled continuous wave paper
│ README.md <-- Citation guidelines and information
│
+---images <-- Contains project images and logos
│ SHG-banner.png <-- SHG project banner
│
+---results <-- Numerical simulation results and benchmark data
│ E08_f_4000_Np_1_tp_50_… <-- Best iteration results data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component r-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component t-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component z-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component r-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component t-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component z-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component r-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component t-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Electric field component z-direction data
│ E_08_f_4000_Np_1_tp_50… <-- Scale maximum data
│ E_08_f_4000_Np_1_tp_50… <-- Phase pick data for Psi2
│ E_08_f_4000_Np_1_tp_50… <-- Phase pick data for Psi3
│
+---src <-- Toolkit source code and documentation
│ Code_SHG-PW-BG-Field-… <-- Fortran finite difference solver (main toolkit)
│
│ Article_SHG-PW-BG-Fiel… <-- Research paper PDF (problem solved by toolkit)
│ CITATION.cff <-- Citation metadata file
│ LICENSE <-- Project license information
│ README.md <-- Toolkit overview and 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)
- Plotting Software (Gnuplot, Python matplotlib, or similar for visualizing results)
-
Clone the Repository
git clone https://github.com/Second-Harmonic-Generation/SHG-PW-BG-Fields-Ideal.git cd SHG-PW-BG-Fields-Ideal -
Explore the Research Papers
- Navigate to the
citation/folder - Read the main research paper:
Article_SHG-PW-BG-Field-Ideal.pdf - Review additional papers for comprehensive understanding
- Navigate to the
-
Compile and Run the Simulation
cd src gfortran -o shg_simulation Code_SHG-PW-BG-Field-Ideal.f90 ./shg_simulation -
Analyze Results
- Check the
results/folder for output files - Examine
.pltfiles for electric field component data - Use plotting software to visualize the simulation results:
# Example with Gnuplot gnuplot -e "plot 'results/E_08_f_4000_Np_1_tp_50_Elec12_r.plt' with lines"
- Check the
-
Explore Different Parameters (Optional)
- Edit the Fortran source code to modify simulation parameters
- Recompile and run to explore different scenarios
- Compare results with published findings in the research papers
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.
