  We present a detailed investigation of the behavior of the nonlinear q-voter
model for opinion dynamics. At the mean-field level we derive analytically, for
any value of the number q of agents involved in the elementary update, the
phase diagram, the exit probability and the consensus time at the transition
point. The mean-field formalism is extended to the case that the interaction
pattern is given by generic heterogeneous networks. We finally discuss the case
of random regular networks and compare analytical results with simulations.
