# Emotion Generation and Transition of Companion Robots Based on Plutchik’s Model and Quantum Circuit Schemes

Authors: Fei Yan; Xue Yang; Nianqiao Li; Xu Yu; Hongyu Zhai
Journal: Security and Communication Networks
 (2021)

---

## Abstract

Loneliness and isolation are on the rise worldwide, threatening human well-being and the wellness of different age groups and backgrounds. Notably, global social distancing measures during the COVID-19 crisis have exacerbated this problem, resulting in various psychological and physiological ailments. Within both the categories of social and medical robots, companion robots are capable of engaging emotionally with users and providing continuous monitoring and assessment of their health. In this study, we propose a framework for modeling the emotion space of companion robots to facilitate their emotion generation and transition based on Plutchik’s wheel of emotions and reversible quantum circuit schemes. Superposition encodings allow fewer computing resources for the generation and storage of emotional states, and by using unitary operations, they facilitate easier emotion transition and recovery over different intervals. Further, an encryption strategy is designed based on the emotion communication architecture to secure the emotion-related data in human-robot interaction. It is hoped that such an integrative framework and research agenda exploring the role of companion robots will be useful to care for users’ social health by mitigating their negative emotions, especially during difficult times.


---

## Body

## 1. Introduction

Artificial intelligence (AI) refers to the simulation of human intelligence in machines (e.g., robots) that are programmed to think like humans and mimic their actions. In recent years, advances in AI and robotics have aroused great expectations for so-called companion robots [1], i.e., robots that are specifically designed to engage in physical and linguistic, as well as emotional interactions with humans. One of the main goals of these robots is often the emotional care of children, the elderly, and people with disabilities. From this point of view, these robots should be capable of recognizing, understanding, and expressing various emotional characteristics that will facilitate their interactions with humans naturally and harmoniously [2]. However, a robot’s emotion, like a human’s emotion, is a complex variable that varies with time and is affected by many factors that are collectively referred to as the development of scenarios, i.e., external environment (background music and communication atmosphere) and a human’s emotional changes (e.g., facial expressions, speech, and other physiological signals). These features make robot’s emotions difficult to record, track, and recover. As such, the concept of emotion space is introduced in [3] to describe emotion and its complex changes more intuitively by establishing a mathematical model of emotional states.In accordance with the dimensionality theory of emotion space, all human emotions are distributed in a certain dimensional space and various emotions are distributed in different positions [4]. Therefore, the similarity and differences between different emotional states can be displayed based on their distance in the space. Among others, the following emotion models are widely cited. The valance-arousal (VA) model [5] includes valence and arousal dimensions that represent the degree of pleasant-unpleasant and excited-calm emotions, respectively. As an extension of the VA model, the pleasure-arousal-dominance (PAD) model [6] uses an additional “D” dimension to indicate dominance-submissiveness, i.e., the control state of the individual emotion relative to given situations and influences from others. Finally, Plutchik’s wheel of emotions (PWE) model [7] makes use of color psychology and highlights the relationship between emotions and colors when different emotion types and intensities are described. It provides a simply logical way to make sense of feelings, thereby being widely used for emotion summary, emotion detection, and emotion analysis.Recently, quantum information science has been transiting from limited demonstrations in the laboratory to mature fields of scientific and engineering areas, such as artificial intelligence [8] and machine learning [9]. Meanwhile, discussions of the relationship between quantum mechanics and affective computing have been ongoing for a long time [4]. In 2007, Lukac and Perkowski proposed a quantum-mechanical model to express specific emotions of robots based on quantum cellular automata [10]. Later, by using quantum circuits (QCs) to model fuzzy sets, Raghuvanshi et al. advanced an approach to process emotional behaviors of humanoid robots [11]. Although these contributions aimed to better understand and model emotions from the perspective of quantum computing, they failed to provide specific mathematical formulations for easy computing and operations in emotions. To improve on these efforts, in 2015, Yan et al. proposed an emotion space based on a Bloch sphere, where φ∈0,2π is used to represent different emotions, the intensity θ∈0,π of which varies from lowest to highest [12]. Based on this, in 2020, Hoorn et al. modeled a pure psychological state within the amygdala through a vector composed of affective and reflective elements [13]. However, these studies are unable to make the most of the dimensional emotion model, resulting in the limitations of emotion expression and inefficiency in complicated emotional human-robot interaction (HRI).To compensate for these shortcomings, in this study, we propose a framework for modeling the emotion space of companion robots to facilitate their emotion generation and transition based on PWE and reversible QC schemes. Such a framework consists of two emotion-related components (type and intensity) and its active cycle (i.e., time period), in which emotion type is encoded by an angle vector within a superposition state, while emotion intensity and time period are both encoded by quantum sequences. Superposition encodings allow fewer computing resources for the generation of emotional states and the unitary operations facilitate easier tracking of emotion transitions over different intervals in the emotion space. Since companion robots always focus on social and medical uses, in order to fully protect user’s privacy, we finally designed a reliable security strategy of emotional data in the emotional HRI environment. To achieve the abovementioned goals, several quantum models and operation modules are presented in each corresponding section.The rest of this paper is organized as follows. In Section2, the framework to model the emotion space of companion robots is proposed and emotion generation within the emotion space is discussed. In Section 3, a series of emotion transition and recovery operations based on emotion types and intensities are discussed. In Section 4, an emotion encryption strategy is designed for the secure communication in emotional HRI. Conclusions and future works are summarized in Section 5.


## 2. Emotion Representation of Companion Robots

On the basis of the PWE model and QC schemes, in this section, we present a quantum structure of PWE, i.e., QWE, in which the emotion types of robots are encoded into the phase parameter of a superposition qubit, and the corresponding emotion intensities are encoded into a sequence of qubits. Based on the QWE, its initialization and measurement are discussed.


### 2.1. Quantum Structure of PWE

Plutchik divided emotions into eight (pairwise opposite) primary types, i.e., “trust” versus “disgust,” “joy” versus “sadness,” “anticipation” versus “surprise,” and “fear” versus “anger,” as shown in Figure1. In addition, he established an important relationship between emotion and color on the wheel of emotions, i.e., the closer it is to the center of the wheel, the darker the color and the stronger the emotion. Therefore, the eight core emotion types could be extended into another 16 emotions by adding or reducing their intensities (i.e., making the current emotion stronger and weaker), as presented in the PWE model shown in Figure 2(a). Further, there are eight kinds of intermediate emotions that can achieve a smooth transition between two adjacent emotion types, such as “love” being the intermediate emotion between “trust” and “joy,” and “submission” the intermediate emotion between “trust” and “fear.”Figure 1
Eight primary emotion types in PWE model.Figure 2
Diagram of (a) PWE and (b) QWE models.Although it is better for robots to master more emotional skills to communicate with humans, their emotions will never be as delicate and diverse as a human being’s. To formulate and transform the robot’s emotions, we slightly modified the original PWE model (i.e., removed the intermediate emotions and extended the eight core emotions into their lowest intensities, which we name corresponding marginal emotions), as shown in Figure2(b). As such, it is obvious that each emotion of the robots can be uniquely determined by the parameters of angle (from 0 to 2π) and radius in this disc.In quantum mechanics, given an orthogonal basis, any pure stateψ of a qubit can be written as a superposition of the basis vectors 0 and 1 [14]. Quantum mechanics also dictates that the total probability of any system must equal unity, i.e., ψ|ψ=1 or ψ2=1. Given this constraint, ψ can be always expressed using ψ=cosθ0+sinθ1, where θ∈0,π/2. Therefore, the emotion type can be encoded (using angle αET/4 for the convenience of emotion retrieval operation) in the probability amplitude of a superposition qubit, which is expressed as(1)ET=cosαET40+sinαET41,αET∈0,2π.A robot’s emotion will be determined by both its emotion types and its corresponding intensities. As shown in Figure 2(b), there are four levels of emotion intensities, which are represented by quantum sequences 00, 01, 10, and 11, respectively. To make the QWE scalable, the value of emotion intensity is set to be adjustable using m qubits (that can represent 2m intensity levels), which is generally defined as(2)EI=⊗i=0m−1Ii=|Im−1Im−2…I1I0,Ii∈0,1.Therefore, the integrative QWE model can be represented as(3)QWE=ET⊗EI,where ET and EI are defined in equations (1) and (2), respectively. As such, a specified emotion in the PWE model is uniquely represented by an angular interval and corresponding radius value, as shown in Table 1.Table 1
Relationship between emotion and its corresponding angle and radius.
TypeIntensity11100100α0ET∈0,π/4AdmirationTrustAcceptanceMarginal trustα1ET∈π/4,π/2EcstasyJoySerenityMarginal joyα2ET∈π/2,3π/4VigilanceAnticipationInterestMarginal anticipationα3ET∈3π/4,πRageAngerAnnoyanceMarginal angerα4ET∈π,5π/4LoathingDisgustBoredomMarginal disgustα5ET∈5π/4,3π/2GriefSadnessPensivenessMarginal sadnessα6ET∈3π/2,7π/4AmazementSurpriseDistractionMarginal surpriseα7ET∈7π/4,2πTerrorFearApprehensionMarginal fear


