|
Ran
|
Jobs
1
|
Files
1261
|
Run time
1min
|
Badge
README BADGES
|
push
github
Fix Barrier broadcast arguments (#11113) (#11114) This commit fixes an issue with the Barrier class's broadcast_arguments() method. Previously the Barrier class was overriding broadcast_arguments(), however this custom implementation resulted in an identical output to the Instruction's implementation (its parent class) but stripped out all the error checking to determine if the arguments aligned with the size of the instruction. This could result in creating a corrupt circuit that had a mismatch between the barrier width and the number of qargs. For example: ``` circuit = QuantumCircuit(1) circuit.append(Barrier(42), [0]) ``` would not error despite trying to add a 42 qubit barrier on qubit 0. This would result in weird errors such as invalid qpy generation that are confusing to debug. This commit fixes this by deleting the broadcast_arguments() implementation for Barrier so it will just depend on the inherited implementation from Instruction which will return an identical result but check the instruction is valid. (cherry picked from commit 5df2439c3) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
73864 of 85004 relevant lines covered (86.89%)
91967.33 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 6647644611.1 | 0 |
86.89 |
GitHub Action Run |