Top Banner
GENERAL ARTICLE Quantum Game Theory – II * A Comprehensive Study Indranil Ghosh Indranil Ghosh is a graduate student doing post graduation in physics specialising in condensed matter physics, from the Department of Physics, Jadavpur University, Kolkata. His research interests include computational physics, numerical computing, quantum mechanics and quantum computing. The following article is a continuation the article titled Quan- tum Game Theory – I: A Comprehensive Study [1], that ap- peared in the May issue of Resonance. 1. Quantum Game Theory Classical game theory, when analysed from the perspective of quantum algorithms and quantum probability amplitudes, is called ‘quantum game theory’ [2]. This provides us with the extra abil- ities to utilize the entanglement between players’ moves and also the linear superpositions of strategy actions. The players perform local unitary operations on their qubits analogous to the classical moves they play in classical game theory. For dynamic games like quantum penny flip, the property of superposition between qubits may be sucient for analysis, but static games like quan- tum prisoner’s dilemma generally require quantum entanglement. Next, we analyse the game theory models in details. 1.1 Penny Flip Game 1.1.1 Classical version This game is played between two players. Let us assume them to be Alice and Bob. Here Alice always plays the first move fol- lowed by Bob. The rules of the game are as follows: Out of the two equally probable states of the unbiased penny, i.e, {H, T }, Alice sets the initial state of the penny in either H or T . * Vol.26, No.6, DOI: https://doi.org/10.1007/s12045-021-1180-6 RESONANCE | June 2021 791
22

GENERAL ARTICLE Quantum Game Theory – II

Feb 23, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Quantum Game Theory – II*

A Comprehensive Study

Indranil Ghosh

Indranil Ghosh is a graduate

student doing post graduation

in physics specialising in

condensed matter physics,

from the Department of

Physics, Jadavpur University,

Kolkata. His research

interests include

computational physics,

numerical computing,

quantum mechanics and

quantum computing.

The following article is a continuation the article titled Quan-

tum Game Theory – I: A Comprehensive Study [1], that ap-

peared in the May issue of Resonance.

1. Quantum Game Theory

Classical game theory, when analysed from the perspective of

quantum algorithms and quantum probability amplitudes, is called

‘quantum game theory’ [2]. This provides us with the extra abil-

ities to utilize the entanglement between players’ moves and also

the linear superpositions of strategy actions. The players perform

local unitary operations on their qubits analogous to the classical

moves they play in classical game theory. For dynamic games

like quantum penny flip, the property of superposition between

qubits may be sufficient for analysis, but static games like quan-

tum prisoner’s dilemma generally require quantum entanglement.

Next, we analyse the game theory models in details.

1.1 Penny Flip Game

1.1.1 Classical version

This game is played between two players. Let us assume them

to be Alice and Bob. Here Alice always plays the first move fol-

lowed by Bob. The rules of the game are as follows:

• Out of the two equally probable states of the unbiased penny, i.e,

{H, T }, Alice sets the initial state of the penny in either H or T .

*Vol.26, No.6, DOI: https://doi.org/10.1007/s12045-021-1180-6

RESONANCE | June 2021 791

Page 2: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

• Now both of them have access to two possible strategies, i.e,

S 1 ≡ flip the penny, S 2 ≡ keep the penny as it is. After Alice’s

initial setting of the state, Bob, without knowing this initial state,

plays either S 1 or S 2.

• After this, again Alice, without knowing Bob’s move, plays ei-

ther S 1 or S 2.

• At last Bob, without knowing Alice’s move again, plays either

S 1 or S 2. Now, the final state is checked.

• If the final state is in H state, Alice looses 1 point and Bob gains

1 point. Otherwise, if in T state, the reverse happens. This is a

two-player zero-sum game, where their payoffs in every situation

are exactly opposite to each other and add up to give 0.

1.1.2 Quantum version

The H and T states are replaced by the up, u and down, d states,

