Morse Function on 3-Torus from Heegaard Splitting It is easy to visualize some Morse functions on surfaces (such as the torus) via the height function, but this seemingly doesn't work for 3-manifolds. I am looking for an explicit one on the 3-torus $\mathbb{T}^3$. In paritcular:
It is true that every nice-enough 3-manifold admits a self-indexing Morse function $f:M\to[0,3]$ (with unique maximum and minimum), and from this we get a Heegaard diagram, with splitting surface $\Sigma=f^{-1}(\frac{3}{2})$. Now apparently, a converse also holds, so that given a Heegaard decomposition we can read off a self-indexing Morse function (edit: perhaps multiple Morse functions, as per Ryan Budney's comment).
With the known Heegaard decomposition of $\mathbb{T}^3$ (handlebodies $N$ and $\mathbb{T}^3-N$ for a small neighborhood $N$ about the generating 1-complex $S^1\cup S^1\cup S^1\subset\mathbb{T}^3$, and splitting surface $\partial N$), what is the corresponding Morse function? I can't write one down.
 A: The Morse function on $(S^1)^3$ that gives the genus 3 Heegaard splitting (the standard one) is basically just a smoothed "distance from the 1-skeleton function".  
So if you think of $S^1$ as the unit circle in $\mathbb C$, then 
$$f : (S^1)^3 \to \mathbb R$$
is given by
$$f(z_1,z_2,z_3) = |z_1-1|^2 + |z_2-1|^2 + |z_3-1|^2$$
where we're taking the norm/modulus squared of vectors in $\mathbb C$ in the above formula.  The critical points are 8 triples $(z_1,z_2,z_3)$ of the form $(\pm 1, \pm 1, \pm 1)$, so you have the minimum $(1,1,1)$, maximum $(-1,-1,-1)$, index 1 critical points $(-1,1,1), (1,-1,1), (1,1,-1)$ and index two (the negatives of the index one critical points).  
If you really demand self-indexing then you'll need the function $\frac{f(z_1,z_2,z_3)}{4}$
A: After seeing Ryan Budney's function, I came up with this:  
On an n-torus $\mathbb{T}^n$ we have a Morse function $f=\sum^n_{i=1}\cos\theta_i$, which has critical points $\text{crit}(f)=\lbrace(\theta_1,\ldots,\theta_n)\;|\;\theta_i = 0\text{ or }\pi\;\;\forall\;i\rbrace$.  
In particular, we get a self-indexing Morse function $f(\theta_1,\theta_2,\theta_3)=\frac{1}{2}\sum^3_{i=1}\cos\theta_i+\frac{3}{2}$ on $\mathbb{T}^3$.  
Indeed, it has a unique maximum $(0,0,0)$ with value 3, and a unique minimum $(\pi,\pi,\pi)$ with value 0. There are 3 index-1 critical points (two angles are $\pi$ and one angle is $0$) with value $1$, and 3 index-2 critical points (one angle is $\pi$ and two angles are $0$) with value $2$, and the indices are evident from the Hessian $H_{(\theta_1,\theta_2,\theta_3)}f=-\text{diag}(\cos\theta_1,\cos\theta_2,\cos\theta_3)$.  
Now this $f$ then provides a Heegaard diagram for $\mathbb{T}^3$ of genus $3$ (since there are 3 index-1 and 3 index-2 critical points, corresponding to the $\alpha,\beta$-curves). As Wikipedia states: It was proved by Frohman and Hass that any other genus 3 Heegaard splitting of the three-torus is topologically equivalent to this one (the one in the original question).  
[[Edit]]: This is precisely Ryan's function... so nevermind.
