github
Fix extraction of controlled parametric gates (#13067) The `mutable` check in the controlled-gate `OperationFromPython` extraction logic to check for a mutated `base_gate` was overzealous, and would return false positives for parametric controlled gates. The only modification to `base_gate` of a standard-library gate that would not have caused data-model problems from Python space would be setting the base-gate label, which is used for a public feature of the circuit visualisers. The change to `get_standard_gate_name_mapping` is just a minor convenience to make the gate objects directly appendable to a circuit; previously, each `Parameter` object was distinct and had a UUID clash with others of the same name, so could not be used together. The new behaviour is purely a convenience for tests; it largely should not be useful for users to directly append these gates. (cherry picked from commit 8f3308475)
10 of 10 new or added lines in 2 files covered. (100.0%)
5 existing lines in 2 files now uncovered.66917 of 74493 relevant lines covered (89.83%)
230045.64 hits per line