{'fraction_non_alphanumeric': 0.01674641148325359, 'fraction_numerical': 0.004784688995215311, 'mean_word_length': 5.340909090909091, '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}}
Domain engineering algorithm for practical and effective photon sources.

We introduce a method for shaping the spectral response of nonlinear light sources by tailoring the quasi-phase matching. Our algorithm relies on engineering the poling to accurately trace a generated target signal field amplitude to determine the desired nonlinearity profile. The proposed poling algorithm results in a poling pattern that is more robust to manufacture, as all domain inversions are of equal width. The poling pattern is verified using a nonlinear beam propagation method simulation. This approach is applied to achieve Gaussian-shaped phase matching along a potassium titanyl phosphate (KTP) crystal in order to generate pure heralded single photons of spectral purity ~0.996-this is highly desirable for heralded single photon quantum optics.