Apparatus for second harmonic generation