The surface code is a many-body quantum system, and simulating it in generic conditions is computationally hard. While the surface code is believed to have a high threshold, the numerical simulations used to establish this threshold are based on simplified noise models. We present a tensor-network algorithm for simulating error correction with the surface code under arbitrary local noise. We use this algorithm to study the threshold and the subthreshold behavior of the amplitudedamping and systematic rotation channels. We also compare these results to those obtained by making standard approximations to the noise models.Introduction. -The working principle behind quantum error correction is to "fight entanglement with entanglement," i.e., protect the data against local interaction with the environment by encoding them into delocalized degrees of freedom of a many-body system. Thus, characterizing a fault-tolerant scheme is ultimately a problem of quantum many-body physics.While simulating quantum many-body systems is generically hard, particular systems have additional structure that can be taken advantage of. For example, free-fermion Hamiltonians have algebraic properties that make them exactly solvable. An analogy in stabilizer quantum error correction is Pauli noise, where errors are Pauli operators drawn from some fixed distribution. Because of their algebraic structure, Pauli noise models can be simulated efficiently using the stabilizer formalism [1]. Beyond Pauli noise, noise composed of Clifford gates and projections onto Pauli eigenstates can also be simulated efficiently using the same methods [2].While such efficiently simulable noise models can be useful to benchmark fault-tolerant schemes, they do not represent most models of practical interest. For instance, qubits that are built out of nondegenerate energy eigenstates are often subject to relaxation, a.k.a. amplitude damping. Miscalibrations often result in systematic errors corresponding to small unitary rotations [3]. Given that these processes do not have efficient descriptions within the stabilizer formalism, understanding how a given fault-tolerant scheme will respond to them is a difficult and important problem.The simplest approach to such many-body problems is brute-force simulation, where an arbitrary state in Hilbert space is represented as an exponentially large vector of coefficients. Using such methods, small surface codes (up to distance 3) have been simulated under nonClifford noise [4]. In another study, brute-force simulation of the seven-qubit Steane code was performed without concatenation [5]. Simulation of such low distance codes allows comparison of noise at the logical level to the noise on the physical level; however, it is difficult to infer quantities of interest such as thresholds or overheads from such small simulations. Another approach, akin to the use of tight-binding approximations in solid-state physics, is to approximate these noise processes with efficiently simulable ones [2,6]. However, the accuracy of these ap...