We review a molecular dynamics method for nucleon many-body systems called the quantum molecular dynamics (QMD) and our studies using this method. These studies address the structure and the dynamics of nuclear matter relevant to the neutron star crusts, supernova cores, and heavy-ion collisions. A key advantage of QMD is that we can study dynamical processes of nucleon many-body systems without any assumptions on the nuclear structure. First we focus on the inhomogeneous structures of low-density nuclear matter consisting not only of spherical nuclei but also of nuclear "pasta", i.e., rod-like and slab-like nuclei. We show that the pasta phases can appear in the ground and equilibrium states of nuclear matter without assuming nuclear shape. Next we show our simulation of compression of nuclear matter which corresponds to the collapsing stage of supernovae. With increase of density, a crystalline solid of spherical nuclei change to a triangular lattice of rods by connecting neighboring nuclei. Finally, we discuss the fragment formation in expanding nuclear matter. Our results suggest that a generally accepted scenario based on the liquid-gas phase transition is not plausible at lower temperatures.