# Constraint Preserving Mixers for the Quantum Approximate Optimization Algorithm
## 5 Constrained Mixers
### General Cases
#### 5.2.2 Example 2  
Finally, we investigate the case \(B=\{|10010\rangle,|01110\rangle,|10011\rangle,|11101\rangle,|00110\rangle,|010 10\rangle\}\), which restricts to six of the total \(2^{5}=32\) computational basis states for 5 qubits. It is not clear a priori if for any (distinct) pair \(T_{i_{1},j_{1}}\) and \(T_{i_{2},j_{2}}\), all pairs of non-vanishing Pauli strings commute. In order to fulfill Equation (6) for \(r=1\), this means that one needs to Trotterize according to all pairs of \(T_{A}\), as shown in Table 5. The resulting cost for this Trotterized mixer is Cost(\(H_{M}\)) = 1360. Since \(\mathcal{H}\cap B\) is spanned by \(k=2^{n}-|B|=26\) computational basis states, there are \(\binom{k}{2}=325\) different pairs to add to each \(T_{i\leftrightarrow j}\). As Table 5 shows, this can reduce the cost of the resulting mixer to Cost(\(H_{M}\)) = 568. Of course, there is the possibility to reduce the cost even further by adding more mixers for states in the kernel of \(H_{M,B}\). However, this quickly becomes computationally very demanding, when all possibilities are considered in a brute-force fashion.  
\begin{table}
\begin{tabular}{l l l l} \hline \hline \(\mathbf{C}\) = & \(\mathbf{T_{1\leftrightarrow 2}}\) & \(\mathbf{T_{2\leftrightarrow 3}}\) & \(\mathbf{T_{3\leftrightarrow 1}}\) \\ \hline \{\} & 12 & 8 & 16 \\ \{\(|0000\rangle,|001\rangle\) & 20 & 2 & 24 \\ \(|000\rangle,|101\rangle\) & 24 & 20 & 28 \\ \(|000\rangle,|110\rangle\) & 6 & 20 & 28 \\ \(|000\rangle,|111\rangle\) & 28 & 24 & **8** \\ \(|001\rangle,|101\rangle\) & 20 & 16 & 24 \\ \(|001\rangle,|110\rangle\) & 28 & 24 & **8** \\ \(|001\rangle,|111\rangle\) & 6 & 20 & 28 \\ \(|101\rangle,|110\rangle\) & 24 & 20 & 28 \\ \(|101\rangle,|111\rangle\) & 20 & 16 & 24 \\ \(|110\rangle,|111\rangle\) & 20 & **2** & 24 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Comparison of the Cost(\(H_{M,B}+H_{M,C}\)) for different added mixers \(C\) for the case \(B=\{|100\rangle,|010\rangle,|011\rangle\}\). All 10 possible pairs are shown. We see that the cost can be both reduced and increased.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c c c c} \hline \hline \(\mathbf{C}\) = & \(\mathbf{T_{1\leftrightarrow 2}}\) & \(\mathbf{T_{1\leftrightarrow 3}}\) & \(\mathbf{T_{1\leftrightarrow 4}}\) & \(\mathbf{T_{1\leftrightarrow 5}}\) & \(\mathbf{T_{1\leftrightarrow 6}}\) & \(\mathbf{T_{2\leftrightarrow 3}}\) & \(\mathbf{T_{2\leftrightarrow 4}}\) & \(\mathbf{T_{2\leftrightarrow 5}}\) & \(\mathbf{T_{2\leftrightarrow 6}}\) & \(\mathbf{T_{3\leftrightarrow 4}}\) & \(\mathbf{T_{3\leftrightarrow 5}}\) & \(\mathbf{T_{3\leftrightarrow 6}}\) & \(\mathbf{T_{4\leftrightarrow 5}}\) & \(\mathbf{T_{4\leftrightarrow 6}}\) & \(\mathbf{T_{5\leftrightarrow 6}}\) \\ \hline \{\} & 96 & 64 & 112 & 80 & 80 & 112 & 96 & 64 & 64 & 96 & 96 & 96 & 112 & 112 & 80 \\ \{\(|00010\rangle,|00011\rangle\) & 160 & 24 & 176 & 144 & 144 & 176 & 160 & 128 & 128 & 160 & 160 & 160 & 176 & 176 & 144 \\ \{\(|00010\rangle,|01101\rangle\) & 208 & 176 & **48** & 192 & 192 & 224 & 208 & 176 & 176 & 208 & 208 & 208 & 224 & 224 & 192 \\ \{\(|00010\rangle,|0001\rangle\) & 192 & 160 & 208 & 176 & 176 & 208 & **48** & 160 & 160 & 192 & 192 & 192 & 208 & 208 & 176 \\ \{\(|00010\rangle,|10101\rangle\) & 208 & 176 & 224 & 192 & 192 & 224 & 208 & 176 & 176 & 208 & 208 & 208 & 224 & **48** & 192 \\ \{\(|00010\rangle,|10101\rangle\) & 208 & 176 & 224 & 192 & 192 & 224 & 208 & 176 & 176 & 208 & 208 & 208 & 208 & 48 & 224 & 192 \\ \{\(|00010\rangle,|10101\rangle\) & 192 & 160 & 208 & 176 & 176 & 208 & 192 & 160 & 160 & 40 & 192 & 192 & 208 & 208 & 176 \\ \{\(|0010\rangle,|01000\rangle\) & 192