Hi All,(adsbygoogle = window.adsbygoogle || []).push({});

I'm working out a program to emulate a quantum computer (definitely in a nascent stage), and I'm struggling with a piece of the math. I looked at the math sections in these forums, but thought this might be more appropriate to post it. I'll try to conceptually outline the problem, and then post some of the math.

When dealing with qubits, they are often conceptualized as two complex numbers...

[tex]\alpha = A + Bi \\

\beta = C + Di[/tex]

However, it's customary to forceBto be equal to zero (B=0), by changing the values ofA,C, &D. Things are easy if we just setBto zero in the beginning. However, once the qubit (i.e., complex number pair) is pushed through a quantum gate, it is quite easy forBto have a non-zero value on the other side of the gate. A trivial example of this is the application of aNOTgate...

[tex]\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \times \begin{bmatrix} A + Bi \\ C + Di \end{bmatrix} = \begin{bmatrix} C + Di \\ A + Bi \end{bmatrix}[/tex]

TheBpart might start out as zero. However, it starts out as part of Alpha, but winds up as part of Beta, so Alpha is no longer "Real" after theiNOTgate is applied. (Note that I just swappedA&BwithC&Dto illustrate theNOTgate. However, in the following, it is assumed thatA&Bstay associated with Alpha, and thatC&Dstay associated with Beta.)

Many gates do even more than this: Alpha may start out "Real", with either a "Real" or "Complex" Beta. However, after the application of the gate, both Alpha and Beta will be "Complex". That is precisely my problem. There is some transformation that allows us to "force" Alpha back to real (i.e., forcingB(post-gate) to zero), while still preserving all the other criteria of defining a qubit. This transformation is done by changing the values ofA,C, &D. But let me outline the criteria that must be maintained:

[tex]|\alpha|^2_{PreTransformation} = |\alpha|^2_{PostTransformation} \\

|\beta|^2_{PreTransformation} = |\beta|^2_{PostTransformation} \\

|\alpha|^2_{PreTransformation} + |\beta|^2_{PreTransformation} = 1 \\

|\alpha|^2_{PostTransformation} + |\beta|^2_{PostTransformation} = 1 [/tex]

This information might be enough to outline the problem (but I'm not sure it is). I just need the outline of an algorithm (transformation) to push Alpha back to "Real" after the application of any gate.

However, there are other criteria that must be maintained. As those familiar with quantum computing know, all of this can be conceptualized as a Bloch sphere (with a corresponding Bloch vector).

These additional criteria require the introduction of Theta and Phi (two angles in radians). And that's also where the problem rears it's head yet again. I can solve for Theta and Phi from Alpha and Beta so long as Alpha is "Real". Theta and Phi can be thought of as polar coordinates, with the limits of...

[tex]0 \le \theta \le \pi \\

0 \le \varphi < 2\pi[/tex]

Theta is an angle of rotation about the Y axis. It can rotate the vector from straight up () to straight down (0). Phi is an angle of rotation about the Z axis. Looking straight down from the top of the sphere, it rotates the vector around in the sphere. Theta and Phi provide unique positions on any/all points of the surface of the sphere (with the exceptions of when Theta = 0 or Theta =piat which times, the value of Phi doesn't matter (and is just twisting rather than rotating the vector).pi

Okay, here are the relationships between our Alpha and our Beta with our newly introduced Theta and Phi. But again, this is where my problem comes in. These relationships assume that Alpha is "Real" (and has no "Imaginary" part. Going back to the original definitions of Alpha and Beta (in terms ofA,B,C, &D), we can say that...

[tex]\theta = 2 \times ArcCos(A) \\

...and... \\

\varphi = ArcCos(C / Sin(\theta / 2)),\ recognizing\ that\ \theta \ must\ be\ calculated\ first. \\

... or\ alternatively ... \\

\varphi = ArcSin(D / Sin(\theta / 2)),\ still\ recognizing\ that\ \theta \ must\ be\ calculated\ first.[/tex]

And, regardless of whether the ArcCos or ArcSin approach is taken to derive Phi, there is still one more consideration in calculating it. IfDis less than zero, we must subtract it from 2pi. In other words, we must do something like the following after it's calculated...

[tex]if\ D < 0\ then\ \varphi = 2\pi - \varphi [/tex]

Also, it's important to notice thatBdidn't appear in the calculations of Theta and Phi, becauseBwas assumed to be zero.

For completeness, we can also solve forA,C, &D, given a Theta and Phi via...

[tex]A = Cos(\theta / 2) \\

C = Cos(\varphi) \times Sin(\theta / 2) \\

D = Sin(\varphi) \times Sin(\theta / 2) [/tex]

And again, the above assumes thatBwill be zero (making Alpha be "Real").

So, to summarize the introduction of Theta and Phi (which define a specific Bloch vector), they can not change during the transformations ofA,C, &D, makingB=0.

That's about it. So, in an attempt to summarize my problem, I need an algorithm that pushes Alpha back to a "Real" number (i.e.B=0) after it has been made "Complex" from pushing the qubit through a gate.

Even a reference to some webpage that discusses this would be much appreciated. I've looked through several reference that I have, but haven't found the answer. I'm suspecting that it's rather simple (once it's all said and done), but I'm just not seeing it.

Regards (and thanks in advance),

Elroy

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Qubits, 2 complex numbers, forcing one to real

**Physics Forums | Science Articles, Homework Help, Discussion**