Enhancing Coherence of Spin Centers in p-n Diodes via Optimization Algorithms — arXiv2