The analog of the Riemann curvature tensor for noncommutative tori manifests itself in the term $a_4$ appearing in the heat kernel expansion of the Laplacian of curved metrics. This talk presents a joint work with Alain Connes, in which we obtain an explicit formula for the $a_4$ associated with a general metric in the canonical conformal structure on noncommutative twotori. Our final formula has a complicated dependence on the modular automorphism of the state or volume form of the metric, namely in terms of several variable functions with lengthy expressions. We verify the accuracy of the functions by checking that they satisfy a family of conceptually predicted functional relations. By studying the latter abstractly we find a partial differential system which involves a natural flow and action of cyclic groups of order two, three and four, and we discover symmetries of the calculated expressions with respect to the action of these groups. At the end, I will illustrate the application of our results to certain noncommutative fourtori equipped with nonconformally flat metrics and higher dimensional modular structures.

