Interplay between Riccati, Ermakov, and Schrödinger equations to produce complex‐valued potentials with real energy spectrum