### 2.2. QWE Initialization and Measurement

Utilizing QCs to process the emotional information imposes the need to first store the emotions as quantum states. Emotion generation using QWE includes the initialization of its two components, i.e., emotion typeET and emotion intensity EI. First, m+1 qubits should be prepared to store robot’s initial emotional state in the form of Ψ0=0⊗m+1. Then, we consider the operation,(4)RεαET2=cosαET4−sinαET4sinαET4cosαET4,to transform a 0 state to an expected emotion type ET, i.e.,(5)RεαET20=cosαET40+sinαET41=ET.Following this, an operationΩ is applied on 0⊗m to obtain the corresponding emotion intensity EI, i.e.,(6)Ω0⊗m=⊗i=0m−1Ωi0=⊗i=0m−10⊕Ii=⊗i=0m−1Ii=EI.Thus far, an emotion state in the QWE disc is obtained from the initial statesΨ0.Measurement operation is the unique tool by which one recovers classical information from a quantum system [14]. To facilitate the information exchange between classical and quantum models in a hybrid system, emotion retrieval from the QWE model is an essential requirement. The procedure can be accomplished using the following steps.First, emotion types can be acquired by means of the probability measuring the state0, i.e., K=cos2αET/4. Then, the value of angle αET can be calculated by antitrigonometric functions αET=4arccosK, where αET∈0,2π. Additionally, emotion intensity can be recovered from a quantum sequence via projected measurements JM, i.e.,(7)EIJMEI=∑j=02m−1j⊗i=0m−1Ii||jj⊗i=0m−1Ii=Im−1Im−2…I1I0=EI.An emotion retrieval operation ensures that a robot’s emotion can be recovered at any time for communication with other classical models in a companion robot architecture.


## 2.1. Quantum Structure of PWE

Plutchik divided emotions into eight (pairwise opposite) primary types, i.e., “trust” versus “disgust,” “joy” versus “sadness,” “anticipation” versus “surprise,” and “fear” versus “anger,” as shown in Figure1. In addition, he established an important relationship between emotion and color on the wheel of emotions, i.e., the closer it is to the center of the wheel, the darker the color and the stronger the emotion. Therefore, the eight core emotion types could be extended into another 16 emotions by adding or reducing their intensities (i.e., making the current emotion stronger and weaker), as presented in the PWE model shown in Figure 2(a). Further, there are eight kinds of intermediate emotions that can achieve a smooth transition between two adjacent emotion types, such as “love” being the intermediate emotion between “trust” and “joy,” and “submission” the intermediate emotion between “trust” and “fear.”Figure 1
Eight primary emotion types in PWE model.Figure 2
Diagram of (a) PWE and (b) QWE models.Although it is better for robots to master more emotional skills to communicate with humans, their emotions will never be as delicate and diverse as a human being’s. To formulate and transform the robot’s emotions, we slightly modified the original PWE model (i.e., removed the intermediate emotions and extended the eight core emotions into their lowest intensities, which we name corresponding marginal emotions), as shown in Figure2(b). As such, it is obvious that each emotion of the robots can be uniquely determined by the parameters of angle (from 0 to 2π) and radius in this disc.In quantum mechanics, given an orthogonal basis, any pure stateψ of a qubit can be written as a superposition of the basis vectors 0 and 1 [14]. Quantum mechanics also dictates that the total probability of any system must equal unity, i.e., ψ|ψ=1 or ψ2=1. Given this constraint, ψ can be always expressed using ψ=cosθ0+sinθ1, where θ∈0,π/2. Therefore, the emotion type can be encoded (using angle αET/4 for the convenience of emotion retrieval operation) in the probability amplitude of a superposition qubit, which is expressed as(1)ET=cosαET40+sinαET41,αET∈0,2π.A robot’s emotion will be determined by both its emotion types and its corresponding intensities. As shown in Figure 2(b), there are four levels of emotion intensities, which are represented by quantum sequences 00, 01, 10, and 11, respectively. To make the QWE scalable, the value of emotion intensity is set to be adjustable using m qubits (that can represent 2m intensity levels), which is generally defined as(2)EI=⊗i=0m−1Ii=|Im−1Im−2…I1I0,Ii∈0,1.Therefore, the integrative QWE model can be represented as(3)QWE=ET⊗EI,where ET and EI are defined in equations (1) and (2), respectively. As such, a specified emotion in the PWE model is uniquely represented by an angular interval and corresponding radius value, as shown in Table 1.Table 1
Relationship between emotion and its corresponding angle and radius.
TypeIntensity11100100α0ET∈0,π/4AdmirationTrustAcceptanceMarginal trustα1ET∈π/4,π/2EcstasyJoySerenityMarginal joyα2ET∈π/2,3π/4VigilanceAnticipationInterestMarginal anticipationα3ET∈3π/4,πRageAngerAnnoyanceMarginal angerα4ET∈π,5π/4LoathingDisgustBoredomMarginal disgustα5ET∈5π/4,3π/2GriefSadnessPensivenessMarginal sadnessα6ET∈3π/2,7π/4AmazementSurpriseDistractionMarginal surpriseα7ET∈7π/4,2πTerrorFearApprehensionMarginal fear


## 2.2. QWE Initialization and Measurement

Utilizing QCs to process the emotional information imposes the need to first store the emotions as quantum states. Emotion generation using QWE includes the initialization of its two components, i.e., emotion typeET and emotion intensity EI. First, m+1 qubits should be prepared to store robot’s initial emotional state in the form of Ψ0=0⊗m+1. Then, we consider the operation,(4)RεαET2=cosαET4−sinαET4sinαET4cosαET4,to transform a 0 state to an expected emotion type ET, i.e.,(5)RεαET20=cosαET40+sinαET41=ET.Following this, an operationΩ is applied on 0⊗m to obtain the corresponding emotion intensity EI, i.e.,(6)Ω0⊗m=⊗i=0m−1Ωi0=⊗i=0m−10⊕Ii=⊗i=0m−1Ii=EI.Thus far, an emotion state in the QWE disc is obtained from the initial statesΨ0.Measurement operation is the unique tool by which one recovers classical information from a quantum system [14]. To facilitate the information exchange between classical and quantum models in a hybrid system, emotion retrieval from the QWE model is an essential requirement. The procedure can be accomplished using the following steps.First, emotion types can be acquired by means of the probability measuring the state0, i.e., K=cos2αET/4. Then, the value of angle αET can be calculated by antitrigonometric functions αET=4arccosK, where αET∈0,2π. Additionally, emotion intensity can be recovered from a quantum sequence via projected measurements JM, i.e.,(7)EIJMEI=∑j=02m−1j⊗i=0m−1Ii||jj⊗i=0m−1Ii=Im−1Im−2…I1I0=EI.An emotion retrieval operation ensures that a robot’s emotion can be recovered at any time for communication with other classical models in a companion robot architecture.


