#31283 closed enhancement (fixed)

1000× speedup of conjugate of double dense matrices

Reported by: Markus Wageringel Owned by:
Priority: major Milestone: sage-9.3
Component: numerical Keywords:
Cc: Travis Scrimshaw Merged in:
Authors: Markus Wageringel Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 7683cd2 (Commits, GitHub, GitLab) Commit: 7683cd259aa000d6aefe4ecd12aa1adf6f4b06c8
Dependencies: Stopgaps:

Status badges

Description

This ticket implements conjugate more efficiently for matrices over CDF and RDF. This speeds up taking the conjugate, and by extension Hermitian transpose, a lot.

Before:

sage: A = matrix.random(CDF, 80)
sage: %timeit A.C
28.7 ms ± 628 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
sage: %timeit A.H
30.2 ms ± 572 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

This is a performance bottleneck because it is much slower than matrix multiplication for example, even though that would have worse complexity.

After:

sage: A = matrix.random(CDF, 80)
sage: %timeit A.C
5.96 µs ± 36.9 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
sage: %timeit A.H
14 µs ± 59.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

Change History (6)

comment:1 Changed 23 months ago by Markus Wageringel

Authors: Markus Wageringel
Branch: u/gh-mwageringel/31283
Commit: 7683cd259aa000d6aefe4ecd12aa1adf6f4b06c8
Status: newneeds_review

New commits:

7683cd231283: speed up conjugate and hermitian transpose of double matrices

comment:2 Changed 23 months ago by Markus Wageringel

Cc: Travis Scrimshaw added

The bot is green. Please review.

comment:3 Changed 23 months ago by Travis Scrimshaw

LGTM

comment:4 Changed 23 months ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review

comment:5 Changed 23 months ago by Markus Wageringel

Thank you.

comment:6 Changed 23 months ago by Volker Braun

Branch: u/gh-mwageringel/312837683cd259aa000d6aefe4ecd12aa1adf6f4b06c8
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.