In this article we develop a general method by which one can explicitly evaluate certain sums of nth powers of products of d≥1 elementary trigonometric functions evaluated at m=(m1,…,md)-th roots of unity. Our approach is to first identify the individual terms in the expression under consideration as eigenvalues of a discrete Laplace operator associated to a graph whose vertices form a d-dimensional discrete torus Gm which depends on m. The sums in question are then related to the nth step of a Markov chain on Gm. The Markov chain admits the interpretation as a particular random walk, also viewed as a discrete time and discrete space heat diffusion, so then the sum in question is related to special values of the associated heat kernel. Our evaluation follows by deriving a combinatorial expression for the heat kernel, which is obtained by periodizing the heat kernel on the infinite lattice Zd which covers Gm.