## 3. Emotion Generation and Transition of Companion Robots

To record and track the emotional change of a companion robot, it is necessary to integrate the robot’s active cycle (i.e., time period) in the emotion space. Therefore, a qubit sequencet representing the time period is used. The QWE-based emotion space (QWES) is defined as(8)QWES=12n∑t=02n−1QWEt⊗t=12n∑t=02n−1ETt⊗EIt⊗t,where QWEt is defined in equation (3) and t=⊗j=0n−1tj,tj∈0,1. Generally, QWESt stores the robot’s emotions QWEt and time information t at that moment.As a three-dimensional (3D) emotion space, QWES is made up of2n QWE discs, as shown in Figures 3(a) and 3(b), and each disc is used to locate the robot’s emotion at each moment t. As such, the QWES is depicted and visualized as a cylinder in Figure 3(c), which represents different emotions from each instant t=0 to t=2n−1, and the color gradient curve in the cylinder records the emotional changes of the companion robot over time.Figure 3
(a) QWE model; (b) QWE disc sequence; (c) graphical description of QWES.


### 3.1. Emotion Generation in QWES

Emotion of companion robots is a time-dependent and continuously changing variable, i.e., a robot’s emotion at timet is related to its previous emotional state at time t−1. During the emotional HRI, the robot’s emotion will change according to the stimulus it received to achieve the purpose of accompanying the users. These stimuli are the portrayal of human emotions, mainly including human physiological and behavioral signals (e.g., heart rate and facial expressions) and environmental factors (such as atmosphere).To describe the transition of a robot’s emotions over time, these stimuli are encoded as a unitary matrixMt, i.e., emotion transition matrix (ETM). Using the ETM, the relationship between the present emotion and previous emotional state in the QWES is formalized as(9)QWEt=MtQWEt−1=MtMt−1…M1QWE0=∏q=1tMqQWE0,where QWE0 is the robot’s initial emotional state and MtMt−1…M1 is a series of ETMs that describe the changes of the robot’s emotions from the initial to present state.As such, the ETM can be used to track emotions, and its inverse matrixMt−1 can be used to recover the emotional state at time t−1 from time t, i.e.,(10)QWEt−1=Mt−1QWEQWEt.Figure4 is an example that simply describes the process of emotion generation and transition in QWES. The companion robot with emotion “interest” receives external stimulus at time t−2 and then transforms its own emotion into “acceptance” through the ETM, i.e., QWEt−2=Mt−2QWEt−3. After experiencing three stimuli from the external environment, the robot’s emotion becomes “admiration,” i.e., QWEt=MtMt−1Mt−2QWEt−3. This process shows again that the robot’s emotional change is a continuous process and the present emotion is related to its previous emotional state.Figure 4
Example of emotion generation in QWES.Based on above discussions, the time periodt and initial emotion QWE0 are two core parts for emotion generation and transition in QWES. These two parts will now be discussed separately. First, n+m+1 qubits (Ψ0=0⊗n+m+1) are prepared for the storage of robot’s QWES, where m+1 qubits are used to encode the robot’s emotion and n qubits are employed to initialize the time period.Then, applying the transformℋ=H⊗n⊗I⊗m+1 on Ψ0, the intermediate state Ψ1 is produced(11)ℋΨ0=12n0⊗m+1⊗∑t=02n−1t=Ψ1,where I and H are the 2D identity and Hadamard matrices.Thus far, the time information in QWES has been formulated, i.e., the robot’s active cycle has been initialized. However, at this moment, there is no emotional state in the QWES, but immediately when the robot receives an instantaneous stimulus from the outside world (e.g., at an instantt=00…0), the robot will generate its emotional state at that time. Mathematically, this process can be realized using the quantum operator U0, defined as(12)U0=I⊗m+1⊗∑i=t,t≠02n−1ii+P0⊗tt,where(13)P0=Rεα0ET2⊗Ω0is used for generating the robot’s emotion at time t=00…0. Therefore, applying the U0 operation on the intermediate state Ψ1 in equation (11) will produce the robot’s initial emotional state Ψ2:(14)U0Ψ1=U012n∑t=02n−10⊗m+1⊗t=12n∑i=t,t≠02n−10⊗m+1i+cosα0ET40+sinα0ET41⊗i=0m−1I0i⊗t=Ψ2,which is regarded as QWE0, as discussed earlier.Equation (14) indicates that U0 is an operation that only generates the robot’s emotion value at time 00…0 in QWES, whereas emotions at other time periods will be stimulated by the ETM from that initial emotion over time. The QC for emotion generation and transition in QWES is shown in Figure 5, where ∏q=1tMq is a series of ETMs used for the emotion transition. In the following subsections, several basic transition operations using the ETM will be enumerated.Figure 5
QC scheme of emotion generation procedure in QWES.


### 3.2. Basic Emotion Transitions

Emotion transition is aimed at adjusting robot’s emotions to suit human emotional demand. This may be triggered by human behavioral data (facial expressions and body gestures) or physiological data (blood pressure and heart rate). In this section, a series of unitary operations will be employed for transitions of a robot’s emotions from one state to another in the QWES, including their emotion types and intensities.


#### 3.2.1. Emotion-Type Transition

An emotion-type transition is a basic operation to achieve transitions from one type to another, but will not affect its emotion intensity. We define the emotion-type transition matrix at timet as(15)MtET=RεΔαET2⊗I⊗m,where RεΔαET/2 is defined in equation (4) and ΔαET/4 is the transitioning parameter for emotion types. Equation (16) shows the process for emotion-type transitions:(16)QWESt=MtETQWEt−1⊗t=RεΔαET2cosαt−1ET4|0+sinαt−1ET41⊗i=0m−1It−1i⊗t=ETt⊗EIt⊗t,where(17)ETt=cosαt−1ET+ΔαET40+sinαt−1ET+ΔαET41,and(18)EIt=EIt−1=⊗i=0m−1It−1i.As shown in equations (17) and (18), the angle vector encoding emotion types is changed from αt−1ET/4 to αt−1ET+ΔαET/4, the intensity of which remains unaltered. The QC for executing this operation is depicted in Figure 6(a), where t0,t1,…,tn−1 indicates different time intervals. Figure 6(b) shows various possible emotional results by implementing different transitioning parameters when the initial emotion type is presented as αtET=π/8.Figure 6
Emotion-type transitions: (a) QC and (b) possible results whenαtET=π/8.
(a)(b)


#### 3.2.2. Emotion-Intensity Transition

Emotion intensity is encoded by a sequence of qubits and its transition requires operation on multiple qubits, setting them to either0 or 1. Emotion-intensity transition refers to the transformation of the intensity into a new state by adding or reducing transition parameters ΔEI=ΔIm−1ΔIm−2⋯ΔI0 to/from its earlier states. To achieve this operation, the emotion-intensity transition matrix MtEI is defined as(19)MtEI=I⊗ADDt,where ADDt is a quantum adder [15] that consists of two modules, i.e., sum modules for bitwise summation and carry modules for corresponding carries. Its implementation gives(20)ADDtEIt−1,ΔEI=EIt−1,EIt−1+ΔEI.Applying MtEI on QWEt−1 will produce(21)QWESt=MtEIQWEt−1⊗t=cosαt−1ET40+sinαt−1ET41⊗i=0m−1ADDt|It−1i⊗t=ETt⊗EIt⊗t,where EIt=EIt−1+ΔET is the result after emotion-intensity transition, while the emotion type ETt is unchanged.Figure7(c) presents the QC for emotion-intensity transition with a quantum adder and a quantum controlled-set 1 gate [16] to transform the emotion intensity without affecting any emotion types. As shown in Figure 7(a), the quantum controlled-set 1 gate can be used to set an input qubit i to 1 with a condition c to prevent the overflow errors. Supposing that the robot’s emotion is “marginal anger,” i.e., EIt=00, the possible results with different ΔEI values are presented in Figure 7(b). According to the reversibility of quantum operations, the substraction process is likewise executable using the quantum adder. As such, the emotion transition to a lower intensity can be similarly realized, where a quantum controlled-set 0 gate (similar to the quantum controlled-set 1 gate but with the target qubit set to 0) will be used for the overflow prevention.Figure 7
Emotion-intensity transitions: (a) quantum controlled-set 1 gate [16]; (b, c) various results and the QC.
(a)(b)(c)Since the robot’s emotions are specified by both emotion type and intensity, the ETM can be generally defined asMt=MtET⊗MtEI to achieve the emotion transition. In addition, as described in Section 2.1, emotions at diagonal positions in the QWE model are opposite. As such, the mutual transition between these opposite emotions can be simply realized using the above operations and setting the angles and qubit sequence.


