API reference¶
The trusted core (rational, poly, model, certificate, checker)
uses only the standard library and exact arithmetic. The search side
(solver, candidate, search) uses numpy and only proposes certificates.
Checker¶
twindex.checker
¶
The certificate checker (trusted core). Exact rational arithmetic only.
Mathematical basis (proved in docs/THEORY.md):
(T1) For theta >= 0 the problem has a unique classical solution u_theta. (T2) If p(0) = p(1) = 0 and |-p'' + q p^3 - 1| <= rho on [0, 1], then |u_theta(x) - p(x)| <= rho * x (1 - x) / 2 on [0, 1]. (T3) For fixed p the residual is affine in theta, so for theta in c +- h, sup |r(.; theta)| <= sup |r(.; c)| + sum_j h_j sup |B_j p^3|.
Consequences at a sensor x_i with s_i = rho * x_i (1 - x_i) / 2: |p(x_i) - y_i| + s_i <= eps proves |u(x_i) - y_i| <= eps, |p(x_i) - y_i| - s_i > eps proves |u(x_i) - y_i| > eps.
check_witness(problem, theta, p, depth=DEFAULT_DEPTH)
¶
Claim: theta is in C_y. VALID proves it; INVALID means malformed or disproved.
Source code in twindex/checker.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
check_pair(problem, w1, w2, claimed_gap, depth=DEFAULT_DEPTH)
¶
Claim: both thetas are in C_y and |theta_k - theta'_k| >= claimed_gap.
Source code in twindex/checker.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
box_residual_bound(center, half_width, p, depth=DEFAULT_DEPTH, cache=None, model=V1_MODEL)
¶
Upper bound of sup_{x in [0,1], theta in center +- half_width} |r(x; theta)| (T3).
Source code in twindex/checker.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
monotone_hypotheses(problem, depth=12)
¶
Check the hypotheses of THEORY Theorem 6: alpha, beta >= 0 and g >= 0 on [0, 1].
VALID: proved. INVALID: disproved. INCONCLUSIVE: g >= 0 not decided at depth.
Source code in twindex/checker.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
check_box(problem, center, half_width, p, status, depth=DEFAULT_DEPTH, sensitivities=(), corners=None)
¶
Claim: B = center +- half_width lies inside C_y ('inside') or misses it ('outside').
With sensitivities the candidate is the affine family p + sum_j D_j s_j.
With corners = (p_lo, p_hi) (and p=None) the box is decided by the
monotone two-corner bound of THEORY Theorem 6.
Source code in twindex/checker.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
check_paving(problem, paving, depth=DEFAULT_DEPTH)
¶
Verify a SIVIA paving and its claim lower <= D_Q(y) <= upper (DESIGN.md section 6).
Source code in twindex/checker.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | |
check_certificate(cert, depth=DEFAULT_DEPTH)
¶
Check a parsed Certificate or a raw decoded-JSON dict.
Source code in twindex/checker.py
831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 | |
Certificates¶
twindex.certificate
¶
Certificate JSON format v1: strict parsing, validation and construction (trusted core).
See docs/DESIGN.md section 6. Every number is a JSON string holding an exact rational. Unknown keys are rejected so that typos cannot silently drop a field.
CertificateError
¶
Bases: ValueError
The certificate is malformed (a structural or hypothesis violation).
Source code in twindex/certificate.py
64 65 | |
Transform
dataclass
¶
Oriented paving coordinates: theta = origin + matrix @ phi, phi in the root box.
Source code in twindex/certificate.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
parse_certificate(obj)
¶
Validate a decoded JSON object and return a typed Certificate.
Raises CertificateError on any structural problem.
Source code in twindex/certificate.py
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | |
loads_certificate_json(text)
¶
Decode certificate JSON text under strict budgets.
Rejected: JSON floats, NaN and Infinity; duplicate object keys (ambiguous certificates); integer literals longer than MAX_JSON_INT_DIGITS digits; nesting deeper than MAX_JSON_DEPTH; input larger than MAX_CERTIFICATE_BYTES.
Source code in twindex/certificate.py
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | |
read_certificate_json(path)
¶
Decode a certificate file under the budgets of :func:loads_certificate_json.
Source code in twindex/certificate.py
707 708 709 710 711 712 713 | |
load_certificate(path)
¶
Read and parse a (1-D) certificate file. JSON numbers that are floats are rejected.
Source code in twindex/certificate.py
716 717 718 | |
make_box_certificate(problem, center, half_width, p, status, provenance=None, sensitivities=None, corners=None)
¶
Box certificate with a single candidate p (optionally an affine family via
sensitivities) or, with p=None, a monotone corners=(p_lo, p_hi) box.
Source code in twindex/certificate.py
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | |
make_paving_certificate(problem, candidates, tree, upper, lower=None, provenance=None, transform=None)
¶
Build a paving certificate.
tree uses the JSON node shape of DESIGN.md section 6; at values may be
Fractions and are formatted here. transform=(origin, matrix, root) makes it
oriented (THEORY Theorem 8): leaves are boxes in phi, theta = origin + matrix @ phi.
Source code in twindex/certificate.py
818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 | |
dump_certificate(cert, path)
¶
Write a certificate dict as pretty JSON (validating it first).
Source code in twindex/certificate.py
885 886 887 888 889 890 | |
Model¶
twindex.model
¶
The boundary value problem and its exact building blocks (trusted core).
-u''(x) + q(x; theta) f(u(x)) = g(x) on (0, 1), u(0) = alpha, u(1) = beta,
q(x; theta) = sum_{j=0..d} theta_j B_j(x), B_j(x) = C(d, j) x^j (1 - x)^(d - j),
f(u) = sum_m a_m u^m with odd m and a_m >= 0, g a polynomial.
The default Model() is the original v1 problem: d = 3, f(u) = u^3, g = 1.
Every hypothesis the checker relies on (theta >= 0 so that q >= 0, odd powers
with nonnegative coefficients so that f is nondecreasing) is enforced here.
ProblemError
¶
Bases: ValueError
A problem instance or parameter vector violates a hypothesis.
Source code in twindex/model.py
47 48 | |
Model
dataclass
¶
The equation: coefficient degree, source term and nonlinearity.
nonlinearity lists (m, a_m) pairs; zero coefficients are dropped and
the pairs are stored sorted by power.
Source code in twindex/model.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
theta(theta)
¶
Parse a parameter vector exactly and check its length.
Source code in twindex/model.py
120 121 122 123 124 125 126 127 128 | |
q(theta)
¶
q(x; theta) = sum_j theta_j B_j(x).
Source code in twindex/model.py
130 131 132 133 134 135 | |
f_of(p)
¶
f(p) = sum_m a_m p^m, exactly.
Source code in twindex/model.py
137 138 139 140 141 142 | |
residual(p, theta)
¶
r = -p'' + q(.; theta) f(p) - g, exactly.
Source code in twindex/model.py
144 145 146 | |
Problem
dataclass
¶
A problem instance. All values are exact rationals.
Invariants (checked in __post_init__): sensors lie in the open interval
(0, 1) and are distinct; one datum per sensor; epsilon > 0; the box has one
interval per model parameter with 0 <= lo <= hi; 0 <= target < num_params.
Source code in twindex/model.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
build(sensors, data, epsilon, box, target=0, model=V1_MODEL)
staticmethod
¶
Construct from loosely typed values, parsing every number exactly.
Source code in twindex/model.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
bernstein_basis(d)
¶
Bernstein basis B_0..B_d of degree d on [0, 1]: nonnegative there, summing to 1.
Source code in twindex/model.py
51 52 53 | |
q_poly(theta)
¶
q(x; theta) for the v1 model (cubic Bernstein coefficient).
Source code in twindex/model.py
163 164 165 | |
residual(p, theta)
¶
r = -p'' + q p^3 - 1 for the v1 model.
Source code in twindex/model.py
168 169 170 | |
barrier(x)
¶
x (1 - x) / 2: the barrier factor in |u - p| <= rho * x (1 - x) / 2.
Source code in twindex/model.py
173 174 175 176 | |
Polynomials¶
twindex.poly
¶
Exact rational polynomials and certified sup-norm bounds on [0, 1].
Part of the trusted core: standard library only, no floating point.
The sup bound rests on two classical facts about the Bernstein form
p(x) = sum_i b_i C(n, i) x^i (1 - x)^(n - i) on [0, 1]:
- the basis polynomials are nonnegative and sum to 1, so
|p(x)| <= max_i |b_i|; b_0 = p(0)andb_n = p(1), so endpoint coefficients are attained values.
De Casteljau subdivision at x = 1/2 gives the Bernstein coefficients of the two halves exactly, which tightens the bound (fact 1 applied piecewise) while fact 2 supplies a lower bound used for pruning. All arithmetic is on Python integers.
Poly
¶
Immutable polynomial with exact rational coefficients in the monomial basis.
coeffs[k] multiplies x**k. Trailing zero coefficients are stripped, so
the zero polynomial has coeffs == () and degree -1.
Source code in twindex/poly.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
bernstein_coeffs(p, n=None)
¶
Exact Bernstein coefficients of p of degree n (default max(deg p, 0)) on [0, 1].
Uses b_i = sum_{k <= i} C(i, k) / C(n, k) * a_k.
Source code in twindex/poly.py
168 169 170 171 172 173 174 175 176 177 178 179 180 | |
sup_abs_bound(p, depth=6)
¶
Certified upper bound on max_{x in [0, 1]} |p(x)|.
Exact: never smaller than the true maximum. depth bounds the number of
bisection levels (at most 2**depth leaves). Pieces whose Bernstein bound
cannot exceed an attained endpoint value are pruned.
Source code in twindex/poly.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
nonneg_status(p, depth=8)
¶
Decide p >= 0 on [0, 1] exactly, where possible.
Returns True when proved (every Bernstein coefficient of every leaf piece is
= 0, so each piece is a convex combination of nonnegative numbers), False when disproved (some attained value b_0 or b_n of a piece is negative), and None when
depthbisection levels decide neither.
Source code in twindex/poly.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
Rationals¶
twindex.rational
¶
Exact rational parsing and formatting for the trusted core.
Every number that enters a certificate is an exact rational written as a string:
an integer ("-3"), a fraction ("22/7"), or a finite decimal ("0.125",
"1e-3"). Python floats are rejected outright, because a float has usually
been rounded already and silently accepting one would hide that.
RationalError
¶
Bases: ValueError
Raised when a value is not an acceptable exact rational.
Source code in twindex/rational.py
34 35 | |
parse_rational(value)
¶
Parse an exact rational.
Accepts int, Fraction, or a string holding an integer, a/b with
b > 0, or a finite decimal with optional exponent. Rejects bool,
float, nan/inf and anything else.
Source code in twindex/rational.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
format_rational(q)
¶
Canonical string form: "a" for integers, "a/b" otherwise (lowest terms).
Source code in twindex/rational.py
79 80 81 82 83 84 | |
Search (untrusted)¶
twindex.search
¶
Untrusted, deterministic local witness search; every output is checked exactly.
This is a heuristic lower-bound search, with no claim of global optimality. Adaptive SIVIA retains every undecided box in a certified outer enclosure.
make_problem(theta_bar, sensors, eps, box, *, target=0, model=V1_MODEL, n=48, digits=12)
¶
Round synthetic data to decimals and certify the generating parameter.
Raises RuntimeError if rounding or the candidate prevents exact certification.
Source code in twindex/search.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
find_pair(problem, *, seed=None, n=48, rounds=3, digits=6, depth=6)
¶
Locally enlarge the target gap, rationalise, then certify both witnesses.
Start from a feasible seed (default: prior midpoint). Use target-coordinate steps and least-squares sensor compensation in the other coordinates. Bisection accepts only numerical sensor deviations below 0.9 epsilon. Final exact checks also require rho/8 <= epsilon/10. Failure raises; numerical feasibility alone never produces an output certificate.
Source code in twindex/search.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
sivia(problem, max_leaves=64, min_width='1/100', *, n=32, depth=6, candidate_factory=None, affine=None, mode='auto', priority='width', branching_policy='widest')
¶
Build a bounded adaptive paving, then replay every claim exactly.
Bisect the widest coordinate (target first on ties), processing boxes with
the widest target projection first. Numerical failures and budget-limited
boxes remain unresolved, so even an unfinished search has an honest upper
bound. candidate_factory(center) may supply an alternative exact Poly.
mode selects auto (monotone when its hypotheses certify, else affine),
monotone, affine, or plain. The legacy affine flag explicitly selects
affine/plain and cannot be combined with a non-auto mode.
Affine mode tries undecided plain boxes with centred
finite-difference sensitivities of exact candidates. Probes stay in the
prior; fixed coordinates use zero sensitivities. Failed probes or oversized
expansions fall back to the plain result. No convergence or tightness is
promised by this heuristic. priority="boundary" processes boxes nearest
the prior target endpoints first, to focus on tightening the outer diameter.
Source code in twindex/search.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | |
twindex.solver
¶
Untrusted floating-point Chebyshev collocation for the model BVP.
Coefficients use numpy's convention: sum c[k] T_k(2*x-1). Numerical convergence is only a diagnostic; only the exact checker can certify a solution.
residual(coeffs, theta, x, model=V1_MODEL)
¶
Evaluate -p'' + q*f(p) - g at physical points x (untrusted).
Source code in twindex/solver.py
40 41 42 43 44 45 46 47 | |
solve_bvp(theta, n=48, tol=1e-13, max_iter=50, *, model=V1_MODEL)
¶
Return n+1 Chebyshev coefficients, using n+1 Lobatto nodes.
Newton's equations include both boundary conditions. A backtracking line search requires a decreasing equation residual. Raise RuntimeError when the iteration budget is exhausted; low degree can still underresolve the continuous equation, so check the residual off the collocation grid too.
Source code in twindex/solver.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
twindex.candidate
¶
Untrusted conversion to exact monomial candidates with exact prescribed BCs.
to_candidate(coeffs, bits=60, degree=None, *, boundary=(0, 0))
¶
Return exact monomial coefficients, constant first.
Subtract the linear lift for the exact rational boundary=(alpha, beta).
Divide the remaining floating Chebyshev polynomial by x(1-x), discard its boundary
remainder, and round the quotient's Chebyshev coefficients to dyadics.
Convert the quotient EXACTLY using T_(k+1)=2(2x-1)T_k-T_(k-1), then
multiply by x(1-x). No floating monomial conversion is performed.
degree optionally truncates the quotient before exact conversion.
Add the lift back exactly, so endpoint values never depend on rounding.
Source code in twindex/candidate.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
General numerical audit (untrusted)¶
These reports contain numerical evidence, not checker verdicts or certificates. See Audit any forward model for interpretation and examples.
twindex.general
¶
Numerical evidence of ambiguity for user-supplied forward maps (UNTRUSTED).
These reports are not certificates and never carry checker verdicts. A small observed range, full-rank Jacobian, or unsuccessful search proves no uniqueness.
AuditReport
dataclass
¶
JSON-ready numerical evidence; endpoints have fresh forward evaluations.
parameters[k].observed_gap is a gap between sampled feasible points,
never a global upper bound. Local LP ranges describe a linear approximation.
Source code in twindex/general.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
to_dict()
¶
Return a JSON-serializable report, distinct from certificate JSON.
Source code in twindex/general.py
38 39 40 | |
CertifiedAuditResult
dataclass
¶
Separate numerical snapshot and exact replay attempts, including failures.
Source code in twindex/general.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
typed(*, depth=6)
¶
One independently replayed outcome per audited coordinate.
The numerical snapshot stays separate at .numerical; no endpoint or failed generation is silently promoted to a certificate.
Source code in twindex/general.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
audit_model(forward, data, prior, epsilon, *, estimate=None, jacobian=None, starts=4, seed=0, max_iter=200, diff_step=1e-05, rank_rtol=None)
¶
Audit any deterministic forward(theta) -> measurements callable.
Requires twindex[general]. data is a nonempty vector, prior an
(N, 2) finite box (fixed coordinates allowed), and epsilon a positive
scalar or per-measurement vector. Only bounded componentwise noise is used.
A supplied jacobian(theta) has shape (M, N), in physical parameter units.
Default relative rank tolerance is max(1e-7, diff_step) for finite differences,
or max(M, Nfree)*machine_epsilon for supplied derivatives. rank_rtol
overrides it; all rank diagnostics remain numerical evidence.
Parameters are scaled to their prior widths and residuals to epsilon. The
reference point is the best bounded least-squares fit from starts starts
(including estimate or the midpoint). Local SVD and LP diagnostics are
followed by multistart nonlinear constrained endpoint searches. All accepted
endpoints are re-evaluated without relaxing the noise or prior constraints.
Solver success alone never establishes feasibility. Forward failures or
malformed outputs raise; stochastic and stateful maps are unsupported.
Source code in twindex/general.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
certify_audit(report, problem, theta_map=None, *, target_map=None, n=32, depth=6, shrink_factors=('1', '9/10', '1/2'), digits=12)
¶
Replay numerical endpoints against an explicitly supplied exact 1-D Problem.
The caller asserts correspondence of the callable and exact problem. This function cannot establish that assertion. By default coordinates correspond in order. A custom theta_map requires target_map[k], the exact target index to certify for audit coordinate k. A map need not preserve separation: each claim uses the actual mapped rational gap. No upper bound is attempted.
Source code in twindex/general.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |