The trotter number P gives the "degree of quantum-mechanicness" you allow for the simulation. P=1 means no quantum mechanics at all, i.e. the particle is represented by only one (classical) point. By increasing P you turn on the quantum mechanics, and will hopefully reach the "quantum limit" where further increases do not change your results.
With the help of Feynman's path-integrals and the primitive approximation
(exp(eps(T+V)) appr.equals exp(epsT)exp(epsV)) we can map any quantum system
onto a 'classical-like' system of "ring-polymers" - but be careful, this
is only correct for a picture and NOT for the actual interaction between
the single beads of the rings!
For the actual integration we use the same procedure thas is used for
classical systems: the Monte-Carlo method. The name comes from the fact
that random numbers are used to pick up one point after another in the
configuration space. If we are able to visit each configuration with the
apropriate probability, we only need to calculate the arithmetic average
over the observables we are interested in and will end up having the correct
statistical enssemble average.
This is possible by following Metropolis' algorithm. Here we need to
calculate the energy-difference one would achieve by doing the "step" from
a "present" configuration to the "next" configurtion (to be tested). If
there is an energy loss the step will be accepted, and an energy gain is
only accepted with the bolzmann-probability (i.e. take a random number
between 0 and 1, and test if it is smaller than exp(-dE/kT)). If the tried
step is rejected the old configuration is also the new one.
In our simulation there are two kinds of tested "steps":