The unit circle problem is the problem of finding the number of eigenvalues of a matrix

inside and outside the unit circle. It is associated with stability analysis of the system

. An algorithm is developed in this paper to solve the problem via Schwarz canonical form.