# Is there a gate that puts a qubit into superposition with a not so purely probabalistic (50 50) outcome?

I know that a Hadamard states is a purely probabalistic one; e.g.

$$H\vert 0\rangle=a\vert 0\rangle+b\vert 1\rangle$$

where $$a^2=0.5$$ and $$b^2=0.5$$.

Are there any states in which the probabilities differ, and if there are how are they important?

Welcome to QCSE.

You already know that $$a^2=b^2=0.5$$. For a single qubit gate akin to the Hadamard gate you can achieve any two probabilities you want, as long as they add to $$1$$.

For example one trick that I learned was that you could choose ratios of Pythagorean triples, i.e. numbers $$a$$,$$b$$,$$c$$ such that $$a^2+b^2=c^2$$. Let's have a gate called $$\mathrm{YOUSEF}$$ defined as:

$$\mathrm{YOUSEF}\vert 0\rangle=\frac{3}{5}\vert 0\rangle+\frac{4}{5}\vert 1\rangle.$$

Such a gate may be useful in biasing your transition probabilities in a manner your algorithm dictates.

• for a qubit such as an electron, does that depend on the phase, for example does the probabilistic outcome of an electron spinning sideways e:g l+> differ from one that's halfway between the l1> and the l+> on a bloch sphere? if yes does l+> or l-> always have a 50 50 probability? Jun 1 '20 at 2:03
• @yousefelbrolosy First things first, dispense with the notion that the electron is actually physically spinning. It's not true, and will only confuse you later. Second, your example doesn't really describe a phase dependence. Usually, when we say "phase", we mean some $e^{i\delta}$ that is part of the coefficient on one or more of the basis states. Jun 1 '20 at 13:33
• @yousefelbrolosy Anyway, the state $\cos(3\pi/8)|0\rangle+\sin(3\pi/8)||1\rangle\approx 0.38|0\rangle+0.92|1\rangle$ is halfway between $|+\rangle$ and $|1\rangle$, and it clearly differs from $|+\rangle=\frac{1}{\sqrt{2}}|0\rangle+\frac{1}{\sqrt{2}}|1\rangle$. Jun 1 '20 at 13:46
• @probably_someone it is about the angular momentum of the electron but not physically spinning am i correct? Jun 1 '20 at 14:15
• @yousefelbrolosy Yes, that's basically it. Jun 1 '20 at 14:24

You can use $$Ry$$ gate to prepare a qubit in superposition with arbitrary probabilities. When you apply the gate on qubit in state $$|0\rangle$$, you get a qubit in superposition $$|\psi\rangle = \cos(\theta/2)|0\rangle + \sin(\theta/2)|1\rangle.$$

By chaning angle $$\theta$$ you can set any probability you want.

For setting $$\theta = \pi/2$$ you will get equally distributed superposition because $$\cos(\pi/4) = \sin(\pi/4)=\frac{1}{\sqrt{2}}$$, for setting $$\theta = \pi$$ you will get qubit $$|\psi\rangle = |1\rangle$$ because $$\cos(\pi/2) =0$$, etc.

Changing $$\theta$$ continously from $$0$$ to $$\pi$$, probability of measuring $$|0\rangle$$ is decreasing from $$1$$ to $$0$$ while probability of measuring $$|1\rangle$$ is increasing from $$0$$ to $$1$$.