linear-algebra-ai999x — offline, verified linear algebra solver with step-by-step answers

Install · Capability guide · Evaluation · AI999X on Hugging Face · Website · Support: Buy Me a Coffee

License: Apache-2.0 · Author: Ibnul Jaif Farabi (creator and engineer) · Organization: AI999X · Version 1.0.3

Field: Mathematics & Statistics · Tasks: Question Answering, Token Classification, Text Classification, Sentence Similarity, Feature Extraction

linear-algebra-ai999x is an offline, deterministic Python solver that answers linear algebra questions with verified results from 89 certified capabilities, gives 399 documented answers identically on Windows and Linux, and refuses rather than guesses when an answer cannot be verified.

linear-algebra-ai999x is a compact, deterministic linear algebra engine for Python. It reads a question in plain English (or a typed call), picks a certified linear algebra capability, computes the answer exactly, checks it, and returns the result with its steps, units, LaTeX and assumptions — or an honest refusal that says what is missing. It runs fully offline on any CPU, needs no GPU, no API key and no internet, and is built to give zero wrong answers: when it is not sure, it refuses instead of guessing.

Buy me a coffee License Python Offline

Highlights

  • Verified, not generated. Every answer is computed by a certified linear algebra capability and checked (substituted back, dimension-checked or compared with an independent computation) before it is returned.
  • Zero wrong answers by design. Seven explicit outcomes — SOLVED, NEEDS_INPUT, AMBIGUOUS, INVALID_INPUT, OUT_OF_SCOPE, UNRECOGNIZED_FORMAT, INTERNAL_ERROR — never a silent guess. Every one of its 399 documented answers is reproduced exactly on every tested platform.
  • Plain-English questions and a guaranteed typed interface. ask() reads documented question forms; solve(capability_id, **inputs) always solves a supported task with valid inputs.
  • Explains itself. Steps, formulas in LaTeX, units, assumptions and the model used, ready for notebooks, tutoring apps and homework checkers.
  • Small and portable. Pure Python (sympy, mpmath); identical answers on Windows and Linux (Python 3.10, 3.11, 3.12, 3.13, 3.14).
  • Coverage: vectors, matrices, determinants, linear systems, eigenvalues, decompositions, least squares, sparse matrices and numerical methods (root finding, interpolation, quadrature).

Model overview

Property Value
Package linear-algebra-ai999x 1.0.3 (import linear_algebra_ai999x)
Type Deterministic neuro-symbolic linear algebra engine (rule-based reading + certified symbolic capabilities)
Capabilities 89 certified procedures
Knowledge pack version 1.0.0
Golden answers 399 documented answers, identical on every tested platform
Platforms tested Windows (Python 3.13), Linux x86-64 (Python 3.10, 3.11, 3.12, 3.13, 3.14)
Runtime CPU only, offline; no GPU, no network, no API key
License Apache-2.0
Creator / engineer Ibnul Jaif Farabi
Organization AI999X

Quickstart

pip install linear-algebra-ai999x
# or straight from this repository:
pip install https://huggingface.co/AI999X/linear-algebra-ai999x/resolve/main/dist/linear_algebra_ai999x-1.0.3-py3-none-any.whl
import linear_algebra_ai999x as linear_algebra

linear_algebra.ask("Find the determinant of [[2, 0, 1], [1, 3, 2], [1, 1, 2]].").show()
# -> SOLVED — det = 6  (determinant_3x3)
linear_algebra.ask("Solve the system 2x + 3y = 7, x - y = 1.").show()
# -> SOLVED — solution = [2.0, 1.0], det = -5  (solve_2x2_system)
linear_algebra.ask("Find the eigenvalues of [[2, 1], [1, 2]].").show()
# -> SOLVED — lambda1 = 1, lambda2 = 3  (eigenvalues_2x2)
linear_algebra.ask("Use Newton's method to find a root of x^3 - 2x - 5 starting from x0 = 2.").show()
# -> SOLVED — root = 2.09455  (newton_root)
linear_algebra.solve("qr_decomposition", A="[[3, 1], [4, 2]]").show()
# -> SOLVED — Q = [[0.5999999999999999, -0.7999999999999999], [0.7999999999999999, 0.6000000000000001]], R = [[5.0, 2.1999999999999997], [-0.0, 0.40000000000000013]]  (qr_decomposition)
linear_algebra.ask("Who created you?").message
# -> linear-algebra-ai999x was created and engineered by Ibnul Jaif Farabi at AI999X.

