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
| Method | Result | Gates passed | rho(T) on L3 | Observed factor (G3) |
|---|---|---|---|---|
| Jacobi jacobi_sweep | PASS | 4 / 4 | 0.988831 | 0.988831 |
| Gauss–Seidel gauss_seidel_sweep | PASS | 4 / 4 | 0.977786 | 0.977787 |
| SOR sor_sweep | PASS | 4 / 4 | 0.931690 | 0.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
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)
| # | Gate | Tolerance | Measured | Result |
|---|---|---|---|---|
| G1 | One 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-12 | largest relative difference 0.0e+00 | PASS |
| G2 | No 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. | exact | correct | PASS |
| G3 | Observed 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-03 | factor 0.988831; rho(T) = 0.988831 | PASS |
| G4 | Reaches the solution L4 (2D Poisson, 36 unknowns), from x = 0. | residual ≤ 1e-10 within 5000 sweeps; error ≤ 1e-08 | 212 sweeps; relative error 2.3e-10 | PASS |
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.
| n | rho(T) | prediction | sweeps |
|---|---|---|---|
| 10 | 0.959493 | 445 | 403 |
| 20 | 0.988831 | 1640 | 1397 |
| 40 | 0.997066 | 6269 | 4999 |
R4. When the method fails: L5 and L6
Relative error after the sweeps shown (at most 50), from x = 0.
| System | rho(T) | sweeps | error | behaviour |
|---|---|---|---|---|
| L5: Symmetric positive definite, not diagonally dominant | 1.2000 | 50 | 9.10e+03 | does not converge |
| L6: The classical counterexample | 0.0000 | 3 | 0.00e+00 | converges |
R5. Residual against error (L3, n = 40)
At the stopping point: relative residual, relative error, and the bound cond(A) times the relative residual.
| sweeps | cond(A) | residual | error | bound |
|---|---|---|---|---|
| 4999 | 681 | 9.98e-09 | 3.80e-07 | 6.79e-06 |
Gauss–Seidel gauss_seidel_sweep
Gates (must pass)
| # | Gate | Tolerance | Measured | Result |
|---|---|---|---|---|
| G1 | One 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-12 | largest relative difference 0.0e+00 | PASS |
| G2 | No 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. | exact | correct | PASS |
| G3 | Observed 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-03 | factor 0.977787; rho(T) = 0.977786 | PASS |
| G4 | Reaches the solution L4 (2D Poisson, 36 unknowns), from x = 0. | residual ≤ 1e-10 within 5000 sweeps; error ≤ 1e-08 | 107 sweeps; relative error 2.1e-10 | PASS |
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.
| n | rho(T) | prediction | sweeps |
|---|---|---|---|
| 10 | 0.920627 | 223 | 203 |
| 20 | 0.977786 | 820 | 700 |
| 40 | 0.994140 | 3134 | 2501 |
R4. When the method fails: L5 and L6
Relative error after the sweeps shown (at most 50), from x = 0.
| System | rho(T) | sweeps | error | behaviour |
|---|---|---|---|---|
| L5: Symmetric positive definite, not diagonally dominant | 0.4648 | 48 | 1.92e-16 | converges |
| L6: The classical counterexample | 2.0000 | 37 | 6.09e+12 | does 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.
| sweeps | cond(A) | residual | error | bound |
|---|---|---|---|---|
| 2501 | 681 | 9.97e-09 | 3.78e-07 | 6.78e-06 |
SOR sor_sweep
Gates (must pass)
| # | Gate | Tolerance | Measured | Result |
|---|---|---|---|---|
| G1 | One 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-12 | largest relative difference 0.0e+00 | PASS |
| G2 | No 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. | exact | correct | PASS |
| G3 | Observed 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-03 | factor 0.931690; rho(T) = 0.931690 | PASS |
| G4 | Reaches the solution L4 (2D Poisson, 36 unknowns), omega = 1.5, from x = 0. | residual ≤ 1e-10 within 5000 sweeps; error ≤ 1e-08 | 38 sweeps; relative error 1.5e-11 | PASS |
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.
| n | omega (optimal) | rho(T) | prediction | sweeps |
|---|---|---|---|---|
| 10 | 1.5604 | 0.560388 | 32 | 38 |
| 20 | 1.7406 | 0.740580 | 61 | 70 |
| 40 | 1.8578 | 0.857788 | 120 | 131 |
R2. SOR: sweeps against omega (L3, n = 20)
Theoretical optimum: omega = 1.7406.
| omega | rho(T) | sweeps |
|---|---|---|
| 1.00 | 0.9778 | 700 |
| 1.05 | 0.9754 | 633 |
| 1.10 | 0.9728 | 572 |
| 1.15 | 0.9699 | 516 |
| 1.20 | 0.9666 | 465 |
| 1.25 | 0.9629 | 417 |
| 1.30 | 0.9586 | 374 |
| 1.35 | 0.9535 | 333 |
| 1.40 | 0.9476 | 295 |
| 1.45 | 0.9405 | 260 |
| 1.50 | 0.9317 | 226 |
| 1.55 | 0.9205 | 194 |
| 1.60 | 0.9056 | 164 |
| 1.65 | 0.8842 | 134 |
| 1.70 | 0.8479 | 103 |
| 1.75 | 0.7500 | 68 |
| 1.80 | 0.8000 | 84 |
| 1.85 | 0.8500 | 123 |
| 1.90 | 0.9000 | 186 |
| 1.95 | 0.9500 | 375 |
R4. When the method fails: L5 and L6
Relative error after the sweeps shown (at most 50), from x = 0, omega = 1.25.
| System | rho(T) | sweeps | error | behaviour |
|---|---|---|---|---|
| L5: Symmetric positive definite, not diagonally dominant | 0.4771 | 50 | 1.81e-16 | converges |
| L6: The classical counterexample | 5.6448 | 17 | 3.36e+12 | does 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.
| sweeps | cond(A) | residual | error | bound |
|---|---|---|---|---|
| 131 | 681 | 9.49e-09 | 1.04e-07 | 6.46e-06 |