Skip to content

Micro-optimization: use NumPy interleaving in add_op_to_circuit()#1047

Closed
mhucka wants to merge 2 commits intomainfrom
perf-opt-matrix-gate-12902948640149436921
Closed

Micro-optimization: use NumPy interleaving in add_op_to_circuit()#1047
mhucka wants to merge 2 commits intomainfrom
perf-opt-matrix-gate-12902948640149436921

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented Apr 12, 2026

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.

mhucka and others added 2 commits April 12, 2026 04:20
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.
@github-actions github-actions Bot added the size: XS <10 lines changed label Apr 12, 2026
@mhucka mhucka closed this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant