Skip to content

Commit

Permalink
Docs: Add relevant comment
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss committed Dec 11, 2024
1 parent 2ec61bb commit 0b5f59b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/circuit/src/circuit_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1392,8 +1392,11 @@ impl CircuitData {
#[cfg(feature = "cache_pygates")]
{
// Standard gates can all rebuild their definitions, so if the
// cached py_op exists, update the `params` attribute and clear out
// any existing cache.
// cached py_op exists, discard it to prompt the instruction
// to rebuild its cached python gate upon request later on. This is
// done to avoid an unintentional duplicated reference to the same gate
// instance in python. For more information, see
// https://github.com/Qiskit/qiskit/issues/13504
previous.py_op.take();
}
} else {
Expand Down

0 comments on commit 0b5f59b

Please sign in to comment.