Numerical and analytical studies of quantum error correction