inQWIRE / SQIR

A Small Quantum Intermediate Representation
MIT License
79 stars 24 forks source link

Add Wiesner's quantum money example #24

Closed adrianleh closed 3 years ago

adrianleh commented 3 years ago

This pull request adds an example of Wiesner's quantum money (https://en.wikipedia.org/wiki/Quantum_money).

The example constructs the following circuit:

Circuit

We end up proving that given two identical bases, the circuit will output the expected result. While if the bases are different, the chance of getting the correct output is 1/2^n_diff, where n_diff is the number of bits different between the two bases.

Since there are quite a few commits in this PR, I'd also suggest to squash-merge.