  The KP equation has a large family of quasiperiodic multiphase solutions.
These solutions can be expressed in terms of Riemann-theta functions. In this
paper, a finite-dimensional canonical Hamiltonian system depending on a finite
number of parameters is given for the description of each such solution. The
Hamiltonian systems are completely integrable in the sense of Liouville. In
effect, this provides a solution of the initial-value problem for the
theta-function solutions. Some consequences of this approach are discussed.
