Quantization of Blackjack: Quantum Basic Strategy and Advantage

Quantum computers that process information by harnessing the remarkable power of quantum mechanics are increasingly being put to practical use. In the future, their impact will be felt in numerous fields, including in online casino games. This is one of the reasons why quantum gambling theory has garnered considerable attention. Studies have shown that the quantum gambling theory often yields nontrivial consequences that classical theory cannot interpret. We devised a quantum circuit reproducing classical blackjack and found possible quantum entanglement between strategies. This circuit can be realized in the near future when quantum computers are commonplace. Furthermore, we showed that the player's expectation increases compared to the classical game using quantum basic strategy, which is a quantum version of the popular basic strategy of blackjack.


I. INTRODUCTION
Quantum information science is growing rapidly not only in theory but also at the hardware level; this leads us to believe that quantum computers will soon be practically applied on a large scale. Once quantum computers are realized on a commercial scale, quantum technology (such as devices or communications) will be widespread. In such a future, an interesting question that arises is how quantum computers can change the world. For example, in quantum game theory, Meyer [1] showed that for a two-player zero-sum strategic game, a player's expectation can increase when using quantum strategies. After Meyer's work, Eisert, Wilkens, and Lewenstein (EWL) [2] showed that quantum entanglement changes the Nash equilibrium [3] between the strategies of two persons in Prisoners' Dilemma (PD). The strategy of whether to cooperate or defect adopted by one person affects another person's strategy through quantum entanglement between the two individual strategies. Prisoners can choose quantum strategies, which are described by unitary operators; therefore, they have more strategies at hand compared to the classical game and can use them to increase their profit. There are many studies inspired by their quantization scheme (e.g. summarized in [4][5][6]), and not a few quantum games induce nontrivial results that are not expected classically.
These ideas of quantizing the strategies can also be applied to gambling theory. A fair quantum gambling game played by two players far from each other was proposed by [7]. In the classical case, it is difficult to ensure fair play without introducing a third party to oversee the game. However, by providing a quantum superposition state and then observing it, it is possible to achieve fair gambling. In addition, procedures were devised to protect the security of such remote gambling from entanglement attacks [8,9]. Zhang et al. devised and realized an optical quantum circuit that helps achieve fair gambling and experimentally showed that the error is practically under control [10]. In the sense of quantizing a game, some quantized games have been proposed [11][12][13][14][15][16]. Quantum duel was proposed [11], and a Russian roulette game using a quantum gun was proposed and studied [12,13]. Quantum chess was devised as a more casual game [14]. Quantized strategies in poker, one of the most popular card games, were also considered in [16] using Meyer's quantized procedure [1]. Recently, a game similar to poker was presented on a quantum computer by [15]. In their experiment, the researchers investigated the expected value under quantum noise on a practical quantum computer. They also showed that the expected value can be improved using quantum error-mitigation techniques. These studies suggest that quite a few games based on quantum mechanics have been examined.
Recent studies have shown that quantum bits yield advantages to blackjack, which is one of the most popular casino games [17]; the researchers showed that the expectation values of two cooperating persons can increase by imparting information of each individual's card with entangled qubits. In the present paper, strategies and cards are represented as qubits and we devised a quantum circuit for reproducing classical blackjack. Classical blackjack has been studied statistically for more than half a century [18][19][20], and it is decided whether the player should do hit or stand. This is called Basic Strategy. Moreover, it is widely known in various rules, such as number of decks, options, and refunds when the player has blackjack [20,21]. In blackjack, as the player can choose strategies (e.g., hit or stand), we can quantize not only the game itself but also the strategies involved using a method similar to [1,2]. This quantum circuit reproducing blackjack can be easily realized in the near future when quantum computers are commonplace. Furthermore, we showed that the player's expectation value increases substantially when quantum strategies are employed in the presence of entanglement.
In the next section II, we explain the blackjack rule that we adopted (simplified for ease of calculation). In section III, we reformulate the blackjack in order to regard it as a object of the quantum game theory. In section IV, we propose a quantum circuit that reproduces blackjack, (especially a toy model,) and express the possibility of entanglement. In section V, we show classical expectation value and basic strategy; we also show that using quantum strategies in the presence of entanglement, the player's expectation value increases compared to the classical game. Some conclusions are shown in section VI.

II. BLACKJACK RULES AND TOY MODEL
Blackjack is a one-on-one card game between a dealer (Alice) and a player (Bob). One deck comprises 52 cards excluding jokers. Aces are worth 1 (hard) or 11 (soft), face cards (JQK) are worth 10, and every other card has its number value. After the player has placed his bet, the dealer distributes two cards to the player. Similarly, she distributes two cards to herself. At this time the dealer has one card face-up and the other face-down. The objective is to get a hand with a total closer to 21. It is worth noting however, that the 21 hand which is made of one ace and one face card or 10 is the strongest (called natural).
First, the player must choose to hit or stand. If he chooses to hit, he draws a card. If he exceeds 21 (bust), he loses his bet regardless of the dealer's hand. Next, the dealer opens the face-down card, and if her total is soft 16 or less, she must hit. She repeats this procedure until her total reaches soft 17 or more. If the dealer busts and the player does not, or if the player's hand is closer to 21 than the dealer's, the player wins the bet. If the player's total equals the dealer's total, the bet will be returned (push). In blackjack, the player can do his best by calculating the expected value of the profit that he will obtain in each initial state. This is widely known as a basic strategy and has been calculated in various rules [20,21]. Note that only the player can choose whether to hit or stand. Conversely, the dealer has no choice of a strategy since she just draws the card mechanically until her total reaches soft 17 or more. At first glance, the player who has many choices seems to have a competitive edge. However, the dealer has the advantage because the player loses if both hands exceed 21. The reason many casinos adopt option rules, such as double down, split, and surrender is to increase the player's expectation.
For simplicity, we quantized a toy model of blackjack proposed by Ethier [22] and called snackjack by Epstein [23]. As snackjack is highly simplified compared to blackjack which uses 52 cards, it is easy to calculate the basic strategy by hand. Recently, Ethier calculated the expectation and basic strategy under various options, with card counting, and with bet variation in this classical snackjack [24]. Snackjack uses eight cards AA223333, aiming toward a maximum value of 7, with an ace having a value of either 1 or 4, and 2 and 3 having their own values. In this paper, we ignored various options and simplified them for calculation. Tab. I shows the rules we followed.

III. CLASSICAL SNACKJACK AS A QUANTUM GAME
Referring to [25,26], we formulate the blackjack played by a player and a dealer as a 2 player quantum game. Blackjack is regarded as the game in which the pay-off is determined by the initial hand cards of the player and the dealer. More precisely, blackjack is a mapping that assigns a 2 player quantum game Γ p,d to an element (p, d) of T 1 × T 2 where T 1 is a set of a pair of initial hand cards of the player, T 2 is a set of an up card of the dealer. The quantum games Γ p,d = (H, ρ, Σ 1 , Σ 2 , P 1 , P 2 ) are specified by Hilbert space H for the states, the initial state ρ ∈ H, the sets Σ 1 and Σ 2 of the strategies of the player and the dealer, and the player's utility P 1 and the dealer's utility P 2 . Each player has a qubit and the state of the system is represented as the tensor product of their qubit. The strategieŝ S 1 (∈ Σ 1 ) andŜ 2 (∈ Σ 2 ) selected by players are regarded as 2 × 2 unitary operators acting on their own qubit. In this FIG. 1. EWL quantization scheme The gate J entangles the two qubits and J † disentangles those. The players choose an unitary operator U as a quantum strategy.
formalism, classical blackjack is the quantum game specified by where |0 (|1 ) denotes stand (hit) andX is the first Pauli matrix. The player has the first qubit and the dealer has the second. We will call each of them strategy bit. Note that the hit |1 for the dealer means that he draws a card if the score of his hand is less than 6. Since the utilities are determined by (p, d) ∈ T 1 × T 2 and player's strategŷ S 1 ∈ Σ 1 , we can write them as P 1 (p, d,Ŝ 1 ) and P 2 (p, d,Ŝ 1 ). Concretely, where E std and E hit are pay-offs corresponding to stand and hit. It is a point to notice that E std and E hit depend on the initial hand cards (p, d). The utilities do not haveŜ 2 dependence since Σ 2 = {Î} in the classical blackjack. Especially in our snackjack (Tab. I), P 2 (p, d,Ŝ 1 ) = −P 1 (p, d,Ŝ 1 ), thus it is a zero-sum game.

IV. ENTANGLEMENT AND QUANTUM CIRCUITS
A. The case of the presence of entangle In this section, using EWL quantization protocol [2], we investigate the quantum blackjack including an entanglement between the player and the dealer. Eisert et al. prepared the entangled player's strategies in 2 players symmetric game, especially in PD game ( Fig. 1). They showed that the dilemma disappears by using restricted quantum strategies and an entanglement. After their work, in PD game, some studies about generalized strategy spaces [27][28][29][30][31] or repeated games [32][33][34] have been worked. In generalized strategy spaces, the players are not able to escape from the dilemma [27,31], and van Enk et al. [35] pointed out that EWL protocol does not preserve the non-cooperative aspects of PD. Our blackjack game, however, does not have any dilemmas due to the asymmetry of only the player seeking a win and trying to beat the dealer who has limited strategy space Σ 2 = {Î}. Thus we straightforwardly adopt EWL protocol. In section VI, we will comment on the degree of freedom of the dealer's strategy in this quantized blackjack game.
We consider entanglement between the player's and dealer's strategies. When the player selects the strategyŜ p , the state of the system just before the observation is where J is 4 × 4 complex matrix acting on both qubits. Classically, all strategies the player can choose areX orÎ. We assume so that the game reproduces the classical game if the player selects the classical strategies. The first part is the player's strategy sector and the second is the dealer's, and operatorÛ is unitary and hermitian. γ is the measure for the game's entanglement [2] and we will call γ entangle intensity below. WhenŜ 1 =X orÎ, it follows In this way, without breaking the classical game, we can insert the operator making entangle strategies. A unitary and hermitian operator is written bŷ In this Σ 2 = {Î} game, except for relative phases,Î,Ẑ andX,Ŷ have the same effect on a strategy bit respectively, hence we can set s 0 = s 2 = 0, s 1 = sin θ, s 3 = cos θ without losing generality. Here θ is game parameter.
In the case of general player's strategyŜ 1 , it follows From here, we limit Σ 1 to {Î,X,Ŷ ,Ẑ}. Both strategies bits after through J † arê The state of 01 means stand, and 11 means hit. As it is clear from (11), when the player choosesŶ orẐ, he can do operations 00 and 10 that do not exist in the classical game. We summarize the quantized blackjack, employing the formalism of the 2 player quantum game Γ p,d = (H, ρ, Σ 1 , Σ 2 , P 1 , P 2 ) introduced in the previous subsection. In order to get the quantized blackjack, we modify two settings of the classical blackjack. The modifications are expanding the set of player's strategy to Σ 1 = {Î,X,Ŷ ,Ẑ} and changing the utilities to where E 00 and E 10 are the expectation values corresponding to operations 00 and 10 respectively. From (10)-(12), P 1 corresponding to each strategy {Î,X,Ŷ ,Ẑ} is {E std , E hit , sin 2 γ(cos 2 θE std + sin 2 θE 00 ) + cos 2 γE hit , cos 2 γE std + sin 2 γ(cos 2 θE hit + sin 2 θE 10 )}.

B. Quantum circuit reproducing blackjack
In this section, we show the circuit which reproduces the games discussed above. First of all, we introduce the circuit which reproduces the classical blackjack defined in section III. Fig. 2 and Fig. 3 show the quantum circuit. Let H whole be Hilbert space, on which the circuit in Fig. 2 works and consists of some spaces as follows: We in turn explain the component spaces of H whole appearing in eq. (14). We first define a deck state |D ∈ H deck , a copied deck state |D copy ∈ H deck copy , an initial player's hand |p ∈ H p-hand , and dealer's hand |d ∈ H d-hand to regard p ∈ T 1 and d ∈ T 2 as qubits. These take this form

FIG. 3. Detail of Hit operator
where, and then |1 means an existing card corresponding to each card sector and |0 means not. H deck , H deck copy , H p-hand and H d-hand are spanned by these 2 8 bases. Secondly, H p-strategy ⊗ H d-strategy is the same as the space H in section III and section IV A. Finally, |Ψ consists of three q-bits and lies on H control , which is a vector space of dimension 2 3 . Note that in the actual blackjack there is no object to which the element of H deck copy or H control corresponds. We, however, need to incorporate these two spaces into our circuit due to some technical reasons. We refer to this in detail below. We explain the outline of Fig. 2 and Fig. 3 as follows. The player's strategy is expressed by a unitary operator S 1 acting on its strategy bit. In Fig. 2, first the dealer and player get the cards classically, then the player chooses the strategyŜ 1 =X orÎ which means hit or stand respectively. If the player chooses hit, he hasX operate to his strategy bit. In that case Hit operatorĤ acts on the deck bit and his hand bit (in Fig. 3). This operation signifies drawing a card from the deck. Now, we can expands the player's strategy space Σ 1 to the set of 2 × 2 unitary matrices thus he can overlap his strategy bit. For example, when he chooses the Hadamard gate, the cases of hit and stand overlap with a 1/2 probability. As is clear from (2), this does not affect the maximum value expected by the player. After the player's operation, the dealer turns over her face-down card byĤ operating, and if the total of her hand (≡ |d|) is 5 or less, she must draw a card one more time. This operation is repeated until |d| ≥ 6.
We next explain the detail of Hit operator, surrounded by the dotted line in Fig. 2. Control bit |Ψ (∈ H control ) is responsible for the probability of appearance of cards and it is comprised of three qubits and takes the following form Each state corresponds to a sector of the card, e.g., 000 to the first ace, 001 to the second ace, 010 to the first deuce , and so on. Therefore, the probability that every particular card is drawn is equal when the unitary Hit operator acts on the deck and hand bit. In Fig. 3, |· i (i = 1, 2, · · · , 8) means the sector of the card in (15), e.g., |· 1 corresponds to the sector of the first ace |A (1) . When |D 1 = |D 1 copy = |1 , (which indicates the existence of the first ace,) |D 1 and |p 1 , corresponding to |000 which is a component of |Ψ , are swapped. Note that, the deck states can be copied without violating the no-cloning theorem [36,37] because the deck state comprises only |0 and |1 , which are orthogonal. After measuring the control bit, it is determined which card has been drawn. Note that, |Ψ converges on a state that corresponds to the sector of the card that has already been drawn with a 3/8 probability at the time of first hit even thoughĤ operates. For example, when a control bit converges on |000 despite |D 1 = |D 1 copy = |0 , there is no exchange. To avoid this problem, we ensure that this procedure is repeated until |p = |p . Even if a strategy bit has |0 component, we can employ this procedure as we know which sector of the card bit was exchanged, by measuring not the hand bit, but the control bit. This is explained below. For example, in the case of the initial cards states and the overlapped player's strategy bit with Hadamard operatorĤ acting on, the first state is where the last state is the player's strategy bit. Here, we omitted the dealer's strategy bit, and the copy bits. After thoroughĤ, the state is and after measuring the control bit, it will be The overall constant has been dropped. When the control bit converges |000 , |010 or |110 in the first line, we repeat this one more time. In this way, we can judge whether we must repeat this procedure without measuring the strategy bit or hand bit. In the following discussions, though we omit specifying this, we always perform this procedure.
Dealer's operation Hit is the same. First, the dealer hits regardless of her strategy bit (corresponding to turn over her face-down card), and if her total |d| is 5 or less and her strategy bit is |1 , she repeats the hit operation. Again, we can determine her hand total only by measuring the control bit; therefore, we can build the algorithm where she must hit until her total |d| reaches 6 without measuring her hand bit. Note that when the strategy bit has |0 component, the same algorithm is used. The summary of the algorithm is shown by Fig. 4.
Finally, after measuring both strategy bits, all states converge. As explained in section II, the player wins when his hand does not exceed 7 and is closer to 7 than the dealer's hand. This quantum circuit reproduces classical snackjack, and therefore the player's expectation and basic strategy must be the same as the classical ones. Such a circuit can be applied to blackjack in a same way by increasing qubits, although it is not considered after this.
We can also design the quantum circuit which reproduces the quantized blackjack formulated in section IV A, inserting EWL protocol in our circuit. The modified quantum circuit is shown in Fig. 5. There is no difference between the circuit in Fig. 5 and Fig. 2   Classically, Tab. II shows E std , E hit in all initial states and basic strategy. Here, we assume that the player bets unit per one game. Some calculations of E std and E hit in the case of No. 14 game are shown in Fig. 6   In the classical game, when the player chooses the basic strategy, the expectation value of this game is -1.7%; thus, the dealer has the advantage in this game. Although the player can also chooseŶ orẐ in the absence of entanglement, these effects on the strategy bit are the same asX andÎ, respectively. Therefore, it does not affect the overall expectation value and basic strategy. Note here, that our classical results are different from [24], because of differences in the rulesets (Tab. I) of snackjack.
In the presence of entanglement, the player has a meaningful quantum strategy,Ŷ orẐ. By the previous section (11)-(13), when parameter γ = θ = π 2 , expectation value E Y which player chooses strategyŶ , equal to E 00 . And also E Z = E 10 . Tab. III shows quantum basic strategy (QBS) which the player can choose in entangled strategy. Fig. 7 shows the calculations of E 00 and E 10 in No. 6 game.
No initial state (As,2s,3s) dealer up Estd Ehit EY = E00 EZ = E10 number of cases QBS 1 (2,0,0) 2 1/5   When the player chooses QBS in Tab. III, the overall expected value is +10.2%; therefore, the player has the advantage in this quantum game. In the γ = θ = π 2 game, the player has other choices that let the dealer definitely stand (prohibiting the second draw) therefore expectation value increases compared to the classical game. We can set various values in not only entangle intensity γ but also game parameter θ. For example in γ = π 4 , θ = π 2 , the player's utilities are {E std , E hit , 1 2 (E hit + E 00 ), 1 2 (E std + E 10 )} by (13), and the best choice for the player becomes QBS in each initial hands. The whole expectation for the player in the game is the sum of the largest utility times the appearance ratio of the initial state from No. 1 to No. 16. Fig. 8 shows numerical results regarding the player's expectation in various parameters. As is clear from (10)- (13), in θ = 0 game, one can see any γ do not change the expectation value from the classical one. Otherwise, when γ = π 4 , θ = π 2 , half entangled game, the expectation is +1.8%. From these results, we conclude that the player has the advantage in the appropriate parameter game.

