  Copositivity of tensors plays an important role in vacuum stability of a
general scalar potential, polynomial optimization, tensor complementarity
problem and tensor generalized eigenvalue complementarity problem. In this
paper, we propose a new algorithm for testing copositivity of high order
tensors, and then present applications of the algorithm in physics and
hypergraphs. For this purpose, we first give several new conditions for
copositivity of tensors based on the representative matrix of a simplex. Then a
new algorithm is proposed with the help of a proper convex subcone of the
copositive tensor cone, which is defined via the copositivity of Z-tensors.
Furthermore, by considering a sum-of-squares program problem, we define two new
subsets of the copositive tensor cone and discuss their convexity. As an
application of the proposed algorithm, we prove that the coclique number of a
uniform hypergraph is equivalent with an optimization problem over the
completely positive tensor cone, which implies that the proposed algorithm can
be applied to compute an upper bound of the coclique number of a uniform
hypergraph. Then we study another application of the proposed algorithm on
particle physics in testing copositivity of some potential fields. At last,
various numerical examples are given to show the performance of the algorithm.
