# Tailored Quantum Alternating Operator Ansatzes for Circuit Fault Diagnostics
## 4 QAOA Approaches to CFD
### Approach 2: Transverse and XY Mixer with a QUBO  
Any solution to the single input/output CFD problem has at most \(n_{o}\) faults. To exploit this bound, we can employ the XY mixer such that over the fault bits \((f_{1},\ldots,f_{n})\), we impose the constraint \(\sum_{i=1}^{n}f_{i}\leq n_{o}\). This can be achieved in different ways, for example, by introducing \(n_{o}\) ancilla qubits and employing the standard ring XY mixer over the \(n\) fault bits and \(n_{o}\) ancilla bits. Note that the XY mixer operating on a computational basis state of \(N\) qubits keeps the number of ones fixed, so if the initial wave function only has support for the computational basis states with \(k\) ones (\(\left|\,\psi\,\right\rangle=\sum_{x\in\{0,1\}^{N}\,\text{s.t. }\,\left|\,x \right|=k}a_{x}\left|\,x\,\right\rangle\)), then the wave function after applying any collection of XY mixers will still have support only for computational basis states with \(k\) ones. To achieve states with a number of ones between \(0\) and \(k\), we can add \(k\) ancillas and then apply the XY mixer on \(N+k\) qubits such that when those mixers are applied to a wave function \(\left|\,\psi^{N+k}\,\right\rangle=\sum_{x\in\{0,1\}^{N}\,\text{s.t. }\,\left|\, x\right|\leq k}\sum_{y\in\{0,1\}^{k}\,\text{s.t. }\,\left|\,y\right|=k-\left|\,x \right|}a_{x+y}\left|\,x\,\right\rangle\left|\,y\,\right\rangle\), the constraint on the number of ones in the wave function is maintained. Then, at the time of measurement, we simply discard the ancilla qubits and consider the resulting state over \(N\) qubits. Since the outputs, as in the previous approach, can be integrated out, and so the wire bits correspond to the qubits between \(1\) and \(n-n_{o}\), the fault bits correspond to qubits between \(n-n_{o}\) and \(2\,n-n_{o}\), and the ancillas correspond to qubits between \(2\,n-n_{o}+1\) and \(2\,n\). Utilizing the XY mixer over qubits between \(2\,n-n_{o}+1\) and \(2\,n\) and the transverse field applied on the wire bits leads to  
\[H_{d}=\left(\sum_{i=1}^{n-n_{o}}\sigma_{i}^{x}\right)+\left(\sigma_{n}^{x} \sigma_{n-n_{o}+1}^{x}+\sigma_{n}^{y}\sigma_{n-n_{o}+1}^{y}\right)+\sum_{i=n-n _{o}+1}^{2\,n-1}\left(\sigma_{i}^{x}\sigma_{i+1}^{x}+\sigma_{i}^{y}\sigma_{i+ 1}^{y}\right),\]which can be split into two noncommuting Hamiltonians:  
\[H_{1}=\left(\sum_{i=1}^{n-n_{o}}\sigma_{i}^{x}\right)+\left(\sigma_{n}^{x}\sigma_ {n-n_{o}+1}^{x}+\sigma_{n}^{y}\sigma_{n-n_{o}+1}^{y}\right)+\sum_{i=1}^{\lfloor(n +n_{o})/2\rfloor}\left(\sigma_{n+2i}^{x}\sigma_{n+2i+1}^{x}+\sigma_{n+2i}^{y} \sigma_{n+2i+1}^{y}\right),\]  
and  
\[H_{2}=\sum_{i=1}^{\lfloor(n+n_{o})/2\rfloor}\left(\sigma_{n+2i-1}^{x}\sigma_{n +2i}^{x}+\sigma_{n+2i-1}^{y}\sigma_{n+2i}^{y}\right).\]  
When \(n+n_{o}\) is odd, \(H_{1}\) also has a noncommuting term associated with qubits \(n-n_{o}+1\), \(n-n_{o}+2\), and \(2\,n\). As for the XY mixing operators [23], we can apply commuting mixing operators associated with \(H_{1}\) and then \(H_{2}\) as follows:  
\[U_{d}(\beta_{t}) =\left(\prod_{i=1}^{n-n_{o}}e^{-i\beta_{t}\sigma_{i}^{x}}\right) \left(\prod_{i=1}^{\lfloor(n+n_{o})/2\rfloor}e^{-i\beta_{t}\left(\sigma_{n+2i} ^{x}\sigma_{n+2i+1}^{x}+\sigma_{n+2i}^{y}\sigma_{n+2i+1}^{y}\right)}\right)\] \[\left(e^{-i\beta_{t}\left(\sigma_{n}^{x}\sigma_{n-n_{o}+1}^{x}+ \sigma_{n}^{y}\sigma_{n-n_{o}+1}^{y}\right)}\right)\left(\prod_{i=1}^{\lfloor (n+n_{o})/2\rfloor}e^{-i\beta_{t}\left(\sigma_{n+2i-1}^{x}\sigma_{n+2i}^{x}+ \sigma_{n+2i-1}^{y}\sigma_{n+2i}^{y}\right)}\right).\]  
The phase-separating operators are then the same as in the previous section.