  We use matrix product techniques to investigate the performance of two
algorithms for obtaining the ground state of a quantum many-body Hamiltonian $H
= H_A + H_B$ in infinite systems. The first algorithm is a generalization of
the quantum approximate optimization algorithm (QAOA) and uses a quantum
computer to evolve an initial product state into an approximation of the ground
state of $H$, by alternating between $H_A$ and $H_B$. We show for the 1D
quantum Ising model that the accuracy in representing a gapped ground state
improves exponentially with the number of alternations. The second algorithm is
the variational imaginary time ansatz (VITA), which uses a classical computer
to simulate the ground state via alternating imaginary time steps with $H_A$
and $H_B$. We find for the 1D quantum Ising model that an accurate
approximation to the ground state is obtained with a total imaginary time
$\tau$ that grows only logarithmically with the inverse energy gap $1/ \Delta$
of $H$. This is much faster than imaginary time evolution by $H$, which would
require $\tau \sim 1/ \Delta$.
