  The separability detecting problem of mixed states is one of the fundamental
problems in quantum information theory. In the last 20 years, almost all
methods are based on the sufficient or necessary conditions for entanglement.
However, in this paper, we only need one algorithm to solve the problem. We
propose a tensor optimization method to check whether an $m$-partite quantum
mixed state is separable or not and give a decomposition for it if it is. We
first convert the separability discrimination problem of mixed states to the
positive Hermitian decomposition problem of Hermitian tensors. Then, employing
the $E$-truncated $K$-moment method, we obtain an optimization model for
discriminating separability. Moreover, applying semidefinite relaxation method,
we get a hierarchy of semidefinite relaxation optimization models and propose
an $E$-truncated $K$-moment and semidefinite relaxations (ETKM-SDR) algorithm
for detecting the separability of mixed states. The algorithm can also be used
for symmetric and non-symmetric decomposition of separable mixed states. By
numerical examples, we find that not all symmetric separable states have
symmetric decompositions. The algorithm can be used for studying properties of
mixed states in the future.
