Verification report

verifiedmethods · Unit A2: Iterative methods for linear systems · version 0.1.0a2

Student
Example student (reference implementation)
Matriculation number
EXAMPLE
Department
Mathematics
Institution
Example university
Supervisor
Example supervisor
Run
2026-11-18 09:18 UTC (local run)
Imports in steps.py
numpy
Student-code fingerprint
SHA-256 c15f069a751962e5a87c4be90f99f33a5520f637ed6b5dc49c1416414693a389
Check-suite fingerprint
SHA-256 2d6eeeb51b2c2275c528c717d5a7561790c1608d875a888537c78829e8de1f5e
Environment
Python 3.13.7, NumPy 2.5.4, SciPy 1.18.1, Matplotlib 3.11.2, Darwin 27.2.0

Summary

MethodResultGates passedrho(T) on L3Observed factor (G3)
Jacobi jacobi_sweepPASS4 / 40.9888310.988831
Gauss–Seidel gauss_seidel_sweepPASS4 / 40.9777860.977787
SOR sor_sweepPASS4 / 40.9316900.931690

A method passes when all four gates pass. On the specified Poisson problem, gate G3 accepts an average convergence factor over sweeps 100 to 200 within 0.1% of the spectral radius rho(T). This does not require every stepwise error ratio to equal rho(T). Details for each method follow the statement below.

Comparing the methods

Relative residual against sweep number on L3 for each implemented method, with dashed reference lines falling by rho(T) per sweep.
R3. Each residual curve should become parallel to its dashed line, which falls by rho(T) per sweep. Numbers: table R1.
Sweeps against the relaxation factor omega for SOR on L3.
R2. The number of sweeps is smallest near the theoretical optimum; numbers in table R2.

AI-use disclosure

Maintainer reference implementation; this is an example, not a student submission.

What this report shows

This report shows that the code with the student-code fingerprint above passed the gates marked PASS, using the check suite with the check-suite fingerprint above. It does not show who wrote the code.

To confirm it, copy the student's student folder into your own fresh copy of this unit and run python verify.py --strict. Your report should show the same gates and student-code fingerprint, and the check-suite fingerprint should match the stated checker on the unit's page at verifiedmethods.github.io. Keep the original versioned zip and its SHA-256 with the submission.

Jacobi jacobi_sweep

Gates (must pass)

#GateToleranceMeasuredResult
G1One sweep matches the method
One sweep from stored starting vectors on L1, L2 and L3 (n = 6). Only rounding separates a correct sweep from the stored values.
≤ 1e-12largest relative difference 0.0e+00PASS
G2No side effects
A sweep must return a new array and leave A, b and x unchanged; changing x in place is the most common bug in hand-written Gauss–Seidel code.
exactcorrectPASS
G3Observed convergence factor matches the spectral radius
On L3 (1D Poisson, n = 20), from x = 0: (||e_200|| / ||e_100||)^(1/100) against rho(T) from the eigenvalues of the iteration matrix.
relative difference ≤ 1e-03factor 0.988831; rho(T) = 0.988831PASS
G4Reaches the solution
L4 (2D Poisson, 36 unknowns), from x = 0.
residual ≤ 1e-10 within 5000 sweeps; error ≤ 1e-08212 sweeps; relative error 2.3e-10PASS

Reported results below have no pass mark: interpret them in your write-up.

R1. Sweeps to reach relative residual 1e-8 on L3 (1D Poisson)

Prediction: log(1e-8)/log(rho), the sweeps for the error to fall by 1e-8 if it falls by rho per sweep; it ignores constant factors.

nrho(T)predictionsweeps
100.959493445403
200.98883116401397
400.99706662694999

R4. When the method fails: L5 and L6

Relative error after the sweeps shown (at most 50), from x = 0.

Systemrho(T)sweepserrorbehaviour
L5: Symmetric positive definite, not diagonally dominant1.2000509.10e+03does not converge
L6: The classical counterexample0.000030.00e+00converges

R5. Residual against error (L3, n = 40)

At the stopping point: relative residual, relative error, and the bound cond(A) times the relative residual.

sweepscond(A)residualerrorbound
49996819.98e-093.80e-076.79e-06

Gauss–Seidel gauss_seidel_sweep

Gates (must pass)

