# The most important quantum question , how to force a superposition qubit to collapses to an exact value? [closed]

Note: forcing a superposition qubit to collapses to 1, means cancel the other value 0 to get 1 appear

Question details step by step:

#If i have two qubits
Qr = QuantumRegister(1)
qr = QuantumRegister(1)

#and two classical registers
Cr = ClassicalRegister(1)
cr = ClassicalRegister(1)

#and one quantum circuit
cc = QuantumCircuit(Qr,qr,Cr,cr)

#And put Qr in superposition state
cc.h(Qr[0])

#And copy Qr to qr
cc.cx(Qr[0],qr[0])

# How to force qr[0] to collapses to a certain needed value (say 1) ,
# and after measuring Qr[0] it gives the same qr[0] value (gives 1 too)

#########################################################################
# need to do some tricks to force qr[0] to be 1
# (force it to be 1 by changing the probability of being 1 to high,
# not by changing the value of it to 1)
# and Qr[0] measuring also gives 1 (without doing any operations to it)
# all operations will done to qr[0] only
# we can add/use any new registers
#########################################################################

# and after measuring , we have to found that Cr[0] == cr[0] == 1
cc.measure(Qr[0],Cr[0]) # Cr==1
cc.measure(qr[0],cr[0]) # cr==1

# who can do it? and how?
# or even increasing the probability of getting 1 like 90%:10% instead of 50%:50%



Idea (1): when we do h(Qr), it will be in superposition state, it means it can be 0 and changed to 1 at any moment, i need some method to measure the probability of being 1 at this moment, if it is high then i do normal measure to catch it, if it is low, then i loop doing another things and test the probability again until it is changed to high, then we can do normal measure to catch and make it real, we will do this to all qubits one by one till get all our outputs match the known outputs, then our inputs will be the secret inputs that we want to know.

.

in another words: we want Qr still in superposition but after excute it 1000 shots and measure it,we get 990 times 1 and 10 times 0 or {'0': 10, '1': 990}

• Hi remon78eg! Welcome to QCSE! I'm not sure what you mean by "and Qr[0] measuring also gives 1 (without doing any operations to it.)" If Qr[0] is not $|1\rangle$ then a local operation on Qr[0] is needed to make it $|1\rangle$. Can you edit your question to clarify? Also, I'm a little confused about "forc[ing] a qubit to collapse to an exact value." A qubit in a superposition will collapse according to the Born rule. But it sounds like your question is "how can I perform local operations on a qubit that is in $|+\rangle$ to be in $|1\rangle$?" – Mark S Jul 14 '19 at 12:33
• first i did cc.h(Qr[0]) , so it is now (0 and 1) in the same time, then i did cc.cx(Qr[0],qr[0]) so, qr=Qr , now if i measured any of them, the other will be the same because it is a copy, so if i successfully forced qr to be 1, then Qr also will be 1 (without doing any operations to it.) – remon78eg Jul 14 '19 at 14:42
• Have a look at post-selection, this how what you describe is called. – Nelimee Jul 15 '19 at 6:16

i think you have done entaglment $$\frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$$ so when you measure the first qubit the second qubit forces to be collapses to the same state as the first qubit state.

• i can't understand the formulas , i can understand code only, can you explain by qiskit code, i did cc.h(Qr[0]) , so it is in superposition state now, i will not do any thing to it, i will do changes to qr only to force it to collapse to 1,and if Qr is 1 also , then we succeeded. – remon78eg Jul 14 '19 at 14:51
• @remon78eg, I don't think you can do what you want to do without local operations on Qr. You cannot "force qr to be 1" and have "Qr also will be 1 (without doing any operations to it.)" If you have two qubits Qr and qr that are both entangled in a Bell state, you cannot do an operation on qr only to "force" it to be "1", and have the second qubit Qr also be "1" with any probability greater than $1/2$, without acting on the second qubit Qr. – Mark S Jul 14 '19 at 15:42
• @Aman, i do copy, so both (Qr & qr) have the same value, if first one collapsed to 1 then the other must collapsed to 1 also or we do some error and changed the value ,not the probability of being 1 – remon78eg Jul 14 '19 at 16:09
• @remon78eg It seems like you wish to have a system go from $\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)$ to $\frac{1}{\sqrt{2}}(|10\rangle+|11\rangle)$. This is OK. But you seem to want the system to then be in $|11\rangle$ without operating on the second qubit. This is not doable. Being in $\frac{1}{\sqrt{2}}(|10\rangle+|11\rangle)$ means that the first qubit will measure $1$ always, and the second qubit will measure $0$ with 50% probability (and $1$ with 50% probability.) – Mark S Jul 14 '19 at 17:51
• @remon78eg yes if the first one collapsed to one the other must collapse to 1. But if you have more than one two qubits and measure one of them you may have a superposition state of the rest of the qubit other than the measured qubits. – Aman Jul 14 '19 at 18:05

You cannot force a superposition to collapse in a particular direction. When you perform a measurement that removes a superposition, that 'collapse' is random, and you cannot choose which way it collapses.

However, if you know what superposition you have, you can always convert it into any other state that you want to via unitary evolution (at which point you should not be using the 'collapse' terminology, which implies a non-unitary evolution).

Reading the comments, it seems that what you want to do is manipulate the probabilities with which the state collapses. This is better incorporated into the preparation procedure. Instead of performing a Hadamard rotation on the first qubit, perform a $$Y$$-rotation of some angle $$2\theta$$. I think this is provided by a command called ry. This will provide you with a state $$\cos\theta|0\rangle+\sin\theta|1\rangle$$ so that when you apply the controlled-not gate, you'll have $$\cos\theta|00\rangle+\sin\theta|11\rangle$$. This means that when you measure, you'll get the answer 0 (on both qubits) with probability $$\cos^2\theta$$, and 1 with probability $$\sin^2\theta$$.

• the word "cannot" in knowledge, is incorrect, the correct word is "don't know", because there is no impossible, but we just don't know how to do it now, may be we know how, later. – remon78eg Jul 16 '19 at 7:14
• @remon78eg The qualifier that applies throughout this site is "within the standard theory of Quantum Mechanics". True, it might be a physically permissable operation, but one would have to go beyond standard quantum mechanics to achieve it. – DaftWullie Jul 16 '19 at 8:49