Commit 8e223fa
committed
Optimize MatrixGate translation using NumPy interleaving
Replaced an inefficient nested list comprehension with a NumPy-based
approach for interleaving real and imaginary parts of unitary matrices.
This avoids thousands of small list allocations and leverages NumPy's
optimized slicing and flattening.1 parent 3dee003 commit 8e223fa
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| |||
0 commit comments