  The curvature of the noncommutative torus $T^2_\theta$ ($\theta$ irrational)
endowed with a noncommutative conformal metric has been the focus of attention
of several recent works. Continuing the approach taken in the paper [A. Connes
and H. Moscovici, http://arxiv.org/abs/1110.3500] we extend the study of the
curvature to twisted Dirac spectral triples constructed out of Heisenberg
bimodules that implement the Morita equivalence of the $C^*$-algebra $A_\theta
= C(T^2_\theta)$ with other toric algebras $A_{\theta'}$. In the enlarged
context the conformal metric on $T^2_\theta$ is exchanged with an arbitrary
Hermitian metric on the Heisenberg $(A_\theta, A_{\theta'})$-bimodule $E'$ for
which ${\rm End}_{A_{\theta'}}(E') = A_\theta $. We prove that the Ray-Singer
log-determinant of the corresponding Laplacian, viewed as a functional on the
space of all Hermitian metrics on $E'$, attains its extremum at the unique
Hermitian metric whose corresponding connection has constant curvature. The
gradient of the log-determinant functional gives rise to a noncommutative
analogue of the Gaussian curvature. The genuinely new outcome of this paper is
that the latter is shown to be independent of any Heisenberg bimodule $E'$ such
that $A_\theta = {\rm End}_{A_{\theta'}}(E')$, and in this sense it is Morita
invariant. To prove the above results we extend Connes' pseudodifferential
calculus to Heisenberg modules. The twisted version, which offers more
flexibility even in the case of trivial coefficients, could potentially be
applied to other problems in the elliptic theory on noncommutative tori. A
noteworthy technical feature is that we systematize the computation of the
resolvent expansion for elliptic differential operators on noncommutative tori
to an extent which makes the (previously employed) computer assistance
unnecessary.