i.e, |0〉 and |1〉 eigenstates of a quantum system (like an electron)

respectively. The up state is defined as, u = |0〉 =

1

0

and the

down state as, d = |1〉 =

0

1

. The strategies are replaced by

unitary operators S 1 = σx, i.e, the spin flip operator and S 2 = I,

i.e, the identity operator. The initial quantum state is set to be

either up, u or down, d. The rules for the sequence of player

moves remain the same as that of the classical version. Finally

the final quantum state is measured to analyse the game. We later

introduce some complicated situations where either Alice or Bob

cheats or where both of them do.

1.1.3 Representation and the game frame

For our analysis, let’s suppose Alice sets the initial state to be

always in up, u state and further build upon the situation. Instead,

if Alice sets the initial state to be in down, d state, the outcome of

the game remains same, with the change that the payoffs to Alice

and Bob just get reversed. The game can be represented by the

binary tree:

792 RESONANCE | June 2021

Page 3: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Alice, u

d

u

d

Bob,σ

x

u

Bob,I

Alice

, σx

d

u

Bob,σ

x

d

Bob,I

Alice,

I

Bob, σx

u

d

u

Bob,σ

x

d

Bob,I

Alice

, σx

u

d

Bob,σ

x

u

Bob,I

Alice,

I

Bob, I

The simple operations that have been utilized here are, u = Iu,

d = Id, u = σxd and d = σxu. The sequence of the penny states

can be jotted down in the form of a matrix, given in Table 1.

Table 1. Sequence for

penny states.Alice/Bob I, I I, σx σx, I σx, σx

I u, u, u d, d, d d, u, u u, d, d

σx d, d, u u, u, d u, d, u d, u, d

This as a result gives us the payoff matrix of the game as in Table

6.

Table 2. Payoff matrix for

Alice and Bob.Alice/Bob I, I I, σx σx, I σx, σx

I (−1, 1) (1,−1) (1,−1) (−1, 1)

σx (1,−1) (−1, 1) (−1, 1) (1,−1)

The first element in each cell of the matrix is Alice’s payoff,

and the second element is Bob’s. Alice and Bob both have ac-

cess to mixed strategies. Both of them chooses moves σx and

I with equal probability of 12. It is evident from the payoff ma-

trix that, despite what Bob’s move is, Alice’s expected payoff is

πAlice =12((1) + (−1)) = 0. Similarly, Bob’s expected payoff, de-

RESONANCE | June 2021 793

Page 4: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

spite Alice’s move, is, πBob =12((1) + (−1) + (1) + (−1)) = 0. For

‘N’ such games and ‘x’ wins for Alice, as given in [3], the actual

payoff to Alice would be a member of the payoff set,

= { f (x; N)}{2x − N, x = 0, 1, ...,N}. (1)

The probability of these payoffs,

P(∏

) = { f (x; N, p)} = {

(

N

x

)

pxqN−x,∀x}. (2)

For Bob too, we will have the same computations. In our case,

we have taken N = 1 giving us∏

= {−1,+1} and P(∏

) = { 12,

12}.

1.1.4 Simulation results

A simple quantum simulator named, QSimulator.py. is written

in Python version 3.6.8. All the Python files written hereafter are

present in the Github repository [4]. The above file is further used

in analysing all the quantum games in this article. The program

is designed for a maximum of an 8-qubit system. The qubit |0〉

is represented by Q0 and qubit |1〉 is represented by Q1. Quantum

state, |01110〉 is represented by Q01110 and so on. Also,

|01110〉 = |0〉 ⊗ |1〉 ⊗ |1〉 ⊗ |1〉 . ⊗ |0〉 (3)

Python’s numpy package lets us create these quantum systems.

The ⊗ in the above equation is called the tensor product or the

outer product and is implemented by numpy’s outer() function.

The QSimulator.py file provides with all the necessary quantum

logic gates required in our further studies. For example,

794 RESONANCE | June 2021

