Coding agents write matrix code quickly, but they like to reach for the explicit inverse, mix up axes when broadcasting or miss that a matrix is close to singular. The script runs without errors and the result is still useless. This training shows how to get reliable linear algebra code with coding agents: let the agent choose and justify suitable solvers and factorisations, check condition numbers and residuals, handle sparse matrices properly and write tests that genuinely catch numerical errors. You work with NumPy and SciPy on problems from your field and build a rules file that holds your agent to these standards in future.
Who the linear algebra training is for
Engineers, data scientists, computing teams and lecturers who work with matrices in Python, for example in simulation, least-squares fitting, control engineering or image processing.
What you'll walk away with
- Choose a suitable solver or factorisation for a linear system and have the agent justify the choice
- Compute condition number, residual and backward error and judge how far a result can be trusted
- Store and solve sparse matrices with SciPy without accidentally falling back to dense arithmetic
- Write tests with constructed matrices of known properties and tolerances that match the conditioning
- Maintain a rules file for the agent covering array shapes, data types and unwanted shortcuts
Typical scenarios
- An agent solved a least-squares fit through the normal equations; switching to a QR factorisation removes the unstable coefficients that appeared with nearly collinear measurement series.
- A finite-difference model with many unknowns ran painfully slowly because the agent had built a dense matrix; with sparse storage and a suitable solver it runs on a laptop again.
- A university chair has test cases with known spectra generated for its eigenvalue exercise, so that students can check their own implementations against them.
Does this fit your team?
Pick a few dates that suit you. The request is non-binding, and the agenda is tailored in a short call beforehand.
What the linear algebra training covers
- Typical errors in agent-written matrix codeThe explicit inverse, wrong broadcasting axes, silent type conversions and confused row and column order, shown with real examples.
- Choosing solvers and factorisations deliberatelyLU, Cholesky, QR and the singular value decomposition: when each fits and how to get a reasoned choice from the agent.
- Conditioning, residuals and error estimatesYou measure how sensitive a problem is to perturbations and have results always reported with residual and backward error.
- Sparse and large systemsStorage formats in SciPy, iterative solvers, preconditioning and the question of when a dense computation is good enough.
- Tests and the rules fileTest matrices with known properties, justified tolerances and an instruction file that anchors these rules in the repository.
Before the linear algebra training: prerequisites
- Basic Python and NumPy, and linear algebra at university level
- A laptop with NumPy, SciPy and a coding agent cleared for use on your code
- Optionally a script of your own with matrix computations you want to improve
Materials you keep
- A decision guide for solvers and factorisations with typical use cases
- Test templates for linear algebra with constructed matrices and justified tolerances
- A rules file for coding agents with conventions for numerical matrix code