### 3.3. Example of Emotion Tracking and Recovery

Emotion tracking is a process that tracks emotion transitions over different time intervals. When the companion robot is ready in an emotional HRI, its active cycle will be initialized in advance by using three Hadamard gates, as shown in equation (11). In this example, we suppose that time t in QWES is encoded by three qubits, i.e., t∈0,7. Subsequently, its initial emotion QWE0 (i.e., “trust”) will be generated as the basis of emotion transition to another time period. Notably, the transitions between emotions are realized by ETM, as was discussed earlier. The QC is presented in Figure 8, where the emotion at time t=001 is “admiration.” The transition to emotion “vigilance” at time t=010 is realized by a controlled-rotation matrix Rε5π/16 two CNOT gates with the condition t.Figure 8
QC of the emotional change from “trust” to “surprise.”Specifically, to obtain the emotion “vigilance” at timet=010, the following three steps are performed (further depicted in the green area in Figure 8).Step 1: using a controlled-rotation matrixRεπ/16 with a CNOT gate to generate emotion “trust” at time 000Step 2: using a constrained quantum adder operation to transform the emotion in Step 1 to “admiration” at time001Step 3: applying a controlled-rotation matrixRεπ/4 to further transform the emotion in Step 2 to “vigilance” at time 010Tracking and recovery of robot’s emotions are useful for monitoring and analyzing the users’ emotional change, especially those who need emotional care.


## 3.1. Emotion Generation in QWES

Emotion of companion robots is a time-dependent and continuously changing variable, i.e., a robot’s emotion at timet is related to its previous emotional state at time t−1. During the emotional HRI, the robot’s emotion will change according to the stimulus it received to achieve the purpose of accompanying the users. These stimuli are the portrayal of human emotions, mainly including human physiological and behavioral signals (e.g., heart rate and facial expressions) and environmental factors (such as atmosphere).To describe the transition of a robot’s emotions over time, these stimuli are encoded as a unitary matrixMt, i.e., emotion transition matrix (ETM). Using the ETM, the relationship between the present emotion and previous emotional state in the QWES is formalized as(9)QWEt=MtQWEt−1=MtMt−1…M1QWE0=∏q=1tMqQWE0,where QWE0 is the robot’s initial emotional state and MtMt−1…M1 is a series of ETMs that describe the changes of the robot’s emotions from the initial to present state.As such, the ETM can be used to track emotions, and its inverse matrixMt−1 can be used to recover the emotional state at time t−1 from time t, i.e.,(10)QWEt−1=Mt−1QWEQWEt.Figure4 is an example that simply describes the process of emotion generation and transition in QWES. The companion robot with emotion “interest” receives external stimulus at time t−2 and then transforms its own emotion into “acceptance” through the ETM, i.e., QWEt−2=Mt−2QWEt−3. After experiencing three stimuli from the external environment, the robot’s emotion becomes “admiration,” i.e., QWEt=MtMt−1Mt−2QWEt−3. This process shows again that the robot’s emotional change is a continuous process and the present emotion is related to its previous emotional state.Figure 4
Example of emotion generation in QWES.Based on above discussions, the time periodt and initial emotion QWE0 are two core parts for emotion generation and transition in QWES. These two parts will now be discussed separately. First, n+m+1 qubits (Ψ0=0⊗n+m+1) are prepared for the storage of robot’s QWES, where m+1 qubits are used to encode the robot’s emotion and n qubits are employed to initialize the time period.Then, applying the transformℋ=H⊗n⊗I⊗m+1 on Ψ0, the intermediate state Ψ1 is produced(11)ℋΨ0=12n0⊗m+1⊗∑t=02n−1t=Ψ1,where I and H are the 2D identity and Hadamard matrices.Thus far, the time information in QWES has been formulated, i.e., the robot’s active cycle has been initialized. However, at this moment, there is no emotional state in the QWES, but immediately when the robot receives an instantaneous stimulus from the outside world (e.g., at an instantt=00…0), the robot will generate its emotional state at that time. Mathematically, this process can be realized using the quantum operator U0, defined as(12)U0=I⊗m+1⊗∑i=t,t≠02n−1ii+P0⊗tt,where(13)P0=Rεα0ET2⊗Ω0is used for generating the robot’s emotion at time t=00…0. Therefore, applying the U0 operation on the intermediate state Ψ1 in equation (11) will produce the robot’s initial emotional state Ψ2:(14)U0Ψ1=U012n∑t=02n−10⊗m+1⊗t=12n∑i=t,t≠02n−10⊗m+1i+cosα0ET40+sinα0ET41⊗i=0m−1I0i⊗t=Ψ2,which is regarded as QWE0, as discussed earlier.Equation (14) indicates that U0 is an operation that only generates the robot’s emotion value at time 00…0 in QWES, whereas emotions at other time periods will be stimulated by the ETM from that initial emotion over time. The QC for emotion generation and transition in QWES is shown in Figure 5, where ∏q=1tMq is a series of ETMs used for the emotion transition. In the following subsections, several basic transition operations using the ETM will be enumerated.Figure 5
QC scheme of emotion generation procedure in QWES.


## 3.2. Basic Emotion Transitions

Emotion transition is aimed at adjusting robot’s emotions to suit human emotional demand. This may be triggered by human behavioral data (facial expressions and body gestures) or physiological data (blood pressure and heart rate). In this section, a series of unitary operations will be employed for transitions of a robot’s emotions from one state to another in the QWES, including their emotion types and intensities.


### 3.2.1. Emotion-Type Transition

An emotion-type transition is a basic operation to achieve transitions from one type to another, but will not affect its emotion intensity. We define the emotion-type transition matrix at timet as(15)MtET=RεΔαET2⊗I⊗m,where RεΔαET/2 is defined in equation (4) and ΔαET/4 is the transitioning parameter for emotion types. Equation (16) shows the process for emotion-type transitions:(16)QWESt=MtETQWEt−1⊗t=RεΔαET2cosαt−1ET4|0+sinαt−1ET41⊗i=0m−1It−1i⊗t=ETt⊗EIt⊗t,where(17)ETt=cosαt−1ET+ΔαET40+sinαt−1ET+ΔαET41,and(18)EIt=EIt−1=⊗i=0m−1It−1i.As shown in equations (17) and (18), the angle vector encoding emotion types is changed from αt−1ET/4 to αt−1ET+ΔαET/4, the intensity of which remains unaltered. The QC for executing this operation is depicted in Figure 6(a), where t0,t1,…,tn−1 indicates different time intervals. Figure 6(b) shows various possible emotional results by implementing different transitioning parameters when the initial emotion type is presented as αtET=π/8.Figure 6
Emotion-type transitions: (a) QC and (b) possible results whenαtET=π/8.
(a)(b)


### 3.2.2. Emotion-Intensity Transition