Page 5: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

>>> Q0

a r r a y ( [ 1 . , 0 . ] )

>>> Q1

a r r a y ( [ 0 . , 1 . ] )

>>> Q111

a r r a y ( [ 0 . , 0 . , 0 . , 0 . , 0 . , 0 . , 0 . , 1 . ] )

>>> I2

a r r a y ( [ [ 1 . , 0 . ] ,

[ 0 . , 1 . ] ] )

>>> P aul iX ( I2 )

a r r a y ( [ [ 0 . , 1 . ] ,

[ 1 . , 0 . ] ] )

>>> Hadamard ( I2 )

a r r a y ( [ [ 0 .70710678 , 0 . 7 0 7 1 0 6 7 8 ] ,

[ 0 .70710678 , −0 .7071067 8 ] ] )

Here, we have simulated |0〉, |1〉, |111〉, identity operator (I), σx

operator and the Hadamard operator (H). The whole game tree

has been simulated by writing a file penny_flip_1.py. Running

this file, lets us verify that there is an equal probability of 12

for

both the ‘up’ and ‘down’ states to be the final state. Thus, the

probability of winning for Alice is equal to the probability of win-

ning for Bob. Look at Figure 1 and Figure 2.

These two cases occur with equal probability for a large number

of samplings. This can be plotted as given in Figure 3.

Next, we perform the analysis of few more complicated case stud-

ies, where the players may cheat, and the property of quantum

superposition is exploited.

1.1.5 Case 1: Alice cheats

Let us suppose Alice takes the help of the quantum property of su-

perposition to cheat. She sets the initial state to be a superposition

of both the ‘up’ and ‘down’ states instead of the ‘up’ state as in

the previous case. Let the initial state set by Alice be, |ψ〉 = u+d√2

.

RESONANCE | June 2021 795

Page 6: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 1. Probability

distribution for the final

state after measurement

(Bob wins).

Figure 2. Probability dis-

tribution for the final state

after measurement (Alice

wins).

We note the following equations,

|φ〉 = I |ψ〉 =u + d√

2, (4)

and

|φ〉 = σx |ψ〉 =d + u√

2=

u + d√

2. (5)

where, |φ〉 is the final quantum state. A simple simulation of the

above equations is carried out with QSimulator.py.

796 RESONANCE | June 2021

Page 7: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 3. Plot that shows

that both the possible states

have an equal probability of

0.5 to be the final state after

collapsing due to measure-

ment.

>>> u = Q0

>>> d = Q1

>>> p s i = ( u + d ) / np . s q r t ( 2 )

>>> p s i

a r r a y ( [ 0 . 7 0 7 1 0 6 7 8 , 0 . 7 0 7 1 0 6 7 8 ] )

>>> np . d o t ( I2 , p s i )

a r r a y ( [ 0 . 7 0 7 1 0 6 7 8 , 0 . 7 0 7 1 0 6 7 8 ] )

>>> P aul iX ( p s i )

a r r a y ( [ 0 . 7 0 7 1 0 6 7 8 , 0 . 7 0 7 1 0 6 7 8 ] )

Keeping the above in mind, the game tree is represented as,

RESONANCE | June 2021 797

Page 8: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Alice, u+d√

2

u+d√

2

u+d√

2

u+d√

2

Bob,σ

x/I

Alice,

σx/I

Bob,σ

x/I

The above game tree is simulated by writing a Python file, penny_flip_2.py.

This file is then run to generate the plot given in Figure 4.

On measurement of the final state it is discovered by Alice that

once again, she loses or wins with equal probabilities. For N = 1,

again,∏

= {−1, 1} and P(∏

) = { 12,

12}. Measurement yields the

basis eigenstate |0〉with the probability, | 〈0|φ〉 |2 = 12

and the basis

eigenstate |1〉 with the probability, | 〈1|φ〉 |2 = 12.

1.1.6 Case 2: Bob cheats

