I am reading the very basics about CSS codes in the Nielsen & Chuang.
On page 450 of this book is explained how the ancillas are used to detect a bit-flip error on the encoded data.
We consider $C_2 \subset C_1$ two classical linear error correcting codes, and we focus on $CSS(C_1,C_2)$.
We consider the state:
$$ |x+C_2 \rangle = \frac{1}{\sqrt{|C_2|}} \sum_{y \in C_2} |x+y\rangle$$
We assume this state has received bit-flip and phase errors described by $e_1$ and $e_2$ respectively. Thus it becomes:
$$ |\psi\rangle = \frac{1}{\sqrt{|C_2|}} \sum_{y \in C_2} (-1)^{(x+y).e_2}|x+y+e_1\rangle $$
Now, the book says:
To detect where bit flips occurred it is convenient to introduce an ancilla containing sufficient qubits to store the syndrome for the code C1, and initially in the all zero state $|0\rangle$.We use reversible computation to apply the parity matrix H1 for the code C1,taking $|x+y+e_1\rangle |0\rangle$ to $|x+y+e_1\rangle |H_1(x+y+e_1)\rangle=|x + y + e \rangle |H_1e_1 \rangle$
My question is simply: How do we do the transformation $|0\rangle \rightarrow |H_1(x+y+e_1)\rangle$ for the ancilla ? For me it would require to know $|H_1(x+y+e_1)\rangle$ and then find the appropriate unitary to make the transformation $|0\rangle \rightarrow |H_1(x+y+e_1)\rangle$. But we are not supposed to know the state that is encoded and if we measure it we may destroy it.
So how can we know which transformation to apply to make: $|0\rangle \rightarrow |H_1(x+y+e_1)\rangle$ ? I don't understand the argument of reversible computation.
[edit] : I actually just thought about using CNOT between the qubits and the ancillas to first to $|x+y+e_1\rangle |0\rangle \rightarrow |x+y+e_1\rangle |x+y+e_1\rangle$. But then we need to apply $H_1$ on the ancillas. But it is not a unitary operation so how can we do it on a quantum circuit ?