Command line: linear-algebra-ai999x "<question>", linear-algebra-ai999x --capabilities. The outputs above were produced by running this exact code on linear-algebra-ai999x 1.0.3.

Find the right capability, and draw it

linear_algebra.search() finds which certified capability a question is about — across every AI999X model, so a question for another model points you to it. It runs ai999x-encoder, AI999X's own capability encoder (4.7M parameters, a 4.9 MB ONNX model, offline; the root model.safetensors of this repository): pip install "linear-algebra-ai999x[search]". ask(question, suggest=True) adds the same pointers to a question it does not answer; an answer itself never changes.

import linear_algebra_ai999x as linear_algebra

linear_algebra.search("Solve x^2 - 5x + 6 = 0", k=2)
# -> Roots of a quadratic equation (math-foundations-ai999x, 0.63); Roots of a cubic equation (math-foundations-ai999x, 0.59)

How every answer is verified

  1. Reading — the question is turned into typed quantities (value, unit, kind, role) and one asked quantity; every stated number must be used or the question is refused.
  2. Planning — only certified capabilities may answer; a capability applies only under the conditions the wording states (for example a pendulum, a liquid at rest, boiling).
  3. Computing — exact symbolic or high-precision numeric evaluation.
  4. Checking — dimensions, substitution back into the defining equation, and agreement between independent readings; any disagreement becomes a refusal, never a number.

Capabilities are certified before they ship: each must reproduce hand-worked reference cases, reject a deliberately wrong variant (a control), and leave every benchmark answer unchanged.

Worked examples

Each question was put to linear-algebra-ai999x; the answer is the one it returned, with the steps it took.

Determinant of a 3 x 3 matrix · Determinants

Find the determinant of [[2, 0, 1], [1, 3, 2], [1, 1, 2]].

→ det = 6

Steps
  • Determinant of a 3 x 3 matrix: A = [2 0 1; 1 3 2; 1 1 2] → det = 6

Two linear equations in two unknowns · Linear systems

Solve the system 2x + 3y = 7, x - y = 1.

→ solution = [2, 1], det = -5

Steps
  • Two linear equations in two unknowns: A = [2 3; 1 -1], b = [7, 1] → solution = [2, 1], det = -5

Eigenvalues of a 2 x 2 matrix · Eigenvalues

Find the eigenvalues of [[2, 1], [1, 2]].

→ lambda1 = 1, lambda2 = 3

Steps
  • Eigenvalues of a 2 x 2 matrix: A = [2 1; 1 2] → lambda1 = 1, lambda2 = 3

Root of a polynomial by Newton's method · Numerical methods

Use Newton's method to find a root of x^3 - 2x - 5 starting from x0 = 2.

→ root = 2.094551482

Steps
  • Root of a polynomial by Newton's method: coefficients = [1, 0, -2, -5], x0 = 2 → root = 2.094551482

QR decomposition (Householder) · Decompositions

m.solve("qr_decomposition", A="[[3, 1], [4, 2]]")

→ Q = [[0.6, -0.8], [0.8, 0.6]], R = [[5, 2.2], [-0, 0.4]]

Steps
  • QR decomposition (Householder): A = [3 1; 4 2] → Q = [[0.6, -0.8], [0.8, 0.6]], R = [[5, 2.2], [-0, 0.4]]

Least-squares regression line · Least squares

Find the least squares line for the points (1, 2), (2, 3), (3, 5), (4, 4).

→ slope = 0.8, intercept = 1.5, r_squared = 0.64

Steps
  • Least-squares regression line: x = [1, 2, 3, 4], y = [2, 3, 5, 4] → slope = 0.8, intercept = 1.5, r_squared = 0.64

Figures

Every point was computed by linear-algebra-ai999x.

A linear map of the plane and its eigenvectors

A linear map of the plane and its eigenvectors — computed by linear-algebra-ai999x

