1

The context of this question comes from calculating the fidelity drop of quantum systems after applying rotational X and Z gates. The equation to solve is shown below, for which the angle $\alpha$ needs to be found. $$ B = m\cos^{2}(\alpha) + k\cos(\alpha)\sin(\alpha) + n\sin^{2}(\alpha) $$ In the equation $B$, $m$, $k$, and $n$ are known.

I would be happy to receive some help with this, thanks in advance!

Blue
  • 75,673

3 Answers3

2

$$ B = m\cos^{2}(\alpha) + k\cos(\alpha)\sin(\alpha) + n\sin^{2}(\alpha) $$ $$ \implies B-\frac{m+n}{2}=\frac{m-n}{2} \cos 2 \alpha + \frac{k}{2} \sin 2\alpha $$ $$ \frac{2B-m-n}{\sqrt{(m-n)^2+k^2}}=\frac{(m-n) \cos 2 \alpha + k \sin 2\alpha}{\sqrt{(m-n)^2+k^2}}=\cos(2\alpha-\beta) $$ Finally we get $$\alpha=\frac{1}{2}\cos^{-1}\left[\frac{2B-m-n}{\sqrt{(m-n)^2+k^2}}\right]+\frac{\beta}{2},~~ \beta=\tan^{-1}\frac{k}{m-n}.$$

Z Ahmed
  • 43,235
  • 1
    I followed the steps and come to almost the same. So we have the following: $$\cos(2\alpha -\beta) = \frac{2B - m - n}{\sqrt{(m - n)^{2} + k^{2}}}$$ Then: $$2\alpha - \beta = \arccos \Bigg( \frac{2B - m - n}{\sqrt{(m - n)^{2} + k^{2}}} \Bigg)$$ And finally: $$\alpha = \frac{\beta}{2} + \frac{1}{2}\arccos\Bigg ( \frac{2B - m - n}{\sqrt{(m - n)^{2} + k^{2}}} \Bigg)$$ with $\beta = \arctan(\frac{k}{m - n})$. Which is slightly different to your result. – Leonardo Gonzalez Jul 14 '22 at 16:23
  • Very good, I have corrected my answer. – Z Ahmed Jul 14 '22 at 16:32
1
  1. Move the $\cos\alpha\sin\alpha$ term to one side, then square both sides of the equation
  2. Use $x=\cos^2\alpha$, so then $\sin^2\alpha=1-x$
  3. Solve the equation in $x$
  4. Finds $\alpha$.
  5. Check the solution by plugging it back into the original equation. You might need to adjust the sign of $\alpha$

EDIT: $$ (B - m\cos^{2}(\alpha) - n\sin^{2}(\alpha))^2= k^2\cos^2(\alpha)\sin^2(\alpha) $$ Substituting $\cos^2\alpha=x,\ \sin^2\alpha=1-\cos^2\alpha=1-x$, you get: $$(B-mx-n(1-x))^2=k^2x(1-x)$$ This is a simple quadratic equation in $x$.

Andrei
  • 37,370
  • Did you try that? The solutions are looking horrible ... – Michael Hoppe Jul 14 '22 at 14:40
  • If $B,m,k,n$ have some known numeric values, the answer is easy to compute. Or use some symbolic math program to help you simplify the solution to the quadratic. For example wolfram alpha – Andrei Jul 14 '22 at 14:49
  • By trying what you propose and adding one more squaring step, I come indeed to a not looking nice equation. Which turns out to be a polynomial function of degree $n=4$ on which I need to find the 4 zeros evaluating my $\cos^{2}(\alpha)$. Then pick the valid ones and estimate my angle $\alpha$. – Leonardo Gonzalez Jul 14 '22 at 15:23
  • @LeonardoGonzalez I've added my calculation to show that you get a polynomial of degree 2, not 4. – Andrei Jul 14 '22 at 20:17
0

Hint:

Avoid squaring as it generally introduces When do we get extraneous roots?

Divide both sides by $\cos^2\alpha$ to find $$B(1+t^2)=m+kt+nt^2$$ which on rearrangement is a quadratic equation in $t=\tan^2\alpha$

We can divide both sides by $\sin^2\alpha$ as well to find another quadratic equation in $\dfrac1t$