# Optimizing Multidimensional Pooling for Variational Quantum Algorithms
## 2 Background
### Quantum Gates
#### 2.2.5 Quantum Measurement  
Although colloquially denoted as a measurement \"gate\", the measurement or observation of a qubit is an irreversible non-unitary operation that projects a qubit's quantum state \(\ket{\psi}\) to one of its \(\ket{0}\) or \(\ket{1}\) basis states [14]. The probability of either basis state being measured is directly determined by the square of the magnitude of each corresponding basis state coefficient, i.e., \(p_{0}=\ket{c_{0}}^{2}\) and \(p_{1}=\ket{c_{1}}^{2}\); see (7) [6]. Here, we use the vector \(\vec{\psi}_{\text{decoded-data}}^{\text{classical}}\), to refer to the measured/decoded output classical data, assuming amplitude encoding [18], resulting from the measurement of the quantum state \(\ket{\psi}\); see (8). We also adhere to the Dirac (Bra-Ket) notation [14] to only represent quantum states and wave functions, e.g., \(\ket{\psi}\). More specifically, \(\vec{\psi}_{\text{decoded-data}}^{\text{classical}}\), without using the Dirac (Bra-Ket) notation, is a vector that represents the decoded/extracted classical data after measurement, as denoted in Figure 5 by the double-line rail carrying classical bit values [14], rather than a quantum state or a quantum wave function. It is also worth mentioning that \(\ket{\psi}\) is assumed to be a pure state, as defined by (2) and (9) [14]. \[P(\ket{\psi})= \begin{bmatrix}p_{0}\\ p_{1}\end{bmatrix} = \begin{bmatrix}\ket{c_{0}}^{2}\\ \ket{c_{1}}^{2}\end{bmatrix}  \tag{7}\]  
\[\psi_{\text{decoded-data}}^{\text{classical}}=\sqrt{P(\ket{\psi})}= \begin{bmatrix} \ket{c_{0}}\\ \ket{c_{1}}\end{bmatrix}  \tag{8}\]  
In general, an \(n\)-qubit quantum state \(\ket{\psi}\) has \(2^{n}\) possible basis states/measurement outcomes, as shown in (9). Figure 4: Rotate-left and rotate-right operations. Figure 5: Single-qubit measurement diagram. Figure 3: Diagram of swap gate and its decomposition. \[|\psi\rangle=\left[ \begin{array}{c}c_{0}\\ c_{1}\\ \vdots\\ c_{j}\\ \vdots\\ c_{N-2}\\ c_{N-1}\end{array} \right],\text{where }0\leq j<N\text{, and }N=2^{n} \tag{9}\]  
Accordingly, given the full measurement of a quantum state vector, the probability of finding the qubits in any particular state \(|j\rangle\), where \(0\leq j<2^{n}\), is given by \(\left|c_{j}\right|^{2}\)[6]. The overall probability distribution \(P(|\psi\rangle)\) can thus be expressed according to (10). Similar to single qubit measurement, the amplitude-encoded [18] output classical data \(\psi_{\text{decoded-data}}^{\text{classical}}\) resulting from the measurement of the \(n\)-qubit quantum state \(|\psi\rangle\) can be calculated from the square root of the probability distribution \(\sqrt{P(|\psi\rangle)}\), as shown in (11) and Figure 6. Additionally, \(|\psi\rangle\) is assumed to be a pure state [14]. Furthermore, when the encoded classical data are positive real, the amplitudes/coefficients of the corresponding quantum state are accordingly positive real, i.e., \(c_{j}\in\mathbb{Z}\), where \(0\leq j<2^{n}\). This results in the amplitudes of \(|\psi\rangle\) being numerically equal in values to the coefficients of \(\psi_{\text{decoded-data}}^{\text{classical}}\), i.e., \(|\psi\rangle=\psi_{\text{decoded-data}}^{\text{classical}}\). In other words, the quantum state \(|\psi\rangle\) can be completely determined from the measurement probability distribution such that \(|\psi\rangle=\sqrt{P(|\psi\rangle)}\) only when the amplitudes of the quantum state are all of positive real values. It is also worth mentioning that, in order to reconstruct the probability distribution \(P(|\psi\rangle)\), it is necessary to repeatedly measure (sample) the quantum state \(|\psi\rangle\) to the order of \(2^{n}\) measurements (samples) where \(n\) is the number of qubits.