microsoft / QuantumKatas

Tutorials and programming exercises for learning Q# and quantum computing
MIT License
4.54k stars 1.22k forks source link

Mistake in multi-qubit measurement tutorial exercise 2 calculations. #803

Closed ivan-shaporov closed 2 years ago

ivan-shaporov commented 2 years ago

https://github.com/microsoft/QuantumKatas/blob/cf3d7e3cbae6f5a0bfd0cf67381ce613d7412383/tutorials/MultiQubitSystemMeasurements/Workbook_MultiQubitSystemMeasurements.ipynb?short_path=78ffc93#L97-L101

I repeated the calculations and got a different result with the amplitudes of the last two terms swapped:

$\newcommand{\ket}[1]{\left|#1\right>}$, $\newcommand{\bra}[1]{\left<#1\right|}$ $$\ket \psi = \frac{2}{3}\ket {00} + \frac{1}{3} \ket {01} + \frac{2}{3}\ket {11} = $$ $$= \frac{2}{3} \big[ \frac{1}{\sqrt{2}}\big(\ket{+} + \ket{-}\big) \otimes \frac{1}{\sqrt{2}} \big(\ket{+} + \ket{-}\big) \big] + $$ $$+ \frac{1}{3} \big[ \frac{1}{\sqrt{2}}\big(\ket{+} + \ket{-}\big) \otimes \frac{1}{\sqrt{2}} \big(\ket{+} - \ket{-}\big) \big] + $$ $$+ \frac{2}{3} \big[ \frac{1}{\sqrt{2}}\big(\ket{+} - \ket{-}\big) \otimes \frac{1}{\sqrt{2}} \big(\ket{+} - \ket{-}\big) \big] = $$ $$= \frac{1}{3} \big[ \big(\ket{+} + \ket{-}\big) \otimes \big(\ket{+} + \ket{-}\big) \big] + $$ $$+ \frac{1}{6} \big[ \big(\ket{+} + \ket{-}\big) \otimes \big(\ket{+} - \ket{-}\big) \big] + $$ $$+ \frac{1}{3} \big[ \big(\ket{+} - \ket{-}\big) \otimes \big(\ket{+} - \ket{-}\big) \big] = $$ $$= \frac{1}{3} \big[ \ket{++} + \ket{+-} + \ket{-+} + \ket{--} \big] + $$ $$+ \frac{1}{6} \big[ \ket{++} - \ket{+-} + \ket{-+} - \ket{--} \big] + $$ $$+ \frac{1}{3} \big[ \ket{++} - \ket{+-} - \ket{-+} + \ket{--} \big] = $$ $$= (\frac{1}{3} + \frac{1}{6} + \frac{1}{3})\ket{++} + $$ $$+ (\frac{1}{3} - \frac{1}{6} - \frac{1}{3})\ket{+-} + $$ $$+ (\frac{1}{3} + \frac{1}{6} - \frac{1}{3})\ket{-+} + $$ $$+ (\frac{1}{3} - \frac{1}{6} + \frac{1}{3})\ket{--} = $$ $$= \frac{5}{6}\ket{++} - \frac{1}{6}\ket{+-} + \frac{1}{6}\ket{-+} + \frac{1}{2}\ket{--} ;$$

The resulting table also looks wrong having ++ twice.

ivan-shaporov commented 2 years ago

Added PR #804