# Quantum Cheque

This post was prepared by Bikash's Quantum for QuantumComputing.com.

A quantum cheque scheme is mainly composed of three algorithms, Gen, Sign and Verify. Gen algorithm produces a cheque book and a key for the customer, who issues a cheque. Sign algorithm creates a quantum cheque state, QC, and Verify algorithm checks the validity of a cheque. A quantum cheque has mainly three properties, Verifiability, i.e., it can be verified by a Bank's main branch or any of its acting branches, Non-repudiation, i.e, after issuing a cheque, a customer must not be able to disclaim it, and Unforgeability, i.e., a quantum cheque can not be fabricated or it can not be reused.

## The Quantum Cheque Scheme

The quantum cheque scheme can be described by considering three parties, Alice, Bob and Bank. Here, the Bank is denoted as the main branch, which can have several branches securely connected by a classical channel. In this protocol, only Alice and Bank are considered to be trusted parties, and not necessarily the branches. After a cheque is issued by Alice, Bob goes to Bank or any of its branches to withdraw money.

The following three schemes are followed for a successful quantum cheque transaction.

1. Gen Algorithm:

Initially, a shared key, $k$, is prepared by Alice and the Bank. Then Alice gives her public key, $pk$, to the Bank and collects her Private Key, $sk$.

The Bank prepares a set of $m$ number of GHZ states,

$∣ϕ_{GHZ}⟩=2 1 (∣0_{(i)}⟩_{A_{1}}∣0_{(i)}⟩_{A_{2}}∣0_{(i)}⟩_{B}+∣1_{(i)}⟩_{A_{1}}∣1_{(i)}⟩_{A_{2}}∣1_{(i)}⟩_{B})$

where $1≤i≤m$, along with the respective unique serial number $s∈{0,1}_{n}$. From every GHZ entangled state, the Bank gives two qubits, named $∣ϕ⟩_{A_{1}}$ and $∣ϕ⟩_{A_{2}}$, and the serial number to Alice, while keeping the third qubit, $∣ϕ⟩_{B}$, and other information, secretly in a database.

Here, $∣ϕ_{(i)}⟩_{GHZ_{i=1:m}}$ stands for ${∣ϕ_{(1)}⟩_{GHZ},∣ϕ_{(2)}⟩_{GHZ},…,∣ϕ_{(m)}⟩_{GHZ}}$.

At the end, Alice possesses $(id,pk,sk,k,s,{∣ϕ_{(i)}⟩_{A_{1}},∣ϕ_{(i)}⟩_{A_{2}}}_{i=1:m})$, and the Bank carries $(id,pk,k,s,{∣ϕ_{(i)}⟩_{B}}_{i=1:m})$.

2. Sign Algorithm:

Alice prepares a random number by using a random number generation procedure, $r←U_{{0,1}_{L}}$ to sign a cheque of amount $M$ and creates a $n$-qubit state by using the following one way function,

${∣ψ⟩}_{alice}=f(k∣∣id∣∣r∣∣M)$

