# What is the process of error correction if I want to apply one $X$ gate to my logical qubit?

I am trying to understand the general process of error correction.

E.g. I have a few physical qubits encoded as a logical qubit $$\vert0\rangle_L = \vert 0 0 0...0\rangle$$. What is the process of error correction if I want to apply, say, one $$X$$ gate to my logical qubit?

1. Apply $$X$$ gate on logical qubit $$\vert0\rangle_L$$.

$$\Rightarrow$$ $$X$$ gate is applied on the underlying physical qubits $$\vert 0 0 0...0\rangle$$.

2. Error correction algorithm is applied and corrects errors (if any).

Is this process repeated until every gate of the quantum circuit has been applied? Or how often is the error correction algorithm applied?