# Tailored Quantum Alternating Operator Ansatzes for Circuit Fault Diagnostics
## 4 QAOA Approaches to CFD
### Approach 3: Graph Diffusors with a Linear Field on the Fault Bits  
In this approach, we tailor the mixing operators to maintain the valid fault configuration space. Around each gate, a mixing operator is associated with swapping valid fault configurations around that gate, utilizing the descriptions given in Section 3.1 such that, given a valid configuration, the mixing operators populate states that are also valid configurations. Given a set of logical gates \(G=\{g_{1},\ldots,g_{m}\}\) in the fault model over \(w_{1},\ldots,w_{n}\) wires and \(f_{1},\ldots,f_{n}\) fault bits, define \(V_{g}^{(S_{i}S_{0})}\) as detailed in Section 3.1. We wish to construct the collection of unitaries \(\mathcal{U}=\{U_{S_{1}}^{(1)},\ldots,U_{S_{1}}^{(r)},\ldots,U_{S_{m}}^{(r)}\}\) associated with the mixing operator of each gate and the respective tuple of input/output pairs for each gate. (Note that the index \((r)\) runs over a set of input/output pairs to the gate, so it is typically an \(n\)-tuple and not a single integer.) For example, as in the circuit considered in Section 3 and illustrated in Figure 1, if \(g_{2}\) is an NAND gate, then \(\{U_{g_{2}}^{(1)},\ldots,U_{g_{2}}^{(8)}\}\) are associated with the eight input/output pairs for an NAND gate. We define the uniform superposition over the collections \(V_{g_{i}}^{(j)}\) as \(\left|\,V_{g_{i}}^{(j)}\,\right\rangle=\frac{1}{\left\|V_{g_{i}}^{(j)}\, \right\rangle}\sum_{v_{0}\in V_{g_{i}}^{(j)}}\left|\,v\,\right\rangle\). (See Table 1 for such a description for an NAND gate) Then, we define each mixing operator associated with a specific input/output pair for a specific gate:  
\[U_{g_{i}}^{(j)}(\beta_{t}) =\mathbb{1}-\left(1-e^{-i\beta_{t}}\right)\left|\,V_{g_{i}}^{(j) }\,\right\rangle\left\langle\,V_{g_{i}}^{(j)}\,\right|\] \[=\mathbb{1}-\left(1-e^{-i\beta_{t}}\right)/\left|\,V_{g_{i}}^{(j) }\,\right|\sum_{v,u\in V_{g_{i}}^{(j)}}\left|\,v\,\right\rangle\left\langle\,u\, \right|.\]Then, we define the mixing operator associated with each gate:  
\[U_{g_{i}}(\beta_{t})=\prod_{j=(1)}^{(r)}U_{g_{i}}^{(j)}(\beta_{t}).\]  
Here, \(U_{g_{i}}(\beta_{t})\) are unitary because \(U_{g_{i}}^{(j)}(\beta_{t})\) are mutually commutative over the input/output pair index \(j\). \(U_{g_{i}}^{(j)}\), which has an eigenvalue \(e^{ia}\) for an eigenvector \(\big{|}\ V_{g_{i}}^{(j)}\big{>}\) and an eigenvalue of one for any vector in the range of the projector \(\mathbb{1}-\big{|}\ V_{g_{i}}^{(j)}\big{>}\big{<}\big{<}\ V_{g_{i}}^{(j)}\big{|}\). Then, we define  
\[U_{d}(\beta_{t})=\prod_{i=1}^{m}U_{g_{i}}(\beta_{t}),\]  
as the mixing operator for this ansatz, where we apply each gate one after another. However, for circuits with a highly regular structure (such as those introduced in Section 3), we can group many commutating unitaries together and apply all \(U_{i}(\beta_{t})\) with in two steps. The cost function (also one-local) simply counts the number of faults of the configurations:  
\[U_{c}(\alpha_{t})=\prod_{i=n}^{2\pi}\Big{(}e^{ia_{s}\big{(}1-\sigma_{i}^{2} \big{)}/2}\Big{)}.\]  
The feasibility space and how it is connected through the action of \(U_{d}\) is more complicated for this approach than previous approaches such that it cannot be as easily described by a uniform superposition over the states. We begin with a known feasible configuration and apply \(U_{d}(\beta_{t})\) to explore the feasible configuration from there. A simple starting state used for this purpose is the state with only faults placed on the faulty output states. We also consider a modified protocol which includes a second cost function that has this state as its minimum, in clear inspiration from a similar CQA [3] approach. A sufficient (and one-local) cost function puts a penalty on every bit that does not conform with the initial state chosen. As such, the cost associated with any state in the space is given by its Hamming distance from the initial state. Let \(x^{0}=\{x^{0}_{1},\ldots,x^{0}_{2n}\}\) be the computational basis string associated with the initial state \(\ket{\psi}=\big{|}\ x^{0}\big{>}\).