Skip to content

Added L*D*L.T decomposition for real matrices.#1065

Open
cousinitt wants to merge 8 commits into
mpmath:masterfrom
cousinitt:add_ldlt
Open

Added L*D*L.T decomposition for real matrices.#1065
cousinitt wants to merge 8 commits into
mpmath:masterfrom
cousinitt:add_ldlt

Conversation

@cousinitt
Copy link
Copy Markdown
Contributor

Added $L\cdot D\cdot L^T$ decomposition for real matrices.

@cousinitt
Copy link
Copy Markdown
Contributor Author

So pytest -q -k test_ldlt obviously tests my specific test code. What runs the entire test suite so that I don't uselessly waste time checking things on PR time? (Sorry)

@skirpichev skirpichev added this to the 1.5 milestone Mar 11, 2026
@skirpichev skirpichev self-requested a review March 15, 2026 01:33
Copy link
Copy Markdown
Collaborator

@skirpichev skirpichev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments from me.

BTW, I'm not sure we need this: numpy has no such method. Also, we have cholesky(), which can be used to get this decomposition.

Lets someone else decide if we must have this.

Comment thread mpmath/matrices/linalg.py
u_conj_T = U.apply(lambda x: ctx.conj(x)).T
return v_conj_T * Splus * u_conj_T

def ldlt(ctx, A):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about naming. numpy has no such function, scipy has linalg.ldl, which handle also hermitian matrices.

Copy link
Copy Markdown
Contributor Author

@cousinitt cousinitt Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could probably make it handle Hermitian matrices ... also if not needed, no hurt feelings here.

Comment thread mpmath/matrices/linalg.py
Comment thread mpmath/tests/test_linalg.py Outdated
Comment thread mpmath/tests/test_linalg.py Outdated
Comment thread mpmath/tests/test_linalg.py Outdated
cousinitt and others added 4 commits March 19, 2026 20:45
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@skirpichev skirpichev added the pending The issue will be closed if no feedback is provided label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need decision pending The issue will be closed if no feedback is provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants