  We propose a new version of the matrix product (MP) states approach to the
description of quantum spin chains, which allows one to construct MP states
with certain total spin and its z-projection. We show that previously known MP
wavefunctions for integer-spin antiferromagnetic chains and ladders correspond
to some particular cases of our general ansatz. Our method allows to describe
systems with spontaneously broken rotational symmetry, like quantum
ferrimagnetic chains whose ground state has nonzero total spin. We apply this
approach to describe the ground state properties of the isotropic ferrimagnetic
Heisenberg chain with alternating spins 1 and 1/2 and compare our variational
results with the high-precision numerical data obtained by means of the quantum
Monte Carlo (QMC) method. For both the ground state energy and the correlation
functions we obtain very good agreement between the variational results and the
QMC data.
