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}