I've been trying to figure out how to create a simple circuit in Qiskit to create a check (cheque ) generation and verification as described in this paper.
I started with 3 qubits, first one with the bank (
q0), second one with Alice (
q1) and 3rd one with Bob (
q2). Initially, I created a single
GHZ state between the bank and Alice. Then Alice encodes a state in her qubit - right now simply applying a
U3 gate, followed by a Bell measurement (not quite clear what is going on here). Finally, the SWAP test which determines whether the two states (Alice's and Bob's) are the same or not; if the states are same we get one state with a probability of
1 ideally, and if the states are different (invalid check/cheque) we get differing probabilities for
OPENQASM 2.0; include "qelib1.inc"; qreg q; creg c; x q; cx q,q; barrier q,q,q; // random state u3(pi/4,0,0) q; barrier q,q,q; // bell measurement h q; cx q,q; barrier q,q,q; // any change to state here will make the swap test fail barrier q,q,q; // swap test h q; cswap q,q,q; h q; barrier q,q,q; // measure first qubit measure q -> c;
Is this the way it's intended to work?