{'fraction_non_alphanumeric': 0.01953125, 'fraction_numerical': 0.0, 'mean_word_length': 5.572649572649572, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Dirichlet-to-Neumann map method for second-harmonic generation in piecewise uniform waveguides

For second-harmonic generation in two-dimensional waveguiding structures composed of segments that are invariant in the longitudinal direction, we develop an efficient numerical method based on the Dirichlet-to-Neumann (DtN) maps of the segments and a marching scheme using two operators and two functions. A Chebyshev collocation method is used to discretize the longitudinal variable for computing the DtN map and the locally generated second harmonic wave in each segment. The method rigorously solves the inhomogeneous Helmholtz equation of the second-harmonic wave without making any analytic approximations. Numerical examples are used to illustrate this new method.