Fig. 10: Decomposition of controlled gates using Toffoli (or CCZ) gates and an ancilla (Fig. 4.10 in37), where i, j ∈ {1, 2, 3} and D ∈ {A1, B1, C1, A2, B2, S} as appropriate.
From: Belief propagation with quantum messages for quantum-enhanced classical communications

The top two identities can be used to implement each of the doubly controlled \({U}_{ \circledast }(\theta ,\theta ^{\prime} )\) appearing in Fig. 11, by applying doubly controlled versions of the components of \({U}_{ \circledast }(\theta ,\theta ^{\prime} )\) in Fig. 9. Note that \({m}_{1}={(-1)}^{{\hat{x}}_{1}}\) is the result of estimating x1 to be \({\hat{x}}_{1}\in \{0,1\}\). See Supplementary Note 5 for the relevant calculations and the angle γ.