Now, let’s suppose Alice remains innocent and plays fair, but Bob

commits trickery in his move. So, |ψ〉 = |0〉 again. Instead of

playing the classical moves I or σx, Bob plays a quantum move,

i.e., he plays the Hadamard operation. We note the equations,

H |ψ〉 =u + d√

2, (6)

798 RESONANCE | June 2021

Page 9: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 4. Probability den-

sities showing equal proba-

bilities.

and

H(H |ψ〉) =1

2

2

0

=

1

0

= u. (7)

If the game tree is drawn, it will be seen that after Bob’s first

move, the state of the penny will be in the superposed state given

by (12) and after his second move, the Hadamard operation brings

back the penny state to ‘up’, i.e, |φ〉 = u = |0〉 again. This has been

simulated with the file penny_flip_3.py, which generates the plot

given in Figure 5.

The payoff set for both Alice and Bob is {−1,+1}. Measure-

ment yields state ‘up’ with probability, | 〈0|φ〉 |2 = 1 and the state

‘down’ with probability, | 〈1|φ〉 |2 = 0. So, for Alice, P(∏

) =

{1, 0} and for Bob, P(∏

) = {0, 1}.

1.1.7 Case 3: Both of them cheat

Let us consider two conditions here, allowing Alice to cheat by

setting the initial penny state to be ‘down’ or the superposed state

instead of the traditional ‘up’ situation. Bob always plays the

Hadamard operation.

Alice sets the initial state to be ‘down’, so, |ψ〉 = |1〉 and Bob

RESONANCE | June 2021 799

Page 10: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 5. Probability

density showing |0〉 appears

with probability 1.

plays H,

Hd = H |1〉 =u − d√

2. (8)

Now, Alice plays σx,

σx(Hd) =d − u√

2, (9)

or she plays I,

I(Hd) =u − d√

2. (10)

After this, Bob again plays the H operation,

H(σx(Hd)) = −d, (11)

or,

