  We study a carbon nanotube quantum dot embedded into a SQUID loop in order to
investigate the competition of strong electron correlations with proximity
effect. Depending whether local pairing or local magnetism prevails, a
superconducting quantum dot will respectively exhibit positive or negative
supercurrent, referred to as a 0 or $\pi$ Josephson junction. In the regime of
strong Coulomb blockade, the 0 to $\pi$ transition is typically controlled by a
change in the discrete charge state of the dot, from even to odd. In contrast,
at larger tunneling amplitude the Kondo effect develops for an odd charge
(magnetic) dot in the normal state, and quenches magnetism. In this situation,
we find that a first order 0 to $\pi$ quantum phase transition can be triggered
at fixed valence when superconductivity is brought in, due to the competition
of the superconducting gap and the Kondo temperature. The SQUID geometry
together with the tunability of our device allows the exploration of the
associated phase diagram predicted by recent theories. We also report on the
observation of anharmonic behavior of the current-phase relation in the
transition regime, that we associate with the two different accessible
superconducting states. Our results ultimately reveal the spin singlet nature
of the Kondo ground state, which is the key process in allowing the stability
of the 0-phase far from the mixed valence regime.
