-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding stabilizer PY #220
Adding stabilizer PY #220
Conversation
|
||
|
||
# Append mid-circuit measurement | ||
for measurement in tc_circuit._extra_qir: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mid-circuit measurement can be interleaved with other gates, should first call tc.translation._merge_extra_qir
to get an ordered set of gates and measurements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@refraction-ray added this functionality and code works thanks
Merge extra QIR with the main QIR to get an ordered set of gates and measurements
```merged_qir = tc.translation._merge_extra_qir(tc_circuit._qir, tc_circuit._extra_qir)```
|
||
# Compute and print the entanglement entropy | ||
try: | ||
entropy = compute_entanglement_entropy(stabilizer_tableau) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also compare the results with baseline results by tc.quantum.entanglement_entropy
, also one needs one extra argument for entanglement calculation -- the sites to be traced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@refraction-ray compared it with baseline entropy here is the result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please first refactor the code, with the reference style from other scripts in /examples
, now the code is heavily duplicated
@refraction-ray Hi Github is not allowing me to make changes in the same PR |
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