[Bug]: formula for `pinv` is transpose of the pseudoinverse

Open Beginner friendly
#1,014 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Domain
documentation

Research direction

Open the linked pinv documentation and review the displayed pseudoinverse formula and the descriptions of Σ+, U, and V^H. Correct the formula, clarify the definition of Σ+, and use “unitary” where appropriate for the complex case. Done means the documented equations and terminology accurately describe the pseudoinverse.

Written by the indexing model from the issue text.

Description

The documentation of pinv shows:

$$
A^+ = U \Sigma^+ V^H
$$

but it should be:

$$
A^+ = V \Sigma^+ U^H
$$

It describes:

...and $\Sigma^+$ is then a diagonal matrix consisting of the reciprocals of $A$’s singular values, leaving zeros in place.

but it should probably me more like:

...and $\Sigma^+$ is then the transpose of $\Sigma$ with nonzero diagonal entries replaced by their reciprocals.

When checking this, GPT-5.6 also noticed that $U$ abd $V^H$ are described as "orthogonal", but "unitary" would be more correct in the complex case.

Dominant language
Python
Stars
281
Forks
52
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from data-apis/array-api

All issues in data-apis/array-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.