\begin{eqnarray} \left[\hat A,\hat B\right]&=&\hat A\hat B-\hat B\hat A \\ &=& \begin{pmatrix} a_1&0&0\\ 0&a_2&0\\ 0&0&a_3 \end{pmatrix} \begin{pmatrix} b_1&0&0\\ 0&0&b_2\\ 0&b_2&0 \end{pmatrix} - \begin{pmatrix} b_1&0&0\\ 0&0&b_2\\ 0&b_2&0 \end{pmatrix} \begin{pmatrix} a_1&0&0\\ 0&a_2&0\\ 0&0&a_3 \end{pmatrix} \\ &=& \begin{pmatrix} a_1 b_1&0&0\\ 0&0&a_2 b_2\\ 0& a_3 b_2&0 \end{pmatrix} - \begin{pmatrix} a_1 b_1&0&0\\ 0&0&a_3 b_2\\ 0& a_2 b_2&0 \end{pmatrix} \\ &=& \begin{pmatrix} 0&0&0\\ 0&0&(a_2-a_3) b_2\\ 0&-(a_2- a_3) b_2&0 \end{pmatrix} \end{eqnarray}
Because \(\hat A\) is diagonal in the basis \(\vert 1\rangle\), \(\vert 2\rangle\), and \(\vert 3 \rangle\), this is the eigenbasis for \(\hat A\). In this basis, the eigenvalues are just the diagonal elements of \(\hat A\), i.e. \(a_1\), \(a_2\), and \(a_3\). The eigenbasis can be represented by the standard basis: \[\vert 1\rangle\doteq \begin{pmatrix} 1\\ 0\\ 0 \end{pmatrix} \vert 2\rangle\doteq \begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix} \vert 3\rangle\doteq \begin{pmatrix} 0\\ 0\\ 1 \end{pmatrix} \] In this same basis, we need to explicitly find the eigenvalues and eigenvectors of \(B\). \begin{eqnarray} \left\vert \lambda -B I\right\vert &=& \left\vert \begin{pmatrix} \lambda-b_1&0&0\\ 0&\lambda&-b_2\\ 0&-b_2&\lambda \end{pmatrix} \right\vert \\ &=&\left(\lambda-b_1\right)\left(\lambda^2-b_2^2\right) \\ &=&0 \\ &\Rightarrow& \lambda=b_1, \lambda=\pm b_2 \end{eqnarray} For \(\lambda=b_1\), we have: \begin{eqnarray} \begin{pmatrix} b_1&0&0\\ 0&0&b_2\\ 0&b_2&0 \end{pmatrix} \begin{pmatrix} x\\ y\\ z \end{pmatrix} &=& b_1 \begin{pmatrix} x\\ y\\ z \end{pmatrix} \\ &\Rightarrow& \begin{pmatrix} b_1 x\\ b_2 z\\ b_2 y \end{pmatrix} = \begin{pmatrix} b_1 x\\ b_1 y\\ b_1 z \end{pmatrix} \\ &\Rightarrow& \begin{pmatrix} x\\ y\\ z \end{pmatrix} = \begin{pmatrix} 1\\ 0\\ 0 \end{pmatrix} \end{eqnarray} For \(\lambda=b_2\), we have: \begin{eqnarray} \begin{pmatrix} b_1&0&0\\ 0&0&b_2\\ 0&b_2&0 \end{pmatrix} \begin{pmatrix} x\\ y\\ z \end{pmatrix} &=& b_2 \begin{pmatrix} x\\ y\\ z \end{pmatrix} \\ &\Rightarrow& \begin{pmatrix} b_1 x\\ b_2 z\\ b_2 y \end{pmatrix} = \begin{pmatrix} b_2 x\\ b_2 y\\ b_2 z \end{pmatrix} \\ &\Rightarrow& \begin{pmatrix} x\\ y\\ z \end{pmatrix} =\frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ 1 \end{pmatrix} \end{eqnarray} For \(\lambda=-b_2\), we have: \begin{eqnarray} \begin{pmatrix} b_1&0&0\\ 0&0&b_2\\ 0&b_2&0 \end{pmatrix} \begin{pmatrix} x\\ y\\ z \end{pmatrix} &=& -b_2 \begin{pmatrix} x\\ y\\ z \end{pmatrix} \\ &\Rightarrow& \begin{pmatrix} b_1 x\\ b_2 z\\ b_2 y \end{pmatrix} = \begin{pmatrix} -b_2 x\\ -b_2 y\\ -b_2 z \end{pmatrix} \\ &\Rightarrow& \begin{pmatrix} x\\ y\\ z \end{pmatrix} =\frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ -1 \end{pmatrix} \end{eqnarray}
If the state is initially in state \(\vert 2\rangle\), the we will take that as the “incoming” ket in the probability calculations. If we make a measurement of the observable \(B\), then we can only obtain its eigenvalues \(b_1\), \(\pm b_2\) as the results of the measurement. To find the probabilities, we take use the associated eigenstates of \(B\) as the “outgoing” bra state. \begin{eqnarray} \mathcal{P}_{b_1}&=&\left\vert \langle b_1\vert 2\rangle \right\vert^2 \\ &\doteq& \left\vert \begin{pmatrix} 1&0&0 \end{pmatrix} \begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix} \right\vert^2 \\ &=&\left\vert 0 \right\vert^2 \\ &=& 0 \end{eqnarray} \begin{eqnarray} \mathcal{P}_{b_2}&=&\left\vert \langle b_2\vert 2\rangle \right\vert^2 \\ &\doteq& \left\vert \frac{1}{\sqrt{2}} \begin{pmatrix} 0&1&1 \end{pmatrix} \begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix} \right\vert^2 \\ &=&\left\vert \frac{1}{\sqrt{2}} \right\vert^2 \\ &=& \frac{1}{2} \end{eqnarray} \begin{eqnarray} \mathcal{P}_{-b_2}&=&\left\vert \langle -b_2\vert 2\rangle \right\vert^2 \\ &\doteq& \left\vert \frac{1}{\sqrt{2}} \begin{pmatrix} 0&1&-1 \end{pmatrix} \begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix} \right\vert^2 \\ &=&\left\vert \frac{1}{\sqrt{2}} \right\vert^2 \\ &=& =\frac{1}{2} \end{eqnarray} Now, the inputs into the \(A\) device are just the eigenstates of \(B\) since after a measurement of \(B\) the state “collapses”, i.e. is projected onto an eigenstate. So the eigenstates of \(B\) are the “incoming” kets and the eigenstates of \(A\) are the “outgoing” bras. If the incoming state is \(\vert b_2\rangle\), then: \begin{eqnarray} \mathcal{P}_{a_1}&=&\left\vert \langle 1\vert b_2\rangle \right\vert^2 \\ &\doteq& \left\vert \begin{pmatrix} 1&0&0 \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ 1 \end{pmatrix} \right\vert^2 \\ &=&\left\vert 0 \right\vert^2 \\ &=& 0 \end{eqnarray} \begin{eqnarray} \mathcal{P}_{a_2}&=&\left\vert \langle 2\vert b_2\rangle \right\vert^2 \\ &\doteq& \left\vert \begin{pmatrix} 0&1&0 \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ 1 \end{pmatrix} \right\vert^2 \\ &=&\left\vert \frac{1}{\sqrt{2}} \right\vert^2 \\ &=& \frac{1}{2} \end{eqnarray} \begin{eqnarray} \mathcal{P}_{a_3}&=&\left\vert \langle 3\vert b_2\rangle \right\vert^2 \\ &\doteq& \left\vert \begin{pmatrix} 0&0&1 \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ 1 \end{pmatrix} \right\vert^2 \\ &=&\left\vert \frac{1}{\sqrt{2}} \right\vert^2 \\ &=& \frac{1}{2} \end{eqnarray} If the incoming state is \(\vert -b_2\rangle\), then: \begin{eqnarray} \mathcal{P}_{a_1}&=&\left\vert \langle 1\vert -b_2\rangle \right\vert^2 \\ &\doteq& \left\vert \begin{pmatrix} 1&0&0 \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ -1 \end{pmatrix} \right\vert^2 \\ &=&\left\vert 0 \right\vert^2 \\ &=& 0 \end{eqnarray} \begin{eqnarray} \mathcal{P}_{a_2}&=&\left\vert \langle 2\vert -b_2\rangle \right\vert^2 \\ &\doteq& \left\vert \begin{pmatrix} 0&1&0 \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ -1 \end{pmatrix} \right\vert^2 \\ &=&\left\vert \frac{1}{\sqrt{2}} \right\vert^2 \\ &=& \frac{1}{2} \end{eqnarray} \begin{eqnarray} \mathcal{P}_{a_3}&=&\left\vert \langle 3\vert -b_2\rangle \right\vert^2 \\ &\doteq& \left\vert \begin{pmatrix} 0&0&1 \frac{1}{\sqrt{2}} \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 0\\ 1\\ -1 \end{pmatrix} \right\vert^2 \\ &=&\left\vert -\frac{1}{\sqrt{2}} \right\vert^2 \\ &=& \frac{1}{2} \end{eqnarray} Although the question doesn't explicitly ask this, you might want to ask what are the probabilities that you measure the different eigenvalues of \(A\) given that you know what happened when you measured \(B\).
In part (1), we found that the operators \(\hat A\) and \(\hat B\) do not commute (unless \(a_2=a_3\)). This means that the corresponding observables are generally incompatible and do not share a complete set of simultaneous eigenstates.
In part (3), this non-commutation implies that the two measurements are incompatible. After measuring the observable corresponding to \(\hat B\), the system collapses into an eigenstate of \(\hat B\). Since the eigenstates of \(\hat B\) are generally not eigenstates of \(\hat A\), the subsequent measurement of \(\hat A\) is not deterministic and can yield multiple possible outcomes with nontrivial probabilities.
If \(\hat A\) and \(\hat B\) did commute, then the two observables would be compatible and would share a common set of eigenstates. In that case, measuring \(\hat B\) would leave the system in a state that is also an eigenstate of \(\hat A\), so the subsequent measurement of \(\hat A\) would give a definite result (probability 1 for one eigenvalue and 0 for the others, in the non-degenerate case).
Use a New Representation: Consider a quantum system with an observable \(A\) that has three possible measurement results: \(a_1\), \(a_2\), and \(a_3\). States \(\left|{a_1}\right\rangle \), \(\left|{a_2}\right\rangle \), and \(\left|{a_3}\right\rangle \) are eigenstates of the operator \(\hat{A}\) corresponding to these possible measurement results.
Since the \(a_1\), \(a_2\), and \(a_3\) are the possible values of \(A\) that can be measured, the corresponding kets \(\left|{a_1}\right\rangle \), \(\left|{a_2}\right\rangle \), and \(\left|{a_3}\right\rangle \) form an orthonormal basis. I can calculate the entries in the matrix representation of a ket by taking the inner product of the ket with each of the basis kets. \begin{eqnarray*} \left|{a_1}\right\rangle \doteq \left(\begin{array}{c} \left\langle {a_1}\middle|{a_1}\right\rangle \\ \left\langle {a_1}\middle|{a_2}\right\rangle \\ \left\langle {a_1}\middle|{a_3}\right\rangle \end{array}\right) = \left(\begin{array}{c} 1 \\ 0 \\ 0 \end{array}\right) \end{eqnarray*} The other matrices can be similarly calculated: \[ \left|{a_1}\right\rangle \doteq \left(\begin{array}{c} 1 \\ 0 \\ 0 \end{array}\right), \left|{a_2}\right\rangle \doteq \left(\begin{array}{c} 0 \\ 1 \\ 0 \end{array}\right), \left|{a_3}\right\rangle \doteq \left(\begin{array}{c} 0 \\ 0 \\ 1 \end{array}\right). \]
The system is prepared in the state:
\[\left|{\psi_b}\right\rangle = N\left(1\left|{a_1}\right\rangle -2\left|{a_2}\right\rangle +5\left|{a_3}\right\rangle \right)\]
The probabilities of measuring each \(a_i\) are the norm squared of the expansion coefficients of the initial state when written in the \(a\)-basis. Since \(\left|{\psi}\right\rangle \) is already given in this basis, there isn't much to do --- except for first normalizing it. (Don't forget this!) So, \(\left\langle {\psi}\middle|{\psi}\right\rangle = |N|^2(1^2 + 2^2 + 5^2) = 30|N|^2\), and the state to work with is \(\frac{1}{\sqrt{30}}\left|{\psi}\right\rangle \). Now the probabilities are read off, as \(\big|\left\langle {a_i}\middle|{\psi}\right\rangle \big|^2\), and \begin{eqnarray*} \mathcal{P}_{a_1} = \big|\left\langle {a_1}\middle|{\psi}\right\rangle \big|^2 =\left|\frac{1}{\sqrt{30}}\right|^2 = \frac{1}{30}, \\ \mathcal{P}_{a_2} = \big|\left\langle {a_2}\middle|{\psi}\right\rangle \big|^2=\left|\frac{-2}{\sqrt{30}}\right|^2 = \frac{4}{30}, \\ \mathcal{P}_{a_3} = \big|\left\langle {a_3}\middle|{\psi}\right\rangle \big|^2=\left|\frac{5}{\sqrt{30}}\right|^2 = \frac{25}{30}. \end{eqnarray*}
In a different experiment, the system is prepared in the state:
\[\left|{\psi_c}\right\rangle = N\left(2\left|{a_1}\right\rangle +3i\left|{a_2}\right\rangle \right)\]
The norm of the given vector is \(\sqrt{\left\langle {\psi}\middle|{\psi}\right\rangle } = \sqrt{|N|^2(|2|^2 + |3{i}|^2)} = |N|\sqrt{13}\), so \(N={1\over\sqrt{13}}\) for the vector to be normalized. In the \(a\)-basis: \[ \left|{\psi}\right\rangle \ = \ \frac{2}{\sqrt{13}} \left(\begin{array}{c} 1 \\ 0 \\ 0 \end{array}\right) + \frac{3{i}}{\sqrt{13}} \left(\begin{array}{c} 0 \\ 1 \\ 0 \end{array}\right) \ = \ \frac{1}{\sqrt{13}} \left(\begin{array}{c} 2 \\ 3{i} \\ 0 \end{array}\right). \] The probabilities of measuring the values \(a_1\), \(a_2\), and \(a_3\) are the norm squared of the coefficients: \(4/13\) probability of measuring \(a_1\) and \(9/13\) probability of measuring \(a_2\).
The only component of spin that we know for certain is the y-component, which has a value of \(-\hbar\). The \(S_x\) and \(S_z\) components have a non-zero uncertainty. Therefore, I cannot describe the spin as having a well defined direction. For this state, I can only say that the y-component of spin has a value of \(-\hbar\). Incidentally, the eigenvalues of the \(\hat{S}^2\) operator tell me that I also know the magnitude of the spin vector is \(\sqrt{2}\hbar\). Figure 2.10 (McIntyre) is a nice example of a way to represent a quantum mechanics spin vector.
Since we know the matrix representations of the spin operators and the state \(\left|{-1}\right\rangle _{y}\) in the \(z\)-basis, it will be easiest to work in matrix language in this basis. \begin{eqnarray} \langle S_x\rangle &=& _{y}\left\langle {-1}\right| S_x \left|{-1}\right\rangle _{y}\\ &\doteq& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar}{\sqrt{2}} \begin{pmatrix} 0&1&0\\ 1&0&1\\ 0&1&0 \end{pmatrix} \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=&0 \\\langle S_y\rangle &=& _{y}\left\langle {-1}\right| S_y \left|{-1}\right\rangle _{y}\\ &\doteq& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar}{\sqrt{2}} \begin{pmatrix} 0&-i&0\\ i&0&-i\\ 0&i&0 \end{pmatrix} \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=&-\hbar\\\langle S_z\rangle &=& _{y}\left\langle {-1}\right| S_z \left|{-1}\right\rangle _{y}\\ &\doteq& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar}{\sqrt{2}} \begin{pmatrix} 1&0&0\\ 0&0&0\\ 0&0&-1 \end{pmatrix} \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=&0 \end{eqnarray} Similarly: \begin{eqnarray} \langle S_x^2\rangle &=& _{y}\left\langle {-1}\right| S_x^2 \left|{-1}\right\rangle _{y}\\ &\doteq& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar^2}{2} \begin{pmatrix} 0&1&0\\ 1&0&1\\ 0&1&0 \end{pmatrix} ^2 \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar^2}{2} \begin{pmatrix} 1&0&1\\ 0&2&0\\ 1&0&1 \end{pmatrix} ^2 \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=&\frac{\hbar^2}{2}\\\langle S_y^2\rangle &=& _{y}\left\langle {-1}\right| S_y^2 \left|{-1}\right\rangle _{y}\\ &\doteq& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar^2}{2} \begin{pmatrix} 0&-i&0\\ i&0&-i\\ 0&i&0 \end{pmatrix} ^2 \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar^2}{2} \begin{pmatrix} 1&0&-1\\ 0&2&0\\ -1&0&1 \end{pmatrix} ^2 \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=&\hbar^2\\\langle S_z^2\rangle &=& _{y}\left\langle {-1}\right| S_z^2 \left|{-1}\right\rangle _{y}\\ &\doteq& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar^2}{2} \begin{pmatrix} 1&0&0\\ 0&0&0\\ 0&0&-1 \end{pmatrix} ^2 \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=& \begin{pmatrix} \frac{1}{2}&\frac{i}{\sqrt{2}}&-\frac{1}{2} \end{pmatrix} \frac{\hbar^2}{2} \begin{pmatrix} 1&0&0\\ 0&0&0\\ 0&0&1 \end{pmatrix} ^2 \begin{pmatrix} \frac{1}{2}\\-\frac{i}{\sqrt{2}}\\ -\frac{1}{2} \end{pmatrix} \\ &=&\frac{\hbar^2}{2} \end{eqnarray} Therefore: \begin{eqnarray} \Delta S_x&=&\sqrt{\langle S_x^2\rangle -\langle S_x\rangle^2}\\&=&\frac{\hbar}{\sqrt{2}}\\\Delta S_y&=&\sqrt{\langle S_y^2\rangle -\langle S_y\rangle^2}\\&=&0\\\Delta S_z&=&\sqrt{\langle S_z^2\rangle -\langle S_z\rangle^2}\\&=&\frac{\hbar}{\sqrt{2}} \end{eqnarray} If we make a measurement of the \(y\)-component of angular momentum for this state, we will obtain the result \(-\hbar\) with 100% probability. \begin{eqnarray} \langle S_y\rangle&=& -\hbar;\; \Delta S_y=0 \end{eqnarray} On the other hand, if we make a measurement of the \(x\) or \(z\)-component of angular momentum, we have equal probabilities of obtaining \(+\hbar\) and \(-\hbar\), so the expectation value of these operators is zero, but the uncertainty is nonzero. \begin{eqnarray} \langle S_x\rangle&=& 0;\; \Delta S_x=\frac{\hbar}{\sqrt 2}\\\langle S_z\rangle&=& 0;\; \Delta S_z=\frac{\hbar}{\sqrt 2} \end{eqnarray}