Emotion intensity is encoded by a sequence of qubits and its transition requires operation on multiple qubits, setting them to either0 or 1. Emotion-intensity transition refers to the transformation of the intensity into a new state by adding or reducing transition parameters ΔEI=ΔIm−1ΔIm−2⋯ΔI0 to/from its earlier states. To achieve this operation, the emotion-intensity transition matrix MtEI is defined as(19)MtEI=I⊗ADDt,where ADDt is a quantum adder [15] that consists of two modules, i.e., sum modules for bitwise summation and carry modules for corresponding carries. Its implementation gives(20)ADDtEIt−1,ΔEI=EIt−1,EIt−1+ΔEI.Applying MtEI on QWEt−1 will produce(21)QWESt=MtEIQWEt−1⊗t=cosαt−1ET40+sinαt−1ET41⊗i=0m−1ADDt|It−1i⊗t=ETt⊗EIt⊗t,where EIt=EIt−1+ΔET is the result after emotion-intensity transition, while the emotion type ETt is unchanged.Figure7(c) presents the QC for emotion-intensity transition with a quantum adder and a quantum controlled-set 1 gate [16] to transform the emotion intensity without affecting any emotion types. As shown in Figure 7(a), the quantum controlled-set 1 gate can be used to set an input qubit i to 1 with a condition c to prevent the overflow errors. Supposing that the robot’s emotion is “marginal anger,” i.e., EIt=00, the possible results with different ΔEI values are presented in Figure 7(b). According to the reversibility of quantum operations, the substraction process is likewise executable using the quantum adder. As such, the emotion transition to a lower intensity can be similarly realized, where a quantum controlled-set 0 gate (similar to the quantum controlled-set 1 gate but with the target qubit set to 0) will be used for the overflow prevention.Figure 7
Emotion-intensity transitions: (a) quantum controlled-set 1 gate [16]; (b, c) various results and the QC.
(a)(b)(c)Since the robot’s emotions are specified by both emotion type and intensity, the ETM can be generally defined asMt=MtET⊗MtEI to achieve the emotion transition. In addition, as described in Section 2.1, emotions at diagonal positions in the QWE model are opposite. As such, the mutual transition between these opposite emotions can be simply realized using the above operations and setting the angles and qubit sequence.


## 3.2.1. Emotion-Type Transition

An emotion-type transition is a basic operation to achieve transitions from one type to another, but will not affect its emotion intensity. We define the emotion-type transition matrix at timet as(15)MtET=RεΔαET2⊗I⊗m,where RεΔαET/2 is defined in equation (4) and ΔαET/4 is the transitioning parameter for emotion types. Equation (16) shows the process for emotion-type transitions:(16)QWESt=MtETQWEt−1⊗t=RεΔαET2cosαt−1ET4|0+sinαt−1ET41⊗i=0m−1It−1i⊗t=ETt⊗EIt⊗t,where(17)ETt=cosαt−1ET+ΔαET40+sinαt−1ET+ΔαET41,and(18)EIt=EIt−1=⊗i=0m−1It−1i.As shown in equations (17) and (18), the angle vector encoding emotion types is changed from αt−1ET/4 to αt−1ET+ΔαET/4, the intensity of which remains unaltered. The QC for executing this operation is depicted in Figure 6(a), where t0,t1,…,tn−1 indicates different time intervals. Figure 6(b) shows various possible emotional results by implementing different transitioning parameters when the initial emotion type is presented as αtET=π/8.Figure 6
Emotion-type transitions: (a) QC and (b) possible results whenαtET=π/8.
(a)(b)


## 3.2.2. Emotion-Intensity Transition

Emotion intensity is encoded by a sequence of qubits and its transition requires operation on multiple qubits, setting them to either0 or 1. Emotion-intensity transition refers to the transformation of the intensity into a new state by adding or reducing transition parameters ΔEI=ΔIm−1ΔIm−2⋯ΔI0 to/from its earlier states. To achieve this operation, the emotion-intensity transition matrix MtEI is defined as(19)MtEI=I⊗ADDt,where ADDt is a quantum adder [15] that consists of two modules, i.e., sum modules for bitwise summation and carry modules for corresponding carries. Its implementation gives(20)ADDtEIt−1,ΔEI=EIt−1,EIt−1+ΔEI.Applying MtEI on QWEt−1 will produce(21)QWESt=MtEIQWEt−1⊗t=cosαt−1ET40+sinαt−1ET41⊗i=0m−1ADDt|It−1i⊗t=ETt⊗EIt⊗t,where EIt=EIt−1+ΔET is the result after emotion-intensity transition, while the emotion type ETt is unchanged.Figure7(c) presents the QC for emotion-intensity transition with a quantum adder and a quantum controlled-set 1 gate [16] to transform the emotion intensity without affecting any emotion types. As shown in Figure 7(a), the quantum controlled-set 1 gate can be used to set an input qubit i to 1 with a condition c to prevent the overflow errors. Supposing that the robot’s emotion is “marginal anger,” i.e., EIt=00, the possible results with different ΔEI values are presented in Figure 7(b). According to the reversibility of quantum operations, the substraction process is likewise executable using the quantum adder. As such, the emotion transition to a lower intensity can be similarly realized, where a quantum controlled-set 0 gate (similar to the quantum controlled-set 1 gate but with the target qubit set to 0) will be used for the overflow prevention.Figure 7
Emotion-intensity transitions: (a) quantum controlled-set 1 gate [16]; (b, c) various results and the QC.
(a)(b)(c)Since the robot’s emotions are specified by both emotion type and intensity, the ETM can be generally defined asMt=MtET⊗MtEI to achieve the emotion transition. In addition, as described in Section 2.1, emotions at diagonal positions in the QWE model are opposite. As such, the mutual transition between these opposite emotions can be simply realized using the above operations and setting the angles and qubit sequence.


## 3.3. Example of Emotion Tracking and Recovery

Emotion tracking is a process that tracks emotion transitions over different time intervals. When the companion robot is ready in an emotional HRI, its active cycle will be initialized in advance by using three Hadamard gates, as shown in equation (11). In this example, we suppose that time t in QWES is encoded by three qubits, i.e., t∈0,7. Subsequently, its initial emotion QWE0 (i.e., “trust”) will be generated as the basis of emotion transition to another time period. Notably, the transitions between emotions are realized by ETM, as was discussed earlier. The QC is presented in Figure 8, where the emotion at time t=001 is “admiration.” The transition to emotion “vigilance” at time t=010 is realized by a controlled-rotation matrix Rε5π/16 two CNOT gates with the condition t.Figure 8
QC of the emotional change from “trust” to “surprise.”Specifically, to obtain the emotion “vigilance” at timet=010, the following three steps are performed (further depicted in the green area in Figure 8).Step 1: using a controlled-rotation matrixRεπ/16 with a CNOT gate to generate emotion “trust” at time 000Step 2: using a constrained quantum adder operation to transform the emotion in Step 1 to “admiration” at time001Step 3: applying a controlled-rotation matrixRεπ/4 to further transform the emotion in Step 2 to “vigilance” at time 010Tracking and recovery of robot’s emotions are useful for monitoring and analyzing the users’ emotional change, especially those who need emotional care.


## 4. Emotion Encryption Strategy in Emotional HRI Architecture

Since companion robots always collect, analyze, and transmit large amounts of a user’s emotional data, it is necessary to design a reliable security strategy of emotional data for emotional HRI. In this section, the architecture of emotional HRI and its security issues therein are analyzed. In addition, based on our proposed QWES model, an encryption strategy of emotional data is further proposed to achieve secure communication.


### 4.1. Architecture and Security Issues in Emotional HRI

