- #1
- 42
- 9
Hi All,
I'm gradually teaching myself quantum computing, being an excellent programmer and fair at linear algebra and geometry.
To learn it, I'm writing a quantum computer emulator (complete with graphical representations). I'll share it when I get to some level of completion. The following is a screenshot of one piece of the program:
But here's why I'm posting. I'm struggling somewhat with the math needed to partition Phi into BetaA (real part) and BetaB (imaginary part). I'm trying to write a function with input of Theta and Phi (polar coordinates for qubit), and have it output Alpha, BetaA, and BetaB. As we know...
|Alpha|2 + |Beta|2 must = 1
...or, recognizing that Alpha doesn't need an imaginary part, we can simplify to...
Alpha2 + |Beta|2 = 1
...and Alpha is fairly easy to get from Theta. It's...
Temp1 = (Cos(Theta) + 1) / 2
Alpha = Sqrt(Temp1)
...so, since Temp1 is still squared, we can say that...
Temp2 = 1 - Temp1
...and then...
|Beta|2 must = Temp2
However, now that Temp2 part must be partitioned between BetaA (the real part) and BetaB (the imaginary part). That's where I'm a bit stuck. To simplify things further, let's just stick with the first quadrant of the Phi Argand plane (the XY qubit plane). I can easily sort out the signs once I get past the BetaA and BetaB partitioning.
I can get VERY close just treating it as a linear relationship (before sqrt) to Phi, as follows (using Temp2 from above)...
BetaA = Sqrt(Temp2 * (1 - Phi / (PI/2)))
BetaB = Sqrt(Temp2 - BetaA2)
In fact, this works perfectly when Phi=0, Phi=PI/4, and Phi=PI/2.
However, it's not quite right when Phi isn't on a multiple of 45 degrees.
Some help with this BetaA and BetaB partitioning of Phi would be much appreciated.
Also, if anything isn't clear, please don't hesitate to ask, and I'll attempt to be more clear.
Regards,
Elroy
p.s. Just FYI, being the old curmudgeon that I am, this certainly isn't homework. With my PhD, I've been to school quite enough. :p
I'm gradually teaching myself quantum computing, being an excellent programmer and fair at linear algebra and geometry.
To learn it, I'm writing a quantum computer emulator (complete with graphical representations). I'll share it when I get to some level of completion. The following is a screenshot of one piece of the program:
But here's why I'm posting. I'm struggling somewhat with the math needed to partition Phi into BetaA (real part) and BetaB (imaginary part). I'm trying to write a function with input of Theta and Phi (polar coordinates for qubit), and have it output Alpha, BetaA, and BetaB. As we know...
|Alpha|2 + |Beta|2 must = 1
...or, recognizing that Alpha doesn't need an imaginary part, we can simplify to...
Alpha2 + |Beta|2 = 1
...and Alpha is fairly easy to get from Theta. It's...
Temp1 = (Cos(Theta) + 1) / 2
Alpha = Sqrt(Temp1)
...so, since Temp1 is still squared, we can say that...
Temp2 = 1 - Temp1
...and then...
|Beta|2 must = Temp2
However, now that Temp2 part must be partitioned between BetaA (the real part) and BetaB (the imaginary part). That's where I'm a bit stuck. To simplify things further, let's just stick with the first quadrant of the Phi Argand plane (the XY qubit plane). I can easily sort out the signs once I get past the BetaA and BetaB partitioning.
I can get VERY close just treating it as a linear relationship (before sqrt) to Phi, as follows (using Temp2 from above)...
BetaA = Sqrt(Temp2 * (1 - Phi / (PI/2)))
BetaB = Sqrt(Temp2 - BetaA2)
In fact, this works perfectly when Phi=0, Phi=PI/4, and Phi=PI/2.
However, it's not quite right when Phi isn't on a multiple of 45 degrees.
Some help with this BetaA and BetaB partitioning of Phi would be much appreciated.
Also, if anything isn't clear, please don't hesitate to ask, and I'll attempt to be more clear.
Regards,
Elroy
p.s. Just FYI, being the old curmudgeon that I am, this certainly isn't homework. With my PhD, I've been to school quite enough. :p