You need to set up a theoretical model such as a light going through a medium. The medium is a second order optical material. To begin with, you could use Maxwell equations and consider the medium and light to derive a formulae. You could base on some experimental results from published papers. To use one of them, your model would fit the results. Then make some sensible outcomes.
You could try to use MATLAB software which is easy to use.
Please see one of my papers that may help you to start with.
The idea is the same for either second order or third order optical effects.
You have to target the second order optical material to combine the Maxwell equations and Gaussian beam. Without knowing what materials or size to use, it is difficult to solve the equation. The idea is similar to the reference I listed. It is much easier comparing the third order.
By performing a frequency calculation using Gaussian 09W you can estimate the Nonlinear Optical Properties (NLO) properties in term of the second-order polarizability or first hyperpolarizability β, dipole moment 𝜇 and polarizability α which could be calculated from the values of Quadrupole moment and Octapole moment collected in the output file (attached image). The complete required equations are also attached.
Note: Since the values of (α) and (β) of Gaussian 09W output are reported in atomic units (au), they should be converted into electrostatic units (esu) (for α: 1 au = 0.1482×10−24 esu, for β: 1 au = 8.6393×10−33 esu).