tencent-quantum-lab / tensorcircuit

Tensor network based quantum software framework for the NISQ era
https://tensorcircuit.readthedocs.io
Apache License 2.0
252 stars 75 forks source link

Adding stabilizer PY #220

Closed AbdullahKazi500 closed 4 weeks ago

AbdullahKazi500 commented 4 weeks ago

This PR introduces support for mid-circuit measurements and entanglement entropy computation in the tensorcircuit library. Mid-circuit measurements are a crucial feature in quantum circuit simulation, allowing for measurements to be performed at intermediate stages of circuit execution. Additionally, entanglement entropy computation provides valuable insights into the entanglement properties of quantum states, aiding in quantum error correction and algorithm development.

Key Changes:

Mid-Circuit Measurement Support:

Implemented functionality to support mid-circuit measurements in the tensorcircuit library. Introduced a new method M to perform mid-circuit measurements on qubits. Entanglement Entropy Computation:

Added a function compute_entanglement_entropy to compute the entanglement entropy from the stabilizer tableau extracted after circuit execution. The function constructs a binary matrix representing the stabilizer tableau and computes its rank to determine the entanglement entropy. FIXES #211

AbdullahKazi500 commented 4 weeks ago

@refraction-ray Hi Github is not allowing me to make changes in the same PR made a new PR To address this issue here #221 I have tried to refactor the code with the docstrings and added the changes