Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of wires to measure vs. number of classes #65

Open
cDenius opened this issue Oct 12, 2021 · 0 comments
Open

Number of wires to measure vs. number of classes #65

cDenius opened this issue Oct 12, 2021 · 0 comments

Comments

@cDenius
Copy link
Contributor

cDenius commented Oct 12, 2021

This discussion is a little bit older but I had a look into the code again and want to share my thoughts.

If we use choose the mnist option for our dataset, we measure the probability of two wires. This gives us four different values/probabilities for each option: [00, 01, 10, 11]. Likewise, the target is a four dimensional array with two different possibilities: [1, 0, 0, 0] for class 6 and [0, 1, 0, 0].

@nikmetz , @eileen-kuehn Is this correct? If not, stop me here :D

But this is a problem. We want to measure 00 for class 6 and 01 for class 9. So the value of qubit 0 does not matter at all for our classification - it should be zero in every case. But somehow (I guess for weird quantum reasons :)) we still need to measure it to distinguish 01 from 11 and 00 from 10. This is like saying our output for qubit 1 is only useful if qubit 0 is zero. I'm also not sure if it is a good idea to force a quibt into a specific state (qubit 0 into zero). Due to entanglement it might not be possible that qubit 0 is set to zero and qubit 1 can still be both 0 and 1 depending on the input.

Possible solutions:

  • We only measure one quibt. 0 means class 6, 1 means class 9. But we run into the same problem using ìris with 3 classes.

  • Measure/get the expectation value for as many qubits as there are classes. Apply softmax on these values and take this as our circuit output.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant