Quantum Computing Asked by bhagi radh on April 25, 2021
I have a qubit
$$left| psi right> = (alpha_1 + ialpha_2 ) left|0right> + (beta_1 + ibeta_2 )left|1right>$$
so if i give values $alpha_1 + ialpha_2 = 1 + 4i$ and $beta_1 + ibeta_2 = 3 + 4i$ i will nomralise these and give it to psi
now when I measure using qiskit and plot it will be like 0.6 in state zero and 0.4 in state is there any way that I can make it an equal probability?
I tried passing it through Hadamard gate but it does not give me equal probability.
The Hadamard gate put the states $|0rangle$ and $|1rangle$ into uniform superposition but not for any arbitrary state.
You can check that: $H|0rangle = dfrac{1}{sqrt{2}} begin{pmatrix} 1& 1 1 & -1 end{pmatrix} begin{pmatrix} 1 0end{pmatrix} = dfrac{1}{sqrt{2}}begin{pmatrix} 1 1 end{pmatrix} = dfrac{|0rangle + |1rangle}{sqrt{2}}$ and similarly, you can show that $H|1rangle = dfrac{|0rangle - |1rangle}{sqrt{2}}$. In each case, the probability to see a $|0rangle$ or $|1rangle$ is $big| 1/sqrt{2}big|^2 = 1/2. $
If you have an arbitrary single qubit state, $|psi rangle = alpha|0rangle + beta|1rangle $ then you can show that $H|psirangle = (alpha + beta)|0rangle + (alpha - beta)|1rangle$, so the probability of seeing the state $|0rangle$ is $big| alpha + beta|^2$, and the probability of seeing the state $|1rangle$ is $big| alpha - beta big|^2$, thus they are not the same. So applying the Hadamard gate to an arbitrary state does not bring it to a uniform superposition state.
Of course, you can find a Unitary matrix $U$ that maps the state $|psirangle$ to the uniform superposition state $dfrac{|0rangle + |1rangle}{sqrt{2}}$. But from all your previous questions, it seems like you are using Qiskit for the work that you are doing. What you can do is to reset the particular qubit you are interesting in to the $|0rangle$ state through the reset
option, then apply the Hadamard gate. This is probably the easiest. Below is an example of how to do reset:
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
qreg_q = QuantumRegister(1, 'q')
creg_c = ClassicalRegister(1, 'c')
circuit = QuantumCircuit(qreg_q, creg_c)
circuit.ry(1.213, qreg_q[0]) #A quantum state that is not in uniform superposition
circuit.reset(qreg_q[0]) # reset the qubit to |0>
circuit.h(qreg_q[0]) # Apply the Hadamard gate
print(circuit)
┌───────────┐ ┌───┐
q_0: ┤ RY(1.213) ├─|0>─┤ H ├
└───────────┘ └───┘
c: 1/═══════════════════════
Answered by KAJ226 on April 25, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP