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

Measuring the Deutsch-Jozsa Example #30

Open
simplygreatwork opened this issue Jun 13, 2020 · 1 comment
Open

Measuring the Deutsch-Jozsa Example #30

simplygreatwork opened this issue Jun 13, 2020 · 1 comment

Comments

@simplygreatwork
Copy link

simplygreatwork commented Jun 13, 2020

I'm skipping around the chapters of your book quite a bit. I have a question about the Deutsch-Jozsa example. If I were to measure the qubits, they all have an probablity amplitude of 6.25%. I would expect for this example to function properly with measuring all qubits, the state 0-7 should be 0% and 8-15 should be 12.5%. Is this correct? Or does this example just assume that only three qubits are measured?

@simplygreatwork
Copy link
Author

simplygreatwork commented Jun 14, 2020

I found a QASM example online which provided a different configuration with a measurable result. I made an example for it. I also made a classical example. I know that Deutrsch-Jozsa is contrived and has no practical utility but it is a useful example for comparing a classical implementation with a quantum implementation using superposition.

https://github.com/simplygreatwork/obvious/blob/master/examples/algorithm-constant-or-balanced-quantum.js
https://github.com/simplygreatwork/obvious/blob/master/examples/algorithm-constant-or-balanced-classical.js

I still need to work on allowing each example to use 2^n (any number of bits). Right now the classical version uses one bit and the quantum version uses 3 bits I think (qubits). It would be nice if each version shared the same number of bits (and customizable).

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