According to Pancharatnam [S. Pancharatnam, in Geometric Phases in Physics, edited by A. Shapere and F. Wilczek (World Scientific, Singapore, 1989)], two light beams of differing elliptical polarization can be said to be "in phase" if their interference is maximally constructive. In the same spirit, the relative phase between two beams a and b is the amount by which the phase of beam b needs to be changed to put it in phase with beam a. Berry has established a simple relation between Pancharatnam's concept and a phase relation between two quantum-mechanical states: If two nonorthogonal states \psi-a> and \psi-b> are phased in such a way that \psi-a> + \psi-b> has maximum norm, i.e., such that <psi-a\psi-b> is real and positive, they can be said to be in phase or parallel, and in general the relative phase between them is the phase angle of <psi-a\psi-b>. This concept plays a role in the theory of the Abelian geometric phase. In the non-Abelian case, one has two n-dimensional subspaces instead of two single states, and instead of choosing the phase of each state one has to choose an orthonormal basis (including phase) in each subspace. We show that the concept of "block diagonalization" introduced by Cederbaum, Shirmer, and Meyer [J. Phys. A 22, 2427 (1989)] in the context of a molecular problem provides a natural generalization of the Pancharatnam-Berry phase relation.