[I am just transferring this from Stack Overflow. It might need editing.]
————
[The reader can skip to “It all sounds fine…”, before the spreadsheet representation.]
I am trying to figure out quantum computing from YouTube videos, and pdf’s from universities, and odd bits here and there.
I have been confident that the two values in any q-bit must add to 1 — that is, their squares must.
Pertinent (or related) to Grover’s Algorithm, I have been trying to figure out the procedure for multiplying [i.e. increasing] the amplitude of the one q-bit, relative to the others. (I mostly follow the trigonometry; it is the matrix side I am having trouble with… mostly because I am having trouble getting a handle on the syntax of the algebra.)
(I have been working from the following page.)
https://drive.google.com/file/d/14G_0TwdxBFpI_Ylj5lb_imVtcnunrQcB/view
I think I understand the “reflection around |0〉” part — just flip the sign on the p[robability]|1〉 part.
(Incidentally, I take it that the pertinent q-bits still add to 1, through ignoring their signs?)
That leaves the “reflection around |ψ〉” part. I have just found an account that is meaningful to me (rightly or wrongly!), on this page (straddling pp5 and 6).
https://theory.epfl.ch/courses/topicstcs/Lecture112016.pdf
If I understand correctly, it says that one • applies a Hadamard Gate, • reflects around |0〉 (as above), and • applies a Hadamard Gate (again). (I have not mentally conceptualised this yet.)
It all sounds fine. The issue is that, when I try applying a Hadamard Gate to a biased superposition — {3/4,1/4} as opposed to {1/2,1/2} — the resulting probabilities (i.e. their squares) do not add to 1.
EDIT_01
- My spreadsheet is as follows.
Columns A, B… D… F.
A ----------- B ----------… D -----------… F
= sqrt(0.5)
, = sqrt(0.5)
… = sqrt(3/4)
… =(A1*D1)+(B1*D2)
= sqrt(0.5)
, =-sqrt(0.5)
… = sqrt(1/4)
… =(A2*D1)+(B2*D2)
. Clmn(F) =SUM(F1,F2)
Respectively, for • all SQRT (as above), • SQRT(X/4), • SQRT(0.5) and • no SQRT…
I get 1.225…, 0.866…, 1.06… and 0.75. (Of course, only one of those is “correct” — the first one, I believe — the point here is that this is not my/the error.)
Is my spreadsheet wrong, or is my rendition of matrix multiplication wrong, or is it in fact true that applying a Hadamard Gate to anything other than 0, 1, or 50/50 results in mayhem… or is it okay for a q-bit to have a total probability < 1… please?