Based on the discussions in [17, 18], in this subsection, an emotional HRI architecture is discussed to highlight the role of the proposed QWES. As presented in Figure 9, the architecture of emotional HRI mainly consists of three objects: user, companion robot, and cloud platform. The architecture of the companion robot can be divided into three layers: sensing, application, and network layers. The sensing layer is responsible for collecting and recognizing the user’s emotion-related data, including their physiological multimodal data, surrounding environment data, and recent social information. Additionally, the application layer is used to analyze the user’s emotional data (using machine- and deep-learning algorithms [19]) to generate the companion robot’s emotions and behaviors, thereby providing users with emotion care services, e.g., AI-based emotion monitoring, expression and motion feedback, and various personalized applications. Finally, the network layer includes various network-forward devices to transmit the user’s emotional data to the designated location (e.g., cloud platform).Figure 9
Emotional HRI architecture and QWES model in companion robot.The cloud platform is a powerful tool for analyzing and processing emotional data received from the network layer of the companion robots. It stores a large number of emotional data of both users and companion robots in the form of QWES. The cloud platform can be further divided into edge and remote cloud systems. Owing to the limitation of computing and storage capacity of the companion robots, the edge cloud system is used to receive and process various complex computing tasks for the sake of accelerating computing speed and lower delay. In addition, the remote cloud system does not need to be deployed close to the companion robots and users and can focus on processing and storing larger-scale computing tasks and emotional data without immediate response requirements.Based on the above, it is suggested that, in this architecture, users provide emotional data to the sensing layer of the companion robots and receive the behavior of emotion care from the application layer of the robots. Complementing this, companion robots can share the user’s data and its own logs to the cloud platform for processing (e.g., allowing medical experts to analyze these data for personal treatment, rating the service level of companion robots and providing the real-time patient monitoring for the users’ families). Moreover, a companion robot can also communicate or exchange emotional information with other companion robots through the cloud platform [20].By analyzing the emotional HRI architecture in Figure9, the following security issues are found. First, the user’s emotional data obtained by the sensing layer of a companion robot is based on the multimodal data generated by the user layer. Therefore, a user’s emotional data contain a significant amount of sensitive information (e.g., user’s physiological multimodal data). Leakage of the user’s emotional data stored in the companion robot will seriously compromise the user’s privacy. Second, the application layer of the companion robot will produce its own emotions and behaviors after analyzing the user’s emotional data. If the attacker breaks and modifies these emotional data in the companion robots, the robots will provide incorrect behavior and care for the users. Third, the user’s emotional information uploaded to the cloud platform by the companion robot will be frequently accessed for a variety of applications (e.g., real-time monitoring by the users’ families). If these emotional data are used maliciously, the diagnosis results of patients will be affected and incorrect emotional data will be transmitted during communication with other companion robots, among other possibilities.To protect the security and privacy of the emotional HRI environment, a parallel emotion encryption algorithm (PEEA) is proposed to protect emotional data stored in the form of QWES. There are two main motivations for this algorithm. First, emotional data are essentially a kind of special multimedia data. Although various traditional security technologies for multimedia data exist [21], there are few studies considering emotional data encryption based on the emotional HRI architecture. Second, the PEEA algorithm proposed in this study takes full advantage of the parallel property of quantum computing, which uses fewer quantum operations to offer better encryption results.


### 4.2. Parallel Emotion Encryption Algorithm

The security analysis of the emotional HRI environment highlights the importance of encryption of emotional data. In this subsection, a PEEA strategy is designed for the first attempt based on the QWES model, including encryption of emotion type and intensity. The encryption of emotion intensity consists of quantum cycle shift operations (QCSOs) and subsequence swapping operations (SSOs). The QCSO module is responsible for shifting each piece of intensity data in the emotion superposition state upward the proper number of qubits. The SSO module is used to exchange the subsequence data of each piece of intensity data with different values in different situations. The combination of these two operations facilitates encryption of all of the emotion-intensity data in the QWES model in parallel.


#### 4.2.1. QCSO and SSO Modules

A QCSO is employed to realize shift operations on emotion-intensity valuesEIt, which can be achieved by a series of quantum swapping gates [22], as shown in Figure 10. Supposing that emotion intensities are represented by m qubits, then m−1 swapping gates can be combined to realize the QCSO one time. The QC shifts the mth qubit to the 1st qubit, and, likewise, the 1st,2nd,…m−1th qubits are shifted one qubit upward in a proper sequence.Figure 10
QC for QCSO operations withm − 1 swapping gates.Several SSO operations are defined based on two qubits, which can be used to swap theith and jth qubits in the emotion-intensity sequence EIt by NOT, CNOT, and swapping gates, where i,j∈0,m,i≠j. Obviously, there are four possible combinations of the subsequence consisting of two qubits Iti and Itj, and these combinations will constitute six possible swapping operations [23]. As shown in Figure 11, these SSO operations are indicated by capital letters A–F for usage in the following encryption algorithm.Figure 11
QC for SSO operations based on two qubits.


#### 4.2.2. PEEA Strategy

To protect the emotional data in an active cycle of the companion robots, the emotion-type and -intensity encryption modules are implemented in Figure12. The emotion-intensity encryption includes QCSO and SSO operations, and the emotion-type encryption is composed of a series of controlled-rotation gates. These two encryption modules are combined for implementation, e.g., the controlled-rotation gate is applied on the emotion types ETt, but its control condition is from the emotion intensities EIt.Figure 12
Schematic of QC in PEEA strategy.Two random number sequences are prepared in the encryption strategy of emotion type. The first group is only composed of 0 and 1, which is used to design the control qubits of the controlled-rotation gate in each type encryption module. The second group consists of seven integers1≤r≤7, in which each random number r is involved in the encryption of emotion type. As such, the rotation angle in each controlled-rotation gate is set as Δαn=rn×π/4.In summary, the process of implementing the PEEA strategy is divided into the following steps:Step 1: two random sequences are generated for emotion-type encryption. The QCSO module is applied on the qubit sequence of emotion intensityEIt. Then, a controlled-rotation gate RεΔαn/2 is executed on emotion type ETt with the control condition from the highest qubit in EIt, i.e., Itm−1. The controlled-rotation gate parameters are provided by the two groups of random sequences.Step 2:an SSO operation (say “A” in Figure11) is randomly selected to act on the subsequence ItiItj of emotion intensity EIt. A controlled-rotation gate is then executed on emotion type ETt with the control conditions constrained by EIt. The required parameters are similarly provided by the two groups of random sequences in Step 1.Step 3: the operations in Steps 1 and 2 are iteratively executed. To improve the encryption result, several more SSO operations can be used in the iterations. For the convenience of description, only one SSO is performed for each iteration in this algorithm. The QC diagram of this example is shown in Figure13.Figure 13
QC diagram for encrypting emotional data in QWE model.As mentioned in Section2.1, due to the scalability of the QWE model, the emotion intensity can be extended from two qubits to m qubits. Supposing that m=4, the difference of encryption strategy then lies primarily in emotion intensity EIt, as shown in Figure 14. It is worth noting that, when the emotion intensity is larger than four (i.e., more than 2 qubits are used to represent the emotion intensity), more SSO operations should be randomly selected after performing a QCSO operation in each iteration. In this example, three kinds of SSO modules are used. In addition, it is necessary to ensure that all the qubits in EIt are processed by the multiple SSO modules, as shown in Figure 14(a). The encryption result for emotion-intensity data is presented in Figure 14(b). It is seen that under two iterations, all of the emotion-intensity data have been encrypted.Figure 14
(a) QC of emotion-intensity encryption whenm = 4; (b) encryption results for emotion intensity.
(a)(b)


### 4.3. Example of Emotion Encryption Using PEEA Strategy

