  We improve the complex scaling method (CSM) to obtain virtual states, which
were previously challenging in the conventional CSM. Our approach solves the
Schr\"odinger equation in the momentum space as an eigenvalue problem by
choosing the flexible contours. It proves to be highly effective in identifying
the poles across the different Riemann sheets in the multichannel scatterings.
It is more straightforward and efficient than searching for the zeros of the
Fredholm determinant of the Lippmann-Schwinger equation using the root-finding
algorithms. This advancement significantly extends the capabilities of the CSM
in accurately characterizing the resonances and virtual states in quantum
systems.