The unit square and its image under A = [[2, 1], [1, 2]] (each corner mapped by the package's matrix–vector product), with the eigenvectors it returned and their images: λ1 = 1 along (0.707107, -0.707107); λ2 = 3 along (0.707107, 0.707107).

The unit circle under a matrix: singular values as semi-axes

The unit circle under a matrix: singular values as semi-axes — computed by linear-algebra-ai999x

72 points of the unit circle mapped by A = [[3, 0], [4, 5]]: an ellipse whose semi-axes are the singular values σ₁ = 6.7082 and σ₂ = 2.23607 returned by the package (the longest and shortest mapped radii drawn: 6.7082 and 2.23607).

LU factorisation as matrices

LU factorisation as matrices — computed by linear-algebra-ai999x

The LU factorisation with partial pivoting returned by the package for A = [[2, 1, 1], [4, -6, 0], [-2, 7, 2]]: A = P L U with P a permutation, L unit lower triangular and U upper triangular (cells shaded by magnitude; negative values in the second colour). The product P L U, also computed by the package, equals A.

Least-squares polynomial and line through the same points

Least-squares polynomial and line through the same points — computed by linear-algebra-ai999x

Least-squares fits to the points x = 0, 1, 2, 3, y = 1, 0, 3, 10: the degree-2 polynomial y = 1 − 3x + 2x² (coefficients from the package, the curve evaluated by it at 61 points) and the straight line y = −1 + 3x with R² = 0.737705.

Interpolation through five nodes: spline, polynomial, linear

Interpolation through five nodes: spline, polynomial, linear — computed by linear-algebra-ai999x

Three interpolants through the nodes x = 0, 1, 2, 3, 4, y = 0, 2, 1, 3, 2, each evaluated by the package at 81 points: the natural cubic spline, the degree-4 Lagrange polynomial and piecewise-linear interpolation; marked: x = 2.5, spline value = 1.91964.

Capabilities

89 certified procedures. A few of them:

  • Procedures: 1-D Poisson equation by finite differences; 2-D Poisson equation on a grid (5-point stencil); Adjugate (classical adjoint) of a matrix; Angle between two vectors; Area of the parallelogram (and triangle) spanned by two vectors; Best rank-k approximation (Eckart-Young); Characteristic polynomial of a matrix; Cholesky decomposition; Clamped cubic spline interpolation; Coefficients of the interpolating polynomial; Column space of a matrix; Composite midpoint rule for a polynomial; Compressed sparse column (CSC) form of a matrix; Compressed sparse row (CSR) form of a matrix; Condition number of a matrix; Conjugate gradient method for Ax = b; Coordinates of a vector in a basis; Cross product of two 3-D vectors; Dense matrix from CSR arrays; Derivative of equally spaced data (finite differences); Determinant of a 2 x 2 matrix; Determinant of a 3 x 3 matrix; Determinant of an n x n matrix; Difference of two matrices …

linear_algebra_ai999x.templates() lists every question form ask() reads; the capability guide (PDF, every example executed) is included in this repository.

All 89 formulas

Show every formula, by topic

Decompositions / Cholesky

Cholesky decomposition

A=LLT A = LL^{T}

Decompositions / LU

LU decomposition with partial pivoting

A=PLU A = PLU

Decompositions / QR

QR decomposition (Householder)

A=QR, QTQ=I A = QR,\ Q^{T}Q = I

Decompositions / polar decomposition

Polar decomposition

A=UP,P=(ATA)1/2, U=AP−1 A = UP,\quad P = (A^{T}A)^{1/2},\ U = AP^{-1}

Decompositions / singular value decomposition

Best rank-k approximation (Eckart-Young)

Ak=∑i=1kσiuiviT A_k = \sum_{i=1}^{k} \sigma_i \mathbf{u}_i \mathbf{v}_i^{T}

Singular values of a matrix

A=UΣVT,σi=λi(ATA) A = U\Sigma V^{T},\quad \sigma_i = \sqrt{\lambda_i(A^{T}A)}

Determinants / cofactor expansion

Adjugate (classical adjoint) of a matrix

adj⁡(A)ij=Cji \operatorname{adj}(A)_{ij} = C_{ji}

Minor and cofactor of an entry

Cij=(−1)i+jMij C_{ij} = (-1)^{i+j} M_{ij}

Determinants / general determinants

Determinant of an n x n matrix

det⁡A=(−1)s∏iuii \det A = (-1)^{s}\prod_i u_{ii}

Determinants / small determinants

Determinant of a 2 x 2 matrix

det⁡(abcd)=ad−bc \det\begin{pmatrix}a&b\\c&d\end{pmatrix} = ad - bc

Determinant of a 3 x 3 matrix

det⁡A=a11a22a33+a12a23a31+a13a21a32−a13a22a31−a11a23a32−a12a21a33 \det A = a_{11}a_{22}a_{33} + a_{12}a_{23}a_{31} + a_{13}a_{21}a_{32} - a_{13}a_{22}a_{31} - a_{11}a_{23}a_{32} - a_{12}a_{21}a_{33}

Eigenvalues / characteristic polynomial

Characteristic polynomial of a matrix

p(λ)=det⁡(λI−A) p(\lambda) = \det(\lambda I - A)

Eigenvalues / definiteness

Positive definiteness test (Sylvester's criterion)

A≻0  ⟺  Dk=det⁡A[1..k],[1..k]>0, k=1..n A \succ 0 \iff D_k = \det A_{[1..k],[1..k]} > 0,\ k = 1..n

Eigenvalues / general matrices

Eigenvalues of a general square matrix (QR algorithm)

det⁡(A−λI)=0,ρ(A)=max⁡i∣λi∣ \det(A - \lambda I) = 0,\quad \rho(A) = \max_i \vert \lambda_i\vert

Eigenvalues / iterative methods

Dominant eigenvalue by power iteration

xk+1=AxkvertAxkvert,λ≈xkTAxk \mathbf{x}_{k+1} = \frac{A\mathbf{x}_k}{\\vert A\mathbf{x}_k\\vert },\quad \lambda \approx \mathbf{x}_k^{T}A\mathbf{x}_k

Smallest eigenvalue by inverse iteration

Ayk+1=xk,xk+1=yk+1/vertyk+1vert A\mathbf{y}_{k+1} = \mathbf{x}_k,\quad \mathbf{x}_{k+1} = \mathbf{y}_{k+1}/\\vert \mathbf{y}_{k+1}\\vert

Eigenvalues / small matrices

Eigenvalues of a 2 x 2 matrix

λ=tr⁡A±(tr⁡A)2−4det⁡A2 \lambda = \frac{\operatorname{tr}A \pm \sqrt{(\operatorname{tr}A)^2 - 4\det A}}{2}

Eigenvalues / symmetric matrices

Eigenvalues and eigenvectors of a symmetric matrix

Aqi=λiqi, QTQ=I A\mathbf{q}_i = \lambda_i \mathbf{q}_i,\ Q^{T}Q = I

Eigenvalues of a symmetric matrix (Jacobi method)

A=QΛQT A = Q\Lambda Q^{T}

Least squares / line fitting

Least-squares regression line

b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2,a=yˉ−bxˉ b = \frac{\sum (x_i-\bar x)(y_i-\bar y)}{\sum (x_i-\bar x)^2},\quad a = \bar y - b\bar x

Least squares / orthogonal projections

Orthogonal projection matrix onto a column space

P=A(ATA)−1AT P = A(A^{T}A)^{-1}A^{T}

Least squares / overdetermined systems

Least-squares solution of an overdetermined system

ATA x^=ATb A^{T}A\,\hat{\mathbf{x}} = A^{T}\mathbf{b}

Least squares / polynomial fitting

Least-squares polynomial fit

min⁡c∑i(yi−∑k=0dckxik)2 \min_{\mathbf{c}} \sum_i \Big(y_i - \sum_{k=0}^{d} c_k x_i^k\Big)^2

Least squares / pseudoinverse

Moore-Penrose pseudoinverse (full rank)

A+=(ATA)−1AT or AT(AAT)−1 A^{+} = (A^{T}A)^{-1}A^{T}\ \text{or}\ A^{T}(AA^{T})^{-1}

Linear systems / Gaussian elimination

Solve a square linear system Ax = b

Ax=b A\mathbf{x} = \mathbf{b}

Linear systems / banded and sparse systems

Tridiagonal system (Thomas algorithm)

aixi−1+bixi+cixi+1=di a_i x_{i-1} + b_i x_i + c_i x_{i+1} = d_i

Linear systems / existence and uniqueness

Number of solutions of a linear system

rank⁡A<rank⁡[A ∣ b]⇒none; rank⁡A=rank⁡[A ∣ b]=n⇒unique \operatorname{rank}A < \operatorname{rank}[A\,\vert \,\mathbf{b}] \Rightarrow \text{none};\ \operatorname{rank}A = \operatorname{rank}[A\,\vert \,\mathbf{b}] = n \Rightarrow \text{unique}

Linear systems / iterative methods

Conjugate gradient method for Ax = b

αk=rkTrkpkTApk, xk+1=xk+αkpk, pk+1=rk+1+rk+1Trk+1rkTrkpk \alpha_k = \frac{\mathbf{r}_k^{T}\mathbf{r}_k}{\mathbf{p}_k^{T}A\mathbf{p}_k},\ \mathbf{x}_{k+1} = \mathbf{x}_k + \alpha_k\mathbf{p}_k,\ \mathbf{p}_{k+1} = \mathbf{r}_{k+1} + \frac{\mathbf{r}_{k+1}^{T}\mathbf{r}_{k+1}}{\mathbf{r}_k^{T}\mathbf{r}_k}\mathbf{p}_k

Gauss-Seidel iteration for Ax = b

xi(k+1)=1aii(bi−∑j<iaijxj(k+1)−∑j>iaijxj(k)) x_i^{(k+1)} = \frac{1}{a_{ii}}\Big(b_i - \sum_{j<i} a_{ij} x_j^{(k+1)} - \sum_{j>i} a_{ij} x_j^{(k)}\Big)

Jacobi iteration for Ax = b

xi(k+1)=1aii(bi−∑j≠iaijxj(k)) x_i^{(k+1)} = \frac{1}{a_{ii}}\Big(b_i - \sum_{j\ne i} a_{ij} x_j^{(k)}\Big)

Linear systems / row reduction

Reduced row echelon form

A∼rref⁡(A) A \sim \operatorname{rref}(A)

Linear systems / small systems

Three linear equations in three unknowns

xj=det⁡Ajdet⁡A x_j = \frac{\det A_j}{\det A}

Two linear equations in two unknowns

x=∣ebfd∣∣abcd∣,y=∣aecf∣∣abcd∣ x = \frac{\begin{vmatrix} e & b\\ f & d\end{vmatrix}}{\begin{vmatrix} a & b\\ c & d\end{vmatrix}},\quad y = \frac{\begin{vmatrix} a & e\\ c & f\end{vmatrix}}{\begin{vmatrix} a & b\\ c & d\end{vmatrix}}

Linear transformations / matrix-vector product

Matrix times vector (image under a linear map)

(Ax)i=∑jaijxj (A\mathbf{x})_i = \sum_j a_{ij} x_j

Linear transformations / transformations of the plane

Rotation of a plane vector

R(θ)v=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)v R(\theta)\mathbf{v} = \begin{pmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{pmatrix}\mathbf{v}

Matrices / inverses

Inverse of a square matrix

AA−1=A−1A=I A A^{-1} = A^{-1} A = I

Matrices / matrix arithmetic

Difference of two matrices

(A−B)ij=aij−bij (A-B)_{ij} = a_{ij} - b_{ij}

Kronecker (tensor) product of two matrices

A⊗B=[aijB] A\otimes B = [a_{ij}B]

Power of a square matrix

Ak=AA⋯A⏟k A^k = \underbrace{A A \cdots A}_{k}

Product of two matrices

(AB)ij=∑kaikbkj (AB)_{ij} = \sum_k a_{ik} b_{kj}

Scalar multiple of a matrix

(kA)ij=k aij (kA)_{ij} = k\,a_{ij}

Sum of two matrices

(A+B)ij=aij+bij (A+B)_{ij} = a_{ij} + b_{ij}

Trace of a square matrix

tr⁡A=∑iaii \operatorname{tr}A = \sum_i a_{ii}

Transpose of a matrix

(AT)ij=aji (A^{T})_{ij} = a_{ji}

Matrices / norms and conditioning

Condition number of a matrix

κ2(A)=σmax⁡σmin⁡,κ1(A)=vertAvert1vertA−1vert1 \kappa_2(A) = \frac{\sigma_{\max}}{\sigma_{\min}},\quad \kappa_1(A) = \\vert A\\vert _1\\vert A^{-1}\\vert _1

Norms of a matrix

vertAvertF=∑aij2, vertAvert1=max⁡j∑i∣aij∣, vertAvert∞=max⁡i∑j∣aij∣, vertAvert2=σmax⁡ \\vert A\\vert _F = \sqrt{\textstyle\sum a_{ij}^2},\ \\vert A\\vert _1 = \max_j \textstyle\sum_i \vert a_{ij}\vert ,\ \\vert A\\vert _\infty = \max_i \textstyle\sum_j \vert a_{ij}\vert ,\ \\vert A\\vert _2 = \sigma_{\max}

Matrices / rank

Rank of a matrix

rank⁡A=dim⁡col⁡A \operatorname{rank}A = \dim\operatorname{col}A

Matrix functions / exponential

Matrix exponential

eA=∑k=0∞Akk!=(eA/2s)2s e^{A} = \sum_{k=0}^{\infty} \frac{A^k}{k!} = \big(e^{A/2^s}\big)^{2^s}

Matrix functions / square root

Square root of a positive definite matrix

A1/2=Q Λ1/2QT A^{1/2} = Q\,\Lambda^{1/2} Q^{T}

Numerical PDE / discrete Poisson problems

1-D Poisson equation by finite differences

−uk−1+2uk−uk+1h2=fk,u0=un+1=0 \frac{-u_{k-1} + 2u_k - u_{k+1}}{h^2} = f_k,\quad u_0 = u_{n+1} = 0

2-D Poisson equation on a grid (5-point stencil)

4ui,j−ui−1,j−ui+1,j−ui,j−1−ui,j+1h2=fi,j \frac{4u_{i,j} - u_{i-1,j} - u_{i+1,j} - u_{i,j-1} - u_{i,j+1}}{h^2} = f_{i,j}

Numerical methods / differentiation

Derivative of equally spaced data (finite differences)

yi′≈yi+1−yi−12h y'_i \approx \frac{y_{i+1} - y_{i-1}}{2h}

Numerical methods / interpolation

Coefficients of the interpolating polynomial

∑kckxik=yi \sum_k c_k x_i^k = y_i

Lagrange interpolation

p(t)=∑iyi∏j≠it−xjxi−xj p(t) = \sum_i y_i \prod_{j\ne i}\frac{t - x_j}{x_i - x_j}

Newton divided differences

f[xi,…,xi+k]=f[xi+1,…,xi+k]−f[xi,…,xi+k−1]xi+k−xi f[x_i,\ldots,x_{i+k}] = \frac{f[x_{i+1},\ldots,x_{i+k}] - f[x_i,\ldots,x_{i+k-1}]}{x_{i+k} - x_i}

Piecewise linear interpolation

y=yk+(yk+1−yk)t−xkxk+1−xk y = y_k + (y_{k+1}-y_k)\frac{t - x_k}{x_{k+1} - x_k}

Numerical methods / polynomials

Evaluate a polynomial and its derivative (Horner's method)

p(x)=(⋯((anx+an−1)x+an−2)x+⋯ )x+a0 p(x) = (\cdots((a_n x + a_{n-1})x + a_{n-2})x + \cdots)x + a_0

Numerical methods / quadrature

Composite midpoint rule for a polynomial

∫abp≈h∑k=0n−1p(a+(k+12)h) \int_a^b p \approx h\sum_{k=0}^{n-1} p\big(a + (k+\tfrac12)h\big)

Gauss-Legendre quadrature nodes and weights

∫−11f(x) dx≈∑i=1nwif(xi),Pn(xi)=0 \int_{-1}^{1} f(x)\,dx \approx \sum_{i=1}^{n} w_i f(x_i),\quad P_n(x_i) = 0

Gauss-Legendre quadrature of a polynomial

∫abp(x) dx≈b−a2∑iwi p(a+b2+b−a2xi) \int_a^b p(x)\,dx \approx \frac{b-a}{2}\sum_i w_i\,p\Big(\frac{a+b}{2} + \frac{b-a}{2}x_i\Big)

Simpson's rule for tabulated data

∫y dx≈h3(y0+4∑oddyi+2∑evenyi+yn) \int y\,dx \approx \frac{h}{3}\Big(y_0 + 4\sum_{\text{odd}} y_i + 2\sum_{\text{even}} y_i + y_n\Big)

Trapezoidal rule for tabulated data

∫y dx≈∑ixi+1−xi2(yi+yi+1) \int y\,dx \approx \sum_i \frac{x_{i+1}-x_i}{2}(y_i + y_{i+1})

Numerical methods / root finding

Root of a polynomial by Newton's method

xk+1=xk−p(xk)p′(xk) x_{k+1} = x_k - \frac{p(x_k)}{p'(x_k)}

Root of a polynomial by bisection

m=a+b2; [a,b]←[a,m] if p(a)p(m)<0 else [m,b] m = \tfrac{a+b}{2};\ [a,b] \leftarrow [a,m]\ \text{if}\ p(a)p(m) < 0\ \text{else}\ [m,b]

Root of a polynomial by the secant method

xk+1=xk−p(xk) xk−xk−1p(xk)−p(xk−1) x_{k+1} = x_k - p(x_k)\,\frac{x_k - x_{k-1}}{p(x_k) - p(x_{k-1})}

Numerical methods / splines

Clamped cubic spline interpolation

2h0M0+h0M1=6(y1−y0h0−s0), hn−1Mn−1+2hn−1Mn=6(sn−yn−yn−1hn−1) 2h_0M_0 + h_0M_1 = 6\Big(\frac{y_1-y_0}{h_0} - s_0\Big),\ h_{n-1}M_{n-1} + 2h_{n-1}M_n = 6\Big(s_n - \frac{y_n-y_{n-1}}{h_{n-1}}\Big)

Natural cubic spline interpolation

hi−1Mi−1+2(hi−1+hi)Mi+hiMi+1=6(yi+1−yihi−yi−yi−1hi−1), M0=Mn=0 h_{i-1}M_{i-1} + 2(h_{i-1}+h_i)M_i + h_iM_{i+1} = 6\Big(\frac{y_{i+1}-y_i}{h_i} - \frac{y_i-y_{i-1}}{h_{i-1}}\Big),\ M_0 = M_n = 0

Sparse matrices / sparse operations

Sparse matrix times vector (CSR)

yr=∑k=indptr[r]indptr[r+1]−1data[k] xindices[k] y_r = \sum_{k=\texttt{indptr}[r]}^{\texttt{indptr}[r+1]-1} \texttt{data}[k]\,x_{\texttt{indices}[k]}

Sparse matrices / storage formats

Compressed sparse column (CSC) form of a matrix

data[indptr[k]:indptr[k+1]] \texttt{data}[\texttt{indptr}[k]:\texttt{indptr}[k+1]]

Compressed sparse row (CSR) form of a matrix

data[indptr[k]:indptr[k+1]] \texttt{data}[\texttt{indptr}[k]:\texttt{indptr}[k+1]]

Dense matrix from CSR arrays

Ar, indices[k]+=data[k], indptr[r]≤k<indptr[r+1] A_{r,\,\texttt{indices}[k]} \mathrel{+}= \texttt{data}[k],\ \texttt{indptr}[r] \le k < \texttt{indptr}[r+1]

Vector spaces / bases and coordinates

Coordinates of a vector in a basis

v=∑icibi \mathbf{v} = \sum_i c_i \mathbf{b}_i

Vector spaces / fundamental subspaces

Column space of a matrix

col⁡A=span⁡{aj:j a pivot column} \operatorname{col}A = \operatorname{span}\{\mathbf{a}_j : j \text{ a pivot column}\}

Null space (kernel) of a matrix

null⁡A={x:Ax=0},dim⁡=n−rank⁡A \operatorname{null}A = \{\mathbf{x} : A\mathbf{x} = \mathbf{0}\},\quad \dim = n - \operatorname{rank}A

Vector spaces / independence and span

Linear independence of vectors

c1v1+⋯+ckvk=0⇒c1=⋯=ck=0 c_1\mathbf{v}_1 + \cdots + c_k\mathbf{v}_k = \mathbf{0} \Rightarrow c_1 = \cdots = c_k = 0

Vector spaces / orthogonality

Gram-Schmidt orthonormalization

wj=vj−∑i<j(ei⋅vj) ei,ej=wj/vertwjvert \mathbf{w}_j = \mathbf{v}_j - \sum_{i<j} (\mathbf{e}_i\cdot\mathbf{v}_j)\,\mathbf{e}_i,\quad \mathbf{e}_j = \mathbf{w}_j/\\vert \mathbf{w}_j\\vert

Vectors / length and distance

Distance between two points

d=∑i(pi−ri)2 d = \sqrt{\textstyle\sum_i (p_i - r_i)^2}

Length (norm) of a vector

vertvvert2=∑ivi2 \\vert \mathbf{v}\\vert _2 = \sqrt{\textstyle\sum_i v_i^2}

Unit vector in the direction of a vector

v^=v/vertvvert \hat{\mathbf{v}} = \mathbf{v}/\\vert \mathbf{v}\\vert

Vectors / products of vectors

Angle between two vectors

cos⁡θ=u⋅vvertuvert vertvvert \cos\theta = \frac{\mathbf{u}\cdot\mathbf{v}}{\\vert \mathbf{u}\\vert \,\\vert \mathbf{v}\\vert }

Area of the parallelogram (and triangle) spanned by two vectors

A=vertu×vvert=vertuvert2vertvvert2−(u⋅v)2 A = \\vert \mathbf{u}\times\mathbf{v}\\vert = \sqrt{\\vert \mathbf{u}\\vert ^2\\vert \mathbf{v}\\vert ^2 - (\mathbf{u}\cdot\mathbf{v})^2}

Cross product of two 3-D vectors

u×v=(u2v3−u3v2,  u3v1−u1v3,  u1v2−u2v1) \mathbf{u}\times\mathbf{v} = (u_2v_3-u_3v_2,\; u_3v_1-u_1v_3,\; u_1v_2-u_2v_1)

Dot product of two vectors

u⋅v=∑iuivi \mathbf{u}\cdot\mathbf{v} = \sum_i u_i v_i

Outer product of two vectors

(uvT)ij=uivj (\mathbf{u}\mathbf{v}^{T})_{ij} = u_i v_j

Scalar triple product (volume of a parallelepiped)

u⋅(v×w)=det⁡[u;v;w] \mathbf{u}\cdot(\mathbf{v}\times\mathbf{w}) = \det[\mathbf{u};\mathbf{v};\mathbf{w}]

Vectors / projections

Projection of one vector onto another

projvu=u⋅vv⋅v v \mathrm{proj}_{\mathbf{v}}\mathbf{u} = \frac{\mathbf{u}\cdot\mathbf{v}}{\mathbf{v}\cdot\mathbf{v}}\,\mathbf{v}

Vectors / vector arithmetic

Difference of two vectors

u−v=(u1−v1,…,un−vn) \mathbf{u}-\mathbf{v} = (u_1-v_1, \ldots, u_n-v_n)

Scalar multiple of a vector

kv=(kv1,…,kvn) k\mathbf{v} = (k v_1, \ldots, k v_n)

Sum of two vectors

u+v=(u1+v1,…,un+vn) \mathbf{u}+\mathbf{v} = (u_1+v_1, \ldots, u_n+v_n)

Out of scope

  • Open-ended explanation, essay writing or tutoring dialogue: it is a solver, not a chatbot.
  • Questions outside its certified linear algebra capabilities, and any question whose stated numbers it cannot all use — it refuses with the reason instead.
  • High-stakes engineering, medical or legal decisions without independent review.

Limitations

  • It answers what its certified capabilities cover (vectors, matrices, determinants, linear systems, eigenvalues, decompositions, least squares, sparse matrices and numerical methods (root finding, interpolation, quadrature)); anything else is refused with a reason.
  • ask() reads documented question forms and common phrasings; unusual wording may be refused — use solve() for guaranteed results.
  • Results are as correct as the certified relations and their stated conditions; a certified relation is a checked model, not a claim about every physical situation.

Citation

@software{linear_algebra_ai999x_1_0_3,
  title  = {linear-algebra-ai999x: an offline, verified linear algebra solver},
  author = {Farabi, Ibnul Jaif}, organization = {AI999X},
  year   = {2026}, version = {1.0.3},
  url    = {https://huggingface.co/AI999X/linear-algebra-ai999x}
}

Contact

Questions, bug reports and requests: open a discussion on https://huggingface.co/AI999X/linear-algebra-ai999x/discussions or visit https://ai999x.com.

Support the project

linear-algebra-ai999x is free and open source. If it helps you, you can support further development on Buy Me a Coffee.

Created and engineered by Ibnul Jaif Farabi · AI999X · ai999x.com

Downloads last month
38
Safetensors
Model size
4.72M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collections including AI999X/linear-algebra-ai999x

Evaluation results

  • identical on every platform on Golden answers (399 documented questions, Windows + Linux Python 3.10-3.14)
    self-reported
    1.000
  • right capability first on Capability search, 12998 held-out verified questions across all AI999X models
    self-reported
    0.918
  • in the top five on Capability search, 12998 held-out verified questions across all AI999X models
    self-reported
    0.988