In this subsection, we apply the encryption process in Figure13 to a QWES model. Further, we give the format of encryption and decryption keys and explain the decryption procedure. As analyzed in Figure 13, the following encryption key is given:(22)I0:Q0⟶R201⟶A10⟶R110⟶I1:Q1⟶R401⟶F10⟶R600,where I0 and I1 indicate the first and second encryption iterations, respectively. “Q” and “R” represent, respectively, the QCSO and controlled-rotation operations used to encrypt the emotion type. Their subscripts indicate the generated random numbers participating in the encryption algorithm. The first digit in the square brackets on the right-hand side of “R” indicates the control condition of this operation, i.e., the controlled-rotation gate is executed when the control qubits are set as 0 or 1. The second digit indicates the position of the control qubits. In addition, letters A–F represent the randomly adopted SSO modules, and the numbers in square brackets after them represent the two qubits on which the modules are executed. The right-pointing arrow indicates the execution order of each operation.According to the encryption key defined in equation (22), the QC diagram in Figure 13 will encrypt the emotional data based on the QWES model. The original emotions and corresponding encrypted emotions at each moment are shown in Figure 15.Figure 15
Example illustrating the emotion encryption using PEEA strategy.Since all quantum operations are reversible, the decryption process of the PEEA strategy is the reverse implementation of the emotion encryption process. As such, in the generation of decryption key, the execution order of each module is opposite to that of the encryption key:(23)I1:R−600⟶F10⟶R−401⟶Q1⟶I0:R−110⟶A10⟶R−201⟶Q0.The proposed PEEA strategy makes use of the parallelism of quantum computing and can globally encrypt the emotional data based on the QWES model with only a few simple quantum gates. This shows that when the QWES-based emotional data are transmitted in the emotional HRI architecture, adequate safeguards can be implemented to better protect the user’s privacy.


## 4.1. Architecture and Security Issues in Emotional HRI

Based on the discussions in [17, 18], in this subsection, an emotional HRI architecture is discussed to highlight the role of the proposed QWES. As presented in Figure 9, the architecture of emotional HRI mainly consists of three objects: user, companion robot, and cloud platform. The architecture of the companion robot can be divided into three layers: sensing, application, and network layers. The sensing layer is responsible for collecting and recognizing the user’s emotion-related data, including their physiological multimodal data, surrounding environment data, and recent social information. Additionally, the application layer is used to analyze the user’s emotional data (using machine- and deep-learning algorithms [19]) to generate the companion robot’s emotions and behaviors, thereby providing users with emotion care services, e.g., AI-based emotion monitoring, expression and motion feedback, and various personalized applications. Finally, the network layer includes various network-forward devices to transmit the user’s emotional data to the designated location (e.g., cloud platform).Figure 9
Emotional HRI architecture and QWES model in companion robot.The cloud platform is a powerful tool for analyzing and processing emotional data received from the network layer of the companion robots. It stores a large number of emotional data of both users and companion robots in the form of QWES. The cloud platform can be further divided into edge and remote cloud systems. Owing to the limitation of computing and storage capacity of the companion robots, the edge cloud system is used to receive and process various complex computing tasks for the sake of accelerating computing speed and lower delay. In addition, the remote cloud system does not need to be deployed close to the companion robots and users and can focus on processing and storing larger-scale computing tasks and emotional data without immediate response requirements.Based on the above, it is suggested that, in this architecture, users provide emotional data to the sensing layer of the companion robots and receive the behavior of emotion care from the application layer of the robots. Complementing this, companion robots can share the user’s data and its own logs to the cloud platform for processing (e.g., allowing medical experts to analyze these data for personal treatment, rating the service level of companion robots and providing the real-time patient monitoring for the users’ families). Moreover, a companion robot can also communicate or exchange emotional information with other companion robots through the cloud platform [20].By analyzing the emotional HRI architecture in Figure9, the following security issues are found. First, the user’s emotional data obtained by the sensing layer of a companion robot is based on the multimodal data generated by the user layer. Therefore, a user’s emotional data contain a significant amount of sensitive information (e.g., user’s physiological multimodal data). Leakage of the user’s emotional data stored in the companion robot will seriously compromise the user’s privacy. Second, the application layer of the companion robot will produce its own emotions and behaviors after analyzing the user’s emotional data. If the attacker breaks and modifies these emotional data in the companion robots, the robots will provide incorrect behavior and care for the users. Third, the user’s emotional information uploaded to the cloud platform by the companion robot will be frequently accessed for a variety of applications (e.g., real-time monitoring by the users’ families). If these emotional data are used maliciously, the diagnosis results of patients will be affected and incorrect emotional data will be transmitted during communication with other companion robots, among other possibilities.To protect the security and privacy of the emotional HRI environment, a parallel emotion encryption algorithm (PEEA) is proposed to protect emotional data stored in the form of QWES. There are two main motivations for this algorithm. First, emotional data are essentially a kind of special multimedia data. Although various traditional security technologies for multimedia data exist [21], there are few studies considering emotional data encryption based on the emotional HRI architecture. Second, the PEEA algorithm proposed in this study takes full advantage of the parallel property of quantum computing, which uses fewer quantum operations to offer better encryption results.


## 4.2. Parallel Emotion Encryption Algorithm

The security analysis of the emotional HRI environment highlights the importance of encryption of emotional data. In this subsection, a PEEA strategy is designed for the first attempt based on the QWES model, including encryption of emotion type and intensity. The encryption of emotion intensity consists of quantum cycle shift operations (QCSOs) and subsequence swapping operations (SSOs). The QCSO module is responsible for shifting each piece of intensity data in the emotion superposition state upward the proper number of qubits. The SSO module is used to exchange the subsequence data of each piece of intensity data with different values in different situations. The combination of these two operations facilitates encryption of all of the emotion-intensity data in the QWES model in parallel.


### 4.2.1. QCSO and SSO Modules

A QCSO is employed to realize shift operations on emotion-intensity valuesEIt, which can be achieved by a series of quantum swapping gates [22], as shown in Figure 10. Supposing that emotion intensities are represented by m qubits, then m−1 swapping gates can be combined to realize the QCSO one time. The QC shifts the mth qubit to the 1st qubit, and, likewise, the 1st,2nd,…m−1th qubits are shifted one qubit upward in a proper sequence.Figure 10
QC for QCSO operations withm − 1 swapping gates.Several SSO operations are defined based on two qubits, which can be used to swap theith and jth qubits in the emotion-intensity sequence EIt by NOT, CNOT, and swapping gates, where i,j∈0,m,i≠j. Obviously, there are four possible combinations of the subsequence consisting of two qubits Iti and Itj, and these combinations will constitute six possible swapping operations [23]. As shown in Figure 11, these SSO operations are indicated by capital letters A–F for usage in the following encryption algorithm.Figure 11
QC for SSO operations based on two qubits.


### 4.2.2. PEEA Strategy

To protect the emotional data in an active cycle of the companion robots, the emotion-type and -intensity encryption modules are implemented in Figure12. The emotion-intensity encryption includes QCSO and SSO operations, and the emotion-type encryption is composed of a series of controlled-rotation gates. These two encryption modules are combined for implementation, e.g., the controlled-rotation gate is applied on the emotion types ETt, but its control condition is from the emotion intensities EIt.Figure 12
Schematic of QC in PEEA strategy.Two random number sequences are prepared in the encryption strategy of emotion type. The first group is only composed of 0 and 1, which is used to design the control qubits of the controlled-rotation gate in each type encryption module. The second group consists of seven integers1≤r≤7, in which each random number r is involved in the encryption of emotion type. As such, the rotation angle in each controlled-rotation gate is set as Δαn=rn×π/4.In summary, the process of implementing the PEEA strategy is divided into the following steps:Step 1: two random sequences are generated for emotion-type encryption. The QCSO module is applied on the qubit sequence of emotion intensityEIt. Then, a controlled-rotation gate RεΔαn/2 is executed on emotion type ETt with the control condition from the highest qubit in EIt, i.e., Itm−1. The controlled-rotation gate parameters are provided by the two groups of random sequences.Step 2:an SSO operation (say “A” in Figure11) is randomly selected to act on the subsequence ItiItj of emotion intensity EIt. A controlled-rotation gate is then executed on emotion type ETt with the control conditions constrained by EIt. The required parameters are similarly provided by the two groups of random sequences in Step 1.Step 3: the operations in Steps 1 and 2 are iteratively executed. To improve the encryption result, several more SSO operations can be used in the iterations. For the convenience of description, only one SSO is performed for each iteration in this algorithm. The QC diagram of this example is shown in Figure13.Figure 13
QC diagram for encrypting emotional data in QWE model.As mentioned in Section2.1, due to the scalability of the QWE model, the emotion intensity can be extended from two qubits to m qubits. Supposing that m=4, the difference of encryption strategy then lies primarily in emotion intensity EIt, as shown in Figure 14. It is worth noting that, when the emotion intensity is larger than four (i.e., more than 2 qubits are used to represent the emotion intensity), more SSO operations should be randomly selected after performing a QCSO operation in each iteration. In this example, three kinds of SSO modules are used. In addition, it is necessary to ensure that all the qubits in EIt are processed by the multiple SSO modules, as shown in Figure 14(a). The encryption result for emotion-intensity data is presented in Figure 14(b). It is seen that under two iterations, all of the emotion-intensity data have been encrypted.Figure 14
(a) QC of emotion-intensity encryption whenm = 4; (b) encryption results for emotion intensity.
(a)(b)


