Skip to content

Optimize targeted_left_multiply for onehot source#5905

Closed
daxfohl wants to merge 8 commits into
quantumlib:masterfrom
daxfohl:speedup-linalg2
Closed

Optimize targeted_left_multiply for onehot source#5905
daxfohl wants to merge 8 commits into
quantumlib:masterfrom
daxfohl:speedup-linalg2

Conversation

@daxfohl
Copy link
Copy Markdown
Collaborator

@daxfohl daxfohl commented Oct 3, 2022

For onehot left_matrix, this is just a slice that's moved and multiplied by a constant. Speeds up 2x2 Kraus components by two times, 4x4 by six times, and so on. Will be useful for the _ConfusionChannel in #5851

Fixes #5903

@daxfohl daxfohl requested review from a team, cduck and vtomole as code owners October 3, 2022 06:24
@daxfohl daxfohl requested a review from tanujkhattar October 3, 2022 06:24
@CirqBot CirqBot added the size: S 10< lines changed <50 label Oct 3, 2022
@daxfohl daxfohl marked this pull request as draft October 3, 2022 06:35
@daxfohl daxfohl marked this pull request as ready for review October 3, 2022 07:08
@daxfohl
Copy link
Copy Markdown
Collaborator Author

daxfohl commented Oct 8, 2022

@viathor Also closing this one because the new call to flatnonzero will likely be significant in the nominal case. However the same pattern can be used in _apply_channel_ eventually if so desired.

@daxfohl daxfohl closed this Oct 8, 2022
@daxfohl daxfohl deleted the speedup-linalg2 branch October 8, 2022 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S 10< lines changed <50

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize targeted_left_multiply for onehot operators

2 participants