  Basic principles of particle-in-cell (PIC ) codes with the main application
for plasma-based acceleration are discussed. The ab initio full electromagnetic
relativistic PIC codes provide the most reliable description of plasmas. Their
properties are considered in detail. Representing the most fundamental model,
the full PIC codes are computationally expensive. The plasma-based acceler-
ation is a multi-scale problem with very disparate scales. The smallest scale
is the laser or plasma wavelength (from one to hundred microns) and the largest
scale is the acceleration distance (from a few centimeters to meters or even
kilometers). The Lorentz-boost technique allows to reduce the scale disparity
at the costs of complicating the simulations and causing unphysical numerical
instabilities in the code. Another possibility is to use the quasi-static
approxi- mation where the disparate scales are separated analytically.
