DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
L

dsh-linalg

Linalg

DeepSeek Harness (dsh) 的线性代数工具箱:矩阵乘法、行列式、逆矩阵、迹、转置、RREF、秩、整数幂、带有唯一解/无穷多解/无解分类的线性方程组求解器、对称特征分解、带有测得残差的 LU / QR / Cholesky 分解,以及用于超定方程组的最小二乘求解器——零运行时依赖

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:TYEclipse/dsh-linalg#e70472bb6a538511c9d773c062e43cc1462bade6
README兼容性版本

兼容性与来源证明

Linalg 以 dsh-linalg 发布,当前版本为 0.3.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
github
Registry 更新时间
2026/10/21

版本

0.3.0stable
2026/10/21
0.2.0stable
2026/10/2
0.1.3stable
2026/9/10
查看其余 1 个版本收起版本
0.1.0stable
2026/9/7
最新版
0.3.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
any
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

README

dsh-linalg

Linear algebra toolbox for DeepSeek Harness (dsh): matrix multiply, determinant, inverse, trace, transpose, reduced row echelon form, rank, integer matrix powers, a linear system solver that classifies unique / infinitely many / no solutions, a symmetric eigen-decomposition with measured residuals, matrix factorizations (LU with partial pivoting, thin QR, Cholesky) with measured reconstruction residuals, a least-squares solver for overdetermined systems, and vector operations (dot / cross / norm / projection / angle).

Zero runtime dependencies, pure local arithmetic — no network, no processes, no eval.

Why

Language models frequently make arithmetic errors on matrix multiplication, determinants, inverses and linear systems. This plugin hands those computations to exact local code with Gaussian elimination and partial pivoting, so results are deterministic and correct to 10 decimal places.

Install

dsh plugin --profile web add github:TYEclipse/dsh-linalg

Replace web with your profile name. (Requires pnpm on your PATH.)

Tools

ToolWhat it does
matrix_multiplyMultiply two matrices A·B with dimension checking
matrix_computeOne operation per call: transpose, determinant, inverse, trace, rref, rank, power (integer exponent)
matrix_decomposeOne factorization per call: lu (P·A = L·U, singular flagged), qr (thin A = Q·R, R diagonal positive) or cholesky (A = L·Lᵀ, symmetric positive definite only) — each with a measured reconstruction residual
matrix_eigenEigen-decomposition of a real symmetric matrix: all eigenvalues (descending) + unit eigenvectors + measured residual
least_squaresMinimizer of ‖A·x − b‖ for overdetermined systems, plus the minimum residual norm and max ‖Aᵀ(A·x − b)‖ (rank-deficient / underdetermined input is an error)
solve_linearSolve Ax = b; classifies unique / infinite (particular + nullspace basis + free-variable count) / no solution
vector_opsdot, cross (3D), norm, projection, angle (degrees)

Input matrices are plain JSON arrays of arrays, e.g. [[1, 2], [3, 4]]. Maximum dimension is 20×20 by default (configurable).

Examples

Determinant:

matrix_compute(matrix=[[2,1,1],[1,3,2],[1,0,0]], op="determinant")  →  -1

Inverse:

matrix_compute(matrix=[[4,7],[2,6]], op="inverse")
→ [[0.6,-0.7],[-0.2,0.4]]

Solve 2x+3y=8, x−y=1:

solve_linear(a=[[2,3],[1,-1]], b=[8,1])
→ unique solution: [2.2, 1.2]

Under-determined system (1 equation, 3 variables) reports the full parametric form:

solve_linear(a=[[1,1,1],[1,2,3]], b=[6,14])
→ kind=infinite, particular=[-2,8,0], nullspaceBasis=[[1,-2,1]], freeVariableCount=1

Cross product:

vector_ops(op="cross", a=[1,2,3], b=[4,5,6])  →  [-3,6,-3]

Angle between [3,4] and the x-axis:

vector_ops(op="angle", a=[3,4], b=[4,0])  →  53.1301023542  (degrees)

Rank and integer powers:

matrix_compute(matrix=[[1,2,3],[4,5,6],[7,8,9]], op="rank")  →  2
matrix_compute(matrix=[[1,1],[1,0]], op="power", exponent=20)
→ [[10946, 6765], [6765, 4181]]

Eigenvalues of a symmetric matrix (2x2 by hand would be a quadratic; here it is exact):

matrix_eigen(matrix=[[2,1],[1,2]])
→ eigenvalues (descending): 3, 1
  sum = 4, max residual = 0
  eigenvectors (unit, one per row):
    lambda1 = 3: [0.7071067812, 0.7071067812]
    lambda2 = 1: [0.7071067812, -0.7071067812]

The 4x4 tridiagonal [[2,-1,0,0],[-1,2,-1,0],[0,-1,2,-1],[0,0,-1,2]] gives 3.6180339887, 2.6180339887, 1.3819660113, 0.3819660113 — the closed form 2 − 2·cos(kπ/5).

LU factorization (row permuted, one swap):

matrix_decompose(matrix=[[2,1,1],[4,-6,0],[-2,7,2]], kind="lu")
→ p = [1, 0, 2]  (row i of P·A is row p[i] of A)
  swaps = 1, sign = -1, singular = false, det from U = -16
  L = [[1,0,0],[0.5,1,0],[-0.5,1,1]]
  U = [[4,-6,0],[0,4,1],[0,0,1]]

Thin QR (R diagonal positive, so the factorization is unique):

matrix_decompose(matrix=[[3,0],[4,5]], kind="qr")
→ Q = [[0.6,-0.8],[0.8,0.6]]   R = [[5,4],[0,3]]

Cholesky of a symmetric positive definite matrix:

matrix_decompose(matrix=[[4,12,-16],[12,37,-43],[-16,-43,98]], kind="cholesky")
→ L = [[2,0,0],[6,1,0],[-8,5,3]], det from L = 36

Least squares — fit y = a + b·x through (1,1), (2,2), (3,2):

least_squares(a=[[1,1],[1,2],[1,3]], b=[1,2,2])
→ x1 = 0.6666666667, x2 = 0.5
  min ‖A·x − b‖ = 0.4082482905, max ‖Aᵀ(A·x − b)‖ = 0

Numerical behaviour

  • Gaussian elimination with partial pivoting (largest-magnitude pivot per column).
  • All output numbers are rounded to 10 decimal places (configurable roundPlaces); values below 5e-12 are snapped to exactly 0, so -0 never appears.
  • Pivot tolerance is 1e-12: entries below that are treated as zero, so numerically singular matrices are reported as singular instead of producing garbage.
  • Singular inverse requests fail cleanly with an error message; inconsistent systems return kind: "none" with the reducing row equation.
  • matrix_eigen runs the cyclic Jacobi method in full double precision: every eigenvector is unit length, eigenvectors are signed so the leading non-zero component is positive, and the reply carries maxResidual = the largest |A·v − λ·v| entry actually measured. Non-square or non-symmetric input, and non-convergence, are reported as errors — never a guessed spectrum.
  • power uses binary exponentiation; negative exponents invert first (and fail cleanly on singular input), exponents are limited to the integer range −64…64.
  • matrix_decompose reports the residual it actually measured (max |P·A − L·U|, max |A − Q·R|, max |A − L·Lᵀ|). A singular matrix still gets an LU pair, but singular: true is set and the determinant from U is 0; linearly dependent columns make QR fail (no orthonormal completion is invented); an asymmetric or indefinite matrix is rejected by Cholesky with the offending entry / pivot spelled out.
  • least_squares solves through the thin QR factorization (not the normal equations, which square the condition number) and returns both the minimum residual norm and max |Aᵀ(A·x − b)| — zero proves the answer really is the minimizer. Rank-deficient or underdetermined input is an error rather than one arbitrary minimizer.

Configuration

- name: 'github:TYEclipse/dsh-linalg'
  config:
    maxDimension: 20   # max rows/columns (1–50)
    roundPlaces: 10    # decimals in every output number (1–15)

Development

pnpm install
pnpm build
pnpm test
pnpm lint

License

MIT