  The Heisenberg representation of quantum operators provides a powerful
technique for reasoning about quantum circuits, albeit those restricted to the
common (non-universal) Clifford set $H$, $S$ and $CNOT$. The Gottesman-Knill
theorem showed that we can use this representation to efficiently simulate
Clifford circuits. We show that Gottesman's semantics for quantum programs can
be treated as a type system, allowing us to efficiently characterize a common
subset of quantum programs. We apply this primarily towards tracking
entanglement in programs, showing how superdense coding and GHZ circuits
entangle and disentangle qubits and how to safely dispose of ancillae. We
demonstrate the efficiency of our typechecking algorithm both for simple
deductions and those involving entanglement and measurement.
