Obtain hamiltonian from a lagrange functional. Assume that we have a Lagrange functional $L = L(\psi, \partial_t\psi,\partial_x\psi)$ with $\psi:(x,t) \rightarrow \psi(x,t)$.
From the this I want to calculate the Hamiltonian. I was wondering how here the generalized impulses look like? For $L(q,\dot{q})$ it would simply be $p = \frac{\partial L}{\partial \dot{q}}$. How do the generalised impulses look like if I have a field that also depends on the x-coordinate? Do I need two generalised impulses, one for $\partial_x \psi$ and one for $\partial_t \psi$?
 A: If you think $\mathcal{L}=\mathcal{L}(\psi,\partial_\mu\psi)$ like in classical field theory, you can generalize the old $\delta S=0$ condition with coordinate ($q,\dot{q}$) to the field version
$$
\delta\mathcal{L}=\frac{\partial\mathcal{L}}{\partial\psi}\delta\psi+\frac{\partial\mathcal{L}}{\partial\partial_\mu\psi}\delta\partial_\mu\psi=0
$$
and using an integration by parts for the second therm you obtain the Euler-Lagrange equation
$$
\frac{\partial\mathcal{L}}{\partial\psi}=\partial_\mu\frac{\partial\mathcal{L}}{\partial\partial_\mu\psi}.
$$
If you define the momenta $p^\mu=\frac{\partial\mathcal{L}}{\partial\partial_\mu\psi}
$, the Hamiltonian has the form 
$$
\mathcal{H}=(p^\mu\partial_\mu\psi-\mathcal{L})_{|\partial_\mu\psi=\partial_\mu\psi(p^\mu)} 
$$
as usual. Your generalized momenta are
$$
p^0=\frac{\partial\mathcal{L}}{\partial\partial_0\psi}=\frac{\partial\mathcal{L}}{\partial\dot{\psi}}
$$
and
$$
p^i=\frac{\partial\mathcal{L}}{\partial\partial_i\psi}=\frac{\partial\mathcal{L}}{\partial\nabla\psi},
$$ 
so yes, one momenta for the time derivative and three momenta for spatial derivatives.
