  Many proposals for fault-tolerant quantum computation require injection of
'magic states' to achieve a universal set of operations. Some qubit states are
above a threshold fidelity, allowing them to be converted into magic states via
'magic state distillation', a process based on stabilizer codes from quantum
error correction.
  We define quantum weight enumerators that take into account the sign of the
stabilizer operators. These enumerators completely describe the magic state
distillation behavior when distilling T-type magic states. While it is
straightforward to calculate them directly by counting exponentially many
operator weights, it is also an NP-hard problem to compute them in general.
This suggests that finding a family of distillation schemes with desired
threshold properties is at least as hard as finding the weight distributions of
a family of classical codes.
  Additionally, we develop search algorithms fast enough to analyze all useful
5 qubit codes and some 7 qubit codes, finding no codes that surpass the best
known threshold.
