  Quantum light sources in the mid-infrared (MIR) band play an important role
in many applications, such as quantum sensing, quantum imaging, and quantum
communication. However, there is still a lack of high-quality quantum light
sources in the MIR band, such as the spectrally pure single-photon source. In
this work, we present the generation of spectrally-pure state in an optimized
poled lithium niobate crystal using a metaheuristic algorithm. In particular,
we adopt the particle swarm optimization algorithm to optimize the duty cycle
of the poling period of the lithium niobate crystal. With our approach, the
spectral purity can be improved from 0.820 to 0.998 under the third
group-velocity-matched condition, and the wavelength-tunable range is from 3.0
$\mu$m to 4.0 $\mu$m for the degenerate case and 3.0 $\mu$m to 3.7 $\mu$m for
the nondegenerate case. Our work paves the way for developing quantum photonic
technologies at the MIR wavelength band.
