Open viathor opened 3 weeks ago
The python API is more important than the C++ API. The C++ method should probably live in src/util_top/*
, along with most of the other top-level utilities not used by other utilities, to avoid explosion in compilation times by dumping everything into the class source files.
It's fairly simple to compute von Neumann entropy of a stabilizer state given its tableau and a partitioning of the qubit register, see e.g. here.
The API might look something like
where
first
andlast
are iterators to a collection ofsize_t
specifying one of two subpartitions of the qubits indexed from zero to tableau'snum_qubits
minus one. The functions would throwstd::out_of_range
if the collection contains qubits outside the range. Return typesize_t
is chosen to matchTableau.num_qubits
(which makes sense in light of the formula (1) in the answer linked above). Return type TODO is a representation of the subset of the given partition on which the entanglement is supported.The new functions should be exposed via pybind.
I found a mention of this feature in this past issue.
Credit: function
entanglement_support
suggested by @Strilanc.