H(I(H(d)) = d. (12)

The tree that models the game is,

800 RESONANCE | June 2021

Page 11: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 6. Probability

density showing |1〉 appears

with probability 1.

Alice, d

u−d√2

u−d√2

d

Bob,

H

Ali

ce,I

d−u√2

−d

Bob,

H

Alice,

σx

Bob,

H

This has been simulated with penny_flip_4.py which generates

the plot as shown in Figure 6.

The payoff set for Alice and Bob is {−1,+1}. When the final state

RESONANCE | June 2021 801

Page 12: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

is |φ〉 = −d, measurement yields base state ‘down’ with proba-

bility 1 and the base state ‘up’ with probability 0 and the similar

result emerges for the case when |φ〉 = d. So, the probability set

for Alice is P(∏

) = {0, 1} and for Bob is P(∏

) = {1, 0}. So, Alice

always wins in this case.

In the next case, Alice sets the initial state of the penny in the

superposed state as in case 2. Now, Bob plays H,

H |ψ〉 = H[u + d√

2] = u. (13)

Next, Alice plays either σx or I. So,

σxu = d, (14)

or

Iu = u. (15)

Finally Bob again plays H, so,

|φ〉 = Hd =u − d√

2, (16)

or

|φ〉 = Hu =u − d√

2. (17)

This can be represented by a similar game tree and can be sim-

ulated with the file penny_flip_5.py, that generates the plot given

in Figure 7

The payoff set for both Alice and Bob is∏

= {−1,+1}. When

|φ〉 = u−d√2

, measurement yields base state ‘up’ with probability,

| 〈0|φ〉 |2 = 12

and the base state ‘down’ with probability, | 〈1|φ〉 |2 =12. Similar results appear for |φ〉 = u+d

√2

. The probability set for

both Alice and Bob is { 12,

12}. So, Alice and Bob has the equal

probability for winning. In the next sub-section, we will be dis-

cussing both classical and quantum versions.

802 RESONANCE | June 2021

Page 13: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 7. Probability den-

sity showing |0〉 and |1〉 ap-

pearing with equal probabil-

ity of 0.5.

1.2 Prisoner’s Dilemma

1.2.1 Classical version

Prisoner’s dilemma [5] [6] is a paradoxical situation occurring in

game theory or decision analysis problems, which shows why two

rational agents might not cooperate with each other, even though

it appears that it is in their best interest to do so. This is a very

interesting model having a wide range of applications in com-

puter science, biology, economics and philosophy. The game was

developed in 1950 by Merrill Flood and Melvin Dresher while

working at RAND cooperation.

Prisoner’s dilemma is a 2 X 2 non-zero sum game (i.e., a game

where the payoffs of each player do not add up to give 0), gener-

ally presented in a static form. The game reads in the following

way: there are two suspects Alice and Bob, suspected of commit-

ting a crime together, who have been brought in for interrogation.

Both of them has access to two strategy moves, i.e., either to “co-

operate” (C) with each other by remaining silent or to “defect”

(D), i.e., confess to the crime. None of them knows what the

other does. Both the rational players try to maximize their ex-

pected utility with mixed strategies. We introduce four payoffs,

RESONANCE | June 2021 803

Page 14: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

w, x, y and z, which follow the chain of inequalities,

z > w > x > y. (18)

Now, the payoff matrix of the game model is structured as:

Table 3. Payoff matrix for

prisoner’s dilemma.Alice/Bob C D

C (w,w) (y, z)

D (z, y) (x, x)

Assuming that the payoff matrix is symmetric, it is inferred that

the payoffs w, x, y, and z are the same for each player, and the

payoffs have ordinal significance too. Here, strategies, S Alice =

{C,D}, S Bob = {C,D} and the payoffs,∏

= {πAlice, πBob}. Now,

looking at the payoff matrix, we make some analyses.

1. First, consider the case of Alice cooperating. If now, Bob too

cooperates, he gets a w and if he defects, he gets a z. As z > w,

Bob has an advantage by defecting rather than cooperating with

Alice.

2. For Alice defecting, if Bob cooperates, he gets a y, and if he

cooperates, he gets a x. As x > y, Bob again has an advantage if

he defects.

So, the dominant strategy for Bob is the move sBob, such that the

payoff πBob to Bob has the property,

πBob(siAlice, sBob) ≥ πBob(si

Alice, sj

Bob) (19)

∀siAlice∈ S Alice and ∀s

j

Bob∈ S Bob. So, the dominant strategy for

Bob is to defect, i.e., sBob = D. For Alice too, if the same anal-

yses are done, it can be seen that the dominant strategy for Alice

is to defect, i.e., sAlice = D. Thus both the rational players defect

to receive a payoff of x each, whereas two irrational players can

cooperate and receive a greater payoff of w each. The game will

be in equilibrium with {sAlice, sBob} = {D, D}. This paradoxical

outcome is the core problem of the prisoner’s dilemma because

804 RESONANCE | June 2021

Page 15: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

both Alice and Bob would have a more desirable position, if both

of them had cooperated, yielding πAlice = πBob = w, as w > x.

For a player having a strictly dominant strategy, it is irrational

for that player to choose any other strategy guaranteeing him/her

a lower payoff. In the prisoner’s dilemma, individual rationality

leads to the dilemma even though both the players would be better

off cooperating. On application of the IDSDS algorithm (section

2.4) on the payoff matrix of the game, we end up with {D, D}

as the only strategy profile that can be played, on availability of

common knowledge of rationality (Table 8). For our simulation

experiments, we consider w = 3, x = 1, y = 0 and z = 5 as con-

sidered in most of the literature. A python file IDSDS_PD.py is

written that simulates the IDSDS algorithm on the payoff matrix

with the assigned values and generates the desired result.

Table 4. Iterated strictly

dominant-strategy equi-

librium for the prisoner’s

dilemma game.

Alice/Bob D

D (x, x)

Also, it is noted that the only strong Nash equilibrium of the game

is {D, D} because neither Alice nor Bob can increase his/her pay-

off by one-sidedly departing from the given equilibrium point.

Also, in the payoff matrix, the point {w,w} is Pareto optimal. In

the next section, the quantum version of the game is discussed,

and it is shown how the addition of quantum moves changes the

result of the game and ultimately lets us break out of the dilemma.

1.2.2 Quantum version

The quantum version of prisoner’s dilemma has been studied in

details by Eisert, Wilkens, and Lewenstein [7]. Du et al. [8] re-

alised the game experimentally on a nuclear magnetic resonance

quantum computer. The quantum version of the game makes use

of entanglement between the shared states of the two agents be-

sides the concept of quantum superposition.

The quantum game, GQ = GQ(H,G0Q, {si} j, {πi} j) is a list of 4

elements, where H is a Hilbert space, G0Q

is the initial prepared

RESONANCE | June 2021 805

Page 16: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

state of the game, {si} j is the set of strategy moves of player j,

while {πi} j is the set of payoffs to player j. The two goals of

the quantum version are—maximizing the payoffs to player j and

finding a way to escape the dilemma. Alice and Bob both possess

a qubit each and are allowed to manipulate their qubits. Each of

their qubits lie in H2 consisting of the basis vectors {|0〉 , |1〉}. The

game, thus, lies in H2 ⊗ H

2, with basis vectors |00〉, |01〉, |10〉

and |11〉. As the convention is followed, the left qubit belongs to

Alice and the right to Bob.

The initial state of the game is set as,

G0Q = U |00〉 . (20)

U is a unitary operator known to both Alice and Bob. U oper-

ates on both of their qubits. U serves the purpose of maximally

entangling Alice’s and Bob’s qubits. This operator brings the dif-

ference of the quantum version of the game from the classical

version. Without U, the payoffs to both remain the same as that

of the classical version. Now, let UAlice and UBob are the unitary

operators that can be applied on the respective players’ qubits.

UAlice,UBob ∈ S where S is the strategy set available to both the

players. After the moves played by both of them, the state of the

game is represented as:

G1Q = |ψs〉 = (UAlice ⊗ UBob)G0

Q = (UAlice ⊗ UBob)U |00〉 . (21)

Next, to get the final state,

Gf

Q= |ψ f 〉 = U†G1

Q = U†(UAlice ⊗ UBob)U |00〉 . (22)

Here, U† = (U∗)T . As, U is unitary, so, U† = U−1. On the

measurement of the final state of the system, we get the expected

payoff to Alice as,

πAlice = w| 〈ψ f |00〉 |2 + y| 〈ψ f |01〉 |2 + z| 〈ψ f |10〉 |2 + x| 〈ψ f |11〉 |2.

(23)

806 RESONANCE | June 2021

Page 17: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

and the expected payoff to Bob is,

πBob = w| 〈ψ f |00〉 |2 + z| 〈ψ f |01〉 |2 + y| 〈ψ f |10〉 |2 + x| 〈ψ f |11〉 |2.

(24)

Considering,

U =I ⊗ I + iσx ⊗ σx

√2

. (25)

The inverse thus calculated is,

U−1 =I ⊗ I − iσx ⊗ σx

√2

. (26)

The initial state has the superposed form:

G0Q = U |00〉 =

|00〉 + i |11〉√

2. (27)

The classical move “cooperating” is mapped to the operator I,

and the move “defecting” is mapped to the operator σx. A Python

file named QPD.py is written which consists of a function qpd()

that takes in 6 parameters: the operators UAlice and UBob, and the

payoffs w, x, y and z. This function plots the probability densities

of the basis eigenstates along with the expected payoff values of

Alice and Bob as a tuple. Considering for example, a simple

case, where Alice defects and Bob cooperates, i.e., UAlice = σx

and UBob = I,

|ψs〉 = (σx ⊗ I)G0Q =|10〉 + i |01〉√

2, (28)

and

|ψ f 〉 = U† |ψs〉 = |10〉 . (29)

We get |10〉 with probability 1 and πAlice = 5 and πBob = 0. Few

lines of codes can simulate these as follows,

>>> sigma_x=P aul iX ( I2 )

>>> qpd ( sigma_x , I2 , 3 , 1 , 0 , 5 )

(4 .99999999999 99 9 8 , 0 . 0 )

RESONANCE | June 2021 807

Page 18: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 8. Probability den-

sity showing |10〉 appearing

with probability 1.

The plot generated is given in Figure 8

Now, two less traditional quantum moves represented by the Hadamard

matrix, H and σz are introduced. So, both UAlice,UBob ∈ {I, σx,H, σz}.

We consider few case studies here,

Alice plays σx and Bob plays H: UAlice = σx and UBob = H. So,

|ψs〉 = (σx ⊗ H)G0Q =|10〉 + |11〉 + i |00〉 − i |01〉

√2

, (30)

and

|ψ f 〉 = U† |ψs〉 =|11〉 − i |01〉√

2. (31)

A measurement of the final state yields an equal probability for

a payoff of y = 0 or a payoff of x = 1 to Alice and an equal

probability for a payoff of z = 5 or a payoff of x = 1 to Bob. We

obtain, πAlice = 0.5 and πBob = 3. Codes to simulate this situation,

>>> sigma_x=P aul iX ( I2 )

>>> H=Hadamard ( I2 )

>>> qpd ( sigma_x , H, 3 , 1 , 0 , 5 )

(0 .49999999999999 98 , 2 .999999999999999)

The plot generated is given in Figure 9.

808 RESONANCE | June 2021

Page 19: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 9. Probability den-

sity showing |01〉 and |11〉

appearing with equal proba-

bility of 0.5.

Next both Alice and Bob plays H: UAlice = H and UBob = H. So,

|ψs〉 = (H ⊗ H)G0Q

=|00〉 + |01〉 + |10〉 + |11〉 + i |00〉 − i |01〉 − i |10〉 + i |11〉

2√

2,

(32)

and

|ψ f 〉 = U† |ψs〉 =|00〉 + |11〉 − i |01〉 − i |10〉

2. (33)

Final state measurement yields an equal probability of 0.25 for

a payoff of w = 3 or a payoff of y = 0 or a payoff of z = 5 or

a payoff of x = 1 to Alice and an equal probability of 0.25 for

a payoff of w = 3 or a payoff of y = 0 or a payoff of z = 5 or

a payoff of x = 1 to Bob. Here πAlice = 2.25 and πBob = 2.25.

Codes to simulate this situation:

>>> qpd (H, H, 3 , 1 , 0 , 5 )

(2 .24999999999999 87 , 2 .2499999999999987)

The plot generated is given in Figure 10.

Finally, the case, Alice plays σz and Bob plays H: UAlice = σz

RESONANCE | June 2021 809

Page 20: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 10. Probability

density showing |00〉, |01〉,

|10〉 and |11〉 appearing with

equal probability of 0.25.

and UBob = H, so,

|ψs〉 = (σz ⊗ H)G0Q =|00〉 + |01〉 − i |10〉 + i |11〉

√2

, (34)

and the final state,

|ψ f 〉 = U† |ψs〉 =|00〉 − i |10〉

2. (35)

A measurement of the final state yields an equal probability of 0.5

for a payoff of x = 3 or a payoff of z = 5 to Alice and an equal

probability of 0.5 for a payoff of x = 3 or a payoff of y = 0 to

Bob. Here, πAlice = 4 and πBob = 1.5. Simple codes to simulate

the situation:

>>> s igma_z=P a u l i Z ( I2 )

>>> H=Hadamard ( I2 )

>>> qpd ( sigma_z , H, 3 , 1 , 0 , 5 )

(3 .99999999999999 82 , 1 .4999999999999993)

The plot generated is given in Figure 11.

This way all the 24 = 16 combinations can be worked out to gen-

erate the payoffmatrix. A Python file named Payoff_matrix_QPD.py

is written to serve this purpose.

810 RESONANCE | June 2021

Page 21: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

Figure 11. Probability

density showing |00〉 and

|10〉 appearing with equal

probability of 0.5.

Table 5. Payoff ma-

trix for quantum prisoner’s

dilemma.Alice/Bob I σx H σz

I (3, 3) (0, 5) (0.5, 3) (1, 1)

σx (5, 0) (1, 1) (0.5, 3) (0, 5)

H (3, 0.5) (3, 0.5) (2.25, 2.25) (1.5, 4)

σz (1, 1) (5, 0) (4, 1.5) (3, 3)

Applying the IDSDS algorithm on the payoff matrix given by

Table 9, the iterated strictly dominant-strategy equilibrium has

shifted from {σx, σx} in the classical version to {σz, σz} in the

quantum case.

Table 6. Iterated strictly

dominant-strategy equilib-

rium for quantum prisoner’s

dilemma.

Alice/Bob σz

σz (3, 3)

{σz, σz} is the Nash equilibrium of the game and is also Pareto op-

timal. We now notice that individual rationality leads both Alice

and Bob to choose σz as the ideal move, yielding the payoff tuple

(3, 3) ≡ (w,w), which was not the case in the classical version.

So, we see that in the quantum version rational moves by players,

in fact, help us get out of the dilemma that arises in the classi-

RESONANCE | June 2021 811

Page 22: GENERAL ARTICLE Quantum Game Theory – II

GENERAL ARTICLE

cal version. In the final section, we will delve into the quantum

version of the two person duel game and make a comprehensive

study before concluding our three-part article.

A Software Dependencies

As mentioned before, Python version 3.6.8 have been used. To

use the softwares [4] for simulating the results for the games pre-

sented here, certain independent libraries to be used are: numpy,

pandas, random, itertools, pylab, math, matplotlib, tkinter

and mpl_toolkits. If any library is missing, it can be down-

loaded by writing the following command on the terminal win-

dow:

$ p ip3 i n s t a l l numpy

The above command downloads the numpy library. If the user

wants to run the quantum duel GUI, use the following command

by opening the terminal window at the location where QDuel.py

is located:

$ python3 QDuel . py

Suggested Reading

[1] Indranil Ghosh, Quantum Game Theory–I, Resonance, Vol.26, No.5, pp.671–

684, 2021.

[2] Adrian P Flitney and Derek Abbott, An introduction to quantum game theory,

Fluctuation and Noise Letters, 2(04):R175–R187, 2002.

Address for Correspondence

Indranil Ghosh

Sib Bari, Ward No.-18

Jalpaiguri

West Bengal 735 101, India.

Email:

[email protected]

[3] J Orlin Grabbe, An introduction to quantum game theory, arXiv preprint

quant-ph/0506219, 2005.

[4] Indranil Ghosh, indrag49/quantum-game-theory: Python pro-

gram written to run simulations on quantum game theory models.

https://github.com/indrag49/Quantum-Game-Theory, 2020.

[5] Steven Kuhn, Prisoner’s Dilemma, 1997.

[6] Methamagical Themas and Douglas Hofstadter, The Prisoner’s Dilemma.

[7] Jens Eisert, Martin Wilkens, and Maciej Lewenstein, Quantum games and

quantum strategies, Physical Review Letters, 83(15):3077, 1999.

[8] Jiangfeng Du, Hui Li, Xiaodong Xu, Mingjun Shi, Jihui Wu, Xianyi Zhou,

and Rongdian Han, Experimental realization of quantum games on a quantum

computer, Physical Review Letters, 88(13):137902, 2002.

812 RESONANCE | June 2021