If I want to to search 2 values with Grover's algorithm, it outputs the same probability for both that is bigger that the no searched states that have the same lower percent.
If I use an oracle matrix with all 1's in the diagonals except on the searched states that are -1.
But suppose you are going to find the drink that you want. For example, I like coke 57% , and pepsi 10%, the rest are 1%.
If I change the -1 in those two values in the oracle matrix for example to near 1.5 for coke and 0.5 for pepsi, it will output more probability from bigger to lower: coke module 0.57, pepsi module 0.39 and the others randomly to 0.13.
So is it possible in real life to do this? I ask because I don't know how I can change it in Q# reflection.
/// Reflection `RM` about the marked state.
operation ReflectMarked (markedQubit : Qubit) : Unit {
R1(PI(), markedQubit);
}
/// Reflection about the |00…0〉 state.
/// A register of n qubits initially in the |00…0〉 state.
operation ReflectZero (databaseRegister : Qubit[]) : Unit {
let nQubits = Length(databaseRegister);
for (idxQubit in 0 .. nQubits - 1) {
X(databaseRegister[idxQubit]);
}
Controlled Z(databaseRegister[1 .. nQubits - 1], databaseRegister[0]);
for (idxQubit in 0 .. nQubits - 1) {
X(databaseRegister[idxQubit]);
}
}