  We give an exact solution to the nonlinear optimization problem of
approximating a Hermitian matrix by positive semi-definite matrices. Our
algorithm was then used to judge whether a quantum state is entangled or not.
We show that the exact approximation of a density matrices by tensor product of
positive semi-definite operators is determined by the additivity property of
the density matrix.