VI. CONCLUSION AND DISCUSSION
In section I, we introduced quantum effects in game theory [1,2,[4][5][6] and the application to gambling [7][8][9][10][11][12][13][14][15][16][17]. We then proposed a toy model of blackjack, called snackjack [22][23][24] as a quantum game in section II, III. In section IV, we found that we can possibly entangle strategies without breaking the classical game and proposed a quantum circuit which reproduced classical blackjack. In section V, we showed that the player's expectation increases and the player has an advantage compared to the classical blackjack with QBS.
There remain some interesting questions: (1) The dealer's strategy space Σ 2 = {Î} can be expanded into more general strategy space, e.g. Σ 2 = {Î,Ẑ}. In other words, the dealer inherently has infinite options changing the phase of the initial state |1 . This phase affects the player's strategy bit and perhaps cause a dilemma between them depending on the first hand state. In this case, QBS may not be the best choice for the player. (2) It is a nontrivial question that how this quantized blackjack on noisy intermediate scale quantum computers affects the player's expectation, as in their work [15]. (3) The operation of drawing cards in the circuit we proposed can be applied to other card games. It is also an open question of what kind of quantized casino game will make a difference from the classical one. In the proposed quantum blackjack, we have demonstrated that entanglement between strategies could be used to bankrupt a casino. In the forthcoming quantum era, casinos will have to set house rules that did not exist in the era of classical physics to avoid bankruptcy.