Let be a quantum circuit with gates whose underlying graph has treewidth . Then can be simulated by a deterministic classical algorithm in time
which is polynomial in when (Markov and Shi). The algorithm views the circuit as a tensor network and contracts it in an order derived from a tree decomposition; the cost of the best contraction order is exponential in the treewidth of the line graph of , which is within constant factors of the treewidth of for bounded-degree graphs.
Two consequences stated by the authors: circuits of depth whose gates act only on nearby qubits have logarithmic treewidth and are classically simulable; and a one-way (measurement-based) computation on a graph state of treewidth can be simulated by a randomized algorithm in time .