I'm trying to simulate stabilizer circuits using the Clifford tableau formalism that lets you scale up to hundreds of qubits. What I want to do is find the entanglement entropy on by splitting my quantum state (defined as a line of $N$ qubits) at the end of my quantum circuit after applying gates and some measurements. From [this paper][1], the authors calculate the entanglement entropy for a state defined by its stabilizers. In particular, I'm looking at Equations 10 (this is their "clipped gauge"), A16 and A17. If $\mathcal{S}$ is the set of stabilizers for the state, then the entropy is given by (Equation A16):

$$S = |A| - \log_2 |\mathcal{S}_A|,$$

where $|A|$ is the size of the bipartition of the quantum state and $\mathcal{S}_A$ is the part of $\mathcal{S}$ which acts on $\bar{A}$ with the identity.

I want to simulate my quantum circuit and calculate the entanglement entropy like they do in their paper, but I'm not sure what's the easiest way to do so. A lot of the tools for simulating stabilizer circuits aren't the most transparent to use. In particular, I'm trying to understand how to go from the tableau representation a lot of simulators output and the set of generators I need to calculate the entropy.

**Is there a simple procedure to go from the tableau representation to the entropy?** I'm trying to think of how to implement this in code.

For the actual simulator, I see there are a few options. I need measurements, so while Qiskit does offer [Clifford simulation][2], I can't seem to do measurements with it. The others that offer a Python interface are:
- [Stim][3], by Craig Gidney.
- [Python CHP Stabilizer Simulator][4], also by Craig Gidney.
- [CHP Sim][5], by the community for Q#.

If anyone has experience with these and can explain how to go from the tableau representation to the calculation of the entropy, that would be great, since these simulators usually seem to be for giving shots in the computational basis.


  [1]: https://arxiv.org/abs/1901.08092
  [2]: https://qiskit.org/documentation/stubs/qiskit.quantum_info.Clifford.html?highlight=stabilizer#qiskit.quantum_info.Clifford.stabilizer
  [3]: https://github.com/quantumlib/Stim
  [4]: https://github.com/Strilanc/python-chp-stabilizer-simulator
  [5]: https://github.com/qsharp-community/chp-sim