# How to calculate the coefficients of a qubit from the angles of its Bloch representation?

A quantum bit $$|\psi\rangle=a|0\rangle+b|1\rangle$$ is represented on the Bloch sphere as a point on the spherical surface with $$\theta = 40^°$$ and $$\phi = 245^°$$. Calculate the (complex) coefficients $$a$$ and $$b$$.

Here is theory from wikipedia, that I also looked up

It would be nice to have a step-by-step guide based on a concrete example for reverse operation like it was made here: How can I find the $\theta$ and $\phi$ values of a qubit on the Bloch sphere?

$$|ψ⟩=\cos\left(\frac{θ}{2}\right)|0⟩+e^{iϕ} \sin\left(\frac{θ}{2}\right)|1⟩$$
Identify common coefficients: $$a = \cos\left(\frac{θ}{2}\right)$$ $$b = e^{iϕ} \sin\left(\frac{θ}{2}\right)$$
Then simply plug in your angles $$θ$$ and $$ϕ$$. Be sure your calculator knows whether you are inputting your angles as radians or degrees (eg. $$40°=\frac{2π}{9}$$ rad)!