#GateToleranceMeasuredResult
G1One sweep matches the method
One sweep from stored starting vectors on L1, L2 and L3 (n = 6). Only rounding separates a correct sweep from the stored values.
≤ 1e-12largest relative difference 0.0e+00PASS
G2No side effects
A sweep must return a new array and leave A, b and x unchanged; changing x in place is the most common bug in hand-written Gauss–Seidel code.
exactcorrectPASS
G3Observed convergence factor matches the spectral radius
On L3 (1D Poisson, n = 20), from x = 0: (||e_200|| / ||e_100||)^(1/100) against rho(T) from the eigenvalues of the iteration matrix.
relative difference ≤ 1e-03factor 0.977787; rho(T) = 0.977786PASS
G4Reaches the solution
L4 (2D Poisson, 36 unknowns), from x = 0.
residual ≤ 1e-10 within 5000 sweeps; error ≤ 1e-08107 sweeps; relative error 2.1e-10PASS

Reported results below have no pass mark: interpret them in your write-up.

R1. Sweeps to reach relative residual 1e-8 on L3 (1D Poisson)

Prediction: log(1e-8)/log(rho), the sweeps for the error to fall by 1e-8 if it falls by rho per sweep; it ignores constant factors.

nrho(T)predictionsweeps
100.920627223203
200.977786820700
400.99414031342501

R4. When the method fails: L5 and L6

Relative error after the sweeps shown (at most 50), from x = 0.

Systemrho(T)sweepserrorbehaviour
L5: Symmetric positive definite, not diagonally dominant0.4648481.92e-16converges
L6: The classical counterexample2.0000376.09e+12does not converge

R5. Residual against error (L3, n = 40)

At the stopping point: relative residual, relative error, and the bound cond(A) times the relative residual.

sweepscond(A)residualerrorbound
25016819.97e-093.78e-076.78e-06

SOR sor_sweep

Gates (must pass)

#GateToleranceMeasuredResult
G1One sweep matches the method
One sweep from stored starting vectors on L1, L2 and L3 (n = 6) with omega = 1.25. Only rounding separates a correct sweep from the stored values.
≤ 1e-12largest relative difference 0.0e+00PASS
G2No side effects
A sweep must return a new array and leave A, b and x unchanged; changing x in place is the most common bug in hand-written Gauss–Seidel code.
exactcorrectPASS
G3Observed convergence factor matches the spectral radius
On L3 (1D Poisson, n = 20), omega = 1.5, from x = 0: (||e_200|| / ||e_100||)^(1/100) against rho(T) from the eigenvalues of the iteration matrix.
relative difference ≤ 1e-03factor 0.931690; rho(T) = 0.931690PASS
G4Reaches the solution
L4 (2D Poisson, 36 unknowns), omega = 1.5, from x = 0.
residual ≤ 1e-10 within 5000 sweeps; error ≤ 1e-0838 sweeps; relative error 1.5e-11PASS

Reported results below have no pass mark: interpret them in your write-up.

R1. Sweeps to reach relative residual 1e-8 on L3 (1D Poisson)

Prediction: log(1e-8)/log(rho), the sweeps for the error to fall by 1e-8 if it falls by rho per sweep; it ignores constant factors.

nomega (optimal)rho(T)predictionsweeps
101.56040.5603883238
201.74060.7405806170
401.85780.857788120131

R2. SOR: sweeps against omega (L3, n = 20)

Theoretical optimum: omega = 1.7406.

omegarho(T)sweeps
1.000.9778700
1.050.9754633
1.100.9728572
1.150.9699516
1.200.9666465
1.250.9629417
1.300.9586374
1.350.9535333
1.400.9476295
1.450.9405260
1.500.9317226
1.550.9205194
1.600.9056164
1.650.8842134
1.700.8479103
1.750.750068
1.800.800084
1.850.8500123
1.900.9000186
1.950.9500375

R4. When the method fails: L5 and L6

Relative error after the sweeps shown (at most 50), from x = 0, omega = 1.25.

Systemrho(T)sweepserrorbehaviour
L5: Symmetric positive definite, not diagonally dominant0.4771501.81e-16converges
L6: The classical counterexample5.6448173.36e+12does not converge

R5. Residual against error (L3, n = 40)

At the stopping point: relative residual, relative error, and the bound cond(A) times the relative residual.

sweepscond(A)residualerrorbound
1316819.49e-091.04e-076.46e-06