where, $k$ and $id$, are respectively the secret key and the identity of Alice. The symbol `$∣∣$' concatenates two bit strings.

Alice also prepares $m$ states ${∣ψ_{M}⟩}_{i=1:m}$ corresponding to the amount M, using the one way function $g:{0,1}_{∗}×∣0⟩→∣ψ⟩$, as ${∣ψ_{M}⟩}=g(r∣∣M∣∣i)$

Subsequently, Alice encodes $∣ψ_{M}⟩$ with the entangled qubit, $∣ϕ_{(i)}⟩_{A_{1}}$ after which she performs a Bell measurement on her first two qubits.

The state of the four-qubit entangled system can be written in the following form,

$∣ϕ_{(i)}⟩=∣ψ_{M}⟩⊗∣ϕ⟩_{GHZ}$

$=21 {∣Ψ_{+}⟩_{A_{1}}(α_{i}∣00⟩_{A_{2}B}+β_{i}∣11⟩_{A_{2}B})+∣Ψ_{−}⟩_{A_{1}}(α_{i}∣00⟩_{A_{2}B}−β_{i}∣11⟩_{A_{2}B})+∣Φ_{+}⟩_{A_{1}}(β_{i}∣00⟩_{A_{2}B}+α_{i}∣11⟩_{A_{2}B})+∣Φ_{−}⟩_{A_{1}}(β_{i}∣00⟩_{A_{2}B}−α_{i}∣11⟩_{A_{2}B})}$

where $∣Ψ_{+}⟩,∣Ψ_{−}⟩,∣Φ_{+}⟩$, and $∣Φ_{−}⟩$ denote four Bell states.

Now, Alice applies an appropriate Pauli gate operation on her qubit $∣ϕ_{(i)}⟩_{A_{2}}$, according to the Bell state measurement outcomes:

$∣Ψ_{+}⟩→I$, $∣Ψ_{−}⟩→Z$, $∣Φ_{+}⟩→X$ and $∣Φ_{−}⟩→Y$

It is to be noted that the encoding procedure of quantum cheque needs to be repeated $m$ times.

Alice then uses sign algorithm to sign the serial number $s$ as $σ←Sign_{sk}(s)$, and generates a quantum cheque $QC=(id,s,r,σ,M,∣ϕ_{(i)}⟩_{A_{2}}_{i=1:m},∣ψ_{alice}⟩)$ for Bob to encash.

Swap Test:

In the swap test, the measurement of ancilla (first qubit) on a computational basis yields zero if the two states $∣Ψ⟩$ and $∣Ψ_{′}⟩$ are equal. In this case, swap test is said to be successful. However, if the two states are different, then the measurement of ancilla yields both $∣0⟩$ and $∣1⟩$ each associated with some probability. For $⟨Ψ∣Ψ_{′}⟩≥λ$, the swap test is successful with probability $21+λ_{2} $, and unsuccessful with probability $21−λ_{2} $. It is evident that, for the same input states, the swap test is successful with probability 1 and for different outputs, it is successful with probability less than 1. The efficiency of this test can be amplified by repeating it a large number of times.

3. Verify Algorithm:

In the verification process, Bob produces the quantum cheque QC at any of the acting branches of the Bank. The branch communicates with the Bank (main branch) to check the validity of the $(id,s)$ pair, and a verification is run by using $Vrfy_{pk}(σ,s)$. As described below, the Bank proceeds with the verification process if it finds $(id,s)$ and $σ$ to be valid, otherwise cancels the quantum cheque transaction.

The Bank then measures its qubit, $∣ϕ_{B}⟩$in Hadamard basis to get $∣+⟩$ or $∣−⟩$ as output and conveys the results to the acting branch. The branch applies the appropriate Pauli gate operation on $∣ϕ_{(i)}⟩_{A_{2}}$ to retrieve the unknown state $∣ψ_{M}⟩$.

A similar procedure is followed $m$ times to get $m$ unknown states ${∣ψ_{M}⟩}_{i=1:m}$. The Bank generates $∣ψ_{alice}⟩=f(k∣∣id∣∣r∣∣M)$, and ${∣ψ_{M}⟩}_{i=1:m}={g(r∣∣M∣∣i)}_{i=1:m}$ by using these one way functions, and then performs a swap test on $m+1$ set of states, ${∣ψ_{alice}⟩,∣ψ_{alice}⟩}$, and ${∣ψ_{M}⟩,∣ψ_{M}⟩}_{i=1:m}$.

The cheque is accepted if the swap test is successful, i.e., if $⟨ψ_{alice}∣ψ_{alice}⟩≥λ_{1}$ and ${⟨ψ_{M}∣ψ_{M}⟩≥λ_{2}}_{i=1:m}$, where $λ_{1}$ and $λ_{2}$ are constants fixed by the Bank. Else, the branch terminates the transaction.

## Quantum Circuit

```
# Create a Quantum Circuit with 4 quantum and 1 classical registers respectively
qc = QuantumCircuit(4, 1)
# Prepare a quantum cheque state on qubit q0
qc.u3(pi/4,0,0)
#create a GHZ state on qubits q1, q2 and q3
qc.h(1)
qc.cx(1,2)
qc.cx(1,3)
Now the quantum cheque state is encoded into four qubits q0, q1, q2, and q3.
#perform a Bell-basis measurement on qubit q0 and q1
qc.cx(0, 1)
qc.h(0)
#apply a quantum equivalent circuit for classical channel
qc.cx(1,2)
qc.cz(0,2)
After performing Bell-basis measurement, and applying conditional operations on the qubit 2, the quantum cheque state can be obtained at qubit q2. Hence, by measuring on the qubit q2, we can confirm the quantum cheque state.
# Measure qubit q2
qc.measure([2],[0])
# get a Strangeworks backend
backend = get_backend("qasm_simulator")
# execute circuit
execute(qc, backend, shots=1024)
```

## Results

After executing the circuit, we get 0 with 85% probability and 1 with 15% probability, which was the quantum cheque state initially prepared. Now the state has been teleported to the third qubit $q[2]$.

The first three qubits (q0,q1,q2) are in the possession of Alice, the Bank contains the fourht qubit (q3). Alice uses one of her entangled qubits (2nd qubit), and $∣ϕ_{(i)}⟩_{A_{1}}$, provided by Bank, to encode the unknown state $∣ψ_{M}⟩$. Here, this unknown state can not be generated by using the one way function, $g$, since we model only the quantum aspect and for simplicity only assume the g spits out a description of the following state, that is known to the preparation device but unknown to anybody else as,

$∣ψ_{M}⟩=cos(π/8)∣0⟩+sin(π/8)∣1⟩$

It can be computed by operating $U_{3}(θ,0,0)$ on the qubit q0 initially prepared in $∣0⟩$ state. As this state is now split between Alice's qubit (3rd qubit) and Bank's qubit (4th qubit), measuring the 3rd qubit in computational basis, it is expected to have $∣0⟩$ with probability $≈0.85$ and $|1\rangle$ with probability$≈0.15$.

The encoding procedure should be done $m$ times by using $m$ similar quantum circuits. Now, we take two initial states $∣0⟩$, and $∣0⟩$ for comparison test.

""" Quantum circuit for verifying the quantum cheque state """ from qiskit import QuantumCircuit, execute from strangeworks.qiskit import get_backend # Create a Quantum Circuit with 4 quantum and 1 classical register respectively qc = QuantumCircuit(4, 1) # apply Hadamard operation on q0 qubit qc.h(0) #apply controlled-swap operation on q0, q1 and q2 qubits qc.cx(1,2) qc.cx(0,2) qc.h(1) qc.t(0) qc.t(1) qc.tdg(2) qc.cx(1,2) qc.cx(0,1) qc.t(2) qc.cx(0,2) qc.tdg(1) qc.tdg(2) qc.cx(0,1) qc.cx(1,2) qc.h(1) qc.t(2) qc.cx(1,2) #apply Hadamard operation on q0 qubit qc.h(0) #measure q0 qubit qc.measure([0],[0]) # get a Strangeworks backend backend = get_backend("qasm_simulator") # execute circuit execute(qc, backend, shots=1024)

## Results

The above code prepares the quantum circuit for quantum cheque verification, where two states are compared. In this case, both the initial states (2nd qubit and 3rd qubit) are taken as, $∣0⟩$. It is expected to have $∣0⟩$ with probability 1, after measuring the ancilla qubit (1st qubit) in computational basis. After executing the quantum circuit, $∣0⟩$ is resulted on the ancilla qubit with 100% probability.

## Conclusion

To conclude, we have demonstrated here an experimental procedure of quantum cheque transaction in a quantum networked environment. Quantum cheque state is prepared and then encoded with the GHZ states and then verified with the swap test. Fredkin gate (controlled-swap operation) has been constructed, by using single qubit and CNOT gates, for verification of quantum cheque.

## References

[1]Subhayan Roy Moulick, and Prasanta K. Panigrahi, Quantum cheques, Quantum Inf. Process. 15, 2475–2486 (2016), [DOI: 10.1007/s11128-016-1273-4]

[2]Bikash K. Behera, Anindita Banerjee, and Prasanta K. Panigrahi, Experimental realization of quantum cheque using a five-qubit quantum computer, Quantum Inf. Process. 16, 312 (2017), [DOI: 10.1007%2Fs11128-017-1762-0]