# Quantum Structure for Modelling Emotion Space of Robots
## 2 Preliminaries of QC and Emotional Plane
### Quantum Bits and Quantum Gates  
The state of a quantum system is described as a vector in a Hilbert space, which is called a _ket_ in quantum mechanical notation [8]. The _ket_ and its adjoint, i.e., the _bra_ notation, are defined as:  
\[\ket{u}=\left(\begin{array}{c}u_{0}\\ u_{1}\\ \vdots\\ u_{n-1}\end{array}\right),u_{i}\in C,i=0,1,\ldots,n-1, \tag{1}\] \[\langle u|=\ket{u}^{*}=\{u_{0}{}^{*}u_{1}{}^{*}\cdots u_{n-1}{}^ {*}\}, \tag{2}\]  
where \(u^{*}\) is the notation of complex conjugate of \(u\).  
The smallest unit of information in a quantum system is a qubit (analogues to the digital binary bit), which is a unit vector in two-dimensional Hilbert space defined by:  
\[\psi=\left(\begin{array}{c}\alpha\\ \beta\end{array}\right)=\alpha\left(\begin{array}{c}1\\ 0\end{array}\right)+\beta\left(\begin{array}{c}0\\ 1\end{array}\right)=\alpha|0\rangle+\beta|1\rangle, \tag{3}\]  
where \(\alpha\) and \(\beta\) are complex numbers.  
The notation for the tensor product, \(\otimes\), is used to express the composition of quantum systems. The tensor product of two matrices is defined as follows:  
\[A=\left(\begin{array}{cccc}a_{11}&a_{12}&\cdots&a_{1m}\\ a_{21}&a_{22}&\cdots&a_{2m}\\ \vdots&\vdots&\ddots&\vdots\\ a_{n1}&a_{n2}&\cdots&a_{nm}\end{array}\right)_{,\,B=\left(\begin{array}{ ccccc}b_{11}&b_{12}&\cdots&b_{1q}\\ b_{21}&b_{22}&\cdots&b_{2q}\\ \vdots&\vdots&\ddots&\vdots\\ b_{p1}&b_{p2}&\cdots&b_{pq}\end{array}\right)}. \tag{4}\]  
\[A\otimes B=\left(\begin{array}{cccc}a_{11}B&a_{12}B&\cdots&a_{1m}B\\ a_{21}B&a_{22}B&\cdots&a_{2m}B\\ \vdots&\vdots&\ddots&\vdots\\ a_{n1}B&a_{n2}B&\cdots&a_{nm}B\end{array}\right). \tag{5}\]  
The short notation for tensor product \(|u\rangle\otimes|v\rangle\) of two vectors or two kets, \(|u\rangle\) and \(|v\rangle\), is \(|uv\rangle\) or \(|u\rangle|v\rangle\) and \(A^{\otimes n}=A\otimes A\otimes\cdots\otimes A\) is used to denote the tensor product of a matrix \(A\) for \(n\) times.  
In the quantum circuit model of QC, a complex transform is broken down into simpler gates such as the commonly used NOT, Hadamard, CNOT, and Toffoli gates [8] which are shown in Figure 1. A gate that acts on \(k\) qubits is usually represented by a \(2^{k}\times 2^{k}\) unitary matrix, where the number of qubits in the input and output of the gate must be equal.  
The final step in quantum simulation is the measurement operation, which converts the quantum information into the classical information in form of probability distributions. This operation converts a single qubit state \(|\psi\rangle=\alpha|0\rangle+\beta|1\rangle\) into a probabilistic classical bit \(M\) (distinguished from a qubit by drawing it as a double-line wire as shown in Figure 2), which is \(0\) with probability \(|\alpha|^{2}\) or \(1\) with probability \(|\beta|^{2}\).  
Figure 1: NOT, Z, CNOT, Toffoli, and Hadamard gates.  
Figure 2: Single qubit measurement gate.  
A projective measurement is described by an observable, \(M\), a Hermitian operator on the state space of the system being observed [8]. The observable has a spectral decomposition that is described in the form presented in Equation (6):  
\[M=\sum_{m}mP_{m}, \tag{6}\]  
where \(P_{m}\) is the projector onto the eigenspace of \(M\) with eigenvalue \(m\). The possible outcomes of the measurement correspond to the eigenvalues, \(m\), of the observable. Upon measuring the state \(|\psi\rangle\), the probability of recovering a result \(m\) is given by:  
\[p(m)=\langle\psi|P_{m}|\psi\rangle. \tag{7}\]  
Given that the outcome \(m\) occurred, the state of the quantum system immediately after the measurement becomes:  
\[|\psi^{\prime}\rangle=\frac{P_{m}|\psi\rangle}{\sqrt{p(m)}}. \tag{8}\]