## 4.2.1. QCSO and SSO Modules

A QCSO is employed to realize shift operations on emotion-intensity valuesEIt, which can be achieved by a series of quantum swapping gates [22], as shown in Figure 10. Supposing that emotion intensities are represented by m qubits, then m−1 swapping gates can be combined to realize the QCSO one time. The QC shifts the mth qubit to the 1st qubit, and, likewise, the 1st,2nd,…m−1th qubits are shifted one qubit upward in a proper sequence.Figure 10
QC for QCSO operations withm − 1 swapping gates.Several SSO operations are defined based on two qubits, which can be used to swap theith and jth qubits in the emotion-intensity sequence EIt by NOT, CNOT, and swapping gates, where i,j∈0,m,i≠j. Obviously, there are four possible combinations of the subsequence consisting of two qubits Iti and Itj, and these combinations will constitute six possible swapping operations [23]. As shown in Figure 11, these SSO operations are indicated by capital letters A–F for usage in the following encryption algorithm.Figure 11
QC for SSO operations based on two qubits.


## 4.2.2. PEEA Strategy

To protect the emotional data in an active cycle of the companion robots, the emotion-type and -intensity encryption modules are implemented in Figure12. The emotion-intensity encryption includes QCSO and SSO operations, and the emotion-type encryption is composed of a series of controlled-rotation gates. These two encryption modules are combined for implementation, e.g., the controlled-rotation gate is applied on the emotion types ETt, but its control condition is from the emotion intensities EIt.Figure 12
Schematic of QC in PEEA strategy.Two random number sequences are prepared in the encryption strategy of emotion type. The first group is only composed of 0 and 1, which is used to design the control qubits of the controlled-rotation gate in each type encryption module. The second group consists of seven integers1≤r≤7, in which each random number r is involved in the encryption of emotion type. As such, the rotation angle in each controlled-rotation gate is set as Δαn=rn×π/4.In summary, the process of implementing the PEEA strategy is divided into the following steps:Step 1: two random sequences are generated for emotion-type encryption. The QCSO module is applied on the qubit sequence of emotion intensityEIt. Then, a controlled-rotation gate RεΔαn/2 is executed on emotion type ETt with the control condition from the highest qubit in EIt, i.e., Itm−1. The controlled-rotation gate parameters are provided by the two groups of random sequences.Step 2:an SSO operation (say “A” in Figure11) is randomly selected to act on the subsequence ItiItj of emotion intensity EIt. A controlled-rotation gate is then executed on emotion type ETt with the control conditions constrained by EIt. The required parameters are similarly provided by the two groups of random sequences in Step 1.Step 3: the operations in Steps 1 and 2 are iteratively executed. To improve the encryption result, several more SSO operations can be used in the iterations. For the convenience of description, only one SSO is performed for each iteration in this algorithm. The QC diagram of this example is shown in Figure13.Figure 13
QC diagram for encrypting emotional data in QWE model.As mentioned in Section2.1, due to the scalability of the QWE model, the emotion intensity can be extended from two qubits to m qubits. Supposing that m=4, the difference of encryption strategy then lies primarily in emotion intensity EIt, as shown in Figure 14. It is worth noting that, when the emotion intensity is larger than four (i.e., more than 2 qubits are used to represent the emotion intensity), more SSO operations should be randomly selected after performing a QCSO operation in each iteration. In this example, three kinds of SSO modules are used. In addition, it is necessary to ensure that all the qubits in EIt are processed by the multiple SSO modules, as shown in Figure 14(a). The encryption result for emotion-intensity data is presented in Figure 14(b). It is seen that under two iterations, all of the emotion-intensity data have been encrypted.Figure 14
(a) QC of emotion-intensity encryption whenm = 4; (b) encryption results for emotion intensity.
(a)(b)


## 4.3. Example of Emotion Encryption Using PEEA Strategy

In this subsection, we apply the encryption process in Figure13 to a QWES model. Further, we give the format of encryption and decryption keys and explain the decryption procedure. As analyzed in Figure 13, the following encryption key is given:(22)I0:Q0⟶R201⟶A10⟶R110⟶I1:Q1⟶R401⟶F10⟶R600,where I0 and I1 indicate the first and second encryption iterations, respectively. “Q” and “R” represent, respectively, the QCSO and controlled-rotation operations used to encrypt the emotion type. Their subscripts indicate the generated random numbers participating in the encryption algorithm. The first digit in the square brackets on the right-hand side of “R” indicates the control condition of this operation, i.e., the controlled-rotation gate is executed when the control qubits are set as 0 or 1. The second digit indicates the position of the control qubits. In addition, letters A–F represent the randomly adopted SSO modules, and the numbers in square brackets after them represent the two qubits on which the modules are executed. The right-pointing arrow indicates the execution order of each operation.According to the encryption key defined in equation (22), the QC diagram in Figure 13 will encrypt the emotional data based on the QWES model. The original emotions and corresponding encrypted emotions at each moment are shown in Figure 15.Figure 15
Example illustrating the emotion encryption using PEEA strategy.Since all quantum operations are reversible, the decryption process of the PEEA strategy is the reverse implementation of the emotion encryption process. As such, in the generation of decryption key, the execution order of each module is opposite to that of the encryption key:(23)I1:R−600⟶F10⟶R−401⟶Q1⟶I0:R−110⟶A10⟶R−201⟶Q0.The proposed PEEA strategy makes use of the parallelism of quantum computing and can globally encrypt the emotional data based on the QWES model with only a few simple quantum gates. This shows that when the QWES-based emotional data are transmitted in the emotional HRI architecture, adequate safeguards can be implemented to better protect the user’s privacy.


## 5. Conclusions

In this study, we focus on the problem of AI-enabled emotion care for human well-being and wellness and thus propose a framework for modeling the emotion space of companion robots to facilitate their emotion generation and transition based on Plutchik’s wheel of emotions and reversible quantum circuit schemes. It is well known that emotional data are personal and private; thus, to protect the emotional data generated in the emotional HRI environment, a parallel emotion encryption algorithm is proposed in a first attempt by utilizing the parallel property of quantum computing, which can use fewer quantum operations and provide better encryption results. Compared with the available literature, this study not only makes full use of the mathematical formulations and dimensionality of emotion models to provide efficient computing and operations in emotions but also results in the design of an encryption strategy based on the emotion communication architecture to secure the emotion-related data.In planned future work, this study can be extended in the following directions. First, to provide natural communication, the interaction between the QWES model and other objects or layers in the emotional HRI architecture should be further studied. Second, emotion generation is a continuously changing process that requires a series of emotion transition matrices. The data acquisition and matrix formulation should be refined so as to support the personalized development of companion robots. Third, the possibility of using a quantum Fourier transform [24] and other advanced quantum algorithms for efficient and secure emotion processing should be explored. Finally, to make the companion robots more intelligent in the emotional HRI environment, several other quantum-inspired algorithms, such as quantum machine learning [9] and quantum cognition [25], might be worthy of additional research.



---

*Source: 6802521-2021-08-18.xml*