  We introduce a simple and stable computational method for ill-posed partial
differential equation (PDE) problems. The method is based on
Schr\"odingerization, introduced in [S. Jin, N. Liu and Y. Yu, Phys. Rev. A,
108 (2023), 032603], which maps all linear PDEs into Schr\"odinger-type
equations in one higher dimension, for quantum simulations of these PDEs.
Although the original problem is ill-posed, the Schr\"odingerized equations are
Hamiltonian systems and time-reversible, allowing stable computation both
forward and backward in time. The original variable can be recovered by data
from suitably chosen domain in the extended dimension. We will use the backward
heat equation and the linear convection equation with imaginary wave speed as
examples. Error analysis of these algorithms are conducted and verified
numerically. The methods are applicable to both classical and quantum
computers, and we also lay out quantum algorithms for these methods. Moreover,
we introduce a smooth initialization for the Schr\"odingerized equation which
will lead to essentially spectral accuracy for the approximation in the
extended space, if a spectral method is used. Consequently, the extra qubits
needed due to the extra dimension, if a qubit based quantum algorithm is used,
for both well-posed and ill-posed problems, becomes almost $\log\log
{1/\varepsilon}$ where $\varepsilon$ is the desired precision. This optimizes
the complexity of the Schr\"odingerization based quantum algorithms for any
non-unitary dynamical system introduced in [S. Jin, N. Liu and Y. Yu, Phys.
Rev. A, 108 (2023), 032603].
