Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/patches/4d1cec9c2604b819 # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/omega-mv#372 (code only) closed derived `4d1cec9c2604b819` #372 Imported from GitHub aien-dev/omega-mv#372 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `05afc0fdad94873759987956f010bdb139f29bd1` · Head `82c681556feb0b9ec3c4e4a988d4175039b97e3d` ### Apply it ``` git checkout -b patch-4d1cec9c2604b819 05afc0fdad94873759987956f010bdb139f29bd1 curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/4d1cec9c2604b819.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/omega-mv 372 82c681556feb0b9ec3c4e4a988d4175039b97e3d ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":372,"url":"https://github.com/aien-dev/omega-mv/pull/372","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:34Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 5247cae54..51c94f682 100644 --- a/.crumb +++ b/.crumb @@ -46,74 +46,74 @@ "children": [ { "digest": "fb7cc6e608fdbe68a9735a1313285782b9717ff12bde17343f8ce635de3644f6", - "last_commit": "190ff891", + "last_commit": "62b6a28", "name": "calibration", "purpose": "Directory calibration. Purpose not yet described by a human." }, { "digest": "24d7c03a26a7ffe9b181b73585480b5801289accbdf63146edbc36cf3e1cf21f", - "last_commit": "6637b32b", + "last_commit": "6637b32", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, { "digest": "536f7b8db9a92a1f586bad4379d47544a30d1b8e83c2d799c18e66cf8660c9ae", - "last_commit": "30bb116c", + "last_commit": "62b6a28", "name": "doctrine", "purpose": "Directory doctrine. Purpose not yet described by a human." }, { "digest": "d9fc697e5709ba2f0facb12f9a0ec8f4aa01474882c8d0311da037c00b8e7338", - "last_commit": "7843a748", + "last_commit": "7843a74", "name": "mk", "purpose": "Directory mk. Purpose not yet described by a human." }, { "digest": "69cbb8ef13ccce47ccc21f159e95f1eac58679319e2cc25937065f95c4eb9207", - "last_commit": "ae8c7c54", + "last_commit": "62b6a28", "name": "polyglot", "purpose": "Directory polyglot. Purpose not yet described by a human." }, { - "digest": "ef43c9a5070e73a73b0a0e3fc96324e33c5c95f0061eb4174de20d33a8bca08e", - "last_commit": "bacc4b6b", + "digest": "3c5265c592dfea3520521c55f789a97014b081fd81b5e7bd8e4f685490ab0a01", + "last_commit": "3bb365b", "name": "research", "purpose": "Directory research. Purpose not yet described by a human." }, { "digest": "830ce7faaea9ae86190aa304fd8d7797881fbaca9d14fc39a327d202712f73fb", - "last_commit": "9e168fc8", + "last_commit": "9e168fc", "name": "spec", "purpose": "Directory spec. Purpose not yet described by a human." }, { "digest": "c06c116644765d66e2c7346e99179861cbb7bba7e8e932ff40b6c51983d90d01", - "last_commit": "22f7fb72", + "last_commit": "22f7fb7", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { "digest": "6632b2d7fadadd84a7188d5ddefc5029ba0c0492cd29672269dd2b198f787112", - "last_commit": "19f73c70", + "last_commit": "19f73c7", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { "digest": "acd42de9387a133f34b4b6afca962c82d340fba67c6a770a74852406769b4186", - "last_commit": "7683eaaa", + "last_commit": "7683eaa", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:022ae91b39c37b6aaafb2fd952d1cbf4fdfc81303fcdd7b2cec489072de397c6", - "compiled_at": "2026-10-10T03:04:12Z", + "children_root": "sha256:f3c767c48e0f6951118a51fe813553053d6a7f99cf08d3764eb2aca676541e5b", + "compiled_at": "2026-10-10T03:25:07Z", "compiler": "crumb-compile/1", - "digest": "sha256:d69f5211854cc687a4a5f751fbcb1ef18dcce1dbc6fe7182bed0bea516a34abe", + "digest": "sha256:3d32abfc784c29969348ec0571ffa8e3ee5c075f0dd6d38a644b3812d02c4acc", "evidence_files": 5533, "evidence_root": "sha256:8ca3b3e15e055b21c3e96200e3c76f26c3b139e6db06f5a94bc62c97f67157f5", - "files": 7734, - "generated_at_commit": "6637b32b6bf9942ab624ec7e95fd1576f3abe909", - "source_tree": "sha256:ae5bb7ed74053fb01117e6075dec709ee830bdd5a0d644a9cb46d12cd955f817" + "files": 7794, + "generated_at_commit": "3bb365b850107cafd3938ec5100c56629c2055e6", + "source_tree": "sha256:b319ba36a9e330ba732855764dda71d2e047f0d7463e04d8b0d78899d1f62a13" }, "owner_lane": "", "provenance": { diff --git a/research/.crumb b/research/.crumb index 67c417647..318e908ad 100644 --- a/research/.crumb +++ b/research/.crumb @@ -21,27 +21,27 @@ "generated": { "children": [ { - "digest": "0074f53a15e7c9bb3f43093a92c33de8707d18af0f8d1836aa8e1ce3d2c6525c", - "last_commit": "ff9210e0", + "digest": "05f79da818f3feaf713351c4ca1871857f9c8f53d7e30c85f1a368c880b216ed", + "last_commit": "3bb365b", "name": "atemporal", "purpose": "AT-0 Clock-Free Universe research program: relational (Page-Wootters) quantum models with no ext" }, { "digest": "7597531ca9a2cdce9e840dda55ce639f86c4237eda3f2e3d1d5b10c599966a33", - "last_commit": "458c57f5", + "last_commit": "62b6a28", "name": "dirac-oracle", "purpose": "Directory research/dirac-oracle. Purpose not yet described by a human." } ], - "children_root": "sha256:389b49365a8f16bd0f0bf8843630dc75d66c446d6e7e98bcc097fe580fbc9a37", - "compiled_at": "2026-10-10T00:57:37Z", + "children_root": "sha256:3a052883492cfa24539ee6c5909d40ea840407c82f1bdc223ce03bc914f23261", + "compiled_at": "2026-10-10T03:25:07Z", "compiler": "crumb-compile/1", - "digest": "sha256:ef43c9a5070e73a73b0a0e3fc96324e33c5c95f0061eb4174de20d33a8bca08e", + "digest": "sha256:3c5265c592dfea3520521c55f789a97014b081fd81b5e7bd8e4f685490ab0a01", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 335, - "generated_at_commit": "ff9210e09293af5eee705084cc8888cd52bfd44c", - "source_tree": "sha256:72c5d0ad1b2ee85db40b99f5671f6d3ffbe7017502b5a111cddb821a9c62a080" + "files": 395, + "generated_at_commit": "3bb365b850107cafd3938ec5100c56629c2055e6", + "source_tree": "sha256:ddbf9a9d76f9277c3016e42945e126cb0d822404ffbb5bf4663954efbb911596" }, "owner_lane": "", "provenance": { diff --git a/research/atemporal/.crumb b/research/atemporal/.crumb index 4d779d023..7952d31c6 100644 --- a/research/atemporal/.crumb +++ b/research/atemporal/.crumb @@ -4,20 +4,20 @@ "children": [ { "digest": "b5ce051e4052120508499aeed3c249cbc4ef5c0e46b2386e8a8916c7bdb9f7f9", - "last_commit": "ff9210e0", + "last_commit": "bacc4b6", "name": "at0", "purpose": "AT-0 V1: finite clock plus one qubit under the AT0_CASE_V1 / AT0_RESULT_V1 contracts" } ], "children_root": "sha256:f7bd1d7019a69ef57140cd019f86634f3cb80c1e31ca3063dfdf73ac9deef7c6", - "compiled_at": "2026-10-10T00:57:37Z", + "compiled_at": "2026-10-10T03:25:07Z", "compiler": "crumb-compile/1", - "digest": "sha256:0074f53a15e7c9bb3f43093a92c33de8707d18af0f8d1836aa8e1ce3d2c6525c", + "digest": "sha256:05f79da818f3feaf713351c4ca1871857f9c8f53d7e30c85f1a368c880b216ed", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 189, - "generated_at_commit": "ff9210e09293af5eee705084cc8888cd52bfd44c", - "source_tree": "sha256:eb5284f230763c0500674b8ea743884fbe30109420d03d52b6eeb2bc0d1648a5" + "files": 249, + "generated_at_commit": "3bb365b850107cafd3938ec5100c56629c2055e6", + "source_tree": "sha256:0ec61582c7a335edd7ea619fa7fe0f7611507282de695d97a606b3f9c463f7ed" } }, "name": "atemporal", diff --git a/research/atemporal/at1/oracle/.crumb b/research/atemporal/at1/oracle/.crumb new file mode 100644 index 000000000..5a06afc0b --- /dev/null +++ b/research/atemporal/at1/oracle/.crumb @@ -0,0 +1,19 @@ +{ + "extensions": { + "generated": { + "children": [], + "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "compiled_at": "2026-10-10T03:25:07Z", + "compiler": "crumb-compile/1", + "digest": "sha256:4a7c3b518487ee4c64704724384fa76a20336422c6538dbbd21f86aee7cbe463", + "evidence_files": 0, + "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "files": 60, + "generated_at_commit": "3bb365b850107cafd3938ec5100c56629c2055e6", + "source_tree": "sha256:994804d9b92a3a28b6046035bf8760f0357dd7c9038d89ba74d7e357e188b97f" + } + }, + "name": "oracle", + "purpose": "AT-1 reference oracle (Rust, standard library only, built by rustc directly; research cross-check, not part of active execution): AT1_CASE_V1 validator, exact level kernel, literal matrix route plus closed-form and Bloch references, exact judge, AT1_RESULT_V1 oracle-record writer, tests, isolation gate", + "schema_version": "1.0.0" +} diff --git a/research/atemporal/at1/oracle/.gitignore b/research/atemporal/at1/oracle/.gitignore new file mode 100644 index 000000000..2f7896d1d --- /dev/null +++ b/research/atemporal/at1/oracle/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/research/atemporal/at1/oracle/NUMERICAL_ERROR.md b/research/atemporal/at1/oracle/NUMERICAL_ERROR.md new file mode 100644 index 000000000..16f6d2e56 --- /dev/null +++ b/research/atemporal/at1/oracle/NUMERICAL_ERROR.md @@ -0,0 +1,107 @@ +# Numerical error documentation for the AT-1 reference oracle + +Every record this oracle writes says `arithmetic BINARY64`, `bound_kind ESTIMATED`, +`threads 1`. ESTIMATED means the bounds below are first-order estimates backed by the +accounting and the measurements here. They are not proven enclosures. A RIGOROUS claim would +need directed-rounding interval arithmetic with enclosed `cos` and `sin` (AT1_SPEC section +8.4 item 6). Rust's standard library does not provide that and this oracle pulls in nothing +else, so it never claims it. A case that demands `min_bound_kind RIGOROUS` therefore fails +`bound_kind_sufficient` here by design (fixture `at1-n5-rigorous-demand`). + +`U` below is `2^-53`, the unit roundoff of binary64 (half an ulp at 1). + +## What is exact + +- Every validity decision, both identities, the per-level spectrum test `|h + v_j|^2` a + rational square, the kernel pairs `E_j + h0 + s R_j = 0`, the degenerate-matched level, + the kernel dimension, the level eigenvectors `f`, the projected components + `u_j = f (f^dagger psi_0) / ||f||^2` and `S = sum_j ||u_j||^2`: arbitrary-precision + rationals and Gaussian rationals (`src/at1/big.rs`), no float involved. +- Every phase: the turn count `E_j (k - r) tau` (and `2 |h| (k - r) tau` when `|h|` is + rational) is reduced modulo 1 exactly, split into the nearest eighth turn and a remainder + in `[-1/16, 1/16]`; quarter turns are exact (AT1_SPEC section 8.4 item 1). +- Every acceptance check: decided on the written `f64:` tokens converted exactly to + rationals, against the exact scaled-decimal tolerances and bounds. The judge never compares + floats. +- Input conversion: every exact rational is converted to binary64 once, correctly rounded + (round half to even on the exact quotient), so each input carries at most `U` relative + error. A unit test checks the rounding against values with known bit patterns. + +## Per-operation accounting (standard rounding model, first order) + +| Ingredient | Error | Where | +|---|---|---| +| one phase value `cis_turns` (modulus 1) | `CIS_ERR = 8 U` absolute: remainder conversion and `2 pi r` (3 U relative on an angle of at most `pi/8`), `cos` and `sin` at most one ulp each, the binary64 `sqrt(1/2)` of odd eighths, one complex product (`sqrt(5) U`); about 7 U | `src/at1/model.rs` | +| clock state entry `t_j = cis / sqrt(N)` | `(CIS_ERR + 3) U` relative | matrix route | +| `x_j = t_j psi_0` | `(CIS_ERR + 7) U \|\|x_j\|\|` | matrix route | +| kernel block of `P_0` | `b b^dagger` with `b` a converted, normalized eigenvector: about `13.3 U` per entry, Frobenius norm 1; a degenerate-matched block is the exact identity | matrix route | +| `Psi_j = P_0 x` on one block | `\|\|dPsi_j\|\| <= (CIS_ERR + 28) U \|\|x_j\|\|`, `\|\|x_j\|\| = \|\|psi_0\|\| / sqrt(N)`; blocks outside the kernel are exact zeros | matrix route | +| `H_total` block entries | each 2 x 2 diagonal block `(E_j + h0) I + n_j . sigma`, `n_j = h + v_j`, is formed in exact rationals and converted once: `U` relative per entry, so a large `h` cancelling a large `v_j` costs nothing | matrix route | +| `phi_k = sum_j conj(t_j) Psi_j` | compensated (Neumaier) sum: `\|\|dphi\|\| <= sum_j \|\|dPsi_j\|\| / sqrt(N) + (CIS_ERR + 8) U sum_j \|\|Psi_j\|\| / sqrt(N)` (triangle inequality on `(\|Psi_j0\|, \|Psi_j1\|)`; the sum error no longer grows with `N`) | matrix route | +| POVM entry `(a, b)` | `sum_k (w / N) cis(-(E_a - E_b) k tau)`, one exact turn count per term, compensated over the `M` terms: `(CIS_ERR + 4) U w M / N` | matrix route | +| `chi_k = sum_j cis(E_j (k - r) tau) u_j` | compensated sum: `\|\|dchi\|\| <= (CIS_ERR + 6) U sum_j \|\|u_j\|\|` (conversion `U`, phase, product `sqrt(5) U`, compensation `2 U`) | closed form | + +## Stated bounds + +`SAFETY = 2` multiplies every estimate. The operation counts above are worst-case sums of +absolute values, so the factor only covers second-order terms and a platform `cos`/`sin` +that misses its ulp. + +| Quantity | Route | Stated absolute bound | +|---|---|---| +| `constraint_residual` | matrix | `SAFETY gmax (dPsi / \|\|Psi\|\| + 8 U)`, `dPsi = (CIS_ERR + 28) U K \|\|psi_0\|\| / sqrt(N)` over the `K` kernel levels, `gmax = max 2 R_j` over the levels that carry a kernel pair (the norm of `H_total` on the blocks where `Psi` lives; a degenerate-matched block is an exact zero): the exact `Psi` has `H_total Psi = 0` | +| `povm_residual` | matrix | `SAFETY ((CIS_ERR + 4) U w M + 8 U value)` | +| `clock_probability k` | matrix | `SAFETY (w (2 \|\|phi_k\|\| dphi + dphi^2) / \|\|Psi\|\|^2 + p (2 dPsi / \|\|Psi\|\| + (4N + 12) U))` | +| `reference_clock_probability k` | closed form | `SAFETY (w (2 \|\|chi_k\|\| dchi + dchi^2) / (N S) + 16 U p)` | +| each `pauli` and `reference_interacting` value | matrix / closed form | with `a = asin(rel)`, `rel = dphi / \|\|phi_k\|\|` (or `dchi / \|\|chi_k\|\|`): `SAFETY (2 sqrt(P (1 - P)) a + 3 a^2 + 16 U)` | +| each `reference_ideal` value | Bloch rotation | `SAFETY (64 U + angle error)`; the angle error is 0 when `|h|` is rational (exact turn reduction) and `2 pi 8 U |2 |h| (k - r) tau|` otherwise | + +The Pauli bound is per value. The ray of `phi + dphi` lies within the angle `a = asin(rel)` +of the ray of `phi`. `P = cos^2(beta)` has `|dP / dbeta| = 2 sqrt(P (1 - P))` and +`|d^2P / dbeta^2| <= 2`, so `|dP| <= 2 sqrt(P (1 - P)) a + a^2`. Evaluating `sqrt(P (1 - P))` +at the computed `P` moves it by at most `a`, which gives `2 s a + 3 a^2`. This is the +Cauchy-Schwarz sharpening of AT1_SPEC section 8.4 item 4 (`2 ||Delta chi|| / ||chi||`); it +gives exact zeros and ones (a state orthogonal to an eigenvector) the second-order bound +they actually have. + +Bounds are written as scaled decimals at the twentieth decimal place, rounded up and then +increased by one further unit (`bound_token`), so the written bound is never smaller than +the float estimate. The rounding is exact big-integer arithmetic on the exact binary value of the +estimate, with no upper clip; a non-finite estimate is written as the largest binary64. A unit test checks this on exact rationals. + +## Measured (fixtures, rustc 1.98.1 and 1.97.1, aarch64-unknown-linux-gnu, glibc libm) + +| Measurement | Value | Where | +|---|---|---| +| Values compared with the exact AT1_SPEC section 13 tables, 21 cases | 1577 | `fixtures/CALIBRATION.md` | +| Largest deviation, matrix route (the record's own values) | `6.7e-16` (P3b, N1c) | same | +| Largest deviation, closed form (`reference_clock_probability`, `reference_interacting`) | `2.2e-16` | same | +| Largest deviation, Bloch rotation (`reference_ideal`) | `2.2e-16` (N4b, phases not quarter turns) | same | +| Values whose actual error exceeds the written bound | 0 | same | +| Largest written bound on any compared value | `1.1e-13` (P3b, label `p(2) = 1/80`) | same | +| `constraint_residual`, nontrivial kernels | `0` (P1, P1c, N3) to `9.5e-17`, P6 included (`delta_min = 2^-20`) | `*.values` | +| `povm_residual`, complete clocks | `0` on every one | `*.values` | +| `povm_residual`, N4a and N4b | `1` and `1.620185174601965` (`sqrt(42) / 4`) | `*.values` | +| Fixture bytes, rustc 1.97.1 build versus rustc 1.98.1 build | identical (`diff -r`) | both builds | +| Review case: `h_z = 1048573/15` cancelling `v_z = -1048567/15` (before the exact blocks the residual was `8.7e-12` against a bound of `2.6e-14`, reviewer measurement) | residual `6.8e-17`, bound `1.8e-14` | test `review_finding_1_...` | +| Review cases: `N = M = 64` and `N = 64, M = 256, w = 1/4` (before, `N = M = 64` turned INDETERMINATE, reviewer measurement) | constraint and POVM residuals `0`, POVM bound `1.7e-13`, constraint bound `1.8e-14`, PASS | test `review_finding_2_large_clocks` | + +Observed errors sit two to three orders of magnitude below the stated bounds, and the +largest bound sits an order of magnitude below the tolerances `1e-12` of AT1_SPEC section +8.3. + +## Limits + +- Bounds grow like `1 / sqrt(p(k))` (AT1_SPEC section 8.4 item 4) and like + `||psi_0|| / ||Psi||` on the matrix route. AT1_SPEC section 8.3 rule (b) keeps + `p(k) >= 10^-3`; at that floor, on a case where the projection keeps only a small part of + `psi_0`, the oracle's own verdict can turn INDETERMINATE (`PRECISION_INSUFFICIENT`) where + a tighter engine would PASS. No section 13 case comes near this. +- The irrational-`|h|` angle error of `reference_ideal` is an estimate (AT1_SPEC section 8.4 + item 2 states it as a hypothesis); no section 13 case has an irrational `|h|`. +- Largest sizes the contract allows (`N = 64`, `M = 256`) are covered by the review cases + above; the POVM bound grows like `w M` (`N` on a complete clock), still `1.7e-13` there. +- The Neumaier sums carry a second-order term of order `n U^2` for `n` terms, negligible for + `n <= 256`, the largest sum here. +- `cos` and `sin` come from the platform libm; the accounting assumes at most one ulp each. + Nothing here was measured on macOS. diff --git a/research/atemporal/at1/oracle/README.md b/research/atemporal/at1/oracle/README.md new file mode 100644 index 000000000..5833e5071 --- /dev/null +++ b/research/atemporal/at1/oracle/README.md @@ -0,0 +1,155 @@ +# AT-1 reference oracle (Rust, standard library only) + +Independent reference for the AT-1 interacting Page-Wootters qualification. Given an +`AT1_CASE_V1` file it validates the case in contract order, decides the kernel of +`H_total = H_C (x) I + I (x) H_S + V` exactly level by level, computes every written quantity +by two routes (a literal matrix route and the closed form; they share only the exact level +decisions and eigenvectors of `src/at1/model.rs`, the exact phase reduction `cis_turns`, the +compensated sum and the Pauli bound formula), judges the twelve checks in exact arithmetic and writes one +`AT1_RESULT_V1` oracle record. A PASS here means conformance with the frozen contracts and +AT1_SPEC; it says nothing about physics. Reproducing the hand tables is a calibration +result, not a discovery. + +Owner: Agent 2 (`AT1_CHARTER.md` section 7, `aien-dev/omega#371`). Everything lives in this +directory. Nothing here is the candidate engine and nothing here is used by it; no source is +imported from `research/atemporal/at0/` (two leaf files, `sha256.rs` and `complex.rs`, were +copied from the AT-0 oracle as a starting point, as charter section 4 allows). + +## Contracts and readings this code follows + +- Contracts: `AT1_CASE_V1` (sha256 `e62018d8deec97fffca5cacaf6452d8fc45c395596517665cd73eb0c777a3e8f`) + and `AT1_RESULT_V1` (`3e6efd7e641a89bf0e425267525afabc51fe7a5497d3d539cdeaf09ddb6fa92d`), + frozen at `aien-architecture` `cbe4c8ed88d28bb96d5209327ecd30aa9cddaf7a`, the + `contract_commit` every record writes (`CONTRACT_COMMIT` in `src/at1/case.rs`). + `AT0_RESULT_V2` sections 2, 4, 5 and 7 are normative through `AT1_RESULT_V1`. +- Mathematics: `AT1_SPEC.md`, merged as `81047f52850f4bd14c2fc5772ec2ac833ac694b9` + (`SPEC_COMMIT` in `src/at1/mod.rs`). Every section 13 table is a fixture and a test. +- Charter readings (`AT1_CHARTER.md` at `ea91d7c`): (b) shape before range, non-canonical + decided after the whole shape pass; (c) the record carries all four `reference_*` + families in values-block order; (d) the first token of a version line is its key, so an + `OMEGA-AT0-CASE` header is `CASE_PARSE_ERROR` and a wrong version value is + `CASE_UNSUPPORTED_VERSION`; (e) index tokens are compared by parsed value, `01` is + `CASE_NONCANONICAL`, a non-integer or wrong value is `CASE_PARSE_ERROR`. +- Declared token readings (same as the qualified AT-0 C engine, not stated in the frozen + text; listed so a reviewer can object): integers are `-?[0-9]+` (so `+4` is + `CASE_PARSE_ERROR`); a fixed-arity list with the wrong arity (`system_hamiltonian_pauli` 4, + `interaction_pauli` 3, `reference_system_state` 2) and a count mismatch of + `clock_energies`, `interaction_pauli` or `clock_label` lines are `CASE_PARSE_ERROR`; a + rational with denominator below 1 and a negative part of a scaled token are + `CASE_NONCANONICAL`; a rational over the token limit and a scaled exponent above 40 are + `CASE_INVALID_PARAMETER`; `clock_dim 0` (or any value that differs from the number of + `clock_energies` entries) is a count-line mismatch, so `CASE_PARSE_ERROR` before the range + rule `2 <= N <= 64` is reached. The values-block parser the judge uses takes + `physical_state_kernel_dim` only as a canonical decimal (`0` or `[1-9][0-9]*`). +- Phase sign frozen in `AT1_CASE_V1` section 3: `chi_k = sum_j exp(+2 pi i E_j (k - r) tau) u_j`. + +## What the record contains + +- The record's own values (`physical_state_kernel_dim`, `constraint_residual`, + `povm_residual`, `label`, `clock_probability`, `pauli`) come from the literal matrix route + (`src/at1/matrix.rs`): dense `H_total`, the orthogonal projector onto its kernel built + from the exact kernel pairs (never from a numerical eigen-decomposition, AT1_SPEC section + 8.4 item 3), `Psi = P_0 (|t_r> (x) psi_0)`, `phi_k` by the literal bra `` on stderr and exits 2. + +## Layout + +``` +build.sh exact rustc invocation (build | test | lib), POSIX sh +isolation.sh symbol-isolation gate for the compute crate (source rule + nm -u + mutant) +src/main.rs the only file that touches files, git, the process table or the wall clock +src/tests.rs the test suite +src/at1/mod.rs compute crate root; SPEC_COMMIT +src/at1/big.rs arbitrary-precision naturals, integers, rationals, Gaussian rationals +src/at1/sha256.rs SHA-256 (case_id, acceptance_id, verdict_id, evidence_digest, case_file_sha256) +src/at1/complex.rs complex numbers and dense complex matrices +src/at1/case.rs AT1_CASE_V1 parser and validator in contract order; case builder +src/at1/model.rs exact level decisions, kernel pairs, u_j, S; exact phase reduction +src/at1/matrix.rs literal matrix route (the record's own values) +src/at1/closed.rs closed form (Theorem 3) and Bloch rotation (the reference families) +src/at1/result.rs values block, values parser, exact judge, verdict block, record writer +src/at1/fixtures.rs AT1_SPEC section 13 cases with their exact hand tables +fixtures/ .case, .values, CALIBRATION.md (generated, deterministic) +NUMERICAL_ERROR.md accounting, stated bounds, measured errors, limits +``` + +## Build and run (no network, no Cargo, no crates) + +``` +./build.sh build # target/at1-oracle +./build.sh test # target/at1-oracle-test, runs the suite +./isolation.sh # isolation gate, prints ISOLATION PASS +./target/at1-oracle emit [-o ] +./target/at1-oracle check # prints case_id, acceptance_id, case_file_sha256 +./target/at1-oracle fixtures fixtures # regenerates fixtures/ byte for byte +``` + +The build is one command: + +``` +rustc --edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort -D warnings \ + --crate-name at1_oracle src/main.rs -o target/at1-oracle +``` + +The test build uses the same flags without `-C panic=abort`, plus `--test`. `build.sh` +records in the binary `rustc -V`, the host triple and the flag string (the source of +`build_cc` and `build_flags`), and the source state at build time: `git rev-parse HEAD` and +whether `git status --porcelain -- .` was empty in this directory (the source of +`source_commit`, `oracle_commit` and `source_tree_clean`). A binary built without `build.sh` +falls back to the checkout it runs from, one built by `build.sh` outside a git checkout +writes all-zero commits, and both always write `source_tree_clean NO`. `host` is +the host name, then `sw_vers` product name and version when present (macOS), then +`uname -srm`, so a replication record names the machine and the OS. Every digest is computed in Rust; no script calls +`sha256sum` or `shasum`. No Makefile and no toolchain pin file are shipped, so `rustup` +never tries to download anything. + +MacBook (macOS arm64, rustc 1.97.1): the same three commands. `isolation.sh` accepts the +leading underscore BSD `nm` puts on C symbols, and the host name falls back to `uname -n` +when `/etc/hostname` is missing. No script needs GNU make, `sha256sum` or `shasum`. +Verified here with rustc 1.97.1 and 1.98.1 on +`aarch64-unknown-linux-gnu`: both build with `-D warnings`, both pass the suite, and their +fixtures are byte-identical. It has not been run on macOS by this agent. + +## Results (rustc 1.98.1, aarch64-unknown-linux-gnu) + +- Worked example `at1-kat-rotated-level-n4` reproduces `case_file_sha256 76e282fe...9ba4`, + `case_id 890980a4...25f1`, `acceptance_id d63246c3...4d8f`, kernel dimension 2 and + `p = 5/28, 1/4, 9/28, 1/4`; its oracle record has + `verdict_id a918558b4b1e99e4015813eaefaab18973861b7b7d797ef89bddc9f41637eabb`. +- Test suite: 26 tests pass on rustc 1.98.1 and on rustc 1.97.1 (22 suite tests, 4 unit + tests of the arithmetic, SHA-256 and complex layers). +- Section 13 tables covered: 13.2 P1 (a, b), P1c, P2, P3, P3b, P4, P5, P6; 13.3 deviation + classes through N1 to N1f; 13.4 N1 to N1f, N2, N3, N4a, N4b, N5, N6; 13.5 R0 to R14 and + all 42 inherited AT-0 refusal rows re-expressed on P2. 1577 values compared with the exact + tables, largest deviation `6.7e-16`, no value outside its written bound, largest bound + `1.1e-13` (see `fixtures/CALIBRATION.md`). Every case meets its expectation. +- Review cases (second-model review, see the PR): a field `h_z = 1048573/15` cancelling + couplings `v_z = -1048567/15` (constraint residual `6.8e-17`, bound `1.8e-14`, PASS), and + the largest clocks the contract allows, `N = M = 64` and `N = 64, M = 256, w = 1/4` + (constraint and POVM residuals `0`, POVM bound `1.7e-13`, PASS). +- AT1_SPEC section 9: T1, T3 (P1c under IDEAL), T4, T5, T6, T7 and T9 are tests; mutants + M1 (drop `V`, including the blind P1c case and the N1 route to + `ORACLE_DISAGREEMENT`), M3 and M4 are judge tests; a status mismatch fails check 12. +- Isolation gate: PASS (source rule, `nm -u` object rule, both catch the `std::time` mutant). + +## Declared limits + +- Bounds are ESTIMATED, not enclosures; RIGOROUS is never claimed (N5 fails by design). + `NUMERICAL_ERROR.md` gives the accounting and its limits, including the small-`p(k)` case + where the oracle's own verdict can turn INDETERMINATE. +- Not tested here: T2 against the AT-0 tables beyond the P1 table they share, T8 (label + order reversed), T10 (cross-platform; gate G7 belongs to Agent 7), mutant M2 (a flipped `V` + on P2 has an irrational spectrum, so it is not a valid case; it stays with Agent 4's + engine mutants), M5 to M7. +- One thread, binary64, platform `cos`/`sin`. Not run on macOS by this agent. +- `source_tree_clean` covers this directory only (the only source the build reads); a + change elsewhere in the clone does not mark the record dirty. diff --git a/research/atemporal/at1/oracle/build.sh b/research/atemporal/at1/oracle/build.sh new file mode 100755 index 000000000..0f5b82a86 --- /dev/null +++ b/research/atemporal/at1/oracle/build.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Build the AT-1 reference oracle with a direct rustc invocation (no cargo, no crates). +# Usage: ./build.sh -> target/at1-oracle +# ./build.sh test -> builds and runs target/at1-oracle-test +set -eu +cd "$(dirname "$0")" +mkdir -p target +RUSTC_VERSION="$(rustc -V)" +RUSTC_HOST="$(rustc -vV | sed -n 's/^host: //p')" +FLAGS="--edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort -D warnings" +# source provenance is captured at build time (AT0_RESULT_V2 section 7: the commit the +# binary was built from, and whether this directory, the only source it compiles, had +# uncommitted changes); a record from a dirty or non-git build says source_tree_clean NO +SRC_COMMIT="$(git rev-parse HEAD 2>/dev/null || true)" +SRC_CLEAN=NO +if [ -n "$SRC_COMMIT" ] && [ -z "$(git status --porcelain -- . 2>/dev/null)" ]; then SRC_CLEAN=YES; fi +export AT1_RUSTC_VERSION="$RUSTC_VERSION" AT1_RUSTC_HOST="$RUSTC_HOST" AT1_BUILD_FLAGS="$FLAGS" +export AT1_SOURCE_COMMIT="$SRC_COMMIT" AT1_SOURCE_CLEAN="$SRC_CLEAN" +case "${1:-build}" in + build) + rustc $FLAGS --crate-name at1_oracle src/main.rs -o target/at1-oracle + echo "built target/at1-oracle with $RUSTC_VERSION ($RUSTC_HOST)" ;; + test) + # tests need unwinding panics; everything else identical + rustc --edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -D warnings --test --crate-name at1_oracle src/main.rs -o target/at1-oracle-test + ./target/at1-oracle-test "${2:-}" ;; + lib) + # compute crate alone, for the isolation gate (no main.rs, so no I/O layer) + rustc $FLAGS --crate-type lib --crate-name at1 src/at1/mod.rs -o target/libat1.rlib + echo "built target/libat1.rlib" ;; + *) echo "usage: $0 [build|test|lib]" >&2; exit 1 ;; +esac diff --git a/research/atemporal/at1/oracle/fixtures/CALIBRATION.md b/research/atemporal/at1/oracle/fixtures/CALIBRATION.md new file mode 100644 index 000000000..0c0d5ff8a --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/CALIBRATION.md @@ -0,0 +1,27 @@ +# AT-1 oracle calibration fixtures + +Generated by `target/at1-oracle fixtures fixtures/` (deterministic, no wall clock). Each case is one row of AT1_SPEC.md section 13 (aien-architecture `81047f5`); expectations are the spec's exact hand tables. `matrix` is the literal matrix route (the record's own values), `closed` the closed-form route (`reference_clock_probability`, `reference_interacting`), `ideal` the Bloch-rotation route (`reference_ideal`). Deviations are absolute, against the exact value rounded once to binary64. `bound viol.` counts values whose actual error exceeds the written ESTIMATED bound (must be 0). + +| case | class | kernel dim | outcome | failure codes | expectation_met | values checked | max dev matrix | max dev closed | max dev ideal | bound viol. | max bound | +|---|---|---|---|---|---|---|---|---|---|---|---| +| `at1-p1a-zero-coupling` | P1 | 2 | PASS | none | YES | 81 | 5.6e-17 | 5.6e-17 | 0.0e0 | 0 | 2.5e-14 | +| `at1-p1b-zero-coupling-ideal` | P1 | 2 | PASS | none | YES | 81 | 5.6e-17 | 5.6e-17 | 0.0e0 | 0 | 2.5e-14 | +| `at1-p1c-spectator-coupling` | P1c | 2 | PASS | none | YES | 81 | 5.6e-17 | 5.6e-17 | 0.0e0 | 0 | 2.5e-14 | +| `at1-kat-rotated-level-n4` | P2 | 2 | PASS | none | YES | 81 | 3.3e-16 | 1.1e-16 | 0.0e0 | 0 | 3.2e-14 | +| `at1-p3-every-level-coupled` | P3 | 3 | PASS | none | YES | 81 | 4.4e-16 | 2.2e-16 | 0.0e0 | 0 | 4.4e-14 | +| `at1-p3b-degenerate-level` | P3b | 4 | PASS | none | YES | 81 | 6.7e-16 | 2.2e-16 | 0.0e0 | 0 | 1.1e-13 | +| `at1-p4-complex-state-ref-t1` | P4 | 2 | PASS | none | YES | 81 | 3.3e-16 | 2.2e-16 | 5.6e-17 | 0 | 3.0e-14 | +| `at1-p5-large-rationals` | P5 | 2 | PASS | none | YES | 81 | 1.1e-16 | 1.1e-16 | 0.0e0 | 0 | 3.0e-14 | +| `at1-p6-near-miss-level` | P6 | 2 | PASS | none | YES | 81 | 3.3e-16 | 1.1e-16 | 0.0e0 | 0 | 3.2e-14 | +| `at1-n1-p2-ideal` | N1 | 2 | FAIL | SCHRODINGER_DEVIATION_EXCEEDED | YES | 81 | 3.3e-16 | 1.1e-16 | 0.0e0 | 0 | 3.2e-14 | +| `at1-n1b-p3-ideal` | N1b | 3 | FAIL | SCHRODINGER_DEVIATION_EXCEEDED | YES | 81 | 4.4e-16 | 2.2e-16 | 0.0e0 | 0 | 4.4e-14 | +| `at1-n1c-p3b-ideal` | N1c | 4 | FAIL | SCHRODINGER_DEVIATION_EXCEEDED | YES | 81 | 6.7e-16 | 2.2e-16 | 0.0e0 | 0 | 1.1e-13 | +| `at1-n1d-p4-ideal` | N1d | 2 | FAIL | SCHRODINGER_DEVIATION_EXCEEDED | YES | 81 | 3.3e-16 | 2.2e-16 | 5.6e-17 | 0 | 3.0e-14 | +| `at1-n1e-p5-ideal` | N1e | 2 | FAIL | SCHRODINGER_DEVIATION_EXCEEDED | YES | 81 | 1.1e-16 | 1.1e-16 | 0.0e0 | 0 | 3.0e-14 | +| `at1-n1f-p6-ideal` | N1f | 2 | FAIL | SCHRODINGER_DEVIATION_EXCEEDED | YES | 81 | 3.3e-16 | 1.1e-16 | 0.0e0 | 0 | 3.2e-14 | +| `at1-n2-all-levels-out` | N2 | 0 | FAIL | TRIVIAL_PHYSICAL_STATE | YES | 25 | 0.0e0 | 0.0e0 | 0.0e0 | 0 | 1.4e-14 | +| `at1-n3-swapped-level-zero-label` | N3 | 2 | FAIL | CONDITIONAL_UNDEFINED | YES | 69 | 5.6e-17 | 5.6e-17 | 0.0e0 | 0 | 3.4e-14 | +| `at1-n4a-wrong-weight` | N4a | 2 | FAIL | POVM_NORMALIZATION_EXCEEDED,PROBABILITY_SUM_EXCEEDED | YES | 81 | 3.3e-16 | 1.1e-16 | 0.0e0 | 0 | 3.2e-14 | +| `at1-n4b-broken-clock-tau-1-3` | N4b | 2 | FAIL | POVM_NORMALIZATION_EXCEEDED,PROBABILITY_SUM_EXCEEDED | YES | 81 | 3.3e-16 | 1.1e-16 | 2.2e-16 | 0 | 3.2e-14 | +| `at1-n5-rigorous-demand` | N5 | 2 | FAIL | BOUND_KIND_INSUFFICIENT | YES | 81 | 3.3e-16 | 1.1e-16 | 0.0e0 | 0 | 3.2e-14 | +| `at1-n6-zero-projection` | N6 | 1 | FAIL | TRIVIAL_PHYSICAL_STATE | YES | 25 | 0.0e0 | 0.0e0 | 5.6e-17 | 0 | 1.4e-14 | diff --git a/research/atemporal/at1/oracle/fixtures/at1-kat-rotated-level-n4.case b/research/atemporal/at1/oracle/fixtures/at1-kat-rotated-level-n4.case new file mode 100644 index 000000000..d92e2126e --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-kat-rotated-level-n4.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-kat-rotated-level-n4 +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target INTERACTING +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 890980a43bd189494c2c922d2bf0049cbffb07f1090f578e04e1142aee7525f1 +acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-kat-rotated-level-n4.values b/research/atemporal/at1/oracle/fixtures/at1-kat-rotated-level-n4.values new file mode 100644 index 000000000..e46da235f --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-kat-rotated-level-n4.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c9b8427950fa916 2088474@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 1 f64:3fd0000000000001 231135@19 +clock_probability 2 f64:3fd4924924924925 2789474@20 +clock_probability 3 f64:3fd0000000000001 231135@19 +pauli 0 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 0 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 0 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 0 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 1 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 1 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 1 Y PLUS f64:3fedb6db6db6db6c 1591975@20 +pauli 1 Y MINUS f64:3fb249249249249e 1591975@20 +pauli 1 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 1 Z MINUS f64:3fd075075075074b 2454027@20 +pauli 2 X PLUS f64:3fb99999999999a3 1625761@20 +pauli 2 X MINUS f64:3feccccccccccccb 1625761@20 +pauli 2 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 2 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 2 Z PLUS f64:3fe999999999999b 2049257@20 +pauli 2 Z MINUS f64:3fc9999999999993 2049257@20 +pauli 3 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 3 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 3 Y PLUS f64:3fb249249249249e 1591975@20 +pauli 3 Y MINUS f64:3fedb6db6db6db6c 1591975@20 +pauli 3 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 3 Z MINUS f64:3fd075075075074b 2454027@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 1 f64:3fd0000000000001 303264@20 +reference_clock_probability 2 f64:3fd4924924924924 357353@20 +reference_clock_probability 3 f64:3fd0000000000001 303264@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 0 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 0 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 1 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 1 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 1 Y PLUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 1 Y MINUS f64:3fb2492492492493 576185@20 +reference_interacting 1 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 1 Z MINUS f64:3fd075075075074f 730173@20 +reference_interacting 2 X PLUS f64:3fb999999999999a 58222@19 +reference_interacting 2 X MINUS f64:3feccccccccccccc 58222@19 +reference_interacting 2 Y PLUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 2 Z MINUS f64:3fc999999999999a 657869@20 +reference_interacting 3 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 3 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 3 Y PLUS f64:3fb2492492492493 576185@20 +reference_interacting 3 Y MINUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 3 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 3 Z MINUS f64:3fd075075075074f 730173@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id a918558b4b1e99e4015813eaefaab18973861b7b7d797ef89bddc9f41637eabb diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1-p2-ideal.case b/research/atemporal/at1/oracle/fixtures/at1-n1-p2-ideal.case new file mode 100644 index 000000000..b39e4841f --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1-p2-ideal.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n1-p2-ideal +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target IDEAL +expected_outcome FAIL +expected_failure_codes SCHRODINGER_DEVIATION_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 890980a43bd189494c2c922d2bf0049cbffb07f1090f578e04e1142aee7525f1 +acceptance_id e1923453902b4834198b0f513e1476a122f6327c38fc072e8f0d4b5078a263d1 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1-p2-ideal.values b/research/atemporal/at1/oracle/fixtures/at1-n1-p2-ideal.values new file mode 100644 index 000000000..332b1ea25 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1-p2-ideal.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c9b8427950fa916 2088474@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 1 f64:3fd0000000000001 231135@19 +clock_probability 2 f64:3fd4924924924925 2789474@20 +clock_probability 3 f64:3fd0000000000001 231135@19 +pauli 0 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 0 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 0 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 0 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 1 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 1 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 1 Y PLUS f64:3fedb6db6db6db6c 1591975@20 +pauli 1 Y MINUS f64:3fb249249249249e 1591975@20 +pauli 1 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 1 Z MINUS f64:3fd075075075074b 2454027@20 +pauli 2 X PLUS f64:3fb99999999999a3 1625761@20 +pauli 2 X MINUS f64:3feccccccccccccb 1625761@20 +pauli 2 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 2 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 2 Z PLUS f64:3fe999999999999b 2049257@20 +pauli 2 Z MINUS f64:3fc9999999999993 2049257@20 +pauli 3 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 3 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 3 Y PLUS f64:3fb249249249249e 1591975@20 +pauli 3 Y MINUS f64:3fedb6db6db6db6c 1591975@20 +pauli 3 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 3 Z MINUS f64:3fd075075075074b 2454027@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 1 f64:3fd0000000000001 303264@20 +reference_clock_probability 2 f64:3fd4924924924924 357353@20 +reference_clock_probability 3 f64:3fd0000000000001 303264@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 0 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 0 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 1 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 1 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 1 Y PLUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 1 Y MINUS f64:3fb2492492492493 576185@20 +reference_interacting 1 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 1 Z MINUS f64:3fd075075075074f 730173@20 +reference_interacting 2 X PLUS f64:3fb999999999999a 58222@19 +reference_interacting 2 X MINUS f64:3feccccccccccccc 58222@19 +reference_interacting 2 Y PLUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 2 Z MINUS f64:3fc999999999999a 657869@20 +reference_interacting 3 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 3 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 3 Y PLUS f64:3fb2492492492493 576185@20 +reference_interacting 3 Y MINUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 3 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 3 Z MINUS f64:3fd075075075074f 730173@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement FAIL +check oracle_cross_check PASS +check label_status_agreement PASS +outcome FAIL +failure_codes SCHRODINGER_DEVIATION_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id 1b5eb073fa6051220a016e744cd6ae88f0dbf6eb168fa254eca6a78b8258ee3b diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1b-p3-ideal.case b/research/atemporal/at1/oracle/fixtures/at1-n1b-p3-ideal.case new file mode 100644 index 000000000..a503d439f --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1b-p3-ideal.case @@ -0,0 +1,44 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n1b-p3-ideal +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 3 +clock_energies -1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 3/10,0/1,-1/10 +interaction_pauli 1 0/1,3/10,-1/10 +interaction_pauli 2 6/5,0/1,2/5 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 3/4 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target IDEAL +expected_outcome FAIL +expected_failure_codes SCHRODINGER_DEVIATION_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 2273ab7a73d4e29f39ca277b07d33e840a520e1467d0f2e654c1af1f2dd5f720 +acceptance_id e1923453902b4834198b0f513e1476a122f6327c38fc072e8f0d4b5078a263d1 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1b-p3-ideal.values b/research/atemporal/at1/oracle/fixtures/at1-n1b-p3-ideal.values new file mode 100644 index 000000000..2048a89f4 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1b-p3-ideal.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 3 +constraint_residual f64:3c9b4ec9fea6a7f6 6613155@20 +povm_residual f64:0000000000000000 799362@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fd8750750750750 3361515@20 +clock_probability 1 f64:3fc83a83a83a83a9 2000444@20 +clock_probability 2 f64:3fb6db6db6db6dbb 118717@19 +clock_probability 3 f64:3fd5b6db6db6db6f 3072057@20 +pauli 0 X PLUS f64:3fed4ef40991f1a7 1523805@20 +pauli 0 X MINUS f64:3fb5885fb37072d2 1523805@20 +pauli 0 Y PLUS f64:3fd37072d753bd02 2291366@20 +pauli 0 Y MINUS f64:3fe647c694562180 2291366@20 +pauli 0 Z PLUS f64:3fd37072d753bd07 2291366@20 +pauli 0 Z MINUS f64:3fe647c69456217d 2291366@20 +pauli 1 X PLUS f64:3fe656f1826a43a0 3101454@20 +pauli 1 X MINUS f64:3fd3521cfb2b78c0 3101454@20 +pauli 1 Y PLUS f64:3fee7d95bc609a90 1623462@20 +pauli 1 Y MINUS f64:3fa826a439f656fc 1623462@20 +pauli 1 Z PLUS f64:3fe26a439f656f1a 3311988@20 +pauli 1 Z MINUS f64:3fdb2b78c13521cb 3311988@20 +pauli 2 X PLUS f64:3fd47ae147ae1482 4418224@20 +pauli 2 X MINUS f64:3fe5c28f5c28f5be 4418224@20 +pauli 2 Y PLUS f64:3fe7ae147ae147af 4175724@20 +pauli 2 Y MINUS f64:3fd0a3d70a3d70a1 4175724@20 +pauli 2 Z PLUS f64:3feccccccccccccd 2968237@20 +pauli 2 Z MINUS f64:3fb9999999999991 2968237@20 +pauli 3 X PLUS f64:3fd8ed2308158ed2 2534044@20 +pauli 3 X MINUS f64:3fe3896e7bf53898 2534044@20 +pauli 3 Y PLUS f64:3fb6e7bf53896e84 1630579@20 +pauli 3 Y MINUS f64:3fed2308158ed231 1630579@20 +pauli 3 Z PLUS f64:3fe86bca1af286bf 225485@19 +pauli 3 Z MINUS f64:3fce50d79435e508 225485@19 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fd8750750750752 447233@20 +reference_clock_probability 1 f64:3fc83a83a83a83ab 286458@20 +reference_clock_probability 2 f64:3fb6db6db6db6db6 182275@20 +reference_clock_probability 3 f64:3fd5b6db6db6db6f 414022@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fed4ef40991f1a4 581496@20 +reference_interacting 0 X MINUS f64:3fb5885fb37072da 581496@20 +reference_interacting 0 Y PLUS f64:3fd37072d753bd02 730092@20 +reference_interacting 0 Y MINUS f64:3fe647c69456217e 730092@20 +reference_interacting 0 Z PLUS f64:3fd37072d753bd01 730092@20 +reference_interacting 0 Z MINUS f64:3fe647c69456217f 730092@20 +reference_interacting 1 X PLUS f64:3fe656f1826a43a0 886922@20 +reference_interacting 1 X MINUS f64:3fd3521cfb2b78c0 886922@20 +reference_interacting 1 Y PLUS f64:3fee7d95bc609a8f 600789@20 +reference_interacting 1 Y MINUS f64:3fa826a439f656ee 600789@20 +reference_interacting 1 Z PLUS f64:3fe26a439f656f18 92768@19 +reference_interacting 1 Z MINUS f64:3fdb2b78c13521d0 92768@19 +reference_interacting 2 X PLUS f64:3fd47ae147ae147b 1141843@20 +reference_interacting 2 X MINUS f64:3fe5c28f5c28f5c3 1141843@20 +reference_interacting 2 Y PLUS f64:3fe7ae147ae147af 1094896@20 +reference_interacting 2 Y MINUS f64:3fd0a3d70a3d70a3 1094896@20 +reference_interacting 2 Z PLUS f64:3feccccccccccccd 861131@20 +reference_interacting 2 Z MINUS f64:3fb999999999999b 861131@20 +reference_interacting 3 X PLUS f64:3fd8ed2308158ed2 777074@20 +reference_interacting 3 X MINUS f64:3fe3896e7bf53897 777074@20 +reference_interacting 3 Y PLUS f64:3fb6e7bf53896e79 602167@20 +reference_interacting 3 Y MINUS f64:3fed2308158ed231 602167@20 +reference_interacting 3 Z PLUS f64:3fe86bca1af286bc 723023@20 +reference_interacting 3 Z MINUS f64:3fce50d79435e50f 723023@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement FAIL +check oracle_cross_check PASS +check label_status_agreement PASS +outcome FAIL +failure_codes SCHRODINGER_DEVIATION_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id 59d69cf3d010038cb55324f8ed569c9280af623bb276eaf9e96bda16533dccd8 diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1c-p3b-ideal.case b/research/atemporal/at1/oracle/fixtures/at1-n1c-p3b-ideal.case new file mode 100644 index 000000000..bd2758f75 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1c-p3b-ideal.case @@ -0,0 +1,44 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n1c-p3b-ideal +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 3 +clock_energies -1/2,0/1,1/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,-1/2 +interaction_pauli 2 3/10,0/1,-1/10 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(0/1;1/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/2 +povm_weight 3/4 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target IDEAL +expected_outcome FAIL +expected_failure_codes SCHRODINGER_DEVIATION_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 4790c019ffa88f5e67d632f4a1f95dc30ac3abd3aa98b041e8c98f4778837fb5 +acceptance_id e1923453902b4834198b0f513e1476a122f6327c38fc072e8f0d4b5078a263d1 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1c-p3b-ideal.values b/research/atemporal/at1/oracle/fixtures/at1-n1c-p3b-ideal.values new file mode 100644 index 000000000..30b34ce11 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1c-p3b-ideal.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 4 +constraint_residual f64:3c957e82ecdabe8d 1873337@20 +povm_residual f64:0000000000000000 799362@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fe0666666666667 3659323@20 +clock_probability 1 f64:3fce666666666668 2053971@20 +clock_probability 2 f64:3f899999999999a0 306448@20 +clock_probability 3 f64:3fce666666666668 2053971@20 +pauli 0 X PLUS f64:3fd6a2576a2576a1 1892778@20 +pauli 0 X MINUS f64:3fe4aed44aed44ae 1892778@20 +pauli 0 Y PLUS f64:3fef3831f3831f37 851339@20 +pauli 0 Y MINUS f64:3f98f9c18f9c1900 851339@20 +pauli 0 Z PLUS f64:3fe18f9c18f9c190 1955519@20 +pauli 0 Z MINUS f64:3fdce0c7ce0c7cde 1955519@20 +pauli 1 X PLUS f64:3f9af286bca1af48 1111454@20 +pauli 1 X MINUS f64:3fef286bca1af285 1111454@20 +pauli 1 Y PLUS f64:3fe0d79435e50d7a 2713992@20 +pauli 1 Y MINUS f64:3fde50d79435e50c 2713992@20 +pauli 1 Z PLUS f64:3fe50d79435e50d9 2596401@20 +pauli 1 Z MINUS f64:3fd5e50d79435e4d 2596401@20 +pauli 2 X PLUS f64:3fe0000000000006 10650962@20 +pauli 2 X MINUS f64:3fdffffffffffff4 10650962@20 +pauli 2 Y PLUS f64:0000000000000000 355273@20 +pauli 2 Y MINUS f64:3ff0000000000000 355273@20 +pauli 2 Z PLUS f64:3fdffffffffffffc 10650962@20 +pauli 2 Z MINUS f64:3fe0000000000002 10650962@20 +pauli 3 X PLUS f64:3fef286bca1af286 1111454@20 +pauli 3 X MINUS f64:3f9af286bca1af10 1111454@20 +pauli 3 Y PLUS f64:3fe0d79435e50d7a 2713992@20 +pauli 3 Y MINUS f64:3fde50d79435e50b 2713992@20 +pauli 3 Z PLUS f64:3fd5e50d79435e52 2596401@20 +pauli 3 Z MINUS f64:3fe50d79435e50d6 2596401@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fe0666666666666 561984@20 +reference_clock_probability 1 f64:3fce666666666665 342998@20 +reference_clock_probability 2 f64:3f8999999999999b 63774@20 +reference_clock_probability 3 f64:3fce666666666665 342998@20 +reference_ideal 0 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fd6a2576a2576a3 709682@20 +reference_interacting 0 X MINUS f64:3fe4aed44aed44ae 709682@20 +reference_interacting 0 Y PLUS f64:3fef3831f3831f39 469621@20 +reference_interacting 0 Y MINUS f64:3f98f9c18f9c18fc 469621@20 +reference_interacting 0 Z PLUS f64:3fe18f9c18f9c190 724145@20 +reference_interacting 0 Z MINUS f64:3fdce0c7ce0c7ce1 724145@20 +reference_interacting 1 X PLUS f64:3f9af286bca1af2b 52958@19 +reference_interacting 1 X MINUS f64:3fef286bca1af289 52958@19 +reference_interacting 1 Y PLUS f64:3fe0d79435e50d79 89898@19 +reference_interacting 1 Y MINUS f64:3fde50d79435e50f 89898@19 +reference_interacting 1 Z PLUS f64:3fe50d79435e50d8 871874@20 +reference_interacting 1 Z MINUS f64:3fd5e50d79435e51 871874@20 +reference_interacting 2 X PLUS f64:3fdffffffffffffe 2728525@20 +reference_interacting 2 X MINUS f64:3fe0000000000001 2728525@20 +reference_interacting 2 Y PLUS f64:3924000000000000 355273@20 +reference_interacting 2 Y MINUS f64:3fefffffffffffff 355273@20 +reference_interacting 2 Z PLUS f64:3fe0000000000000 2728525@20 +reference_interacting 2 Z MINUS f64:3fdfffffffffffff 2728525@20 +reference_interacting 3 X PLUS f64:3fef286bca1af289 52958@19 +reference_interacting 3 X MINUS f64:3f9af286bca1af2b 52958@19 +reference_interacting 3 Y PLUS f64:3fe0d79435e50d79 89898@19 +reference_interacting 3 Y MINUS f64:3fde50d79435e50f 89898@19 +reference_interacting 3 Z PLUS f64:3fd5e50d79435e51 871874@20 +reference_interacting 3 Z MINUS f64:3fe50d79435e50d8 871874@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement FAIL +check oracle_cross_check PASS +check label_status_agreement PASS +outcome FAIL +failure_codes SCHRODINGER_DEVIATION_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id 974953196ffac798ca808ba9c5143f7f8953e9496a4723681fc66cdb5ed9f9ec diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1d-p4-ideal.case b/research/atemporal/at1/oracle/fixtures/at1-n1d-p4-ideal.case new file mode 100644 index 000000000..c01ab6af0 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1d-p4-ideal.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n1d-p4-ideal +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t1 +reference_system_state (1/1;0/1),(3/5;4/5) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target IDEAL +expected_outcome FAIL +expected_failure_codes SCHRODINGER_DEVIATION_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 921e497172361058b52b87444dfff3ae442cf220ce88cea63fbd3463cef926e4 +acceptance_id e1923453902b4834198b0f513e1476a122f6327c38fc072e8f0d4b5078a263d1 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1d-p4-ideal.values b/research/atemporal/at1/oracle/fixtures/at1-n1d-p4-ideal.values new file mode 100644 index 000000000..8116748c0 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1d-p4-ideal.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c90e48cea38a4fa 1943129@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6a2576a2576a1 1686715@20 +clock_probability 1 f64:3fcce0c7ce0c7ce1 201266@19 +clock_probability 2 f64:3fd4aed44aed44af 2629559@20 +clock_probability 3 f64:3fd18f9c18f9c191 2325844@20 +pauli 0 X PLUS f64:3fee90c5bce90c5d 1469762@20 +pauli 0 X MINUS f64:3fa6f3a4316f3a3c 1469762@20 +pauli 0 Y PLUS f64:3fd2c234f72c2352 2806878@20 +pauli 0 Y MINUS f64:3fe69ee58469ee58 2806878@20 +pauli 0 Z PLUS f64:3fe01c3f8f01c3fb 3048183@20 +pauli 0 Z MINUS f64:3fdfc780e1fc780b 3048183@20 +pauli 1 X PLUS f64:3fe109afbd94109a 2734384@20 +pauli 1 X MINUS f64:3fddeca084d7decc 2734384@20 +pauli 1 Y PLUS f64:3fef914c1bacf915 905814@20 +pauli 1 Y MINUS f64:3f8bacf914c1bad0 905814@20 +pauli 1 Z PLUS f64:3fe38bc31d0f38bf 2680118@20 +pauli 1 Z MINUS f64:3fd8e879c5e18e83 2680118@20 +pauli 2 X PLUS f64:3fb1df279b883622 137052@19 +pauli 2 X MINUS f64:3fedc41b0c8ef93b 137052@19 +pauli 2 Y PLUS f64:3fe39f656f1826a2 229556@19 +pauli 2 Y MINUS f64:3fd8c13521cfb2b8 229556@19 +pauli 2 Z PLUS f64:3fe74e3fc22c7010 2127512@20 +pauli 2 Z MINUS f64:3fd163807ba71fdd 2127512@20 +pauli 3 X PLUS f64:3fd0a3d70a3d70a6 2251793@20 +pauli 3 X MINUS f64:3fe7ae147ae147ad 2251793@20 +pauli 3 Y PLUS f64:3fb999999999999c 1652381@20 +pauli 3 Y MINUS f64:3feccccccccccccd 1652381@20 +pauli 3 Z PLUS f64:3fe5c28f5c28f5c5 2372173@20 +pauli 3 Z MINUS f64:3fd47ae147ae1476 2372173@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6a2576a2576a4 246561@20 +reference_clock_probability 1 f64:3fcce0c7ce0c7ce1 287692@20 +reference_clock_probability 2 f64:3fd4aed44aed44af 363205@20 +reference_clock_probability 3 f64:3fd18f9c18f9c191 326362@20 +reference_ideal 0 X PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 0 X MINUS f64:3fb9999999999998 1421087@20 +reference_ideal 0 Y PLUS f64:3fc999999999999a 1421087@20 +reference_ideal 0 Y MINUS f64:3fe999999999999a 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe999999999999a 1421087@20 +reference_ideal 1 X MINUS f64:3fc999999999999a 1421087@20 +reference_ideal 1 Y PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 1 Y MINUS f64:3fb9999999999998 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:3fb9999999999998 1421087@20 +reference_ideal 2 X MINUS f64:3feccccccccccccd 1421087@20 +reference_ideal 2 Y PLUS f64:3fe999999999999a 1421087@20 +reference_ideal 2 Y MINUS f64:3fc999999999999a 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fc999999999999a 1421087@20 +reference_ideal 3 X MINUS f64:3fe999999999999a 1421087@20 +reference_ideal 3 Y PLUS f64:3fb9999999999998 1421087@20 +reference_ideal 3 Y MINUS f64:3feccccccccccccd 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fee90c5bce90c5b 570281@20 +reference_interacting 0 X MINUS f64:3fa6f3a4316f3a45 570281@20 +reference_interacting 0 Y PLUS f64:3fd2c234f72c234e 828239@20 +reference_interacting 0 Y MINUS f64:3fe69ee58469ee59 828239@20 +reference_interacting 0 Z PLUS f64:3fe01c3f8f01c3f9 874792@20 +reference_interacting 0 Z MINUS f64:3fdfc780e1fc780e 874792@20 +reference_interacting 1 X PLUS f64:3fe109afbd94109c 814253@20 +reference_interacting 1 X MINUS f64:3fddeca084d7decb 814253@20 +reference_interacting 1 Y PLUS f64:3fef914c1bacf916 461484@20 +reference_interacting 1 Y MINUS f64:3f8bacf914c1bad5 461484@20 +reference_interacting 1 Z PLUS f64:3fe38bc31d0f38bc 803784@20 +reference_interacting 1 Z MINUS f64:3fd8e879c5e18e87 803784@20 +reference_interacting 2 X PLUS f64:3fb1df279b88361b 551135@20 +reference_interacting 2 X MINUS f64:3fedc41b0c8ef93d 551135@20 +reference_interacting 2 Y PLUS f64:3fe39f656f1826a6 729595@20 +reference_interacting 2 Y MINUS f64:3fd8c13521cfb2b7 729595@20 +reference_interacting 2 Z PLUS f64:3fe74e3fc22c7010 697175@20 +reference_interacting 2 Z MINUS f64:3fd163807ba71fe1 697175@20 +reference_interacting 3 X PLUS f64:3fd0a3d70a3d70a4 721151@20 +reference_interacting 3 X MINUS f64:3fe7ae147ae147ad 721151@20 +reference_interacting 3 Y PLUS f64:3fb999999999999a 605512@20 +reference_interacting 3 Y MINUS f64:3feccccccccccccc 605512@20 +reference_interacting 3 Z PLUS f64:3fe5c28f5c28f5c3 744375@20 +reference_interacting 3 Z MINUS f64:3fd47ae147ae147a 744375@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement FAIL +check oracle_cross_check PASS +check label_status_agreement PASS +outcome FAIL +failure_codes SCHRODINGER_DEVIATION_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id 737e9c350e0b76b5f388198bee131e05ad3185f48a7c14caef1fd61df8ff1928 diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1e-p5-ideal.case b/research/atemporal/at1/oracle/fixtures/at1-n1e-p5-ideal.case new file mode 100644 index 000000000..776e30ba4 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1e-p5-ideal.case @@ -0,0 +1,43 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n1e-p5-ideal +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 2 +clock_energies -524289/1048574,524285/1048574 +system_dim 2 +system_hamiltonian_pauli 1/524287,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 524175/1048354,724/524177,-1/2 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/2 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target IDEAL +expected_outcome FAIL +expected_failure_codes SCHRODINGER_DEVIATION_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 03beb780ef16e93140272c9a0c3ef2c90a6d506c90252467f4349afcc8a0d585 +acceptance_id e1923453902b4834198b0f513e1476a122f6327c38fc072e8f0d4b5078a263d1 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1e-p5-ideal.values b/research/atemporal/at1/oracle/fixtures/at1-n1e-p5-ideal.values new file mode 100644 index 000000000..8efa075d3 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1e-p5-ideal.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c90bda5e82e59fb 2438566@20 +povm_residual f64:0000000000000000 532909@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fd00004003682e5 2549942@20 +clock_probability 1 f64:3fcfe95ecbab9701 2544697@20 +clock_probability 2 f64:3fcffff7ff92fa33 2549928@20 +clock_probability 3 f64:3fd00b509a2a3480 255517@19 +pauli 0 X PLUS f64:3fe000000001001b 2972161@20 +pauli 0 X MINUS f64:3fdffffffffdffca 2972161@20 +pauli 0 Y PLUS f64:3fdfe95ecbab9598 2972151@20 +pauli 0 Y MINUS f64:3fe00b509a2a3534 2972151@20 +pauli 0 Z PLUS f64:3feffffbffca7d34 362502@20 +pauli 0 Z MINUS f64:3ec000d60b2ed592 362502@20 +pauli 1 X PLUS f64:3fe00b549d35047d 2975778@20 +pauli 1 X MINUS f64:3fdfe956c595f707 2975778@20 +pauli 1 Y PLUS f64:3fe0000400368231 2975788@20 +pauli 1 Y MINUS f64:3fdffff7ff92fb9e 2975788@20 +pauli 1 Z PLUS f64:3feffffbfcf32e61 362522@20 +pauli 1 Z MINUS f64:3ec00c33467b759a 362522@20 +pauli 2 X PLUS f64:3fdfffefff23f430 2972171@20 +pauli 2 X MINUS f64:3fe00008006e05e8 2972171@20 +pauli 2 Y PLUS f64:3fe00b509a2a33ca 2972161@20 +pauli 2 Y MINUS f64:3fdfe95ecbab986c 2972161@20 +pauli 2 Z PLUS f64:3feffffbffc87cfe 362502@20 +pauli 2 Z MINUS f64:3ec000de0c08e6f9 362502@20 +pauli 3 X PLUS f64:3fdfe966c67002a0 2968549@20 +pauli 3 X MINUS f64:3fe00b4c9cc7feb0 2968549@20 +pauli 3 Y PLUS f64:3fdffff7ff92f8ca 2968559@20 +pauli 3 Y MINUS f64:3fe000040036839b 2968559@20 +pauli 3 Z PLUS f64:3feffffc029bcb64 362482@20 +pauli 3 Z MINUS f64:3ebfeb21a4e0d37f 362482@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fd00004003682e6 244555@20 +reference_clock_probability 1 f64:3fcfe95ecbab9705 244093@20 +reference_clock_probability 2 f64:3fcffff7ff92fa33 244553@20 +reference_clock_probability 3 f64:3fd00b509a2a3481 245014@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fe000000001001b 666741@20 +reference_interacting 0 X MINUS f64:3fdffffffffdffcb 666741@20 +reference_interacting 0 Y PLUS f64:3fdfe95ecbab9599 66674@19 +reference_interacting 0 Y MINUS f64:3fe00b509a2a3535 66674@19 +reference_interacting 0 Z PLUS f64:3feffffbffca7d35 356133@20 +reference_interacting 0 Z MINUS f64:3ec000d60b2ed593 356133@20 +reference_interacting 1 X PLUS f64:3fe00b549d35047d 667172@20 +reference_interacting 1 X MINUS f64:3fdfe956c595f709 667172@20 +reference_interacting 1 Y PLUS f64:3fe0000400368231 667173@20 +reference_interacting 1 Y MINUS f64:3fdffff7ff92fb9f 667173@20 +reference_interacting 1 Z PLUS f64:3feffffbfcf32e61 356136@20 +reference_interacting 1 Z MINUS f64:3ec00c33467b759c 356136@20 +reference_interacting 2 X PLUS f64:3fdfffefff23f42f 666743@20 +reference_interacting 2 X MINUS f64:3fe00008006e05e8 666743@20 +reference_interacting 2 Y PLUS f64:3fe00b509a2a33ca 666741@20 +reference_interacting 2 Y MINUS f64:3fdfe95ecbab986b 666741@20 +reference_interacting 2 Z PLUS f64:3feffffbffc87cfe 356133@20 +reference_interacting 2 Z MINUS f64:3ec000de0c08e6fc 356133@20 +reference_interacting 3 X PLUS f64:3fdfe966c67002a0 666311@20 +reference_interacting 3 X MINUS f64:3fe00b4c9cc7feb1 666311@20 +reference_interacting 3 Y PLUS f64:3fdffff7ff92f8cb 666313@20 +reference_interacting 3 Y MINUS f64:3fe000040036839c 666313@20 +reference_interacting 3 Z PLUS f64:3feffffc029bcb64 356131@20 +reference_interacting 3 Z MINUS f64:3ebfeb21a4e0d384 356131@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement FAIL +check oracle_cross_check PASS +check label_status_agreement PASS +outcome FAIL +failure_codes SCHRODINGER_DEVIATION_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id 2c104bdb301c06430e41a7420946c7a1a953537ce14a4c421f7ee63628090f8e diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1f-p6-ideal.case b/research/atemporal/at1/oracle/fixtures/at1-n1f-p6-ideal.case new file mode 100644 index 000000000..fd14b4830 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1f-p6-ideal.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n1f-p6-ideal +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,1/1 +interaction_pauli 1 0/1,0/1,1/1048576 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target IDEAL +expected_outcome FAIL +expected_failure_codes SCHRODINGER_DEVIATION_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id e406d8672cb9e4fd563d34ab6a2f7eddc7b931f233f20860a5706cf18e142c6f +acceptance_id e1923453902b4834198b0f513e1476a122f6327c38fc072e8f0d4b5078a263d1 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n1f-p6-ideal.values b/research/atemporal/at1/oracle/fixtures/at1-n1f-p6-ideal.values new file mode 100644 index 000000000..7f964ec5e --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n1f-p6-ideal.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c9b8427950fa916 626542@19 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 1 f64:3fd4924924924926 2789474@20 +clock_probability 2 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 3 f64:3fd4924924924926 2789474@20 +pauli 0 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 0 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 0 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 0 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 1 X PLUS f64:3fb99999999999a6 1625761@20 +pauli 1 X MINUS f64:3feccccccccccccc 1625761@20 +pauli 1 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 1 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 1 Z PLUS f64:3fe999999999999c 2049257@20 +pauli 1 Z MINUS f64:3fc9999999999992 2049257@20 +pauli 2 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 2 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 2 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 2 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 2 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 2 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 3 X PLUS f64:3fb99999999999a6 1625761@20 +pauli 3 X MINUS f64:3feccccccccccccc 1625761@20 +pauli 3 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 3 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 3 Z PLUS f64:3fe999999999999c 2049257@20 +pauli 3 Z MINUS f64:3fc9999999999992 2049257@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 1 f64:3fd4924924924926 357353@20 +reference_clock_probability 2 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 3 f64:3fd4924924924926 357353@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 0 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 0 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 1 X PLUS f64:3fb999999999999d 58222@19 +reference_interacting 1 X MINUS f64:3feccccccccccccd 58222@19 +reference_interacting 1 Y PLUS f64:3fe0000000000001 733518@20 +reference_interacting 1 Y MINUS f64:3fe0000000000001 733518@20 +reference_interacting 1 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 1 Z MINUS f64:3fc9999999999998 657869@20 +reference_interacting 2 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 2 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 2 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 2 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 2 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 3 X PLUS f64:3fb999999999999d 58222@19 +reference_interacting 3 X MINUS f64:3feccccccccccccd 58222@19 +reference_interacting 3 Y PLUS f64:3fe0000000000001 733518@20 +reference_interacting 3 Y MINUS f64:3fe0000000000001 733518@20 +reference_interacting 3 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 3 Z MINUS f64:3fc9999999999998 657869@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement FAIL +check oracle_cross_check PASS +check label_status_agreement PASS +outcome FAIL +failure_codes SCHRODINGER_DEVIATION_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id f9003fb8fc4f1302af603c7f0b003c7ec767437e9013dd4ce914db9c85eeebd7 diff --git a/research/atemporal/at1/oracle/fixtures/at1-n2-all-levels-out.case b/research/atemporal/at1/oracle/fixtures/at1-n2-all-levels-out.case new file mode 100644 index 000000000..14e1535a7 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n2-all-levels-out.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n2-all-levels-out +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,1/2 +interaction_pauli 2 0/1,0/1,1/2 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target INTERACTING +expected_outcome FAIL +expected_failure_codes TRIVIAL_PHYSICAL_STATE +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 9e31669b05f401ef2900cc5295c1519912500177af374060ab23e4b4d37571e1 +acceptance_id 8f79bf3d89d5580452207d6ad16eb99fc29fd7408930147544b07c66ba6329bc +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n2-all-levels-out.values b/research/atemporal/at1/oracle/fixtures/at1-n2-all-levels-out.values new file mode 100644 index 000000000..529b25c39 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n2-all-levels-out.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 0 +constraint_residual undefined 0@0 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 UNDEFINED +label 1 t1 UNDEFINED +label 2 t2 UNDEFINED +label 3 t3 UNDEFINED +clock_probability 0 undefined 0@0 +clock_probability 1 undefined 0@0 +clock_probability 2 undefined 0@0 +clock_probability 3 undefined 0@0 +pauli 0 X PLUS undefined 0@0 +pauli 0 X MINUS undefined 0@0 +pauli 0 Y PLUS undefined 0@0 +pauli 0 Y MINUS undefined 0@0 +pauli 0 Z PLUS undefined 0@0 +pauli 0 Z MINUS undefined 0@0 +pauli 1 X PLUS undefined 0@0 +pauli 1 X MINUS undefined 0@0 +pauli 1 Y PLUS undefined 0@0 +pauli 1 Y MINUS undefined 0@0 +pauli 1 Z PLUS undefined 0@0 +pauli 1 Z MINUS undefined 0@0 +pauli 2 X PLUS undefined 0@0 +pauli 2 X MINUS undefined 0@0 +pauli 2 Y PLUS undefined 0@0 +pauli 2 Y MINUS undefined 0@0 +pauli 2 Z PLUS undefined 0@0 +pauli 2 Z MINUS undefined 0@0 +pauli 3 X PLUS undefined 0@0 +pauli 3 X MINUS undefined 0@0 +pauli 3 Y PLUS undefined 0@0 +pauli 3 Y MINUS undefined 0@0 +pauli 3 Z PLUS undefined 0@0 +pauli 3 Z MINUS undefined 0@0 +reference_label 0 t0 UNDEFINED +reference_label 1 t1 UNDEFINED +reference_label 2 t2 UNDEFINED +reference_label 3 t3 UNDEFINED +reference_clock_probability 0 undefined 0@0 +reference_clock_probability 1 undefined 0@0 +reference_clock_probability 2 undefined 0@0 +reference_clock_probability 3 undefined 0@0 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS undefined 0@0 +reference_interacting 0 X MINUS undefined 0@0 +reference_interacting 0 Y PLUS undefined 0@0 +reference_interacting 0 Y MINUS undefined 0@0 +reference_interacting 0 Z PLUS undefined 0@0 +reference_interacting 0 Z MINUS undefined 0@0 +reference_interacting 1 X PLUS undefined 0@0 +reference_interacting 1 X MINUS undefined 0@0 +reference_interacting 1 Y PLUS undefined 0@0 +reference_interacting 1 Y MINUS undefined 0@0 +reference_interacting 1 Z PLUS undefined 0@0 +reference_interacting 1 Z MINUS undefined 0@0 +reference_interacting 2 X PLUS undefined 0@0 +reference_interacting 2 X MINUS undefined 0@0 +reference_interacting 2 Y PLUS undefined 0@0 +reference_interacting 2 Y MINUS undefined 0@0 +reference_interacting 2 Z PLUS undefined 0@0 +reference_interacting 2 Z MINUS undefined 0@0 +reference_interacting 3 X PLUS undefined 0@0 +reference_interacting 3 X MINUS undefined 0@0 +reference_interacting 3 Y PLUS undefined 0@0 +reference_interacting 3 Y MINUS undefined 0@0 +reference_interacting 3 Z PLUS undefined 0@0 +reference_interacting 3 Z MINUS undefined 0@0 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial FAIL +check constraint_residual NOT_EVALUATED +check povm_normalization PASS +check clock_probability_sum NOT_EVALUATED +check probability_range NOT_EVALUATED +check pauli_pair_sum NOT_EVALUATED +check conditional_defined NOT_EVALUATED +check target_agreement NOT_EVALUATED +check oracle_cross_check NOT_EVALUATED +check label_status_agreement NOT_EVALUATED +outcome FAIL +failure_codes TRIVIAL_PHYSICAL_STATE +error_code none +expectation_met YES +end verdict +verdict_id 3a2de2486efb6a1414f2f9c2dab6026028de4497a0838ef7f99baa50d82e29b7 diff --git a/research/atemporal/at1/oracle/fixtures/at1-n3-swapped-level-zero-label.case b/research/atemporal/at1/oracle/fixtures/at1-n3-swapped-level-zero-label.case new file mode 100644 index 000000000..96a531050 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n3-swapped-level-zero-label.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n3-swapped-level-zero-label +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 0/1,0/1,-1/1 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target INTERACTING +expected_outcome FAIL +expected_failure_codes CONDITIONAL_UNDEFINED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 6b97f727561cc7bdc405eb98b1f6ea74a3c669786319fb64b61c5ec9802907e7 +acceptance_id e21a8799796aa0f131d32d24e8f2843ecf1b6eb754813a1dbe6a75cc8b72ee3d +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n3-swapped-level-zero-label.values b/research/atemporal/at1/oracle/fixtures/at1-n3-swapped-level-zero-label.values new file mode 100644 index 000000000..ef0ea3426 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n3-swapped-level-zero-label.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:0000000000000000 1776358@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 UNDEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fe0000000000000 3395323@20 +clock_probability 1 f64:3fd0000000000001 2005369@20 +clock_probability 2 f64:0000000000000000 2@20 +clock_probability 3 f64:3fd0000000000001 2005369@20 +pauli 0 X PLUS f64:3fe0000000000000 1841011@20 +pauli 0 X MINUS f64:3fe0000000000000 1841011@20 +pauli 0 Y PLUS f64:3fe0000000000000 1841011@20 +pauli 0 Y MINUS f64:3fe0000000000000 1841011@20 +pauli 0 Z PLUS f64:3ff0000000000000 355273@20 +pauli 0 Z MINUS f64:0000000000000000 355273@20 +pauli 1 X PLUS f64:3fe0000000000000 2456424@20 +pauli 1 X MINUS f64:3fe0000000000000 2456424@20 +pauli 1 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 1 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 1 Z PLUS f64:3ff0000000000000 355273@20 +pauli 1 Z MINUS f64:0000000000000000 355273@20 +pauli 2 X PLUS undefined 0@0 +pauli 2 X MINUS undefined 0@0 +pauli 2 Y PLUS undefined 0@0 +pauli 2 Y MINUS undefined 0@0 +pauli 2 Z PLUS undefined 0@0 +pauli 2 Z MINUS undefined 0@0 +pauli 3 X PLUS f64:3fe0000000000000 2456424@20 +pauli 3 X MINUS f64:3fe0000000000000 2456424@20 +pauli 3 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 3 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 3 Z PLUS f64:3ff0000000000000 355273@20 +pauli 3 Z MINUS f64:0000000000000000 355273@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 UNDEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fe0000000000000 4885@18 +reference_clock_probability 1 f64:3fd0000000000001 308632@20 +reference_clock_probability 2 f64:0000000000000000 2@20 +reference_clock_probability 3 f64:3fd0000000000001 308632@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fe0000000000000 666135@20 +reference_interacting 0 X MINUS f64:3fe0000000000000 666135@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 666135@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 666135@20 +reference_interacting 0 Z PLUS f64:3ff0000000000000 355273@20 +reference_interacting 0 Z MINUS f64:0000000000000000 355273@20 +reference_interacting 1 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Z PLUS f64:3ff0000000000000 355273@20 +reference_interacting 1 Z MINUS f64:0000000000000000 355273@20 +reference_interacting 2 X PLUS undefined 0@0 +reference_interacting 2 X MINUS undefined 0@0 +reference_interacting 2 Y PLUS undefined 0@0 +reference_interacting 2 Y MINUS undefined 0@0 +reference_interacting 2 Z PLUS undefined 0@0 +reference_interacting 2 Z MINUS undefined 0@0 +reference_interacting 3 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Z PLUS f64:3ff0000000000000 355273@20 +reference_interacting 3 Z MINUS f64:0000000000000000 355273@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined FAIL +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome FAIL +failure_codes CONDITIONAL_UNDEFINED +error_code none +expectation_met YES +end verdict +verdict_id 0d94dd9b14047f3e9bfb991b96f63682f19af3a0ca6ef6d9cff93174e0ad89d7 diff --git a/research/atemporal/at1/oracle/fixtures/at1-n4a-wrong-weight.case b/research/atemporal/at1/oracle/fixtures/at1-n4a-wrong-weight.case new file mode 100644 index 000000000..4c8325447 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n4a-wrong-weight.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n4a-wrong-weight +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/2 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target INTERACTING +expected_outcome FAIL +expected_failure_codes POVM_NORMALIZATION_EXCEEDED,PROBABILITY_SUM_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id cbfee5d54341692e3cce5d991b6f8ee6592a2b974f2947b13d5d8def6dec8485 +acceptance_id 0b0cf2ba90f798329ddbfda972114add52783721f2cef34a3caa2810c6c18759 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n4a-wrong-weight.values b/research/atemporal/at1/oracle/fixtures/at1-n4a-wrong-weight.values new file mode 100644 index 000000000..8eaeb87a4 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n4a-wrong-weight.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c9b8427950fa916 2088474@20 +povm_residual f64:3ff0000000000000 710544@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fb6db6db6db6db7 904037@20 +clock_probability 1 f64:3fc0000000000001 1155676@20 +clock_probability 2 f64:3fc4924924924925 1394738@20 +clock_probability 3 f64:3fc0000000000001 1155676@20 +pauli 0 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 0 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 0 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 0 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 1 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 1 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 1 Y PLUS f64:3fedb6db6db6db6c 1591975@20 +pauli 1 Y MINUS f64:3fb249249249249e 1591975@20 +pauli 1 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 1 Z MINUS f64:3fd075075075074b 2454027@20 +pauli 2 X PLUS f64:3fb99999999999a3 1625761@20 +pauli 2 X MINUS f64:3feccccccccccccb 1625761@20 +pauli 2 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 2 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 2 Z PLUS f64:3fe999999999999b 2049257@20 +pauli 2 Z MINUS f64:3fc9999999999993 2049257@20 +pauli 3 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 3 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 3 Y PLUS f64:3fb249249249249e 1591975@20 +pauli 3 Y MINUS f64:3fedb6db6db6db6c 1591975@20 +pauli 3 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 3 Z MINUS f64:3fd075075075074b 2454027@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fb6db6db6db6db7 122342@20 +reference_clock_probability 1 f64:3fc0000000000001 151633@20 +reference_clock_probability 2 f64:3fc4924924924924 178677@20 +reference_clock_probability 3 f64:3fc0000000000001 151633@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 0 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 0 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 1 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 1 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 1 Y PLUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 1 Y MINUS f64:3fb2492492492493 576185@20 +reference_interacting 1 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 1 Z MINUS f64:3fd075075075074f 730173@20 +reference_interacting 2 X PLUS f64:3fb999999999999a 58222@19 +reference_interacting 2 X MINUS f64:3feccccccccccccc 58222@19 +reference_interacting 2 Y PLUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 2 Z MINUS f64:3fc999999999999a 657869@20 +reference_interacting 3 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 3 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 3 Y PLUS f64:3fb2492492492493 576185@20 +reference_interacting 3 Y MINUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 3 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 3 Z MINUS f64:3fd075075075074f 730173@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization FAIL +check clock_probability_sum FAIL +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome FAIL +failure_codes POVM_NORMALIZATION_EXCEEDED,PROBABILITY_SUM_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id ca95d2feac679553ece237a4ebf2c8bf6bdac447a7b0c4f84c8ad3dafb70c2cf diff --git a/research/atemporal/at1/oracle/fixtures/at1-n4b-broken-clock-tau-1-3.case b/research/atemporal/at1/oracle/fixtures/at1-n4b-broken-clock-tau-1-3.case new file mode 100644 index 000000000..a93df913b --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n4b-broken-clock-tau-1-3.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n4b-broken-clock-tau-1-3 +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/3 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target INTERACTING +expected_outcome FAIL +expected_failure_codes POVM_NORMALIZATION_EXCEEDED,PROBABILITY_SUM_EXCEEDED +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id b38d78895bfc845c2e3165a77b7de02d30c317c7ebe538a84d36a8a87687c8a1 +acceptance_id 0b0cf2ba90f798329ddbfda972114add52783721f2cef34a3caa2810c6c18759 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n4b-broken-clock-tau-1-3.values b/research/atemporal/at1/oracle/fixtures/at1-n4b-broken-clock-tau-1-3.values new file mode 100644 index 000000000..43dc9edec --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n4b-broken-clock-tau-1-3.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c9b8427950fa916 2088474@20 +povm_residual f64:3ff9ec474a261264 1353618@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 1 f64:3fd2492492492494 2552931@20 +clock_probability 2 f64:3fd2492492492494 2552931@20 +clock_probability 3 f64:3fc6db6db6db6db7 1808072@20 +pauli 0 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 0 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 0 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 0 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 1 X PLUS f64:3fce66666666666c 2266786@20 +pauli 1 X MINUS f64:3fe8666666666666 2266786@20 +pauli 1 Y PLUS f64:3fea646e17211cbf 2062953@20 +pauli 1 Y MINUS f64:3fc66e47a37b8d04 2062953@20 +pauli 1 Z PLUS f64:3fe8cccccccccccf 2230992@20 +pauli 1 Z MINUS f64:3fccccccccccccc5 2230992@20 +pauli 2 X PLUS f64:3fce66666666666c 2266786@20 +pauli 2 X MINUS f64:3fe8666666666666 2266786@20 +pauli 2 Y PLUS f64:3fc66e47a37b8d04 2062953@20 +pauli 2 Y MINUS f64:3fea646e17211cbf 2062953@20 +pauli 2 Z PLUS f64:3fe8cccccccccccf 2230992@20 +pauli 2 Z MINUS f64:3fccccccccccccc5 2230992@20 +pauli 3 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 3 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 3 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 3 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 3 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 3 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 1 f64:3fd2492492492494 330759@20 +reference_clock_probability 2 f64:3fd2492492492494 330759@20 +reference_clock_probability 3 f64:3fc6db6db6db6db7 244682@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fcffffffffffffe 1421087@20 +reference_ideal 1 X MINUS f64:3fe8000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3feddb3d742c2656 1421087@20 +reference_ideal 1 Y MINUS f64:3fb126145e9ecd54 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:3fcffffffffffffe 1421087@20 +reference_ideal 2 X MINUS f64:3fe8000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fb126145e9ecd54 1421087@20 +reference_ideal 2 Y MINUS f64:3feddb3d742c2656 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 0 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 0 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 1 X PLUS f64:3fce666666666667 696726@20 +reference_interacting 1 X MINUS f64:3fe8666666666665 696726@20 +reference_interacting 1 Y PLUS f64:3fea646e17211cc1 660315@20 +reference_interacting 1 Y MINUS f64:3fc66e47a37b8d00 660315@20 +reference_interacting 1 Z PLUS f64:3fe8cccccccccccd 690332@20 +reference_interacting 1 Z MINUS f64:3fcccccccccccccc 690332@20 +reference_interacting 2 X PLUS f64:3fce666666666667 696726@20 +reference_interacting 2 X MINUS f64:3fe8666666666665 696726@20 +reference_interacting 2 Y PLUS f64:3fc66e47a37b8d00 660315@20 +reference_interacting 2 Y MINUS f64:3fea646e17211cc1 660315@20 +reference_interacting 2 Z PLUS f64:3fe8cccccccccccd 690332@20 +reference_interacting 2 Z MINUS f64:3fcccccccccccccc 690332@20 +reference_interacting 3 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 3 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 3 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 3 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 3 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 3 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization FAIL +check clock_probability_sum FAIL +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome FAIL +failure_codes POVM_NORMALIZATION_EXCEEDED,PROBABILITY_SUM_EXCEEDED +error_code none +expectation_met YES +end verdict +verdict_id d429e11d0ebea7faefe4df3785d30b69366eb4a7b528d71863dea7ebf9afb3fc diff --git a/research/atemporal/at1/oracle/fixtures/at1-n5-rigorous-demand.case b/research/atemporal/at1/oracle/fixtures/at1-n5-rigorous-demand.case new file mode 100644 index 000000000..571a0e7b4 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n5-rigorous-demand.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n5-rigorous-demand +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target INTERACTING +expected_outcome FAIL +expected_failure_codes BOUND_KIND_INSUFFICIENT +min_bound_kind RIGOROUS +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 890980a43bd189494c2c922d2bf0049cbffb07f1090f578e04e1142aee7525f1 +acceptance_id 5713c441496ac2036a0834c4454065809b4f62a026b0090e734b9c2021d81e12 +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n5-rigorous-demand.values b/research/atemporal/at1/oracle/fixtures/at1-n5-rigorous-demand.values new file mode 100644 index 000000000..5b6274b58 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n5-rigorous-demand.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c9b8427950fa916 2088474@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 1 f64:3fd0000000000001 231135@19 +clock_probability 2 f64:3fd4924924924925 2789474@20 +clock_probability 3 f64:3fd0000000000001 231135@19 +pauli 0 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 0 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 0 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 0 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 1 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 1 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 1 Y PLUS f64:3fedb6db6db6db6c 1591975@20 +pauli 1 Y MINUS f64:3fb249249249249e 1591975@20 +pauli 1 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 1 Z MINUS f64:3fd075075075074b 2454027@20 +pauli 2 X PLUS f64:3fb99999999999a3 1625761@20 +pauli 2 X MINUS f64:3feccccccccccccb 1625761@20 +pauli 2 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 2 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 2 Z PLUS f64:3fe999999999999b 2049257@20 +pauli 2 Z MINUS f64:3fc9999999999993 2049257@20 +pauli 3 X PLUS f64:3fda83a83a83a83a 2720727@20 +pauli 3 X MINUS f64:3fe2be2be2be2be2 2720727@20 +pauli 3 Y PLUS f64:3fb249249249249e 1591975@20 +pauli 3 Y MINUS f64:3fedb6db6db6db6c 1591975@20 +pauli 3 Z PLUS f64:3fe7c57c57c57c5a 2454027@20 +pauli 3 Z MINUS f64:3fd075075075074b 2454027@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 1 f64:3fd0000000000001 303264@20 +reference_clock_probability 2 f64:3fd4924924924924 357353@20 +reference_clock_probability 3 f64:3fd0000000000001 303264@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 0 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 0 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 1 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 1 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 1 Y PLUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 1 Y MINUS f64:3fb2492492492493 576185@20 +reference_interacting 1 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 1 Z MINUS f64:3fd075075075074f 730173@20 +reference_interacting 2 X PLUS f64:3fb999999999999a 58222@19 +reference_interacting 2 X MINUS f64:3feccccccccccccc 58222@19 +reference_interacting 2 Y PLUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 733518@20 +reference_interacting 2 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 2 Z MINUS f64:3fc999999999999a 657869@20 +reference_interacting 3 X PLUS f64:3fda83a83a83a83a 777814@20 +reference_interacting 3 X MINUS f64:3fe2be2be2be2be3 777814@20 +reference_interacting 3 Y PLUS f64:3fb2492492492493 576185@20 +reference_interacting 3 Y MINUS f64:3fedb6db6db6db6d 576185@20 +reference_interacting 3 Z PLUS f64:3fe7c57c57c57c58 730173@20 +reference_interacting 3 Z MINUS f64:3fd075075075074f 730173@20 +end values +begin verdict +check bound_kind_sufficient FAIL +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome FAIL +failure_codes BOUND_KIND_INSUFFICIENT +error_code none +expectation_met YES +end verdict +verdict_id 2a7cc7d425037e242b01b817d15f1117d6b7a6fe83de6aa565215fdd1b55dfe3 diff --git a/research/atemporal/at1/oracle/fixtures/at1-n6-zero-projection.case b/research/atemporal/at1/oracle/fixtures/at1-n6-zero-projection.case new file mode 100644 index 000000000..04d9b8ef7 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n6-zero-projection.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-n6-zero-projection +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,1/2 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (3/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind NEGATIVE +prediction_target INTERACTING +expected_outcome FAIL +expected_failure_codes TRIVIAL_PHYSICAL_STATE +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id e90b82cb42d511d5f93034e4f66a94802bd56b5c8e14fb18f8ad0d9d03f63887 +acceptance_id 8f79bf3d89d5580452207d6ad16eb99fc29fd7408930147544b07c66ba6329bc +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-n6-zero-projection.values b/research/atemporal/at1/oracle/fixtures/at1-n6-zero-projection.values new file mode 100644 index 000000000..f4db39548 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-n6-zero-projection.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 1 +constraint_residual undefined 0@0 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 UNDEFINED +label 1 t1 UNDEFINED +label 2 t2 UNDEFINED +label 3 t3 UNDEFINED +clock_probability 0 undefined 0@0 +clock_probability 1 undefined 0@0 +clock_probability 2 undefined 0@0 +clock_probability 3 undefined 0@0 +pauli 0 X PLUS undefined 0@0 +pauli 0 X MINUS undefined 0@0 +pauli 0 Y PLUS undefined 0@0 +pauli 0 Y MINUS undefined 0@0 +pauli 0 Z PLUS undefined 0@0 +pauli 0 Z MINUS undefined 0@0 +pauli 1 X PLUS undefined 0@0 +pauli 1 X MINUS undefined 0@0 +pauli 1 Y PLUS undefined 0@0 +pauli 1 Y MINUS undefined 0@0 +pauli 1 Z PLUS undefined 0@0 +pauli 1 Z MINUS undefined 0@0 +pauli 2 X PLUS undefined 0@0 +pauli 2 X MINUS undefined 0@0 +pauli 2 Y PLUS undefined 0@0 +pauli 2 Y MINUS undefined 0@0 +pauli 2 Z PLUS undefined 0@0 +pauli 2 Z MINUS undefined 0@0 +pauli 3 X PLUS undefined 0@0 +pauli 3 X MINUS undefined 0@0 +pauli 3 Y PLUS undefined 0@0 +pauli 3 Y MINUS undefined 0@0 +pauli 3 Z PLUS undefined 0@0 +pauli 3 Z MINUS undefined 0@0 +reference_label 0 t0 UNDEFINED +reference_label 1 t1 UNDEFINED +reference_label 2 t2 UNDEFINED +reference_label 3 t3 UNDEFINED +reference_clock_probability 0 undefined 0@0 +reference_clock_probability 1 undefined 0@0 +reference_clock_probability 2 undefined 0@0 +reference_clock_probability 3 undefined 0@0 +reference_ideal 0 X PLUS f64:3fe999999999999a 1421087@20 +reference_ideal 0 X MINUS f64:3fc999999999999a 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 0 Z MINUS f64:3fb9999999999998 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3fe999999999999a 1421087@20 +reference_ideal 1 Y MINUS f64:3fc999999999999a 1421087@20 +reference_ideal 1 Z PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 1 Z MINUS f64:3fb9999999999998 1421087@20 +reference_ideal 2 X PLUS f64:3fc999999999999a 1421087@20 +reference_ideal 2 X MINUS f64:3fe999999999999a 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 2 Z MINUS f64:3fb9999999999998 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:3fc999999999999a 1421087@20 +reference_ideal 3 Y MINUS f64:3fe999999999999a 1421087@20 +reference_ideal 3 Z PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 3 Z MINUS f64:3fb9999999999998 1421087@20 +reference_interacting 0 X PLUS undefined 0@0 +reference_interacting 0 X MINUS undefined 0@0 +reference_interacting 0 Y PLUS undefined 0@0 +reference_interacting 0 Y MINUS undefined 0@0 +reference_interacting 0 Z PLUS undefined 0@0 +reference_interacting 0 Z MINUS undefined 0@0 +reference_interacting 1 X PLUS undefined 0@0 +reference_interacting 1 X MINUS undefined 0@0 +reference_interacting 1 Y PLUS undefined 0@0 +reference_interacting 1 Y MINUS undefined 0@0 +reference_interacting 1 Z PLUS undefined 0@0 +reference_interacting 1 Z MINUS undefined 0@0 +reference_interacting 2 X PLUS undefined 0@0 +reference_interacting 2 X MINUS undefined 0@0 +reference_interacting 2 Y PLUS undefined 0@0 +reference_interacting 2 Y MINUS undefined 0@0 +reference_interacting 2 Z PLUS undefined 0@0 +reference_interacting 2 Z MINUS undefined 0@0 +reference_interacting 3 X PLUS undefined 0@0 +reference_interacting 3 X MINUS undefined 0@0 +reference_interacting 3 Y PLUS undefined 0@0 +reference_interacting 3 Y MINUS undefined 0@0 +reference_interacting 3 Z PLUS undefined 0@0 +reference_interacting 3 Z MINUS undefined 0@0 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial FAIL +check constraint_residual NOT_EVALUATED +check povm_normalization PASS +check clock_probability_sum NOT_EVALUATED +check probability_range NOT_EVALUATED +check pauli_pair_sum NOT_EVALUATED +check conditional_defined NOT_EVALUATED +check target_agreement NOT_EVALUATED +check oracle_cross_check NOT_EVALUATED +check label_status_agreement NOT_EVALUATED +outcome FAIL +failure_codes TRIVIAL_PHYSICAL_STATE +error_code none +expectation_met YES +end verdict +verdict_id 664b186ef1f0b44b4bcbb26a2701055410525bb869668d9cf66f4ccaaef7650a diff --git a/research/atemporal/at1/oracle/fixtures/at1-p1a-zero-coupling.case b/research/atemporal/at1/oracle/fixtures/at1-p1a-zero-coupling.case new file mode 100644 index 000000000..b022a3013 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p1a-zero-coupling.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p1a-zero-coupling +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 0/1,0/1,0/1 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target INTERACTING +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id d0393c29fd4c4de2e29b8abbcb09af3e97ef9372caf269c47b0e30351db2c278 +acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p1a-zero-coupling.values b/research/atemporal/at1/oracle/fixtures/at1-p1a-zero-coupling.values new file mode 100644 index 000000000..757905aaf --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p1a-zero-coupling.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:0000000000000000 1776358@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fd0000000000000 2005369@20 +clock_probability 1 f64:3fd0000000000001 2005369@20 +clock_probability 2 f64:3fd0000000000000 2005369@20 +clock_probability 3 f64:3fd0000000000001 2005369@20 +pauli 0 X PLUS f64:3ff0000000000000 355273@20 +pauli 0 X MINUS f64:0000000000000000 355273@20 +pauli 0 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 0 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 0 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 0 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 1 X PLUS f64:3fe0000000000000 2456424@20 +pauli 1 X MINUS f64:3fe0000000000000 2456424@20 +pauli 1 Y PLUS f64:3ff0000000000000 355273@20 +pauli 1 Y MINUS f64:0000000000000000 355273@20 +pauli 1 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 1 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 2 X PLUS f64:0000000000000000 355273@20 +pauli 2 X MINUS f64:3ff0000000000000 355273@20 +pauli 2 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 2 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 2 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 2 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 3 X PLUS f64:3fe0000000000000 2456424@20 +pauli 3 X MINUS f64:3fe0000000000000 2456424@20 +pauli 3 Y PLUS f64:0000000000000000 355273@20 +pauli 3 Y MINUS f64:3ff0000000000000 355273@20 +pauli 3 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 3 Z MINUS f64:3fe0000000000000 2456424@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fd0000000000000 308632@20 +reference_clock_probability 1 f64:3fd0000000000001 308632@20 +reference_clock_probability 2 f64:3fd0000000000000 308632@20 +reference_clock_probability 3 f64:3fd0000000000001 308632@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3ff0000000000000 355273@20 +reference_interacting 0 X MINUS f64:0000000000000000 355273@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Y PLUS f64:3ff0000000000000 355273@20 +reference_interacting 1 Y MINUS f64:0000000000000000 355273@20 +reference_interacting 1 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 2 X PLUS f64:0000000000000000 355273@20 +reference_interacting 2 X MINUS f64:3ff0000000000000 355273@20 +reference_interacting 2 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Y PLUS f64:0000000000000000 355273@20 +reference_interacting 3 Y MINUS f64:3ff0000000000000 355273@20 +reference_interacting 3 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Z MINUS f64:3fe0000000000000 794899@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id 98d5de64411d0201a49070b93a7ac88c0dd40baa9b9df4f0d4269871cd73fb0f diff --git a/research/atemporal/at1/oracle/fixtures/at1-p1b-zero-coupling-ideal.case b/research/atemporal/at1/oracle/fixtures/at1-p1b-zero-coupling-ideal.case new file mode 100644 index 000000000..47bee17fe --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p1b-zero-coupling-ideal.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p1b-zero-coupling-ideal +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 0/1,0/1,0/1 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target IDEAL +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id d0393c29fd4c4de2e29b8abbcb09af3e97ef9372caf269c47b0e30351db2c278 +acceptance_id 9a18f790f4bb6e40bf39960337d1274021f12b8ff78550d93ed31f890943c9ba +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p1b-zero-coupling-ideal.values b/research/atemporal/at1/oracle/fixtures/at1-p1b-zero-coupling-ideal.values new file mode 100644 index 000000000..f4bfdcfee --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p1b-zero-coupling-ideal.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:0000000000000000 1776358@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fd0000000000000 2005369@20 +clock_probability 1 f64:3fd0000000000001 2005369@20 +clock_probability 2 f64:3fd0000000000000 2005369@20 +clock_probability 3 f64:3fd0000000000001 2005369@20 +pauli 0 X PLUS f64:3ff0000000000000 355273@20 +pauli 0 X MINUS f64:0000000000000000 355273@20 +pauli 0 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 0 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 0 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 0 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 1 X PLUS f64:3fe0000000000000 2456424@20 +pauli 1 X MINUS f64:3fe0000000000000 2456424@20 +pauli 1 Y PLUS f64:3ff0000000000000 355273@20 +pauli 1 Y MINUS f64:0000000000000000 355273@20 +pauli 1 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 1 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 2 X PLUS f64:0000000000000000 355273@20 +pauli 2 X MINUS f64:3ff0000000000000 355273@20 +pauli 2 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 2 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 2 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 2 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 3 X PLUS f64:3fe0000000000000 2456424@20 +pauli 3 X MINUS f64:3fe0000000000000 2456424@20 +pauli 3 Y PLUS f64:0000000000000000 355273@20 +pauli 3 Y MINUS f64:3ff0000000000000 355273@20 +pauli 3 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 3 Z MINUS f64:3fe0000000000000 2456424@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fd0000000000000 308632@20 +reference_clock_probability 1 f64:3fd0000000000001 308632@20 +reference_clock_probability 2 f64:3fd0000000000000 308632@20 +reference_clock_probability 3 f64:3fd0000000000001 308632@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3ff0000000000000 355273@20 +reference_interacting 0 X MINUS f64:0000000000000000 355273@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Y PLUS f64:3ff0000000000000 355273@20 +reference_interacting 1 Y MINUS f64:0000000000000000 355273@20 +reference_interacting 1 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 2 X PLUS f64:0000000000000000 355273@20 +reference_interacting 2 X MINUS f64:3ff0000000000000 355273@20 +reference_interacting 2 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Y PLUS f64:0000000000000000 355273@20 +reference_interacting 3 Y MINUS f64:3ff0000000000000 355273@20 +reference_interacting 3 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Z MINUS f64:3fe0000000000000 794899@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check PASS +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id bdae25f12a74ec9e30837ed3e03ccfe31db3bc4f93062fe5a938d5331b840d0b diff --git a/research/atemporal/at1/oracle/fixtures/at1-p1c-spectator-coupling.case b/research/atemporal/at1/oracle/fixtures/at1-p1c-spectator-coupling.case new file mode 100644 index 000000000..9c0577bd4 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p1c-spectator-coupling.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p1c-spectator-coupling +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,1/2 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 0/1,0/1,0/1 +interaction_pauli 3 3/10,0/1,-1/10 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target IDEAL +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id c287bb7d1bcde25c0e087c7fd75f58361c95800adf3351b7f4c68f28d9ca6e21 +acceptance_id 9a18f790f4bb6e40bf39960337d1274021f12b8ff78550d93ed31f890943c9ba +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p1c-spectator-coupling.values b/research/atemporal/at1/oracle/fixtures/at1-p1c-spectator-coupling.values new file mode 100644 index 000000000..55e9e5496 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p1c-spectator-coupling.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:0000000000000000 1776358@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fd0000000000000 2005369@20 +clock_probability 1 f64:3fd0000000000001 2005369@20 +clock_probability 2 f64:3fd0000000000000 2005369@20 +clock_probability 3 f64:3fd0000000000001 2005369@20 +pauli 0 X PLUS f64:3ff0000000000000 355273@20 +pauli 0 X MINUS f64:0000000000000000 355273@20 +pauli 0 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 0 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 0 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 0 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 1 X PLUS f64:3fe0000000000000 2456424@20 +pauli 1 X MINUS f64:3fe0000000000000 2456424@20 +pauli 1 Y PLUS f64:3ff0000000000000 355273@20 +pauli 1 Y MINUS f64:0000000000000000 355273@20 +pauli 1 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 1 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 2 X PLUS f64:0000000000000000 355273@20 +pauli 2 X MINUS f64:3ff0000000000000 355273@20 +pauli 2 Y PLUS f64:3fe0000000000000 2456424@20 +pauli 2 Y MINUS f64:3fe0000000000000 2456424@20 +pauli 2 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 2 Z MINUS f64:3fe0000000000000 2456424@20 +pauli 3 X PLUS f64:3fe0000000000000 2456424@20 +pauli 3 X MINUS f64:3fe0000000000000 2456424@20 +pauli 3 Y PLUS f64:0000000000000000 355273@20 +pauli 3 Y MINUS f64:3ff0000000000000 355273@20 +pauli 3 Z PLUS f64:3fe0000000000000 2456424@20 +pauli 3 Z MINUS f64:3fe0000000000000 2456424@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fd0000000000000 308632@20 +reference_clock_probability 1 f64:3fd0000000000001 308632@20 +reference_clock_probability 2 f64:3fd0000000000000 308632@20 +reference_clock_probability 3 f64:3fd0000000000001 308632@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3ff0000000000000 355273@20 +reference_interacting 0 X MINUS f64:0000000000000000 355273@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 0 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Y PLUS f64:3ff0000000000000 355273@20 +reference_interacting 1 Y MINUS f64:0000000000000000 355273@20 +reference_interacting 1 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 1 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 2 X PLUS f64:0000000000000000 355273@20 +reference_interacting 2 X MINUS f64:3ff0000000000000 355273@20 +reference_interacting 2 Y PLUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 2 Z MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 X PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 X MINUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Y PLUS f64:0000000000000000 355273@20 +reference_interacting 3 Y MINUS f64:3ff0000000000000 355273@20 +reference_interacting 3 Z PLUS f64:3fe0000000000000 794899@20 +reference_interacting 3 Z MINUS f64:3fe0000000000000 794899@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check PASS +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id a0870b16c39236a88a76490b63f24cf179f30a3ec465605ab8135d151ef99401 diff --git a/research/atemporal/at1/oracle/fixtures/at1-p3-every-level-coupled.case b/research/atemporal/at1/oracle/fixtures/at1-p3-every-level-coupled.case new file mode 100644 index 000000000..757cf0f18 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p3-every-level-coupled.case @@ -0,0 +1,44 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p3-every-level-coupled +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 3 +clock_energies -1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 3/10,0/1,-1/10 +interaction_pauli 1 0/1,3/10,-1/10 +interaction_pauli 2 6/5,0/1,2/5 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 3/4 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target INTERACTING +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 2273ab7a73d4e29f39ca277b07d33e840a520e1467d0f2e654c1af1f2dd5f720 +acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p3-every-level-coupled.values b/research/atemporal/at1/oracle/fixtures/at1-p3-every-level-coupled.values new file mode 100644 index 000000000..dce1220e7 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p3-every-level-coupled.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 3 +constraint_residual f64:3c9b4ec9fea6a7f6 6613155@20 +povm_residual f64:0000000000000000 799362@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fd8750750750750 3361515@20 +clock_probability 1 f64:3fc83a83a83a83a9 2000444@20 +clock_probability 2 f64:3fb6db6db6db6dbb 118717@19 +clock_probability 3 f64:3fd5b6db6db6db6f 3072057@20 +pauli 0 X PLUS f64:3fed4ef40991f1a7 1523805@20 +pauli 0 X MINUS f64:3fb5885fb37072d2 1523805@20 +pauli 0 Y PLUS f64:3fd37072d753bd02 2291366@20 +pauli 0 Y MINUS f64:3fe647c694562180 2291366@20 +pauli 0 Z PLUS f64:3fd37072d753bd07 2291366@20 +pauli 0 Z MINUS f64:3fe647c69456217d 2291366@20 +pauli 1 X PLUS f64:3fe656f1826a43a0 3101454@20 +pauli 1 X MINUS f64:3fd3521cfb2b78c0 3101454@20 +pauli 1 Y PLUS f64:3fee7d95bc609a90 1623462@20 +pauli 1 Y MINUS f64:3fa826a439f656fc 1623462@20 +pauli 1 Z PLUS f64:3fe26a439f656f1a 3311988@20 +pauli 1 Z MINUS f64:3fdb2b78c13521cb 3311988@20 +pauli 2 X PLUS f64:3fd47ae147ae1482 4418224@20 +pauli 2 X MINUS f64:3fe5c28f5c28f5be 4418224@20 +pauli 2 Y PLUS f64:3fe7ae147ae147af 4175724@20 +pauli 2 Y MINUS f64:3fd0a3d70a3d70a1 4175724@20 +pauli 2 Z PLUS f64:3feccccccccccccd 2968237@20 +pauli 2 Z MINUS f64:3fb9999999999991 2968237@20 +pauli 3 X PLUS f64:3fd8ed2308158ed2 2534044@20 +pauli 3 X MINUS f64:3fe3896e7bf53898 2534044@20 +pauli 3 Y PLUS f64:3fb6e7bf53896e84 1630579@20 +pauli 3 Y MINUS f64:3fed2308158ed231 1630579@20 +pauli 3 Z PLUS f64:3fe86bca1af286bf 225485@19 +pauli 3 Z MINUS f64:3fce50d79435e508 225485@19 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fd8750750750752 447233@20 +reference_clock_probability 1 f64:3fc83a83a83a83ab 286458@20 +reference_clock_probability 2 f64:3fb6db6db6db6db6 182275@20 +reference_clock_probability 3 f64:3fd5b6db6db6db6f 414022@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fed4ef40991f1a4 581496@20 +reference_interacting 0 X MINUS f64:3fb5885fb37072da 581496@20 +reference_interacting 0 Y PLUS f64:3fd37072d753bd02 730092@20 +reference_interacting 0 Y MINUS f64:3fe647c69456217e 730092@20 +reference_interacting 0 Z PLUS f64:3fd37072d753bd01 730092@20 +reference_interacting 0 Z MINUS f64:3fe647c69456217f 730092@20 +reference_interacting 1 X PLUS f64:3fe656f1826a43a0 886922@20 +reference_interacting 1 X MINUS f64:3fd3521cfb2b78c0 886922@20 +reference_interacting 1 Y PLUS f64:3fee7d95bc609a8f 600789@20 +reference_interacting 1 Y MINUS f64:3fa826a439f656ee 600789@20 +reference_interacting 1 Z PLUS f64:3fe26a439f656f18 92768@19 +reference_interacting 1 Z MINUS f64:3fdb2b78c13521d0 92768@19 +reference_interacting 2 X PLUS f64:3fd47ae147ae147b 1141843@20 +reference_interacting 2 X MINUS f64:3fe5c28f5c28f5c3 1141843@20 +reference_interacting 2 Y PLUS f64:3fe7ae147ae147af 1094896@20 +reference_interacting 2 Y MINUS f64:3fd0a3d70a3d70a3 1094896@20 +reference_interacting 2 Z PLUS f64:3feccccccccccccd 861131@20 +reference_interacting 2 Z MINUS f64:3fb999999999999b 861131@20 +reference_interacting 3 X PLUS f64:3fd8ed2308158ed2 777074@20 +reference_interacting 3 X MINUS f64:3fe3896e7bf53897 777074@20 +reference_interacting 3 Y PLUS f64:3fb6e7bf53896e79 602167@20 +reference_interacting 3 Y MINUS f64:3fed2308158ed231 602167@20 +reference_interacting 3 Z PLUS f64:3fe86bca1af286bc 723023@20 +reference_interacting 3 Z MINUS f64:3fce50d79435e50f 723023@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id a499e80598f5274364478a9fd65d9e084cbd0648f94659ef353456c169afa683 diff --git a/research/atemporal/at1/oracle/fixtures/at1-p3b-degenerate-level.case b/research/atemporal/at1/oracle/fixtures/at1-p3b-degenerate-level.case new file mode 100644 index 000000000..471289e0b --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p3b-degenerate-level.case @@ -0,0 +1,44 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p3b-degenerate-level +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 3 +clock_energies -1/2,0/1,1/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,-1/2 +interaction_pauli 2 3/10,0/1,-1/10 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(0/1;1/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/2 +povm_weight 3/4 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target INTERACTING +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 4790c019ffa88f5e67d632f4a1f95dc30ac3abd3aa98b041e8c98f4778837fb5 +acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p3b-degenerate-level.values b/research/atemporal/at1/oracle/fixtures/at1-p3b-degenerate-level.values new file mode 100644 index 000000000..3d2c83cf2 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p3b-degenerate-level.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 4 +constraint_residual f64:3c957e82ecdabe8d 1873337@20 +povm_residual f64:0000000000000000 799362@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fe0666666666667 3659323@20 +clock_probability 1 f64:3fce666666666668 2053971@20 +clock_probability 2 f64:3f899999999999a0 306448@20 +clock_probability 3 f64:3fce666666666668 2053971@20 +pauli 0 X PLUS f64:3fd6a2576a2576a1 1892778@20 +pauli 0 X MINUS f64:3fe4aed44aed44ae 1892778@20 +pauli 0 Y PLUS f64:3fef3831f3831f37 851339@20 +pauli 0 Y MINUS f64:3f98f9c18f9c1900 851339@20 +pauli 0 Z PLUS f64:3fe18f9c18f9c190 1955519@20 +pauli 0 Z MINUS f64:3fdce0c7ce0c7cde 1955519@20 +pauli 1 X PLUS f64:3f9af286bca1af48 1111454@20 +pauli 1 X MINUS f64:3fef286bca1af285 1111454@20 +pauli 1 Y PLUS f64:3fe0d79435e50d7a 2713992@20 +pauli 1 Y MINUS f64:3fde50d79435e50c 2713992@20 +pauli 1 Z PLUS f64:3fe50d79435e50d9 2596401@20 +pauli 1 Z MINUS f64:3fd5e50d79435e4d 2596401@20 +pauli 2 X PLUS f64:3fe0000000000006 10650962@20 +pauli 2 X MINUS f64:3fdffffffffffff4 10650962@20 +pauli 2 Y PLUS f64:0000000000000000 355273@20 +pauli 2 Y MINUS f64:3ff0000000000000 355273@20 +pauli 2 Z PLUS f64:3fdffffffffffffc 10650962@20 +pauli 2 Z MINUS f64:3fe0000000000002 10650962@20 +pauli 3 X PLUS f64:3fef286bca1af286 1111454@20 +pauli 3 X MINUS f64:3f9af286bca1af10 1111454@20 +pauli 3 Y PLUS f64:3fe0d79435e50d7a 2713992@20 +pauli 3 Y MINUS f64:3fde50d79435e50b 2713992@20 +pauli 3 Z PLUS f64:3fd5e50d79435e52 2596401@20 +pauli 3 Z MINUS f64:3fe50d79435e50d6 2596401@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fe0666666666666 561984@20 +reference_clock_probability 1 f64:3fce666666666665 342998@20 +reference_clock_probability 2 f64:3f8999999999999b 63774@20 +reference_clock_probability 3 f64:3fce666666666665 342998@20 +reference_ideal 0 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fd6a2576a2576a3 709682@20 +reference_interacting 0 X MINUS f64:3fe4aed44aed44ae 709682@20 +reference_interacting 0 Y PLUS f64:3fef3831f3831f39 469621@20 +reference_interacting 0 Y MINUS f64:3f98f9c18f9c18fc 469621@20 +reference_interacting 0 Z PLUS f64:3fe18f9c18f9c190 724145@20 +reference_interacting 0 Z MINUS f64:3fdce0c7ce0c7ce1 724145@20 +reference_interacting 1 X PLUS f64:3f9af286bca1af2b 52958@19 +reference_interacting 1 X MINUS f64:3fef286bca1af289 52958@19 +reference_interacting 1 Y PLUS f64:3fe0d79435e50d79 89898@19 +reference_interacting 1 Y MINUS f64:3fde50d79435e50f 89898@19 +reference_interacting 1 Z PLUS f64:3fe50d79435e50d8 871874@20 +reference_interacting 1 Z MINUS f64:3fd5e50d79435e51 871874@20 +reference_interacting 2 X PLUS f64:3fdffffffffffffe 2728525@20 +reference_interacting 2 X MINUS f64:3fe0000000000001 2728525@20 +reference_interacting 2 Y PLUS f64:3924000000000000 355273@20 +reference_interacting 2 Y MINUS f64:3fefffffffffffff 355273@20 +reference_interacting 2 Z PLUS f64:3fe0000000000000 2728525@20 +reference_interacting 2 Z MINUS f64:3fdfffffffffffff 2728525@20 +reference_interacting 3 X PLUS f64:3fef286bca1af289 52958@19 +reference_interacting 3 X MINUS f64:3f9af286bca1af2b 52958@19 +reference_interacting 3 Y PLUS f64:3fe0d79435e50d79 89898@19 +reference_interacting 3 Y MINUS f64:3fde50d79435e50f 89898@19 +reference_interacting 3 Z PLUS f64:3fd5e50d79435e51 871874@20 +reference_interacting 3 Z MINUS f64:3fe50d79435e50d8 871874@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id 17b9aee03c020b2c5c2c5bcaa1f036e8dd5cbb2ca6e8c42d46141176de896435 diff --git a/research/atemporal/at1/oracle/fixtures/at1-p4-complex-state-ref-t1.case b/research/atemporal/at1/oracle/fixtures/at1-p4-complex-state-ref-t1.case new file mode 100644 index 000000000..1ee244118 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p4-complex-state-ref-t1.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p4-complex-state-ref-t1 +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 0/1,0/1,0/1 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t1 +reference_system_state (1/1;0/1),(3/5;4/5) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target INTERACTING +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 921e497172361058b52b87444dfff3ae442cf220ce88cea63fbd3463cef926e4 +acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p4-complex-state-ref-t1.values b/research/atemporal/at1/oracle/fixtures/at1-p4-complex-state-ref-t1.values new file mode 100644 index 000000000..3b0f25906 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p4-complex-state-ref-t1.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c90e48cea38a4fa 1943129@20 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6a2576a2576a1 1686715@20 +clock_probability 1 f64:3fcce0c7ce0c7ce1 201266@19 +clock_probability 2 f64:3fd4aed44aed44af 2629559@20 +clock_probability 3 f64:3fd18f9c18f9c191 2325844@20 +pauli 0 X PLUS f64:3fee90c5bce90c5d 1469762@20 +pauli 0 X MINUS f64:3fa6f3a4316f3a3c 1469762@20 +pauli 0 Y PLUS f64:3fd2c234f72c2352 2806878@20 +pauli 0 Y MINUS f64:3fe69ee58469ee58 2806878@20 +pauli 0 Z PLUS f64:3fe01c3f8f01c3fb 3048183@20 +pauli 0 Z MINUS f64:3fdfc780e1fc780b 3048183@20 +pauli 1 X PLUS f64:3fe109afbd94109a 2734384@20 +pauli 1 X MINUS f64:3fddeca084d7decc 2734384@20 +pauli 1 Y PLUS f64:3fef914c1bacf915 905814@20 +pauli 1 Y MINUS f64:3f8bacf914c1bad0 905814@20 +pauli 1 Z PLUS f64:3fe38bc31d0f38bf 2680118@20 +pauli 1 Z MINUS f64:3fd8e879c5e18e83 2680118@20 +pauli 2 X PLUS f64:3fb1df279b883622 137052@19 +pauli 2 X MINUS f64:3fedc41b0c8ef93b 137052@19 +pauli 2 Y PLUS f64:3fe39f656f1826a2 229556@19 +pauli 2 Y MINUS f64:3fd8c13521cfb2b8 229556@19 +pauli 2 Z PLUS f64:3fe74e3fc22c7010 2127512@20 +pauli 2 Z MINUS f64:3fd163807ba71fdd 2127512@20 +pauli 3 X PLUS f64:3fd0a3d70a3d70a6 2251793@20 +pauli 3 X MINUS f64:3fe7ae147ae147ad 2251793@20 +pauli 3 Y PLUS f64:3fb999999999999c 1652381@20 +pauli 3 Y MINUS f64:3feccccccccccccd 1652381@20 +pauli 3 Z PLUS f64:3fe5c28f5c28f5c5 2372173@20 +pauli 3 Z MINUS f64:3fd47ae147ae1476 2372173@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6a2576a2576a4 246561@20 +reference_clock_probability 1 f64:3fcce0c7ce0c7ce1 287692@20 +reference_clock_probability 2 f64:3fd4aed44aed44af 363205@20 +reference_clock_probability 3 f64:3fd18f9c18f9c191 326362@20 +reference_ideal 0 X PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 0 X MINUS f64:3fb9999999999998 1421087@20 +reference_ideal 0 Y PLUS f64:3fc999999999999a 1421087@20 +reference_ideal 0 Y MINUS f64:3fe999999999999a 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe999999999999a 1421087@20 +reference_ideal 1 X MINUS f64:3fc999999999999a 1421087@20 +reference_ideal 1 Y PLUS f64:3feccccccccccccd 1421087@20 +reference_ideal 1 Y MINUS f64:3fb9999999999998 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:3fb9999999999998 1421087@20 +reference_ideal 2 X MINUS f64:3feccccccccccccd 1421087@20 +reference_ideal 2 Y PLUS f64:3fe999999999999a 1421087@20 +reference_ideal 2 Y MINUS f64:3fc999999999999a 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fc999999999999a 1421087@20 +reference_ideal 3 X MINUS f64:3fe999999999999a 1421087@20 +reference_ideal 3 Y PLUS f64:3fb9999999999998 1421087@20 +reference_ideal 3 Y MINUS f64:3feccccccccccccd 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fee90c5bce90c5b 570281@20 +reference_interacting 0 X MINUS f64:3fa6f3a4316f3a45 570281@20 +reference_interacting 0 Y PLUS f64:3fd2c234f72c234e 828239@20 +reference_interacting 0 Y MINUS f64:3fe69ee58469ee59 828239@20 +reference_interacting 0 Z PLUS f64:3fe01c3f8f01c3f9 874792@20 +reference_interacting 0 Z MINUS f64:3fdfc780e1fc780e 874792@20 +reference_interacting 1 X PLUS f64:3fe109afbd94109c 814253@20 +reference_interacting 1 X MINUS f64:3fddeca084d7decb 814253@20 +reference_interacting 1 Y PLUS f64:3fef914c1bacf916 461484@20 +reference_interacting 1 Y MINUS f64:3f8bacf914c1bad5 461484@20 +reference_interacting 1 Z PLUS f64:3fe38bc31d0f38bc 803784@20 +reference_interacting 1 Z MINUS f64:3fd8e879c5e18e87 803784@20 +reference_interacting 2 X PLUS f64:3fb1df279b88361b 551135@20 +reference_interacting 2 X MINUS f64:3fedc41b0c8ef93d 551135@20 +reference_interacting 2 Y PLUS f64:3fe39f656f1826a6 729595@20 +reference_interacting 2 Y MINUS f64:3fd8c13521cfb2b7 729595@20 +reference_interacting 2 Z PLUS f64:3fe74e3fc22c7010 697175@20 +reference_interacting 2 Z MINUS f64:3fd163807ba71fe1 697175@20 +reference_interacting 3 X PLUS f64:3fd0a3d70a3d70a4 721151@20 +reference_interacting 3 X MINUS f64:3fe7ae147ae147ad 721151@20 +reference_interacting 3 Y PLUS f64:3fb999999999999a 605512@20 +reference_interacting 3 Y MINUS f64:3feccccccccccccc 605512@20 +reference_interacting 3 Z PLUS f64:3fe5c28f5c28f5c3 744375@20 +reference_interacting 3 Z MINUS f64:3fd47ae147ae147a 744375@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id 124a409087aa673bdfa6c7877dcdbad5173e75f71d4f9a60c7137fa552f2fb4d diff --git a/research/atemporal/at1/oracle/fixtures/at1-p5-large-rationals.case b/research/atemporal/at1/oracle/fixtures/at1-p5-large-rationals.case new file mode 100644 index 000000000..339d5e897 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p5-large-rationals.case @@ -0,0 +1,43 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p5-large-rationals +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 2 +clock_energies -524289/1048574,524285/1048574 +system_dim 2 +system_hamiltonian_pauli 1/524287,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,0/1 +interaction_pauli 1 524175/1048354,724/524177,-1/2 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/2 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target INTERACTING +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id 03beb780ef16e93140272c9a0c3ef2c90a6d506c90252467f4349afcc8a0d585 +acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p5-large-rationals.values b/research/atemporal/at1/oracle/fixtures/at1-p5-large-rationals.values new file mode 100644 index 000000000..b7da13d32 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p5-large-rationals.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c90bda5e82e59fb 2438566@20 +povm_residual f64:0000000000000000 532909@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fd00004003682e5 2549942@20 +clock_probability 1 f64:3fcfe95ecbab9701 2544697@20 +clock_probability 2 f64:3fcffff7ff92fa33 2549928@20 +clock_probability 3 f64:3fd00b509a2a3480 255517@19 +pauli 0 X PLUS f64:3fe000000001001b 2972161@20 +pauli 0 X MINUS f64:3fdffffffffdffca 2972161@20 +pauli 0 Y PLUS f64:3fdfe95ecbab9598 2972151@20 +pauli 0 Y MINUS f64:3fe00b509a2a3534 2972151@20 +pauli 0 Z PLUS f64:3feffffbffca7d34 362502@20 +pauli 0 Z MINUS f64:3ec000d60b2ed592 362502@20 +pauli 1 X PLUS f64:3fe00b549d35047d 2975778@20 +pauli 1 X MINUS f64:3fdfe956c595f707 2975778@20 +pauli 1 Y PLUS f64:3fe0000400368231 2975788@20 +pauli 1 Y MINUS f64:3fdffff7ff92fb9e 2975788@20 +pauli 1 Z PLUS f64:3feffffbfcf32e61 362522@20 +pauli 1 Z MINUS f64:3ec00c33467b759a 362522@20 +pauli 2 X PLUS f64:3fdfffefff23f430 2972171@20 +pauli 2 X MINUS f64:3fe00008006e05e8 2972171@20 +pauli 2 Y PLUS f64:3fe00b509a2a33ca 2972161@20 +pauli 2 Y MINUS f64:3fdfe95ecbab986c 2972161@20 +pauli 2 Z PLUS f64:3feffffbffc87cfe 362502@20 +pauli 2 Z MINUS f64:3ec000de0c08e6f9 362502@20 +pauli 3 X PLUS f64:3fdfe966c67002a0 2968549@20 +pauli 3 X MINUS f64:3fe00b4c9cc7feb0 2968549@20 +pauli 3 Y PLUS f64:3fdffff7ff92f8ca 2968559@20 +pauli 3 Y MINUS f64:3fe000040036839b 2968559@20 +pauli 3 Z PLUS f64:3feffffc029bcb64 362482@20 +pauli 3 Z MINUS f64:3ebfeb21a4e0d37f 362482@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fd00004003682e6 244555@20 +reference_clock_probability 1 f64:3fcfe95ecbab9705 244093@20 +reference_clock_probability 2 f64:3fcffff7ff92fa33 244553@20 +reference_clock_probability 3 f64:3fd00b509a2a3481 245014@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fe000000001001b 666741@20 +reference_interacting 0 X MINUS f64:3fdffffffffdffcb 666741@20 +reference_interacting 0 Y PLUS f64:3fdfe95ecbab9599 66674@19 +reference_interacting 0 Y MINUS f64:3fe00b509a2a3535 66674@19 +reference_interacting 0 Z PLUS f64:3feffffbffca7d35 356133@20 +reference_interacting 0 Z MINUS f64:3ec000d60b2ed593 356133@20 +reference_interacting 1 X PLUS f64:3fe00b549d35047d 667172@20 +reference_interacting 1 X MINUS f64:3fdfe956c595f709 667172@20 +reference_interacting 1 Y PLUS f64:3fe0000400368231 667173@20 +reference_interacting 1 Y MINUS f64:3fdffff7ff92fb9f 667173@20 +reference_interacting 1 Z PLUS f64:3feffffbfcf32e61 356136@20 +reference_interacting 1 Z MINUS f64:3ec00c33467b759c 356136@20 +reference_interacting 2 X PLUS f64:3fdfffefff23f42f 666743@20 +reference_interacting 2 X MINUS f64:3fe00008006e05e8 666743@20 +reference_interacting 2 Y PLUS f64:3fe00b509a2a33ca 666741@20 +reference_interacting 2 Y MINUS f64:3fdfe95ecbab986b 666741@20 +reference_interacting 2 Z PLUS f64:3feffffbffc87cfe 356133@20 +reference_interacting 2 Z MINUS f64:3ec000de0c08e6fc 356133@20 +reference_interacting 3 X PLUS f64:3fdfe966c67002a0 666311@20 +reference_interacting 3 X MINUS f64:3fe00b4c9cc7feb1 666311@20 +reference_interacting 3 Y PLUS f64:3fdffff7ff92f8cb 666313@20 +reference_interacting 3 Y MINUS f64:3fe000040036839c 666313@20 +reference_interacting 3 Z PLUS f64:3feffffc029bcb64 356131@20 +reference_interacting 3 Z MINUS f64:3ebfeb21a4e0d384 356131@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id d7d3137e4de599763a1de744e35a4e245f6a52b83fcc5b9075ea95164b0394b4 diff --git a/research/atemporal/at1/oracle/fixtures/at1-p6-near-miss-level.case b/research/atemporal/at1/oracle/fixtures/at1-p6-near-miss-level.case new file mode 100644 index 000000000..ec2cf8184 --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p6-near-miss-level.case @@ -0,0 +1,45 @@ +OMEGA-AT1-CASE v1 +domain omega.at1.case.v1 +contract AT1_CASE_V1 +case_name at1-p6-near-miss-level +begin semantic +model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG +energy_unit DIMENSIONLESS_HBAR_1 +clock_dim 4 +clock_energies -3/2,-1/2,1/2,3/2 +system_dim 2 +system_hamiltonian_pauli 0/1,0/1,0/1,1/2 +interaction CLOCK_DIAGONAL_PAULI +interaction_pauli 0 0/1,0/1,1/1 +interaction_pauli 1 0/1,0/1,1/1048576 +interaction_pauli 2 3/10,0/1,-1/10 +interaction_pauli 3 0/1,0/1,0/1 +constraint SUM_HC_HS_V +physical_state NULLSPACE_PROJECTION +reference_clock_label t0 +reference_system_state (1/1;0/1),(1/1;0/1) +clock_povm COVARIANT_DISCRETE +povm_tau_turns 1/4 +povm_weight 1/1 +clock_label_count 4 +clock_label 0 t0 +clock_label 1 t1 +clock_label 2 t2 +clock_label 3 t3 +observables PAULI_X,PAULI_Y,PAULI_Z +end semantic +begin acceptance +control_kind POSITIVE +prediction_target INTERACTING +expected_outcome PASS +expected_failure_codes none +min_bound_kind ESTIMATED +tol_constraint_residual 1@12 +tol_povm_residual 1@12 +tol_probability 1@12 +tol_zero_probability 1@9 +tol_schrodinger 1@12 +end acceptance +case_id e406d8672cb9e4fd563d34ab6a2f7eddc7b931f233f20860a5706cf18e142c6f +acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f +end diff --git a/research/atemporal/at1/oracle/fixtures/at1-p6-near-miss-level.values b/research/atemporal/at1/oracle/fixtures/at1-p6-near-miss-level.values new file mode 100644 index 000000000..fdc489dcf --- /dev/null +++ b/research/atemporal/at1/oracle/fixtures/at1-p6-near-miss-level.values @@ -0,0 +1,112 @@ +begin values +physical_state_kernel_dim 2 +constraint_residual f64:3c9b8427950fa916 626542@19 +povm_residual f64:0000000000000000 1065816@20 +label 0 t0 DEFINED +label 1 t1 DEFINED +label 2 t2 DEFINED +label 3 t3 DEFINED +clock_probability 0 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 1 f64:3fd4924924924926 2789474@20 +clock_probability 2 f64:3fc6db6db6db6db7 1808072@20 +clock_probability 3 f64:3fd4924924924926 2789474@20 +pauli 0 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 0 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 0 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 0 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 0 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 1 X PLUS f64:3fb99999999999a6 1625761@20 +pauli 1 X MINUS f64:3feccccccccccccc 1625761@20 +pauli 1 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 1 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 1 Z PLUS f64:3fe999999999999c 2049257@20 +pauli 1 Z MINUS f64:3fc9999999999992 2049257@20 +pauli 2 X PLUS f64:3fef5c28f5c28f5a 1150724@20 +pauli 2 X MINUS f64:3f947ae147ae1490 1150724@20 +pauli 2 Y PLUS f64:3fdfffffffffffff 3196171@20 +pauli 2 Y MINUS f64:3fdfffffffffffff 3196171@20 +pauli 2 Z PLUS f64:3fe47ae147ae147d 3082535@20 +pauli 2 Z MINUS f64:3fd70a3d70a3d704 3082535@20 +pauli 3 X PLUS f64:3fb99999999999a6 1625761@20 +pauli 3 X MINUS f64:3feccccccccccccc 1625761@20 +pauli 3 Y PLUS f64:3fe0000000000000 2472753@20 +pauli 3 Y MINUS f64:3fe0000000000000 2472753@20 +pauli 3 Z PLUS f64:3fe999999999999c 2049257@20 +pauli 3 Z MINUS f64:3fc9999999999992 2049257@20 +reference_label 0 t0 DEFINED +reference_label 1 t1 DEFINED +reference_label 2 t2 DEFINED +reference_label 3 t3 DEFINED +reference_clock_probability 0 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 1 f64:3fd4924924924926 357353@20 +reference_clock_probability 2 f64:3fc6db6db6db6db7 244682@20 +reference_clock_probability 3 f64:3fd4924924924926 357353@20 +reference_ideal 0 X PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 0 X MINUS f64:0000000000000000 1421087@20 +reference_ideal 0 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 0 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Y PLUS f64:3ff0000000000000 1421087@20 +reference_ideal 1 Y MINUS f64:0000000000000000 1421087@20 +reference_ideal 1 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 1 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 X PLUS f64:0000000000000000 1421087@20 +reference_ideal 2 X MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 2 Y PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Y MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 2 Z MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 X MINUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Y PLUS f64:0000000000000000 1421087@20 +reference_ideal 3 Y MINUS f64:3ff0000000000000 1421087@20 +reference_ideal 3 Z PLUS f64:3fe0000000000000 1421087@20 +reference_ideal 3 Z MINUS f64:3fe0000000000000 1421087@20 +reference_interacting 0 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 0 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 0 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 0 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 0 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 1 X PLUS f64:3fb999999999999d 58222@19 +reference_interacting 1 X MINUS f64:3feccccccccccccd 58222@19 +reference_interacting 1 Y PLUS f64:3fe0000000000001 733518@20 +reference_interacting 1 Y MINUS f64:3fe0000000000001 733518@20 +reference_interacting 1 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 1 Z MINUS f64:3fc9999999999998 657869@20 +reference_interacting 2 X PLUS f64:3fef5c28f5c28f5b 497364@20 +reference_interacting 2 X MINUS f64:3f947ae147ae147f 497364@20 +reference_interacting 2 Y PLUS f64:3fe0000000000000 862742@20 +reference_interacting 2 Y MINUS f64:3fe0000000000000 862742@20 +reference_interacting 2 Z PLUS f64:3fe47ae147ae147c 842443@20 +reference_interacting 2 Z MINUS f64:3fd70a3d70a3d70a 842443@20 +reference_interacting 3 X PLUS f64:3fb999999999999d 58222@19 +reference_interacting 3 X MINUS f64:3feccccccccccccd 58222@19 +reference_interacting 3 Y PLUS f64:3fe0000000000001 733518@20 +reference_interacting 3 Y MINUS f64:3fe0000000000001 733518@20 +reference_interacting 3 Z PLUS f64:3fe999999999999a 657869@20 +reference_interacting 3 Z MINUS f64:3fc9999999999998 657869@20 +end values +begin verdict +check bound_kind_sufficient PASS +check values_finite PASS +check physical_state_nontrivial PASS +check constraint_residual PASS +check povm_normalization PASS +check clock_probability_sum PASS +check probability_range PASS +check pauli_pair_sum PASS +check conditional_defined PASS +check target_agreement PASS +check oracle_cross_check NOT_EVALUATED +check label_status_agreement PASS +outcome PASS +failure_codes none +error_code none +expectation_met YES +end verdict +verdict_id b8ecb2632040ea186e6f9456e6f88e3174af3aa5ad68655f6fea2c2abecdeb0d diff --git a/research/atemporal/at1/oracle/isolation.sh b/research/atemporal/at1/oracle/isolation.sh new file mode 100755 index 000000000..bccbfca28 --- /dev/null +++ b/research/atemporal/at1/oracle/isolation.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# Symbol-isolation gate for the AT-1 oracle compute crate (src/at1/), Rust adaptation of the +# charter's nm gate. +# 1. Source rule: no compute file names a std::time, std::fs, std::process, std::thread, +# std::net, std::env, random or clock facility. +# 2. Object rule: the compute crate compiled alone (rlib) has no undefined reference to a +# clock, file, process, thread, network, environment or random symbol (nm -u over its +# objects). Two symbol families are banned: libc entry points (the extern "C" route) and +# mangled Rust std paths (the std route: a std::time call leaves no libc symbol in the +# rlib, only a mangled std path; both the v0 form _RNv..NtCs_3std4time.. and the +# legacy form _ZN3std4time.. contain the substring 3std4time). +# 3. Negative control: a copy of the crate with a hidden std::time read must be caught by the +# source rule AND by the object rule on its own. +# Portable to macOS (BSD nm prefixes C symbols with an underscore, so anchored names allow +# an optional leading underscore; Mach-O mangled std paths keep the 3std4time substring). +# Exit 0 PASS, 1 FAIL. Prints every offending line. +set -u +cd "$(dirname "$0")" +FLAGS="--edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort" +fail=0 + +echo "== source rule (src/at1/)" +if grep -n -E 'std::(time|fs|process|thread|net|env|io::std(in|out|err))|SystemTime|Instant::|getrandom|rand::|libc::|extern "C"' src/at1/*.rs; then + echo "FAIL: forbidden facility named in compute code"; fail=1 +else + echo "ok: no clock, file, process, thread, network, environment or random facility named" +fi + +echo "== object rule (nm -u on the compute rlib)" +./build.sh lib >/dev/null || { echo "FAIL: compute crate did not build alone"; exit 1; } +rm -rf target/iso && mkdir -p target/iso && (cd target/iso && ar x ../libat1.rlib) || { echo "FAIL: cannot unpack rlib"; exit 1; } +objs=$(ls target/iso/*.o 2>/dev/null) +[ -n "$objs" ] || { echo "FAIL: no objects in rlib"; exit 1; } +libc_names='clock_gettime|gettimeofday|^_?time$|nanosleep|getrandom|/dev/urandom|pthread_create|socket|connect|fopen|open64|openat|^_?read$|^_?write$|pread64|pwrite64|fork|execve|system|getenv|mach_absolute_time|arc4random' +std_paths='3std4time|3std2fs|3std7process|3std6thread|3std3net|3std3env|3std2io5stdio|6random' +banned="$libc_names|$std_paths" +object_rule() { + nm -u "$@" 2>/dev/null | awk '{print $NF}' | sort -u | grep -E "$banned" +} +if object_rule $objs; then + echo "FAIL: banned undefined symbol in compute objects"; fail=1 +else + echo "ok: no clock, random, thread, socket, file, process or environment symbol referenced (libc names and mangled std paths)" +fi + +echo "== negative control: a copy that reads the clock must be caught" +rm -rf target/mutant && mkdir -p target/mutant && cp -r src/at1 target/mutant/at1 +printf '\npub fn hidden_clock() -> u64 { std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0) }\n' >> target/mutant/at1/mod.rs +if grep -q -E 'std::(time|fs|process|thread|net|env)' target/mutant/at1/*.rs; then + echo "ok: mutant caught by the source rule" +else + echo "FAIL: mutant not caught by the source rule"; fail=1 +fi +# Agent 5 finding D5: the object rule must catch the std::time mutant on its own. +if rustc $FLAGS --crate-type lib --crate-name at1_mutant target/mutant/at1/mod.rs -o target/mutant/libat1_mutant.rlib 2>/dev/null \ + && rm -rf target/mutant/iso && mkdir -p target/mutant/iso && (cd target/mutant/iso && ar x ../libat1_mutant.rlib) \ + && object_rule target/mutant/iso/*.o >/dev/null; then + echo "ok: mutant caught by the object rule (nm -u, mangled std path)" +else + echo "FAIL: mutant not caught by the object rule"; fail=1 +fi + +[ $fail -eq 0 ] && echo "ISOLATION PASS" || echo "ISOLATION FAIL" +exit $fail diff --git a/research/atemporal/at1/oracle/src/at1/big.rs b/research/atemporal/at1/oracle/src/at1/big.rs new file mode 100644 index 000000000..d26638959 --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/big.rs @@ -0,0 +1,670 @@ +//! Arbitrary-precision integers and rationals, standard library only. +//! +//! AT1_CASE_V1 section 2: rules 3 and 4, the kernel test and the zero test are decided +//! exactly for every case within the token limits ("the sum of three squared rationals can +//! carry a denominator near 2^240"), with no implementation-defined refusal. Nothing here +//! has a fixed width: magnitudes are little-endian u32 limb vectors. +//! +//! Division is binary shift-and-subtract and the gcd is Stein's binary algorithm, chosen +//! for being short and easy to audit rather than fast; every number this oracle meets is a +//! few thousand bits at most. + +use std::cmp::Ordering; + +/// Unsigned magnitude, little-endian limbs, no trailing zero limb (zero is empty). +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub struct Nat(Vec); + +impl Nat { + pub fn zero() -> Nat { + Nat(Vec::new()) + } + pub fn one() -> Nat { + Nat(vec![1]) + } + pub fn from_u64(mut v: u64) -> Nat { + let mut l = Vec::new(); + while v != 0 { + l.push(v as u32); + v >>= 32; + } + Nat(l) + } + fn trim(mut self) -> Nat { + while self.0.last() == Some(&0) { + self.0.pop(); + } + self + } + pub fn is_zero(&self) -> bool { + self.0.is_empty() + } + pub fn is_even(&self) -> bool { + self.0.first().map(|l| l & 1 == 0).unwrap_or(true) + } + /// Decimal digit string (only ASCII digits; caller checked). + pub fn from_decimal(s: &str) -> Nat { + let mut n = Nat::zero(); + for b in s.bytes() { + n = n.mul_small(10).add(&Nat::from_u64((b - b'0') as u64)); + } + n + } + pub fn to_decimal(&self) -> String { + if self.is_zero() { + return "0".to_string(); + } + let mut digits = Vec::new(); + let mut cur = self.clone(); + while !cur.is_zero() { + let (q, r) = cur.divrem_small(1_000_000_000); + digits.push(r); + cur = q; + } + let mut s = format!("{}", digits.pop().unwrap()); + while let Some(d) = digits.pop() { + s.push_str(&format!("{:09}", d)); + } + s + } + /// Value if it fits in u64. + pub fn to_u64(&self) -> Option { + match self.0.len() { + 0 => Some(0), + 1 => Some(self.0[0] as u64), + 2 => Some(self.0[0] as u64 | (self.0[1] as u64) << 32), + _ => None, + } + } + pub fn bits(&self) -> u64 { + match self.0.last() { + None => 0, + Some(&top) => (self.0.len() as u64 - 1) * 32 + (32 - top.leading_zeros() as u64), + } + } + pub fn bit(&self, i: u64) -> bool { + let (w, b) = ((i / 32) as usize, i % 32); + self.0.get(w).map(|l| (l >> b) & 1 == 1).unwrap_or(false) + } + pub fn add(&self, o: &Nat) -> Nat { + let n = self.0.len().max(o.0.len()); + let mut out = Vec::with_capacity(n + 1); + let mut carry = 0u64; + for i in 0..n { + let s = *self.0.get(i).unwrap_or(&0) as u64 + *o.0.get(i).unwrap_or(&0) as u64 + carry; + out.push(s as u32); + carry = s >> 32; + } + if carry != 0 { + out.push(carry as u32); + } + Nat(out).trim() + } + /// self - o; panics if o > self (a logic error, never input-driven). + pub fn sub(&self, o: &Nat) -> Nat { + assert!(self.cmp(o) != Ordering::Less, "Nat::sub underflow"); + let mut out = Vec::with_capacity(self.0.len()); + let mut borrow = 0i64; + for i in 0..self.0.len() { + let mut d = self.0[i] as i64 - *o.0.get(i).unwrap_or(&0) as i64 - borrow; + if d < 0 { + d += 1 << 32; + borrow = 1; + } else { + borrow = 0; + } + out.push(d as u32); + } + Nat(out).trim() + } + pub fn mul_small(&self, m: u32) -> Nat { + let mut out = Vec::with_capacity(self.0.len() + 1); + let mut carry = 0u64; + for &l in &self.0 { + let p = l as u64 * m as u64 + carry; + out.push(p as u32); + carry = p >> 32; + } + if carry != 0 { + out.push(carry as u32); + } + Nat(out).trim() + } + pub fn mul(&self, o: &Nat) -> Nat { + if self.is_zero() || o.is_zero() { + return Nat::zero(); + } + let mut out = vec![0u32; self.0.len() + o.0.len()]; + for (i, &a) in self.0.iter().enumerate() { + let mut carry = 0u64; + for (j, &b) in o.0.iter().enumerate() { + let t = out[i + j] as u64 + a as u64 * b as u64 + carry; + out[i + j] = t as u32; + carry = t >> 32; + } + let mut k = i + o.0.len(); + while carry != 0 { + let t = out[k] as u64 + carry; + out[k] = t as u32; + carry = t >> 32; + k += 1; + } + } + Nat(out).trim() + } + pub fn shl(&self, bits: u64) -> Nat { + if self.is_zero() { + return Nat::zero(); + } + let (words, rem) = ((bits / 32) as usize, (bits % 32) as u32); + let mut out = vec![0u32; words]; + let mut carry = 0u32; + for &l in &self.0 { + if rem == 0 { + out.push(l); + } else { + out.push((l << rem) | carry); + carry = l >> (32 - rem); + } + } + if carry != 0 { + out.push(carry); + } + Nat(out).trim() + } + pub fn shr(&self, bits: u64) -> Nat { + let (words, rem) = ((bits / 32) as usize, (bits % 32) as u32); + if words >= self.0.len() { + return Nat::zero(); + } + let src = &self.0[words..]; + let mut out = Vec::with_capacity(src.len()); + for i in 0..src.len() { + let lo = src[i] >> rem; + let hi = if rem == 0 { 0 } else { src.get(i + 1).map(|h| h << (32 - rem)).unwrap_or(0) }; + out.push(lo | hi); + } + Nat(out).trim() + } + fn divrem_small(&self, d: u32) -> (Nat, u32) { + let mut out = vec![0u32; self.0.len()]; + let mut rem = 0u64; + for i in (0..self.0.len()).rev() { + let cur = (rem << 32) | self.0[i] as u64; + out[i] = (cur / d as u64) as u32; + rem = cur % d as u64; + } + (Nat(out).trim(), rem as u32) + } + /// (floor(self / d), self mod d); d must be nonzero. + pub fn divrem(&self, d: &Nat) -> (Nat, Nat) { + assert!(!d.is_zero(), "division by zero"); + if self.cmp(d) == Ordering::Less { + return (Nat::zero(), self.clone()); + } + if d.0.len() == 1 { + let (q, r) = self.divrem_small(d.0[0]); + return (q, Nat::from_u64(r as u64)); + } + let nb = self.bits(); + let mut q = vec![0u32; self.0.len()]; + let mut r = Nat::zero(); + for i in (0..nb).rev() { + r = r.shl(1); + if self.bit(i) { + r = r.add(&Nat::one()); + } + if r.cmp(d) != Ordering::Less { + r = r.sub(d); + q[(i / 32) as usize] |= 1 << (i % 32); + } + } + (Nat(q).trim(), r) + } + /// Stein's binary gcd; gcd(0, x) = x. + pub fn gcd(&self, o: &Nat) -> Nat { + let (mut a, mut b) = (self.clone(), o.clone()); + if a.is_zero() { + return b; + } + if b.is_zero() { + return a; + } + let mut shift = 0u64; + while a.is_even() && b.is_even() { + a = a.shr(1); + b = b.shr(1); + shift += 1; + } + while a.is_even() { + a = a.shr(1); + } + loop { + while b.is_even() { + b = b.shr(1); + } + if a.cmp(&b) == Ordering::Greater { + std::mem::swap(&mut a, &mut b); + } + b = b.sub(&a); + if b.is_zero() { + break; + } + } + a.shl(shift) + } + /// floor(sqrt(self)), digit-by-digit in base 4 (shifts, adds, compares only). + pub fn isqrt(&self) -> Nat { + if self.is_zero() { + return Nat::zero(); + } + let mut rem = self.clone(); + let mut res = Nat::zero(); + let mut bit_pos = (self.bits() - 1) & !1u64; // highest even bit position + loop { + let bit = Nat::one().shl(bit_pos); + let trial = res.add(&bit); + if rem.cmp(&trial) != Ordering::Less { + rem = rem.sub(&trial); + res = res.shr(1).add(&bit); + } else { + res = res.shr(1); + } + if bit_pos < 2 { + break; + } + bit_pos -= 2; + } + res + } +} + +impl Ord for Nat { + fn cmp(&self, o: &Nat) -> Ordering { + if self.0.len() != o.0.len() { + return self.0.len().cmp(&o.0.len()); + } + for i in (0..self.0.len()).rev() { + if self.0[i] != o.0[i] { + return self.0[i].cmp(&o.0[i]); + } + } + Ordering::Equal + } +} +impl PartialOrd for Nat { + fn partial_cmp(&self, o: &Nat) -> Option { + Some(self.cmp(o)) + } +} + +/// Signed integer: sign flag plus magnitude; zero is never negative. +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub struct Int { + pub neg: bool, + pub mag: Nat, +} + +impl Int { + pub fn zero() -> Int { + Int { neg: false, mag: Nat::zero() } + } + pub fn from_i64(v: i64) -> Int { + Int { neg: v < 0, mag: Nat::from_u64(v.unsigned_abs()) } + } + pub fn from_nat(neg: bool, mag: Nat) -> Int { + let neg = neg && !mag.is_zero(); + Int { neg, mag } + } + pub fn is_zero(&self) -> bool { + self.mag.is_zero() + } + pub fn neg(&self) -> Int { + Int::from_nat(!self.neg, self.mag.clone()) + } + pub fn add(&self, o: &Int) -> Int { + if self.neg == o.neg { + return Int::from_nat(self.neg, self.mag.add(&o.mag)); + } + match self.mag.cmp(&o.mag) { + Ordering::Equal => Int::zero(), + Ordering::Greater => Int::from_nat(self.neg, self.mag.sub(&o.mag)), + Ordering::Less => Int::from_nat(o.neg, o.mag.sub(&self.mag)), + } + } + pub fn sub(&self, o: &Int) -> Int { + self.add(&o.neg()) + } + pub fn mul(&self, o: &Int) -> Int { + Int::from_nat(self.neg != o.neg, self.mag.mul(&o.mag)) + } + pub fn mul_nat(&self, o: &Nat) -> Int { + Int::from_nat(self.neg, self.mag.mul(o)) + } + pub fn to_decimal(&self) -> String { + format!("{}{}", if self.neg { "-" } else { "" }, self.mag.to_decimal()) + } +} + +impl Ord for Int { + fn cmp(&self, o: &Int) -> Ordering { + match (self.neg, o.neg) { + (false, true) => Ordering::Greater, + (true, false) => Ordering::Less, + (false, false) => self.mag.cmp(&o.mag), + (true, true) => o.mag.cmp(&self.mag), + } + } +} +impl PartialOrd for Int { + fn partial_cmp(&self, o: &Int) -> Option { + Some(self.cmp(o)) + } +} + +/// Exact rational num/den with den > 0. `Q::new` reduces; the arithmetic helpers reduce +/// too (the judge's exact comparisons use `cmp`, which needs no reduction). +#[derive(Clone, Debug)] +pub struct Q { + pub num: Int, + pub den: Nat, +} + +impl Q { + pub fn new(num: Int, den: Nat) -> Q { + assert!(!den.is_zero(), "zero denominator"); + if num.is_zero() { + return Q { num: Int::zero(), den: Nat::one() }; + } + let g = num.mag.gcd(&den); + if g == Nat::one() { + return Q { num, den }; + } + Q { num: Int::from_nat(num.neg, num.mag.divrem(&g).0), den: den.divrem(&g).0 } + } + /// Unreduced constructor (exact value, no gcd). + pub fn raw(num: Int, den: Nat) -> Q { + assert!(!den.is_zero(), "zero denominator"); + Q { num, den } + } + pub fn zero() -> Q { + Q { num: Int::zero(), den: Nat::one() } + } + pub fn one() -> Q { + Q::int(1) + } + pub fn int(v: i64) -> Q { + Q { num: Int::from_i64(v), den: Nat::one() } + } + pub fn frac(n: i64, d: i64) -> Q { + assert!(d != 0); + let (n, d) = if d < 0 { (-n, -d) } else { (n, d) }; + Q::new(Int::from_i64(n), Nat::from_u64(d as u64)) + } + pub fn is_zero(&self) -> bool { + self.num.is_zero() + } + pub fn is_neg(&self) -> bool { + self.num.neg + } + pub fn neg(&self) -> Q { + Q { num: self.num.neg(), den: self.den.clone() } + } + pub fn abs(&self) -> Q { + Q { num: Int::from_nat(false, self.num.mag.clone()), den: self.den.clone() } + } + pub fn add(&self, o: &Q) -> Q { + Q::new(self.num.mul_nat(&o.den).add(&o.num.mul_nat(&self.den)), self.den.mul(&o.den)) + } + pub fn sub(&self, o: &Q) -> Q { + self.add(&o.neg()) + } + pub fn mul(&self, o: &Q) -> Q { + Q::new(self.num.mul(&o.num), self.den.mul(&o.den)) + } + /// self / o; o nonzero. + pub fn div(&self, o: &Q) -> Q { + assert!(!o.is_zero(), "division by zero rational"); + Q::new(Int::from_nat(self.num.neg != o.num.neg, self.num.mag.mul(&o.den)), self.den.mul(&o.num.mag)) + } + /// Unreduced add, for the judge (exact, cheaper on 2^-1074 denominators). + pub fn add_raw(&self, o: &Q) -> Q { + if self.den == o.den { + return Q { num: self.num.add(&o.num), den: self.den.clone() }; + } + Q { num: self.num.mul_nat(&o.den).add(&o.num.mul_nat(&self.den)), den: self.den.mul(&o.den) } + } + pub fn sub_raw(&self, o: &Q) -> Q { + self.add_raw(&o.neg()) + } + /// Exact square root of a nonnegative rational, if it is the square of a rational. + pub fn sqrt_exact(&self) -> Option { + if self.num.neg { + return None; + } + let r = Q::new(self.num.clone(), self.den.clone()); + let (a, b) = (r.num.mag.isqrt(), r.den.isqrt()); + if a.mul(&a) == r.num.mag && b.mul(&b) == r.den { + Some(Q::new(Int::from_nat(false, a), b)) + } else { + None + } + } + /// Fractional part in [0, 1): self - floor(self). + pub fn frac_part(&self) -> Q { + let r = Q::new(self.num.clone(), self.den.clone()); + let (_, rem) = r.num.mag.divrem(&r.den); + if rem.is_zero() { + return Q::zero(); + } + if r.num.neg { + Q::new(Int::from_nat(false, r.den.sub(&rem)), r.den.clone()) + } else { + Q::new(Int::from_nat(false, rem), r.den.clone()) + } + } + /// floor(self + 1/2) as i64 (callers use it on values of order one). + pub fn round_half_up_i64(&self) -> i64 { + let twice = Q::raw(self.num.mul_nat(&Nat::from_u64(2)).add(&Int::from_nat(false, self.den.clone())), self.den.mul_small(2)); + // floor of twice.num / twice.den + let (q, r) = twice.num.mag.divrem(&twice.den); + let q = q.to_u64().expect("round of a small rational") as i64; + if twice.num.neg { + if r.is_zero() { + -q + } else { + -q - 1 + } + } else { + q + } + } + /// Exact value of a finite binary64. + pub fn from_f64(x: f64) -> Option { + if !x.is_finite() { + return None; + } + let bits = x.to_bits(); + let neg = bits >> 63 == 1; + let exp = ((bits >> 52) & 0x7ff) as i64; + let frac = bits & ((1u64 << 52) - 1); + let (m, e) = if exp == 0 { (frac, -1074i64) } else { (frac | (1u64 << 52), exp - 1075) }; + if m == 0 { + return Some(Q::zero()); + } + let mag = Nat::from_u64(m); + Some(if e >= 0 { Q::raw(Int::from_nat(neg, mag.shl(e as u64)), Nat::one()) } else { Q::raw(Int::from_nat(neg, mag), Nat::one().shl((-e) as u64)) }) + } + /// n / 10^k. + pub fn from_scaled(n: &Nat, k: u32) -> Q { + let mut d = Nat::one(); + for _ in 0..k { + d = d.mul_small(10); + } + Q::raw(Int::from_nat(false, n.clone()), d) + } + /// Correctly rounded (round half to even) binary64 value. Values met here are far from + /// the overflow and subnormal ranges; both are still handled. + pub fn to_f64(&self) -> f64 { + if self.num.is_zero() { + return 0.0; + } + let (a, b) = (&self.num.mag, &self.den); + // choose s so that q = floor(a * 2^s / b) has 54 or 55 bits + let s: i64 = 55 - (a.bits() as i64 - b.bits() as i64); + let (num, den) = if s >= 0 { (a.shl(s as u64), b.clone()) } else { (a.clone(), b.shl((-s) as u64)) }; + let (q, r) = num.divrem(&den); + let mut q = q.to_u64().expect("55-bit quotient"); + let mut e = -s; // value = (q + r/den) * 2^e + let sticky = !r.is_zero(); + // normalise to exactly 53 significant bits plus guard bit and sticky + let qb = 64 - q.leading_zeros() as i64; + let mut drop = qb - 53; + // subnormal handling: the lowest representable exponent for the integer significand is -1074 + if e + drop < -1074 { + drop = -1074 - e; + } + let result_sig: u64; + if drop > 0 { + if drop >= 64 { + return if self.num.neg { -0.0 } else { 0.0 }; + } + let mask = (1u64 << drop) - 1; + let low = q & mask; + let half = 1u64 << (drop - 1); + q >>= drop; + e += drop; + let round_up = low > half || (low == half && (sticky || q & 1 == 1)); + result_sig = q + if round_up { 1 } else { 0 }; + } else { + // q already exact to 53 bits or fewer; the remainder only matters below one ulp, + // which cannot happen because q has at least 54 bits (drop >= 1) for normal results + result_sig = q; + } + // result_sig * 2^e, result_sig < 2^54 (rounding may carry to 2^53) + let v = (result_sig as f64) * pow2(e); + if self.num.neg { + -v + } else { + v + } + } +} + +/// 2^e as binary64 for e in the normal range, by repeated scaling (exact). +fn pow2(e: i64) -> f64 { + let mut v = 1.0f64; + let mut e = e; + while e > 0 { + let step = e.min(1000); + v *= f64::from_bits(((step + 1023) as u64) << 52); + e -= step; + } + while e < 0 { + let step = (-e).min(1000); + v *= f64::from_bits(((1023 - step) as u64) << 52); + e += step; + } + v +} + +/// Equality by value (consistent with `Ord`): an unreduced `Q::raw` equals its reduced form. +impl PartialEq for Q { + fn eq(&self, o: &Q) -> bool { + self.cmp(o) == Ordering::Equal + } +} +impl Eq for Q {} + +impl Ord for Q { + fn cmp(&self, o: &Q) -> Ordering { + self.num.mul_nat(&o.den).cmp(&o.num.mul_nat(&self.den)) + } +} +impl PartialOrd for Q { + fn partial_cmp(&self, o: &Q) -> Option { + Some(self.cmp(o)) + } +} + +/// Gaussian rational re + i im. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct GQ { + pub re: Q, + pub im: Q, +} + +impl GQ { + pub fn new(re: Q, im: Q) -> GQ { + GQ { re, im } + } + pub fn zero() -> GQ { + GQ { re: Q::zero(), im: Q::zero() } + } + pub fn is_zero(&self) -> bool { + self.re.is_zero() && self.im.is_zero() + } + pub fn conj(&self) -> GQ { + GQ { re: self.re.clone(), im: self.im.neg() } + } + pub fn add(&self, o: &GQ) -> GQ { + GQ { re: self.re.add(&o.re), im: self.im.add(&o.im) } + } + pub fn sub(&self, o: &GQ) -> GQ { + GQ { re: self.re.sub(&o.re), im: self.im.sub(&o.im) } + } + pub fn mul(&self, o: &GQ) -> GQ { + GQ { re: self.re.mul(&o.re).sub(&self.im.mul(&o.im)), im: self.re.mul(&o.im).add(&self.im.mul(&o.re)) } + } + pub fn scale(&self, s: &Q) -> GQ { + GQ { re: self.re.mul(s), im: self.im.mul(s) } + } + pub fn norm2(&self) -> Q { + self.re.mul(&self.re).add(&self.im.mul(&self.im)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn nat_int_q_basics() { + let a = Nat::from_decimal("340282366920938463463374607431768211457"); + assert_eq!(a.to_decimal(), "340282366920938463463374607431768211457"); + let b = Nat::from_decimal("18446744073709551629"); + let (q, r) = a.divrem(&b); + assert_eq!(q.mul(&b).add(&r), a); + assert!(r < b); + assert_eq!(Nat::from_u64(48).gcd(&Nat::from_u64(180)), Nat::from_u64(12)); + assert_eq!(Nat::from_u64(1 << 40).isqrt(), Nat::from_u64(1 << 20)); + assert_eq!(Nat::from_u64(99).isqrt(), Nat::from_u64(9)); + let big = Nat::from_decimal("274763624041").mul(&Nat::from_decimal("274763624041")); + assert_eq!(big.isqrt(), Nat::from_decimal("274763624041")); + assert_eq!(Q::frac(2, 4), Q::frac(1, 2)); + assert_eq!(Q::frac(9, 100).sqrt_exact(), Some(Q::frac(3, 10))); + assert_eq!(Q::frac(41, 100).sqrt_exact(), None); + assert!(Q::frac(-3, 2) < Q::frac(-1, 2)); + assert_eq!(Q::frac(-7, 4).frac_part(), Q::frac(1, 4)); + assert_eq!(Q::frac(7, 4).frac_part(), Q::frac(3, 4)); + assert_eq!(Q::frac(3, 8).round_half_up_i64(), 0); + assert_eq!(Q::frac(1, 2).round_half_up_i64(), 1); + assert_eq!(Q::frac(-1, 2).round_half_up_i64(), 0); + assert_eq!(Q::frac(-5, 8).round_half_up_i64(), -1); + } + + #[test] + fn to_f64_is_correctly_rounded() { + for (n, d) in [(1i64, 3i64), (2, 3), (1, 10), (-7, 9), (524181, 2096716), (274763624041, 549527248074), (1, 1 << 40), (5, 28)] { + assert_eq!(Q::frac(n, d).to_f64(), n as f64 / d as f64, "{}/{}", n, d); + } + for x in [0.1f64, 1.0, -2.5, 1e-300, 5e-324, 1.7976931348623157e308, 0.30000000000000004] { + assert_eq!(Q::from_f64(x).unwrap().to_f64(), x); + } + // halfway case rounds to even: (2^53 + 1) / 1 -> 2^53 + let h = Q::raw(Int::from_nat(false, Nat::from_u64((1u64 << 53) + 1)), Nat::one()); + assert_eq!(h.to_f64(), 9007199254740992.0); + let h3 = Q::raw(Int::from_nat(false, Nat::from_u64((1u64 << 53) + 3)), Nat::one()); + assert_eq!(h3.to_f64(), 9007199254740996.0); + } +} diff --git a/research/atemporal/at1/oracle/src/at1/case.rs b/research/atemporal/at1/oracle/src/at1/case.rs new file mode 100644 index 000000000..b16314a2d --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/case.rs @@ -0,0 +1,642 @@ +//! AT1_CASE_V1 codec: byte rules, canonical encodings, exact validity rules in the order of +//! section 4, identities (section 5). Contract: aien-architecture +//! docs/plans/atemporal/AT1_CASE_V1.md, sha256 e62018d8..., frozen at `CONTRACT_COMMIT`. +//! +//! Readings followed (AT1_CHARTER.md section 8, ruled on omega#371): +//! - (b, inherited) shape before range: fixed literals, enumerations, counts, list arity and +//! index order are shape (`CASE_PARSE_ERROR`); `CASE_NONCANONICAL` is decided after the +//! whole shape pass; `CASE_INVALID_PARAMETER` is for the ranges of section 3. +//! - (d) the first token of each version-bearing line is its key (shape, step 1); the rest +//! is its value (step 2, `CASE_UNSUPPORTED_VERSION`). +//! - (e) index tokens are compared with their position by parsed value in the shape pass. +//! +//! Token readings this oracle declares where the frozen text leaves room (README, section +//! "Declared readings"), matching the qualified AT-0 engine: an integer token is `-?[0-9]+` +//! (so `+4` does not parse: shape); a scaled token is `@` and a negative part is +//! non-canonical; a wrong arity in a fixed-arity list is shape. + +use super::big::{Int, Nat, Q, GQ}; +use super::sha256::{sha256_hex, tagged_hex}; + +/// aien-architecture commit that froze AT1_CASE_V1 and AT1_RESULT_V1 (gate AT1-G0, PR 184). +pub const CONTRACT_COMMIT: &str = "cbe4c8ed88d28bb96d5209327ecd30aa9cddaf7a"; +pub const CASE_DOMAIN: &str = "omega.at1.case.v1"; +pub const ACCEPTANCE_DOMAIN: &str = "omega.at1.acceptance.v1"; +pub const RATIONAL_LIMIT: u64 = 1_048_576; +pub const FAILURE_CODES: [&str; 12] = [ + "BOUND_KIND_INSUFFICIENT", + "CONDITIONAL_UNDEFINED", + "CONSTRAINT_RESIDUAL_EXCEEDED", + "INTERACTING_DEVIATION_EXCEEDED", + "NONFINITE_VALUE", + "ORACLE_DISAGREEMENT", + "POVM_NORMALIZATION_EXCEEDED", + "PRECISION_INSUFFICIENT", + "PROBABILITY_OUT_OF_RANGE", + "PROBABILITY_SUM_EXCEEDED", + "SCHRODINGER_DEVIATION_EXCEEDED", + "TRIVIAL_PHYSICAL_STATE", +]; +pub const BOUND_KINDS: [&str; 3] = ["NONE", "ESTIMATED", "RIGOROUS"]; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Refusal { + pub code: &'static str, + pub detail: String, +} + +fn refuse(code: &'static str, detail: impl Into) -> Result { + Err(Refusal { code, detail: detail.into() }) +} +fn shape(detail: impl Into) -> Result { + refuse("CASE_PARSE_ERROR", detail) +} + +/// Scaled decimal n / 10^k as written (tolerances and bounds). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Scaled { + pub n: Nat, + pub k: u64, +} + +impl Scaled { + pub fn exact(&self) -> Q { + Q::from_scaled(&self.n, self.k.min(40) as u32) + } +} + +#[derive(Clone, Debug)] +pub struct Case { + pub name: String, + pub clock_dim: usize, + pub energies: Vec, + pub h0: Q, + pub h: [Q; 3], + pub v: Vec<[Q; 3]>, + pub ref_label: String, + pub ref_index: usize, + pub psi: [GQ; 2], + pub tau: Q, + pub weight: Q, + pub labels: Vec, + pub control_kind: String, + pub prediction_target: String, + pub expected_outcome: String, + pub expected_codes: Vec, + pub min_bound_kind: String, + pub tol_constraint: Scaled, + pub tol_povm: Scaled, + pub tol_probability: Scaled, + pub tol_zero: Scaled, + pub tol_schrodinger: Scaled, + pub case_id: String, + pub acceptance_id: String, + pub semantic_block: String, + pub acceptance_block: String, + pub file_sha256: String, + /// Level norms R_j = |h + v_j|, exact rationals (validity rule 4). + pub level_norm: Vec, +} + +impl Case { + /// n_j = h + v_j. + pub fn level_vector(&self, j: usize) -> [Q; 3] { + [self.h[0].add(&self.v[j][0]), self.h[1].add(&self.v[j][1]), self.h[2].add(&self.v[j][2])] + } +} + +// ---- token parsers: Ok((value, canonical)) or a shape refusal ------------------------- + +/// Integer grammar `-?[0-9]+`. Canonical: no leading zero (except `0`), not `-0`. +pub fn parse_int(tok: &str) -> Result<(Int, bool), Refusal> { + let (neg, digits) = match tok.strip_prefix('-') { + Some(d) => (true, d), + None => (false, tok), + }; + if digits.is_empty() || !digits.bytes().all(|b| b.is_ascii_digit()) { + return shape(format!("integer {:?}", tok)); + } + let canonical = (digits == "0" || !digits.starts_with('0')) && !(neg && digits.starts_with('0')); + Ok((Int::from_nat(neg, Nat::from_decimal(digits)), canonical)) +} + +/// Small integer value for counts and indices: None when it does not fit (or is negative), +/// which can then never equal a count or a position. +fn small(i: &Int) -> Option { + if i.neg { + return None; + } + i.mag.to_u64().filter(|v| *v <= 1 << 40).map(|v| v as usize) +} + +/// Rational `n/d`. Canonical: both integers canonical, d >= 1, gcd(|n|, d) = 1. +pub fn parse_rational(tok: &str) -> Result<(Q, bool), Refusal> { + let mut parts = tok.split('/'); + let (a, b) = match (parts.next(), parts.next(), parts.next()) { + (Some(a), Some(b), None) => (a, b), + _ => return shape(format!("rational {:?}", tok)), + }; + let (n, cn) = parse_int(a)?; + let (d, cd) = parse_int(b)?; + if d.neg || d.is_zero() { + return Ok((Q::zero(), false)); // d < 1: non-canonical; value never used + } + let reduced = n.mag.gcd(&d.mag) == Nat::one(); + Ok((Q::raw(n, d.mag), cn && cd && reduced)) +} + +/// Complex rational `(re;im)`. +pub fn parse_complex(tok: &str) -> Result<(GQ, bool), Refusal> { + let inner = match tok.strip_prefix('(').and_then(|t| t.strip_suffix(')')) { + Some(i) => i, + None => return shape(format!("complex {:?}", tok)), + }; + let mut parts = inner.split(';'); + match (parts.next(), parts.next(), parts.next()) { + (Some(a), Some(b), None) => { + let (re, ca) = parse_rational(a)?; + let (im, cb) = parse_rational(b)?; + Ok((GQ::new(re, im), ca && cb)) + } + _ => shape(format!("complex {:?}", tok)), + } +} + +/// Scaled decimal `N@k`. Canonical: both parts canonical and nonnegative; zero is `0@0`; +/// N not divisible by 10 unless k = 0. k > 40 is a range error (rule 3), checked later. +pub fn parse_scaled(tok: &str) -> Result<(Scaled, bool), Refusal> { + let mut parts = tok.split('@'); + let (a, b) = match (parts.next(), parts.next(), parts.next()) { + (Some(a), Some(b), None) => (a, b), + _ => return shape(format!("scaled {:?}", tok)), + }; + let (n, cn) = parse_int(a)?; + let (k, ck) = parse_int(b)?; + let k_val = if k.neg { 0 } else { k.mag.to_u64().unwrap_or(u64::MAX) }; + let ten = Nat::from_u64(10); + let n_div10 = !n.is_zero() && n.mag.divrem(&ten).1.is_zero(); + let canonical = cn && ck && !n.neg && !k.neg && !(n.is_zero() && k_val != 0) && !(n_div10 && k_val != 0); + Ok((Scaled { n: n.mag, k: k_val }, canonical)) +} + +/// Comma list without spaces; items nonempty. +fn split_list(tok: &str) -> Result, Refusal> { + let items: Vec<&str> = tok.split(',').collect(); + if items.iter().any(|s| s.is_empty()) { + return shape(format!("list {:?}", tok)); + } + Ok(items) +} + +pub fn is_label(s: &str) -> bool { + let b = s.as_bytes(); + !b.is_empty() && b.len() <= 32 && b[0].is_ascii_lowercase() && b.iter().all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || *c == b'_') +} + +pub fn is_name(s: &str) -> bool { + let b = s.as_bytes(); + !b.is_empty() && b.len() <= 64 && b[0].is_ascii_alphanumeric() && b.iter().all(|c| c.is_ascii_alphanumeric() || matches!(c, b'_' | b'.' | b'-')) +} + +pub fn is_digest(s: &str) -> bool { + s.len() == 64 && s.bytes().all(|c| c.is_ascii_digit() || (b'a'..=b'f').contains(&c)) +} + +// ---- byte rules ----------------------------------------------------------------------- + +pub fn check_bytes(data: &[u8]) -> Result, Refusal> { + if data.last() != Some(&b'\n') { + return shape("missing final LF"); + } + if let Some(b) = data.iter().find(|b| **b != 0x0A && !(0x20..=0x7E).contains(*b)) { + return shape(format!("byte 0x{:02x}", b)); + } + let text = std::str::from_utf8(data).map_err(|_| Refusal { code: "CASE_PARSE_ERROR", detail: "ascii".into() })?; + let mut lines: Vec<&str> = text.split('\n').collect(); + lines.pop(); + for ln in &lines { + if ln.is_empty() || ln.starts_with(' ') || ln.ends_with(' ') || ln.contains(" ") { + return shape(format!("line spacing {:?}", ln)); + } + } + Ok(lines) +} + +struct Cursor<'a> { + lines: Vec<&'a str>, + pos: usize, +} + +impl<'a> Cursor<'a> { + fn peek_key(&self) -> Option<&'a str> { + self.lines.get(self.pos).map(|l| l.split(' ').next().unwrap_or("")) + } + /// Next line must be ` ` with a nonempty value; returns the value. + fn keyed(&mut self, key: &str) -> Result<&'a str, Refusal> { + let line = match self.lines.get(self.pos) { + Some(l) => *l, + None => return shape(format!("missing {}", key)), + }; + self.pos += 1; + match line.strip_prefix(key).and_then(|r| r.strip_prefix(' ')) { + Some(v) if !v.is_empty() => Ok(v), + _ => shape(format!("expected {}, got {:?}", key, line)), + } + } + /// Next line must equal `text` exactly (fixed literal of the section 1 grammar). + fn fixed(&mut self, text: &str) -> Result<(), Refusal> { + match self.lines.get(self.pos) { + Some(l) if *l == text => { + self.pos += 1; + Ok(()) + } + other => shape(format!("expected {:?}, got {:?}", text, other)), + } + } + fn enumerated(&mut self, key: &str, allowed: &[&str]) -> Result { + let v = self.keyed(key)?; + if !allowed.contains(&v) { + return shape(format!("{} {}", key, v)); + } + Ok(v.to_string()) + } +} + +/// Lines from `begin ` through `end ` inclusive, each followed by LF. +pub fn block(lines: &[&str], name: &str) -> String { + let (b, e) = (format!("begin {}", name), format!("end {}", name)); + let start = lines.iter().position(|l| *l == b).unwrap_or(0); + let end = lines.iter().position(|l| *l == e).unwrap_or(start); + lines[start..=end].iter().map(|l| format!("{}\n", l)).collect() +} + +pub fn case_id(sem_block: &str) -> String { + tagged_hex(CASE_DOMAIN, sem_block.as_bytes()) +} + +pub fn acceptance_id(acc_block: &str) -> String { + tagged_hex(ACCEPTANCE_DOMAIN, acc_block.as_bytes()) +} + +fn in_limits(q: &Q) -> bool { + let lim = Nat::from_u64(RATIONAL_LIMIT); + q.num.mag <= lim && q.den <= lim +} + +/// Parse and validate case bytes in the order of AT1_CASE_V1 section 4. +pub fn parse_case(data: &[u8]) -> Result { + // ---- step 1: shape (and token parse), canonical form decided after the whole pass ---- + let lines = check_bytes(data)?; + let mut c = Cursor { lines: lines.clone(), pos: 0 }; + let mut canonical = true; + let mut note = |ok: bool| canonical &= ok; + let header_v = c.keyed("OMEGA-AT1-CASE")?; + let domain_v = c.keyed("domain")?; + let contract_v = c.keyed("contract")?; + let name = c.keyed("case_name")?.to_string(); + if !is_name(&name) { + return shape("case_name"); + } + c.fixed("begin semantic")?; + c.fixed("model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG")?; + c.fixed("energy_unit DIMENSIONLESS_HBAR_1")?; + let (clock_dim_i, ok) = parse_int(c.keyed("clock_dim")?)?; + note(ok); + let clock_dim = small(&clock_dim_i); + let energy_toks = split_list(c.keyed("clock_energies")?)?; + if Some(energy_toks.len()) != clock_dim { + return shape("clock_energies count differs from clock_dim"); + } + let mut energies = Vec::new(); + for t in energy_toks { + let (q, ok) = parse_rational(t)?; + note(ok); + energies.push(q); + } + c.fixed("system_dim 2")?; + let hp = split_list(c.keyed("system_hamiltonian_pauli")?)?; + if hp.len() != 4 { + return shape("system_hamiltonian_pauli arity"); + } + let mut hv = Vec::new(); + for t in hp { + let (q, ok) = parse_rational(t)?; + note(ok); + hv.push(q); + } + c.fixed("interaction CLOCK_DIAGONAL_PAULI")?; + let mut v = Vec::new(); + while c.peek_key() == Some("interaction_pauli") { + let rest = c.keyed("interaction_pauli")?; + let mut parts = rest.split(' '); + let (it, vt) = match (parts.next(), parts.next(), parts.next()) { + (Some(a), Some(b), None) => (a, b), + _ => return shape(format!("interaction_pauli {:?}", rest)), + }; + let (idx, ok) = parse_int(it)?; + note(ok); + if small(&idx) != Some(v.len()) { + return shape(format!("interaction_pauli index {:?} at position {}", it, v.len())); + } + let comps = split_list(vt)?; + if comps.len() != 3 { + return shape("interaction_pauli arity"); + } + let mut vec3 = Vec::new(); + for t in comps { + let (q, ok) = parse_rational(t)?; + note(ok); + vec3.push(q); + } + v.push([vec3[0].clone(), vec3[1].clone(), vec3[2].clone()]); + } + if Some(v.len()) != clock_dim { + return shape("interaction_pauli count differs from clock_dim"); + } + c.fixed("constraint SUM_HC_HS_V")?; + c.fixed("physical_state NULLSPACE_PROJECTION")?; + let ref_label = c.keyed("reference_clock_label")?.to_string(); + if !is_label(&ref_label) { + return shape("reference_clock_label"); + } + let st = split_list(c.keyed("reference_system_state")?)?; + if st.len() != 2 { + return shape("reference_system_state arity"); + } + let (psi0, ok0) = parse_complex(st[0])?; + let (psi1, ok1) = parse_complex(st[1])?; + note(ok0 && ok1); + c.fixed("clock_povm COVARIANT_DISCRETE")?; + let (tau, ok) = parse_rational(c.keyed("povm_tau_turns")?)?; + note(ok); + let (weight, ok) = parse_rational(c.keyed("povm_weight")?)?; + note(ok); + let (label_count_i, ok) = parse_int(c.keyed("clock_label_count")?)?; + note(ok); + let mut labels = Vec::new(); + while c.peek_key() == Some("clock_label") { + let rest = c.keyed("clock_label")?; + let mut parts = rest.split(' '); + let (it, lb) = match (parts.next(), parts.next(), parts.next()) { + (Some(a), Some(b), None) => (a, b), + _ => return shape(format!("clock_label {:?}", rest)), + }; + let (idx, ok) = parse_int(it)?; + note(ok); + if small(&idx) != Some(labels.len()) || !is_label(lb) { + return shape(format!("clock_label {:?} at position {}", rest, labels.len())); + } + labels.push(lb.to_string()); + } + if Some(labels.len()) != small(&label_count_i) { + return shape("clock_label count differs from clock_label_count"); + } + c.fixed("observables PAULI_X,PAULI_Y,PAULI_Z")?; + c.fixed("end semantic")?; + c.fixed("begin acceptance")?; + let control_kind = c.enumerated("control_kind", &["POSITIVE", "NEGATIVE"])?; + let prediction_target = c.enumerated("prediction_target", &["IDEAL", "INTERACTING"])?; + let expected_outcome = c.enumerated("expected_outcome", &["PASS", "FAIL"])?; + let codes_tok = c.keyed("expected_failure_codes")?; + let expected_codes: Vec = if codes_tok == "none" { Vec::new() } else { split_list(codes_tok)?.iter().map(|s| s.to_string()).collect() }; + let min_bound_kind = c.enumerated("min_bound_kind", &["RIGOROUS", "ESTIMATED", "NONE"])?; + let mut tols = Vec::new(); + for key in ["tol_constraint_residual", "tol_povm_residual", "tol_probability", "tol_zero_probability", "tol_schrodinger"] { + let (s, ok) = parse_scaled(c.keyed(key)?)?; + note(ok); + tols.push(s); + } + c.fixed("end acceptance")?; + let cid = c.keyed("case_id")?.to_string(); + if !is_digest(&cid) { + return shape("case_id"); + } + let aid = c.keyed("acceptance_id")?.to_string(); + if !is_digest(&aid) { + return shape("acceptance_id"); + } + c.fixed("end")?; + if c.pos != c.lines.len() { + return shape("trailing lines"); + } + if !canonical { + return refuse("CASE_NONCANONICAL", "a token parses but is not canonical"); + } + + // ---- step 2: values of the version-bearing lines ---- + if header_v != "v1" || domain_v != CASE_DOMAIN || contract_v != "AT1_CASE_V1" { + return refuse("CASE_UNSUPPORTED_VERSION", format!("{} / {} / {}", header_v, domain_v, contract_v)); + } + + // ---- step 3: ranges and fixed values of section 3 ---- + let n = clock_dim.unwrap_or(0); + if !(2..=64).contains(&n) { + return refuse("CASE_INVALID_PARAMETER", "clock_dim"); + } + let mut all_rats: Vec<&Q> = energies.iter().chain(hv.iter()).collect(); + for vj in &v { + all_rats.extend(vj.iter()); + } + all_rats.extend([&psi0.re, &psi0.im, &psi1.re, &psi1.im, &tau, &weight]); + if all_rats.iter().any(|q| !in_limits(q)) { + return refuse("CASE_INVALID_PARAMETER", "rational token limit"); + } + if tols.iter().any(|s| s.k > 40) { + return refuse("CASE_INVALID_PARAMETER", "scaled exponent above 40"); + } + if energies.windows(2).any(|w| w[0] >= w[1]) { + return refuse("CASE_INVALID_PARAMETER", "clock_energies not strictly increasing"); + } + if psi0.is_zero() && psi1.is_zero() { + return refuse("CASE_INVALID_PARAMETER", "reference_system_state zero"); + } + if weight <= Q::zero() || tau <= Q::zero() { + return refuse("CASE_INVALID_PARAMETER", "povm_weight or povm_tau_turns not positive"); + } + if !(1..=256).contains(&labels.len()) { + return refuse("CASE_INVALID_PARAMETER", "clock_label_count"); + } + let mut sorted = labels.clone(); + sorted.sort(); + sorted.dedup(); + if sorted.len() != labels.len() { + return refuse("CASE_INVALID_PARAMETER", "duplicate clock label"); + } + let ref_index = match labels.iter().position(|l| *l == ref_label) { + Some(i) => i, + None => return refuse("CASE_INVALID_PARAMETER", "reference_clock_label not a clock label"), + }; + + // ---- step 4: rational spectrum per level, exact ---- + let h = [hv[1].clone(), hv[2].clone(), hv[3].clone()]; + let mut level_norm = Vec::with_capacity(n); + for (j, vj) in v.iter().enumerate() { + let nj = [h[0].add(&vj[0]), h[1].add(&vj[1]), h[2].add(&vj[2])]; + let nn = nj[0].mul(&nj[0]).add(&nj[1].mul(&nj[1])).add(&nj[2].mul(&nj[2])); + match nn.sqrt_exact() { + Some(r) => level_norm.push(r), + None => return refuse("CASE_IRRATIONAL_SPECTRUM", format!("level {}", j)), + } + } + + // ---- step 5: identities ---- + let semantic_block = block(&lines, "semantic"); + let acceptance_block = block(&lines, "acceptance"); + if case_id(&semantic_block) != cid || acceptance_id(&acceptance_block) != aid { + return refuse("CASE_ID_MISMATCH", ""); + } + + // ---- step 6: acceptance ---- + if expected_outcome == "PASS" { + if !expected_codes.is_empty() { + return refuse("CASE_INVALID_PARAMETER", "expected_failure_codes with PASS"); + } + } else { + let mut s = expected_codes.clone(); + s.sort(); + s.dedup(); + if expected_codes.is_empty() || s != expected_codes || expected_codes.iter().any(|x| !FAILURE_CODES.contains(&x.as_str())) { + return refuse("CASE_INVALID_PARAMETER", "expected_failure_codes"); + } + } + let mut it = tols.into_iter(); + Ok(Case { + name, + clock_dim: n, + energies: energies.into_iter().map(|q| Q::new(q.num, q.den)).collect(), + h0: hv[0].clone(), + h, + v, + ref_label, + ref_index, + psi: [psi0, psi1], + tau, + weight, + labels, + control_kind, + prediction_target, + expected_outcome, + expected_codes, + min_bound_kind, + tol_constraint: it.next().unwrap(), + tol_povm: it.next().unwrap(), + tol_probability: it.next().unwrap(), + tol_zero: it.next().unwrap(), + tol_schrodinger: it.next().unwrap(), + case_id: cid, + acceptance_id: aid, + semantic_block, + acceptance_block, + file_sha256: sha256_hex(data), + level_norm, + }) +} + +// ---- case builder (fixtures and tests) ---------------------------------------------------- + +pub fn qtext(q: &Q) -> String { + let r = Q::new(q.num.clone(), q.den.clone()); + format!("{}/{}", r.num.to_decimal(), r.den.to_decimal()) +} + +/// Exact parameters of one case, for emitting canonical case bytes. +#[derive(Clone)] +pub struct Spec { + pub name: String, + pub energies: Vec, + pub hpauli: [Q; 4], + pub v: Vec<[Q; 3]>, + pub ref_label: usize, + pub psi: [GQ; 2], + pub tau: Q, + pub weight: Q, + pub labels: usize, + pub control_kind: String, + pub target: String, + pub expected_outcome: String, + pub expected_codes: Vec, + pub min_bound_kind: String, + pub tol: [String; 5], +} + +impl Spec { + pub fn semantic_lines(&self) -> Vec { + let mut sem = vec![ + "begin semantic".to_string(), + "model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG".into(), + "energy_unit DIMENSIONLESS_HBAR_1".into(), + format!("clock_dim {}", self.energies.len()), + format!("clock_energies {}", self.energies.iter().map(qtext).collect::>().join(",")), + "system_dim 2".into(), + format!("system_hamiltonian_pauli {}", self.hpauli.iter().map(qtext).collect::>().join(",")), + "interaction CLOCK_DIAGONAL_PAULI".into(), + ]; + for (j, vj) in self.v.iter().enumerate() { + sem.push(format!("interaction_pauli {} {}", j, vj.iter().map(qtext).collect::>().join(","))); + } + sem.push("constraint SUM_HC_HS_V".into()); + sem.push("physical_state NULLSPACE_PROJECTION".into()); + sem.push(format!("reference_clock_label t{}", self.ref_label)); + sem.push(format!("reference_system_state ({};{}),({};{})", qtext(&self.psi[0].re), qtext(&self.psi[0].im), qtext(&self.psi[1].re), qtext(&self.psi[1].im))); + sem.push("clock_povm COVARIANT_DISCRETE".into()); + sem.push(format!("povm_tau_turns {}", qtext(&self.tau))); + sem.push(format!("povm_weight {}", qtext(&self.weight))); + sem.push(format!("clock_label_count {}", self.labels)); + for k in 0..self.labels { + sem.push(format!("clock_label {} t{}", k, k)); + } + sem.push("observables PAULI_X,PAULI_Y,PAULI_Z".into()); + sem.push("end semantic".into()); + sem + } + pub fn acceptance_lines(&self) -> Vec { + let codes = if self.expected_codes.is_empty() { "none".to_string() } else { self.expected_codes.join(",") }; + vec![ + "begin acceptance".to_string(), + format!("control_kind {}", self.control_kind), + format!("prediction_target {}", self.target), + format!("expected_outcome {}", self.expected_outcome), + format!("expected_failure_codes {}", codes), + format!("min_bound_kind {}", self.min_bound_kind), + format!("tol_constraint_residual {}", self.tol[0]), + format!("tol_povm_residual {}", self.tol[1]), + format!("tol_probability {}", self.tol[2]), + format!("tol_zero_probability {}", self.tol[3]), + format!("tol_schrodinger {}", self.tol[4]), + "end acceptance".into(), + ] + } + pub fn bytes(&self) -> Vec { + lines_to_case(&self.name, &self.semantic_lines(), &self.acceptance_lines()) + } +} + +/// Assemble a case file from its blocks, with identities recomputed. +pub fn lines_to_case(name: &str, sem: &[String], acc: &[String]) -> Vec { + let sem_b: String = sem.iter().map(|l| format!("{}\n", l)).collect(); + let acc_b: String = acc.iter().map(|l| format!("{}\n", l)).collect(); + let head = format!("OMEGA-AT1-CASE v1\ndomain {}\ncontract AT1_CASE_V1\ncase_name {}\n", CASE_DOMAIN, name); + let tail = format!("case_id {}\nacceptance_id {}\nend\n", case_id(&sem_b), acceptance_id(&acc_b)); + format!("{}{}{}{}", head, sem_b, acc_b, tail).into_bytes() +} + +/// Recompute both identities of an edited case text (one defect, identities refreshed). +pub fn refresh_ids(text: &str) -> String { + let lines: Vec<&str> = text.split('\n').collect(); + let sem = block(&lines, "semantic"); + let acc = block(&lines, "acceptance"); + let (cid, aid) = (case_id(&sem), acceptance_id(&acc)); + lines + .iter() + .map(|l| { + if l.starts_with("case_id ") { + format!("case_id {}", cid) + } else if l.starts_with("acceptance_id ") { + format!("acceptance_id {}", aid) + } else { + l.to_string() + } + }) + .collect::>() + .join("\n") +} diff --git a/research/atemporal/at1/oracle/src/at1/closed.rs b/research/atemporal/at1/oracle/src/at1/closed.rs new file mode 100644 index 000000000..5439976b5 --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/closed.rs @@ -0,0 +1,173 @@ +//! Oracle reference quantities (AT1_RESULT_V1 section 3), each by its own code path: +//! +//! - `interacting`: the closed form of AT1_SPEC Theorem 3 from the exact level vectors, +//! chi_k = sum_j exp(+2 pi i E_j (k - r) tau) u_j (sign frozen in AT1_CASE_V1 section 3), +//! p(k) = w ||chi_k||^2 / (N S), Pauli probabilities from the pure state of chi_k. +//! This gives `reference_clock_probability` and `reference_interacting`. +//! - `ideal`: Schrodinger evolution under H_S alone, as a right-handed Bloch rotation of +//! psi_0 about h/|h| by 2|h|(t_k - t_r) (AT1_SPEC Definition 5.2). No V, no kernel. +//! This gives `reference_ideal`. +//! +//! Bounds are ESTIMATED (stated estimates, not enclosures); see NUMERICAL_ERROR.md. + +use super::big::{Q, GQ}; +use super::case::Case; +use super::complex::C; +use super::model::{cis_turns, gq_f64, CSum, Levels}; + +/// Unit roundoff of binary64. +pub const U: f64 = 1.0 / 9007199254740992.0; // 2^-53 + +/// Error of one `cis_turns` value (model.rs), in units of U, absolute (the value has modulus +/// 1): remainder conversion and the product 2 pi r (3 U relative on an angle of at most +/// pi/8), `cos` and `sin` at most one ulp each, the binary64 sqrt(1/2) of odd eighths (U) +/// and the final complex product (sqrt(5) U); about 7 U, taken as 8. +pub const CIS_ERR: f64 = 8.0; + +/// Factor applied to every first-order estimate below. The operation counts are worst-case +/// sums of absolute values in the standard rounding model, so the factor only has to cover +/// second-order terms and a libm that misses its ulp; see NUMERICAL_ERROR.md. +pub const SAFETY: f64 = 2.0; + +/// Per-value Pauli bounds from a relative state error `rel = ||d phi|| / ||phi||`. +/// The ray of `phi + d phi` is within the angle `a = asin(rel)` of the ray of `phi`, and +/// `P = cos^2(beta)` has `|dP/dbeta| = 2 sqrt(P (1 - P))` and `|d2P/dbeta2| <= 2`, so +/// `|dP| <= 2 sqrt(P (1 - P)) a + a^2`. `sqrt(P (1 - P))` is evaluated at the computed `P`, +/// which moves it by at most `a` (it is `|sin 2 beta| / 2`), giving `2 s a + 3 a^2`; `16 U` +/// covers the final quadratic form and division. Exact zeros and ones (a state orthogonal +/// to an eigenvector) thereby get a second-order bound, which is what they have. +pub fn pauli_bounds(p: &[[f64; 2]; 3], rel: f64) -> [[f64; 2]; 3] { + let a = if rel < 1.0 { rel.asin() } else { std::f64::consts::FRAC_PI_2 }; + let mut out = [[0.0; 2]; 3]; + for i in 0..3 { + for s in 0..2 { + let pv = p[i][s].clamp(0.0, 1.0); + let sq = (pv * (1.0 - pv)).sqrt(); + out[i][s] = SAFETY * (2.0 * sq * a + 3.0 * a * a + 16.0 * U); + } + } + out +} + +#[derive(Clone, Debug)] +pub struct LabelRef { + pub p: f64, + pub p_bound: f64, + /// [axis][PLUS, MINUS]; None when ||chi_k|| is exactly zero (no state to condition on). + pub pauli: Option<[[f64; 2]; 3]>, + /// Per value, [axis][PLUS, MINUS]; zeros when `pauli` is None. + pub pauli_bound: [[f64; 2]; 3], +} + +/// Six Pauli outcome probabilities of the pure state of a 2-vector, each computed directly +/// as ||^2 / ||phi||^2 (never as 1 - other). +pub fn pauli_of(c0: C, c1: C) -> Option<[[f64; 2]; 3]> { + let nn = c0.norm2() + c1.norm2(); + if nn == 0.0 { + return None; + } + let i = C::I; + let x_p = (c0 + c1).norm2() / (2.0 * nn); + let x_m = (c0 - c1).norm2() / (2.0 * nn); + let y_p = (c0 - i * c1).norm2() / (2.0 * nn); + let y_m = (c0 + i * c1).norm2() / (2.0 * nn); + let z_p = c0.norm2() / nn; + let z_m = c1.norm2() / nn; + Some([[x_p, x_m], [y_p, y_m], [z_p, z_m]]) +} + +/// Interacting reference for every label (only meaningful when the kernel is nontrivial). +pub fn interacting(c: &Case, lv: &Levels) -> Vec { + let n = c.clock_dim as f64; + let w = c.weight.to_f64(); + let s = lv.s.to_f64(); + let uf: Vec<[C; 2]> = lv.u.iter().map(|uj| [gq_f64(&uj[0]), gq_f64(&uj[1])]).collect(); + let live: Vec = (0..c.clock_dim).filter(|&j| !(lv.u[j][0].is_zero() && lv.u[j][1].is_zero())).collect(); + let mag: f64 = live.iter().map(|&j| (uf[j][0].norm2() + uf[j][1].norm2()).sqrt()).sum(); + let r = c.ref_index as i64; + (0..c.labels.len()) + .map(|k| { + let (mut c0, mut c1) = (CSum::new(), CSum::new()); + for &j in &live { + let turns = c.energies[j].mul(&Q::int(k as i64 - r)).mul(&c.tau); + let ph = cis_turns(&turns); + c0.add(ph * uf[j][0]); + c1.add(ph * uf[j][1]); + } + let chi = [c0.value(), c1.value()]; + let nn = chi[0].norm2() + chi[1].norm2(); + let p = w * nn / (n * s); + // first-order, AT1_SPEC 8.4 item 4: per component |d chi_a| <= sum_j |u_ja| times + // (U conversion of the exact u_j + CIS_ERR phase + sqrt(5) U product + 2 U + // for the compensated sum), and by the triangle inequality on (|u_j0|, |u_j1|) + // ||d chi|| <= (CIS_ERR + 5.3) U sum_j ||u_j||; written as (CIS_ERR + 6). + let dchi = (CIS_ERR + 6.0) * U * mag; + let norm = nn.sqrt(); + let p_bound = SAFETY * (w / (n * s) * (2.0 * norm * dchi + dchi * dchi) + 16.0 * U * p); + let pauli = pauli_of(chi[0], chi[1]); + let pauli_bound = match &pauli { + Some(pv) => pauli_bounds(pv, dchi / norm), + None => [[0.0; 2]; 3], + }; + LabelRef { p, p_bound, pauli, pauli_bound } + }) + .collect() +} + +#[derive(Clone, Debug)] +pub struct IdealRef { + pub pauli: [[f64; 2]; 3], + pub bound: f64, +} + +/// Ideal reference: Bloch vector of psi_0 rotated about h/|h| by the angle 2|h|(t_k - t_r). +pub fn ideal(c: &Case) -> Vec { + // exact Bloch vector of psi_0: (2 Re(conj a b), 2 Im(conj a b), |a|^2 - |b|^2) / ||psi||^2 + let (a, b) = (&c.psi[0], &c.psi[1]); + let ab: GQ = a.conj().mul(b); + let nn = a.norm2().add(&b.norm2()); + let two = Q::int(2); + let bloch = [ab.re.mul(&two).div(&nn).to_f64(), ab.im.mul(&two).div(&nn).to_f64(), a.norm2().sub(&b.norm2()).div(&nn).to_f64()]; + let hh = c.h[0].mul(&c.h[0]).add(&c.h[1].mul(&c.h[1])).add(&c.h[2].mul(&c.h[2])); + let h_exact = hh.sqrt_exact(); + let r = c.ref_index as i64; + (0..c.labels.len()) + .map(|k| { + let (b2, angle_err) = if hh.is_zero() { + (bloch, 0.0) + } else { + // rotation by theta = 2 pi * T with T = 2 |h| (k - r) tau turns + let (axis, cs, err) = match &h_exact { + Some(hn) => { + let t = hn.mul(&two).mul(&Q::int(k as i64 - r)).mul(&c.tau); + let z = cis_turns(&t); + let axis = [c.h[0].div(hn).to_f64(), c.h[1].div(hn).to_f64(), c.h[2].div(hn).to_f64()]; + (axis, z, 0.0) + } + None => { + // |h| irrational (every v_j nonzero, AT1_SPEC 8.4 item 2): binary64 turn count + let hn = hh.to_f64().sqrt(); + let t = 2.0 * hn * (k as f64 - r as f64) * c.tau.to_f64(); + let tr = t - t.round(); + let th = 2.0 * std::f64::consts::PI * tr; + let axis = [c.h[0].to_f64() / hn, c.h[1].to_f64() / hn, c.h[2].to_f64() / hn]; + (axis, C::new(th.cos(), th.sin()), 2.0 * std::f64::consts::PI * 8.0 * U * t.abs()) + } + }; + let (co, si) = (cs.re, cs.im); + let dot = axis[0] * bloch[0] + axis[1] * bloch[1] + axis[2] * bloch[2]; + let cross = [axis[1] * bloch[2] - axis[2] * bloch[1], axis[2] * bloch[0] - axis[0] * bloch[2], axis[0] * bloch[1] - axis[1] * bloch[0]]; + let mut out = [0.0; 3]; + for i in 0..3 { + out[i] = bloch[i] * co + cross[i] * si + axis[i] * dot * (1.0 - co); + } + (out, err) + }; + let pauli = [[(1.0 + b2[0]) / 2.0, (1.0 - b2[0]) / 2.0], [(1.0 + b2[1]) / 2.0, (1.0 - b2[1]) / 2.0], [(1.0 + b2[2]) / 2.0, (1.0 - b2[2]) / 2.0]]; + // Rodrigues with unit inputs: a few tens of roundings, plus the angle error (a + // rotation by d theta moves each Bloch component by at most d theta) + let bound = SAFETY * (64.0 * U + angle_err); + IdealRef { pauli, bound } + }) + .collect() +} diff --git a/research/atemporal/at1/oracle/src/at1/complex.rs b/research/atemporal/at1/oracle/src/at1/complex.rs new file mode 100644 index 000000000..eff6151c3 --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/complex.rs @@ -0,0 +1,172 @@ +//! Explicit complex numbers and small dense matrices (Vec>). Written +//! here; no numeric library, nothing shared with the C11 engine. + +use std::ops::{Add, Mul, Neg, Sub}; + +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct C { + pub re: f64, + pub im: f64, +} + +impl C { + pub const ZERO: C = C { re: 0.0, im: 0.0 }; + pub const ONE: C = C { re: 1.0, im: 0.0 }; + pub const I: C = C { re: 0.0, im: 1.0 }; + pub fn new(re: f64, im: f64) -> C { + C { re, im } + } + pub fn real(re: f64) -> C { + C { re, im: 0.0 } + } + pub fn conj(self) -> C { + C { re: self.re, im: -self.im } + } + pub fn norm2(self) -> f64 { + self.re * self.re + self.im * self.im + } + pub fn scale(self, s: f64) -> C { + C { re: self.re * s, im: self.im * s } + } + /// exp(i theta) + pub fn cis(theta: f64) -> C { + C { re: theta.cos(), im: theta.sin() } + } +} + +impl Add for C { + type Output = C; + fn add(self, o: C) -> C { + C { re: self.re + o.re, im: self.im + o.im } + } +} +impl Sub for C { + type Output = C; + fn sub(self, o: C) -> C { + C { re: self.re - o.re, im: self.im - o.im } + } +} +impl Mul for C { + type Output = C; + fn mul(self, o: C) -> C { + C { re: self.re * o.re - self.im * o.im, im: self.re * o.im + self.im * o.re } + } +} +impl Neg for C { + type Output = C; + fn neg(self) -> C { + C { re: -self.re, im: -self.im } + } +} + +pub type Mat = Vec>; + +pub fn zeros(n: usize, m: usize) -> Mat { + vec![vec![C::ZERO; m]; n] +} + +pub fn identity(n: usize) -> Mat { + let mut a = zeros(n, n); + for (i, row) in a.iter_mut().enumerate() { + row[i] = C::ONE; + } + a +} + +pub fn matmul(a: &Mat, b: &Mat) -> Mat { + let (n, k, m) = (a.len(), b.len(), b[0].len()); + let mut out = zeros(n, m); + for i in 0..n { + for j in 0..m { + let mut s = C::ZERO; + for l in 0..k { + s = s + a[i][l] * b[l][j]; + } + out[i][j] = s; + } + } + out +} + +pub fn matvec(a: &Mat, v: &[C]) -> Vec { + a.iter().map(|row| row.iter().zip(v).fold(C::ZERO, |s, (x, y)| s + *x * *y)).collect() +} + +pub fn dagger(a: &Mat) -> Mat { + let (n, m) = (a.len(), a[0].len()); + let mut out = zeros(m, n); + for i in 0..n { + for j in 0..m { + out[j][i] = a[i][j].conj(); + } + } + out +} + +pub fn kron(a: &Mat, b: &Mat) -> Mat { + let (n, m, p, q) = (a.len(), a[0].len(), b.len(), b[0].len()); + let mut out = zeros(n * p, m * q); + for i in 0..n { + for j in 0..m { + for k in 0..p { + for l in 0..q { + out[i * p + k][j * q + l] = a[i][j] * b[k][l]; + } + } + } + } + out +} + +/// a + s * b +pub fn add_scaled(a: &Mat, b: &Mat, s: f64) -> Mat { + a.iter().zip(b).map(|(ra, rb)| ra.iter().zip(rb).map(|(x, y)| *x + y.scale(s)).collect()).collect() +} + +pub fn scale(a: &Mat, s: f64) -> Mat { + a.iter().map(|row| row.iter().map(|x| x.scale(s)).collect()).collect() +} + +/// u v^dagger +pub fn outer(u: &[C], v: &[C]) -> Mat { + u.iter().map(|x| v.iter().map(|y| *x * y.conj()).collect()).collect() +} + +pub fn vnorm2(v: &[C]) -> f64 { + v.iter().map(|x| x.norm2()).sum() +} + +pub fn frobenius(a: &Mat) -> f64 { + a.iter().flatten().map(|x| x.norm2()).sum::().sqrt() +} + +pub fn trace(a: &Mat) -> C { + (0..a.len()).fold(C::ZERO, |s, i| s + a[i][i]) +} + +pub fn real_mat(rows: &[[f64; 2]; 2]) -> Mat { + rows.iter().map(|r| r.iter().map(|x| C::real(*x)).collect()).collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn algebra() { + let x = real_mat(&[[0.0, 1.0], [1.0, 0.0]]); + let y: Mat = vec![vec![C::ZERO, -C::I], vec![C::I, C::ZERO]]; + let z = real_mat(&[[1.0, 0.0], [0.0, -1.0]]); + // X Y = i Z + let xy = matmul(&x, &y); + assert_eq!(xy, scale_c(&z, C::I)); + assert_eq!(trace(&matmul(&x, &x)), C::real(2.0)); + assert_eq!(kron(&identity(2), &identity(3)), identity(6)); + assert_eq!(dagger(&y), y); + assert_eq!(frobenius(&identity(4)), 2.0); + } + + fn scale_c(a: &Mat, c: C) -> Mat { + a.iter().map(|row| row.iter().map(|x| *x * c).collect()).collect() + } +} diff --git a/research/atemporal/at1/oracle/src/at1/fixtures.rs b/research/atemporal/at1/oracle/src/at1/fixtures.rs new file mode 100644 index 000000000..ed4d7df47 --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/fixtures.rs @@ -0,0 +1,351 @@ +//! Calibration fixtures: every case of AT1_SPEC.md section 13 (classes P1 to P6, the N1 +//! family, N2 to N6) built from exact parameters, with the hand-derived values of the +//! spec's tables as expectations. Values are copied from the spec at `SPEC_COMMIT`, written +//! here as exact fractions; nothing here is copied from a run of this oracle. + +use super::big::{Int, Nat, Q, GQ}; +use super::case::{parse_case, Spec}; +use super::result::{compute, Computed}; + +pub fn q(n: i64, d: i64) -> Q { + Q::frac(n, d) +} +pub fn qi(n: i64) -> Q { + Q::int(n) +} +fn gz(re: Q, im: Q) -> GQ { + GQ::new(re, im) +} +/// Exact fraction to binary64 (both parts below 2^53, so one correctly rounded division). +pub fn fr(n: i64, d: i64) -> f64 { + n as f64 / d as f64 +} + +/// One label row of a hand table: p(k), P(X+), P(Y+), P(Z+); None for an UNDEFINED label. +pub type Row = Option<[f64; 4]>; + +pub struct Fixture { + pub name: &'static str, + pub class: &'static str, + pub spec: Spec, + pub kernel_dim: usize, + pub trivial: bool, + /// Interacting table (empty for a trivial kernel). + pub rows: Vec, + /// Ideal reference P(X+), P(Y+), P(Z+) per label. + pub ideal: Vec<[f64; 3]>, + /// Exact povm_residual where the spec gives it. + pub povm: Option, +} + +fn tol() -> [String; 5] { + ["1@12".into(), "1@12".into(), "1@12".into(), "1@9".into(), "1@12".into()] +} + +fn zero3() -> [Q; 3] { + [Q::zero(), Q::zero(), Q::zero()] +} +fn rho() -> [Q; 3] { + [q(3, 10), Q::zero(), q(-1, 10)] +} + +/// Base clock B of AT1_SPEC section 13 with the given couplings. +fn base(name: &str, v: Vec<[Q; 3]>) -> Spec { + Spec { + name: name.to_string(), + energies: vec![q(-3, 2), q(-1, 2), q(1, 2), q(3, 2)], + hpauli: [Q::zero(), Q::zero(), Q::zero(), q(1, 2)], + v, + ref_label: 0, + psi: [gz(qi(1), Q::zero()), gz(qi(1), Q::zero())], + tau: q(1, 4), + weight: qi(1), + labels: 4, + control_kind: "POSITIVE".into(), + target: "INTERACTING".into(), + expected_outcome: "PASS".into(), + expected_codes: vec![], + min_bound_kind: "ESTIMATED".into(), + tol: tol(), + } +} + +fn negative(mut s: Spec, name: &str, codes: &[&str]) -> Spec { + s.name = name.to_string(); + s.control_kind = "NEGATIVE".into(); + s.expected_outcome = "FAIL".into(); + s.expected_codes = codes.iter().map(|c| c.to_string()).collect(); + s +} + +fn ideal_target(mut s: Spec, name: &str) -> Spec { + s.name = name.to_string(); + s.target = "IDEAL".into(); + s +} + +/// Ideal table of P1 (|+x> rotated about z by pi k / 2). +fn p1_ideal() -> Vec<[f64; 3]> { + vec![[1.0, 0.5, 0.5], [0.5, 1.0, 0.5], [0.0, 0.5, 0.5], [0.5, 0.0, 0.5]] +} + +fn rows(t: &[[(i64, i64); 4]]) -> Vec { + t.iter().map(|r| Some([fr(r[0].0, r[0].1), fr(r[1].0, r[1].1), fr(r[2].0, r[2].1), fr(r[3].0, r[3].1)])).collect() +} + +fn p2_spec() -> Spec { + base("at1-kat-rotated-level-n4", vec![zero3(), zero3(), rho(), zero3()]) +} +fn p2_rows() -> Vec { + rows(&[ + [(5, 28), (49, 50), (1, 2), (16, 25)], + [(1, 4), (29, 70), (13, 14), (26, 35)], + [(9, 28), (1, 10), (1, 2), (4, 5)], + [(1, 4), (29, 70), (1, 14), (26, 35)], + ]) +} + +fn p3_spec() -> Spec { + let mut s = base("at1-p3-every-level-coupled", vec![rho(), [Q::zero(), q(3, 10), q(-1, 10)], [q(6, 5), Q::zero(), q(2, 5)]]); + s.energies = vec![q(-1, 2), q(1, 2), q(3, 2)]; + s.weight = q(3, 4); + s +} +fn p3b_spec() -> Spec { + let mut s = base("at1-p3b-degenerate-level", vec![zero3(), [Q::zero(), Q::zero(), q(-1, 2)], rho()]); + s.energies = vec![q(-1, 2), Q::zero(), q(1, 2)]; + s.psi = [gz(qi(1), Q::zero()), gz(Q::zero(), qi(1))]; + s.tau = q(1, 2); + s.weight = q(3, 4); + s +} +fn p4_spec() -> Spec { + let mut s = p2_spec(); + s.name = "at1-p4-complex-state-ref-t1".into(); + s.psi = [gz(qi(1), Q::zero()), gz(q(3, 5), q(4, 5))]; + s.ref_label = 1; + s +} +fn p5_spec() -> Spec { + let mut s = base("at1-p5-large-rationals", vec![zero3(), [q(524175, 1048354), q(724, 524177), q(-1, 2)]]); + s.energies = vec![q(-524289, 1048574), q(524285, 1048574)]; + s.hpauli = [q(1, 524287), Q::zero(), Q::zero(), q(1, 2)]; + s.weight = q(1, 2); + s +} +fn p6_spec() -> Spec { + base("at1-p6-near-miss-level", vec![[Q::zero(), Q::zero(), qi(1)], [Q::zero(), Q::zero(), q(1, 1048576)], rho(), zero3()]) +} + +pub fn all() -> Vec { + let p1 = base("at1-p1a-zero-coupling", vec![zero3(), zero3(), zero3(), zero3()]); + let p1_rows = rows(&[[(1, 4), (1, 1), (1, 2), (1, 2)], [(1, 4), (1, 2), (1, 1), (1, 2)], [(1, 4), (0, 1), (1, 2), (1, 2)], [(1, 4), (1, 2), (0, 1), (1, 2)]]); + let p1c = ideal_target(base("at1-p1c-spectator-coupling", vec![[Q::zero(), Q::zero(), q(1, 2)], zero3(), zero3(), rho()]), "at1-p1c-spectator-coupling"); + let p3_rows = rows(&[ + [(107, 280), (98, 107), (65, 214), (65, 214)], + [(53, 280), (37, 53), (101, 106), (61, 106)], + [(5, 56), (8, 25), (37, 50), (9, 10)], + [(19, 56), (37, 95), (17, 190), (29, 38)], + ]); + let p3b_rows = rows(&[ + [(41, 80), (29, 82), (40, 41), (45, 82)], + [(19, 80), (1, 38), (10, 19), (25, 38)], + [(1, 80), (1, 2), (0, 1), (1, 2)], + [(19, 80), (37, 38), (10, 19), (13, 38)], + ]); + let p3b_ideal = vec![[0.5, 1.0, 0.5], [0.5, 0.0, 0.5], [0.5, 1.0, 0.5], [0.5, 0.0, 0.5]]; + let p4_rows = rows(&[ + [(29, 164), (277, 290), (17, 58), (73, 145)], + [(37, 164), (197, 370), (73, 74), (113, 185)], + [(53, 164), (37, 530), (65, 106), (193, 265)], + [(45, 164), (13, 50), (1, 10), (17, 25)], + ]); + let p4_ideal = vec![[0.9, 0.2, 0.5], [0.8, 0.9, 0.5], [0.1, 0.8, 0.5], [0.2, 0.1, 0.5]]; + let p5_rows = rows(&[ + [(524181, 2096716), (274763624041, 549527248074), (274004612845, 549527248074), (524180, 524181)], + [(522731, 2096716), (274761527333, 548007134774), (274004612845, 548007134774), (522730, 522731)], + [(524177, 2096716), (274759430625, 549523054658), (275520532729, 549523054658), (524176, 524177)], + [(525627, 2096716), (274761527333, 551043167958), (275520532729, 551043167958), (525626, 525627)], + ]); + let p6_rows = rows(&[ + [(5, 28), (49, 50), (1, 2), (16, 25)], + [(9, 28), (1, 10), (1, 2), (4, 5)], + [(5, 28), (49, 50), (1, 2), (16, 25)], + [(9, 28), (1, 10), (1, 2), (4, 5)], + ]); + let sde = ["SCHRODINGER_DEVIATION_EXCEEDED"]; + let povm_sum = ["POVM_NORMALIZATION_EXCEEDED", "PROBABILITY_SUM_EXCEEDED"]; + let mut n4a = negative(p2_spec(), "at1-n4a-wrong-weight", &povm_sum); + n4a.weight = q(1, 2); + let n4a_rows: Vec = p2_rows().iter().map(|r| r.map(|v| [v[0] / 2.0, v[1], v[2], v[3]])).collect(); + let mut n4b = negative(p2_spec(), "at1-n4b-broken-clock-tau-1-3", &povm_sum); + n4b.tau = q(1, 3); + let r3 = 3.0f64.sqrt(); + let n4b_rows: Vec = vec![ + Some([fr(5, 28), fr(49, 50), 0.5, fr(16, 25)]), + Some([fr(2, 7), fr(19, 80), 0.5 + 3.0 * r3 / 16.0, fr(31, 40)]), + Some([fr(2, 7), fr(19, 80), 0.5 - 3.0 * r3 / 16.0, fr(31, 40)]), + Some([fr(5, 28), fr(49, 50), 0.5, fr(16, 25)]), + ]; + let third = |k: f64| { + let th = 2.0 * std::f64::consts::PI * k / 3.0; + [(1.0 + th.cos()) / 2.0, (1.0 + th.sin()) / 2.0, 0.5] + }; + let n4b_ideal = vec![third(0.0), third(1.0), third(2.0), third(3.0)]; + let mut n5 = negative(p2_spec(), "at1-n5-rigorous-demand", &["BOUND_KIND_INSUFFICIENT"]); + n5.min_bound_kind = "RIGOROUS".into(); + let mut n6 = negative(base("at1-n6-zero-projection", vec![zero3(), [Q::zero(), Q::zero(), q(1, 2)], rho(), zero3()]), "at1-n6-zero-projection", &["TRIVIAL_PHYSICAL_STATE"]); + n6.psi = [gz(qi(3), Q::zero()), gz(qi(1), Q::zero())]; + let n6_ideal = vec![[0.8, 0.5, 0.9], [0.5, 0.8, 0.9], [0.2, 0.5, 0.9], [0.5, 0.2, 0.9]]; + let n3_rows: Vec = vec![Some([0.5, 0.5, 0.5, 1.0]), Some([0.25, 0.5, 0.5, 1.0]), None, Some([0.25, 0.5, 0.5, 1.0])]; + let fx = |name: &'static str, class: &'static str, spec: Spec, kernel_dim: usize, trivial: bool, rows: Vec, ideal: Vec<[f64; 3]>, povm: Option| Fixture { name, class, spec, kernel_dim, trivial, rows, ideal, povm }; + vec![ + fx("at1-p1a-zero-coupling", "P1", p1.clone(), 2, false, p1_rows.clone(), p1_ideal(), Some(0.0)), + fx("at1-p1b-zero-coupling-ideal", "P1", ideal_target(p1, "at1-p1b-zero-coupling-ideal"), 2, false, p1_rows.clone(), p1_ideal(), Some(0.0)), + fx("at1-p1c-spectator-coupling", "P1c", p1c, 2, false, p1_rows, p1_ideal(), Some(0.0)), + fx("at1-kat-rotated-level-n4", "P2", p2_spec(), 2, false, p2_rows(), p1_ideal(), Some(0.0)), + fx("at1-p3-every-level-coupled", "P3", p3_spec(), 3, false, p3_rows.clone(), p1_ideal(), Some(0.0)), + fx("at1-p3b-degenerate-level", "P3b", p3b_spec(), 4, false, p3b_rows.clone(), p3b_ideal.clone(), Some(0.0)), + fx("at1-p4-complex-state-ref-t1", "P4", p4_spec(), 2, false, p4_rows.clone(), p4_ideal.clone(), Some(0.0)), + fx("at1-p5-large-rationals", "P5", p5_spec(), 2, false, p5_rows.clone(), p1_ideal(), Some(0.0)), + fx("at1-p6-near-miss-level", "P6", p6_spec(), 2, false, p6_rows.clone(), p1_ideal(), Some(0.0)), + fx("at1-n1-p2-ideal", "N1", negative(ideal_target(p2_spec(), ""), "at1-n1-p2-ideal", &sde), 2, false, p2_rows(), p1_ideal(), Some(0.0)), + fx("at1-n1b-p3-ideal", "N1b", negative(ideal_target(p3_spec(), ""), "at1-n1b-p3-ideal", &sde), 3, false, p3_rows, p1_ideal(), Some(0.0)), + fx("at1-n1c-p3b-ideal", "N1c", negative(ideal_target(p3b_spec(), ""), "at1-n1c-p3b-ideal", &sde), 4, false, p3b_rows, p3b_ideal, Some(0.0)), + fx("at1-n1d-p4-ideal", "N1d", negative(ideal_target(p4_spec(), ""), "at1-n1d-p4-ideal", &sde), 2, false, p4_rows, p4_ideal, Some(0.0)), + fx("at1-n1e-p5-ideal", "N1e", negative(ideal_target(p5_spec(), ""), "at1-n1e-p5-ideal", &sde), 2, false, p5_rows, p1_ideal(), Some(0.0)), + fx("at1-n1f-p6-ideal", "N1f", negative(ideal_target(p6_spec(), ""), "at1-n1f-p6-ideal", &sde), 2, false, p6_rows, p1_ideal(), Some(0.0)), + fx("at1-n2-all-levels-out", "N2", negative(base("", vec![zero3(), [Q::zero(), Q::zero(), q(1, 2)], [Q::zero(), Q::zero(), q(1, 2)], zero3()]), "at1-n2-all-levels-out", &["TRIVIAL_PHYSICAL_STATE"]), 0, true, vec![], p1_ideal(), Some(0.0)), + fx("at1-n3-swapped-level-zero-label", "N3", negative(base("", vec![zero3(), zero3(), [Q::zero(), Q::zero(), qi(-1)], zero3()]), "at1-n3-swapped-level-zero-label", &["CONDITIONAL_UNDEFINED"]), 2, false, n3_rows, p1_ideal(), Some(0.0)), + fx("at1-n4a-wrong-weight", "N4a", n4a, 2, false, n4a_rows, p1_ideal(), Some(1.0)), + fx("at1-n4b-broken-clock-tau-1-3", "N4b", n4b, 2, false, n4b_rows, n4b_ideal, Some(42.0f64.sqrt() / 4.0)), + fx("at1-n5-rigorous-demand", "N5", n5, 2, false, p2_rows(), p1_ideal(), Some(0.0)), + fx("at1-n6-zero-projection", "N6", n6, 1, true, vec![], n6_ideal, Some(0.0)), + ] +} + +/// Largest absolute deviation between a computed table and the hand table, and the +/// smallest margin (bound minus actual error) over the written values, per route. +pub struct Calibration { + pub name: &'static str, + pub values_checked: usize, + pub max_dev_matrix: f64, + pub max_dev_closed: f64, + pub max_dev_ideal: f64, + pub bound_violations: usize, + /// Largest bound written for any checked value (how close a bound comes to a tolerance). + pub max_bound: f64, +} + +pub fn calibrate(f: &Fixture, comp: &Computed) -> Calibration { + let mut cal = Calibration { name: f.name, values_checked: 0, max_dev_matrix: 0.0, max_dev_closed: 0.0, max_dev_ideal: 0.0, bound_violations: 0, max_bound: 0.0 }; + let mut maxb: f64 = 0.0; + let mut see = |dev: &mut f64, got: f64, want: f64, bound: f64, viol: &mut usize, n: &mut usize| { + maxb = maxb.max(bound); + let d = (got - want).abs(); + *dev = dev.max(d); + *n += 1; + if d > bound { + *viol += 1; + } + }; + let mut viol = 0; + let mut n = 0; + for (k, idl) in comp.ideal.iter().enumerate() { + for a in 0..3 { + see(&mut cal.max_dev_ideal, idl.pauli[a][0], f.ideal[k][a], idl.bound, &mut viol, &mut n); + see(&mut cal.max_dev_ideal, idl.pauli[a][1], 1.0 - f.ideal[k][a], idl.bound, &mut viol, &mut n); + } + } + if !f.trivial { + for (k, row) in f.rows.iter().enumerate() { + let (ml, cl) = (&comp.matrix.labels[k], &comp.interacting[k]); + match row { + Some(r) => { + see(&mut cal.max_dev_matrix, ml.p, r[0], ml.p_bound, &mut viol, &mut n); + see(&mut cal.max_dev_closed, cl.p, r[0], cl.p_bound, &mut viol, &mut n); + for a in 0..3 { + let (mp, cp) = (ml.pauli.unwrap(), cl.pauli.unwrap()); + see(&mut cal.max_dev_matrix, mp[a][0], r[a + 1], ml.pauli_bound[a][0], &mut viol, &mut n); + see(&mut cal.max_dev_matrix, mp[a][1], 1.0 - r[a + 1], ml.pauli_bound[a][1], &mut viol, &mut n); + see(&mut cal.max_dev_closed, cp[a][0], r[a + 1], cl.pauli_bound[a][0], &mut viol, &mut n); + see(&mut cal.max_dev_closed, cp[a][1], 1.0 - r[a + 1], cl.pauli_bound[a][1], &mut viol, &mut n); + } + } + None => { + // UNDEFINED label: exact p(k) = 0 + see(&mut cal.max_dev_matrix, ml.p, 0.0, ml.p_bound, &mut viol, &mut n); + see(&mut cal.max_dev_closed, cl.p, 0.0, cl.p_bound, &mut viol, &mut n); + } + } + } + } + if let Some(pv) = f.povm { + // 1 - x is not exact for every x, so the hand value itself carries half an ulp + see(&mut cal.max_dev_matrix, comp.matrix.povm.0, pv, comp.matrix.povm.1, &mut viol, &mut n); + } + cal.bound_violations = viol; + cal.max_bound = maxb; + cal.values_checked = n; + cal +} + +pub struct Rendered { + pub files: Vec<(String, Vec)>, + pub summary: Vec, +} + +/// Case files, values/verdict blocks and CALIBRATION.md; deterministic (no clock). +pub fn render() -> Rendered { + let mut files = Vec::new(); + let mut summary = Vec::new(); + let mut md = String::from( + "# AT-1 oracle calibration fixtures\n\nGenerated by `target/at1-oracle fixtures fixtures/` (deterministic, no wall clock). \ +Each case is one row of AT1_SPEC.md section 13 (aien-architecture `81047f5`); expectations are the spec's exact hand tables. \ +`matrix` is the literal matrix route (the record's own values), `closed` the closed-form route (`reference_clock_probability`, \ +`reference_interacting`), `ideal` the Bloch-rotation route (`reference_ideal`). Deviations are absolute, against the exact value \ +rounded once to binary64. `bound viol.` counts values whose actual error exceeds the written ESTIMATED bound (must be 0).\n\n\ +| case | class | kernel dim | outcome | failure codes | expectation_met | values checked | max dev matrix | max dev closed | max dev ideal | bound viol. | max bound |\n\ +|---|---|---|---|---|---|---|---|---|---|---|---|\n", + ); + for f in all() { + let bytes = f.spec.bytes(); + let c = parse_case(&bytes).expect("fixture case parses"); + let comp = compute(&c); + let cal = calibrate(&f, &comp); + let met = comp.verdict_lines.iter().find(|l| l.starts_with("expectation_met ")).cloned().unwrap_or_default(); + let codes = if comp.verdict.codes.is_empty() { "none".to_string() } else { comp.verdict.codes.join(",") }; + md.push_str(&format!( + "| `{}` | {} | {} | {} | {} | {} | {} | {:.1e} | {:.1e} | {:.1e} | {} | {:.1e} |\n", + f.name, + f.class, + comp.levels.kernel_dim, + comp.verdict.outcome, + codes, + met.trim_start_matches("expectation_met "), + cal.values_checked, + cal.max_dev_matrix, + cal.max_dev_closed, + cal.max_dev_ideal, + cal.bound_violations, + cal.max_bound + )); + let mut vals = comp.values.join("\n"); + vals.push('\n'); + vals.push_str(&comp.verdict_lines.join("\n")); + vals.push_str(&format!("\nverdict_id {}\n", comp.verdict_id)); + summary.push(format!("{} {} {} {}", f.name, comp.verdict.outcome, codes, met)); + files.push((format!("{}.case", f.name), bytes)); + files.push((format!("{}.values", f.name), vals.into_bytes())); + } + files.push(("CALIBRATION.md".to_string(), md.into_bytes())); + Rendered { files, summary } +} + +/// Unused-import guard (Int and Nat are used by callers of this module's helpers). +pub fn _int(n: i64) -> Int { + Int::from_i64(n) +} +pub fn _nat(n: u64) -> Nat { + Nat::from_u64(n) +} diff --git a/research/atemporal/at1/oracle/src/at1/matrix.rs b/research/atemporal/at1/oracle/src/at1/matrix.rs new file mode 100644 index 000000000..eda55c941 --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/matrix.rs @@ -0,0 +1,206 @@ +//! Literal matrix route (the oracle record's own "engine" values, and an internal +//! cross-check of the closed form): build H_total = H_C (x) I + I (x) H_S + V as a dense +//! 2N x 2N matrix, the orthogonal projector onto its kernel from the exact kernel pairs +//! (AT1_SPEC 8.4 item 3: never from a numerical eigen-decomposition), Psi = P_0 (|t_r> (x) +//! psi_0), phi_k by applying the bra , + /// Per value, [axis][PLUS, MINUS]; zeros when `pauli` is None. + pub pauli_bound: [[f64; 2]; 3], +} + +#[derive(Clone, Debug)] +pub struct MatrixValues { + pub kernel_dim: usize, + pub trivial: bool, + /// (value, bound); None on a trivial kernel. + pub constraint: Option<(f64, f64)>, + pub povm: (f64, f64), + pub labels: Vec, +} + +fn pauli_projectors() -> [[Mat; 2]; 3] { + let x = [[0.5, 0.5], [0.5, 0.5]]; + let xm = [[0.5, -0.5], [-0.5, 0.5]]; + let yp: Mat = vec![vec![C::new(0.5, 0.0), C::new(0.0, -0.5)], vec![C::new(0.0, 0.5), C::new(0.5, 0.0)]]; + let ym: Mat = vec![vec![C::new(0.5, 0.0), C::new(0.0, 0.5)], vec![C::new(0.0, -0.5), C::new(0.5, 0.0)]]; + [[real_mat(&x), real_mat(&xm)], [yp, ym], [real_mat(&[[1.0, 0.0], [0.0, 0.0]]), real_mat(&[[0.0, 0.0], [0.0, 1.0]])]] +} + +/// |t_k> = N^(-1/2) sum_j exp(-2 pi i E_j k tau) |E_j>, phase reduced exactly. +fn clock_state(c: &Case, k: usize) -> Vec { + let inv = 1.0 / (c.clock_dim as f64).sqrt(); + c.energies.iter().map(|e| cis_turns(&e.mul(&Q::int(k as i64)).mul(&c.tau).neg()).scale(inv)).collect() +} + +pub fn evaluate(c: &Case, lv: &Levels) -> MatrixValues { + let n = c.clock_dim; + let m = c.labels.len(); + let dim = 2 * n; + let w = c.weight.to_f64(); + // H_total = H_C (x) I + I (x) H_S + V, dense 2N x 2N. Each 2 x 2 diagonal block + // (E_j + h0) I + n_j . sigma, n_j = h + v_j, is formed in exact rationals and converted to + // binary64 once per entry, so a large h cancelling a large v_j costs nothing (review + // finding 1). Off-diagonal blocks are exact zeros. + let mut h_total = zeros(dim, dim); + // largest operator norm of a block that carries part of Psi: a kernel block has + // eigenvalues 0 and E_j + h0 - s R_j = -2 s R_j, so its norm is 2 R_j (0 when degenerate) + let mut gmax: f64 = 0.0; + for j in 0..n { + let nj = c.level_vector(j); + let d = c.energies[j].add(&c.h0); + let blk = [ + [C::real(d.add(&nj[2]).to_f64()), C::new(nj[0].to_f64(), nj[1].neg().to_f64())], + [C::new(nj[0].to_f64(), nj[1].to_f64()), C::real(d.sub(&nj[2]).to_f64())], + ]; + for a in 0..2 { + for b in 0..2 { + h_total[2 * j + a][2 * j + b] = blk[a][b]; + } + } + if let LevelKind::Pair { .. } = lv.kinds[j] { + gmax = gmax.max(2.0 * c.level_norm[j].to_f64()); + } + } + // kernel projector from the exact kernel pairs + let mut p0 = zeros(dim, dim); + for (j, kind) in lv.kinds.iter().enumerate() { + let mut add = |sys: [C; 2]| { + let mut b = vec![C::ZERO; dim]; + b[2 * j] = sys[0]; + b[2 * j + 1] = sys[1]; + let o = outer(&b, &b); + for r in 0..dim { + for s in 0..dim { + p0[r][s] = p0[r][s] + o[r][s]; + } + } + }; + match kind { + LevelKind::Pair { f, .. } => { + let (a, b) = (gq_f64(&f[0]), gq_f64(&f[1])); + let nrm = (a.norm2() + b.norm2()).sqrt(); + add([a.scale(1.0 / nrm), b.scale(1.0 / nrm)]); + } + LevelKind::Degenerate => { + add([C::ONE, C::ZERO]); + add([C::ZERO, C::ONE]); + } + LevelKind::Out => {} + } + } + let clocks: Vec> = (0..m).map(|k| clock_state(c, k)).collect(); + // POVM residual: the explicit sum of the effects F_k = w |t_k> 0.0 { + let rho: Mat = outer(&phi, &phi).iter().map(|row| row.iter().map(|z| z.scale(1.0 / nn)).collect()).collect(); + let mut out = [[0.0; 2]; 3]; + for a in 0..3 { + for s in 0..2 { + out[a][s] = trace(&super::complex::matmul(&rho, &proj[a][s])).re; + } + } + // the trace route adds a few roundings over the pure-state formula; the 16 U + // term of pauli_bounds covers them + (Some(out), pauli_bounds(&out, dphi / norm)) + } else { + (None, [[0.0; 2]; 3]) + }; + LabelVal { p, p_bound, pauli, pauli_bound } + }) + .collect(); + MatrixValues { kernel_dim: lv.kernel_dim, trivial: false, constraint: Some((constraint_val, constraint_bound)), povm: (povm_val, povm_bound), labels } +} diff --git a/research/atemporal/at1/oracle/src/at1/mod.rs b/research/atemporal/at1/oracle/src/at1/mod.rs new file mode 100644 index 000000000..800d03546 --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/mod.rs @@ -0,0 +1,18 @@ +//! AT-1 reference oracle, compute crate. Standard library only; no clock, file, process, +//! thread, network, environment or random facility anywhere below this module +//! (isolation.sh enforces it). All I/O lives in src/main.rs. +#![allow(dead_code)] // several helpers exist for the test suite and the fixtures only + +pub mod big; +pub mod case; +pub mod closed; +pub mod complex; +pub mod fixtures; +pub mod matrix; +pub mod model; +pub mod result; +pub mod sha256; + +/// Mathematical specification the hand-table tests and fixtures target: AT1_SPEC.md, +/// aien-architecture pull request 185, merged as this squash commit (section 13 tables). +pub const SPEC_COMMIT: &str = "81047f52850f4bd14c2fc5772ec2ac833ac694b9"; diff --git a/research/atemporal/at1/oracle/src/at1/model.rs b/research/atemporal/at1/oracle/src/at1/model.rs new file mode 100644 index 000000000..04d0dfed3 --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/model.rs @@ -0,0 +1,156 @@ +//! Exact level structure of the clock-diagonal model (AT1_SPEC.md sections 1 to 4). +//! +//! Everything here is exact Gaussian-rational arithmetic: level norms, kernel pairs, +//! degenerate-matched levels, the unnormalized level eigenvectors of AT1_CASE_V1 section 3, +//! the level vectors u_j = Pi_j psi_0, S = sum ||u_j||^2 and the exact zero test of Psi. +//! No floating-point value enters any decision made here (AT1_SPEC Remark 1.4). +//! Also: exact reduction of phase turn counts modulo one (AT1_SPEC section 8.4 item 1). + +use super::big::{Q, GQ}; +use super::case::Case; +use super::complex::C; + +#[derive(Clone, Debug, PartialEq)] +pub enum LevelKind { + /// R_j > 0 and E_j + h0 + s R_j = 0; `f` the unnormalized eigenvector for h0 + s R_j. + Pair { s: i32, f: [GQ; 2] }, + /// R_j = 0 and E_j + h0 = 0: the whole qubit is in the kernel at this level. + Degenerate, + /// No kernel vector at this level. + Out, +} + +#[derive(Clone, Debug)] +pub struct Levels { + pub kinds: Vec, + /// u_j = Pi_j psi_0 (exact), zero for levels outside the kernel. + pub u: Vec<[GQ; 2]>, + /// S = sum_j ||u_j||^2 (exact). ||Psi||^2 = S / N. + pub s: Q, + pub kernel_dim: usize, + /// Psi exactly zero (AT1_CASE_V1 section 3 zero test), or kernel dimension 0. + pub trivial: bool, +} + +/// Unnormalized eigenvector of n.sigma for eigenvalue s|n| (AT1_CASE_V1 section 3), |n| > 0. +pub fn level_eigenvector(n: &[Q; 3], r: &Q, s: i32) -> [GQ; 2] { + let sr = if s > 0 { r.clone() } else { r.neg() }; + let first = [GQ::new(sr.add(&n[2]), Q::zero()), GQ::new(n[0].clone(), n[1].clone())]; + if !(first[0].is_zero() && first[1].is_zero()) { + return first; + } + [GQ::new(n[0].clone(), n[1].neg()), GQ::new(sr.sub(&n[2]), Q::zero())] +} + +/// with the bra antilinear. +pub fn inner(f: &[GQ; 2], psi: &[GQ; 2]) -> GQ { + f[0].conj().mul(&psi[0]).add(&f[1].conj().mul(&psi[1])) +} + +pub fn levels(c: &Case) -> Levels { + let mut kinds = Vec::with_capacity(c.clock_dim); + let mut u = Vec::with_capacity(c.clock_dim); + let mut kernel_dim = 0; + for j in 0..c.clock_dim { + let n = c.level_vector(j); + let r = &c.level_norm[j]; + let shift = c.energies[j].add(&c.h0); // E_j + h0 + let kind = if r.is_zero() { + if shift.is_zero() { + LevelKind::Degenerate + } else { + LevelKind::Out + } + } else if shift.add(r).is_zero() { + LevelKind::Pair { s: 1, f: level_eigenvector(&n, r, 1) } + } else if shift.sub(r).is_zero() { + LevelKind::Pair { s: -1, f: level_eigenvector(&n, r, -1) } + } else { + LevelKind::Out + }; + let uj = match &kind { + LevelKind::Pair { f, .. } => { + kernel_dim += 1; + let coef = inner(f, &c.psi); + let f2 = f[0].norm2().add(&f[1].norm2()); + let scale = |x: &GQ| x.mul(&coef).scale(&Q::one().div(&f2)); + [scale(&f[0]), scale(&f[1])] + } + LevelKind::Degenerate => { + kernel_dim += 2; + c.psi.clone() + } + LevelKind::Out => [GQ::zero(), GQ::zero()], + }; + kinds.push(kind); + u.push(uj); + } + let s = u.iter().fold(Q::zero(), |acc, uj| acc.add(&uj[0].norm2()).add(&uj[1].norm2())); + let trivial = kernel_dim == 0 || s.is_zero(); + Levels { kinds, u, s, kernel_dim, trivial } +} + +/// exp(2 pi i x) for an exact rational turn count x, with the turn count reduced modulo one +/// exactly (AT1_SPEC 8.4 item 1). The reduced turn is split into the nearest multiple of +/// 1/8 (applied exactly for quarter turns, with the binary64 sqrt(1/2) for odd eighths) +/// and an exact remainder in [-1/16, 1/16] turned into binary64 once. Multiples of 1/4 +/// come out exact. +pub fn cis_turns(x: &Q) -> C { + let f = x.frac_part(); // [0, 1) + let eighth = f.mul(&Q::int(8)).round_half_up_i64(); // 0..=8 + let rest = f.sub(&Q::frac(eighth, 8)); // [-1/16, 1/16) + let base = match eighth.rem_euclid(8) { + 0 => C::new(1.0, 0.0), + 2 => C::new(0.0, 1.0), + 4 => C::new(-1.0, 0.0), + 6 => C::new(0.0, -1.0), + e => { + let h = std::f64::consts::FRAC_1_SQRT_2; + match e { + 1 => C::new(h, h), + 3 => C::new(-h, h), + 5 => C::new(-h, -h), + _ => C::new(h, -h), + } + } + }; + if rest.is_zero() { + return base; + } + let theta = 2.0 * std::f64::consts::PI * rest.to_f64(); + base * C::new(theta.cos(), theta.sin()) +} + +/// Convert an exact Gaussian rational to binary64 components (each correctly rounded). +pub fn gq_f64(z: &GQ) -> C { + C::new(z.re.to_f64(), z.im.to_f64()) +} + +/// Compensated (Neumaier) summation of complex terms, componentwise. First-order error of +/// the result at most 2 U times the sum of the absolute values of the terms, independent +/// of the number of terms (second-order term n U^2, negligible for n <= 256). +#[derive(Clone, Copy, Debug, Default)] +pub struct CSum { + s: [f64; 2], + c: [f64; 2], +} + +impl CSum { + pub fn new() -> CSum { + CSum::default() + } + pub fn add(&mut self, x: C) { + for (i, xi) in [x.re, x.im].into_iter().enumerate() { + let t = self.s[i] + xi; + if self.s[i].abs() >= xi.abs() { + self.c[i] += (self.s[i] - t) + xi; + } else { + self.c[i] += (xi - t) + self.s[i]; + } + self.s[i] = t; + } + } + pub fn value(&self) -> C { + C::new(self.s[0] + self.c[0], self.s[1] + self.c[1]) + } +} diff --git a/research/atemporal/at1/oracle/src/at1/result.rs b/research/atemporal/at1/oracle/src/at1/result.rs new file mode 100644 index 000000000..0052d931c --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/result.rs @@ -0,0 +1,613 @@ +//! AT1_RESULT_V1 writer and exact judge. Contract: aien-architecture +//! docs/plans/atemporal/AT1_RESULT_V1.md, sha256 3e6efd7e..., frozen at +//! `case::CONTRACT_COMMIT`; AT0_RESULT_V2 (sha256 bd0f9eb8...) sections 2, 4, 5 and 7 are +//! normative by reference. +//! +//! The values block holds the matrix route as the record's own values and the four oracle +//! families (`reference_label`, `reference_clock_probability`, `reference_ideal`, +//! `reference_interacting`; charter reading (c)). The verdict is decided from the written +//! tokens only, in exact rational arithmetic: a binary64 token is an exact dyadic rational, +//! a scaled decimal an exact decimal rational, and the ideal marginal w/N an exact rational. + +use super::big::{Nat, Q}; +use super::case::{Case, BOUND_KINDS}; +use super::closed::{self, IdealRef, LabelRef}; +use super::matrix::{self, MatrixValues}; +use super::model::{self, Levels}; +use super::sha256::tagged_hex; + +pub const RESULT_HEADER: &str = "OMEGA-AT1-RESULT v1"; +pub const RESULT_DOMAIN: &str = "omega.at1.result.v1"; +pub const RESULT_CONTRACT: &str = "AT1_RESULT_V1"; +pub const VERDICT_DOMAIN: &str = "omega.at1.verdict.v1"; +pub const EVIDENCE_DOMAIN: &str = "omega.at1.evidence.v1"; +pub const CHECK_NAMES: [&str; 12] = [ + "bound_kind_sufficient", + "values_finite", + "physical_state_nontrivial", + "constraint_residual", + "povm_normalization", + "clock_probability_sum", + "probability_range", + "pauli_pair_sum", + "conditional_defined", + "target_agreement", + "oracle_cross_check", + "label_status_agreement", +]; +pub const AXES: [&str; 3] = ["X", "Y", "Z"]; +pub const SIGNS: [&str; 2] = ["PLUS", "MINUS"]; +pub const PROVENANCE_KEYS: [&str; 13] = [ + "source_repo", + "source_commit", + "source_tree_clean", + "contract_commit", + "engine_sha256", + "oracle_repo", + "oracle_commit", + "oracle_sha256", + "build_cc", + "build_flags", + "host", + "run_started_utc", + "run_finished_utc", +]; + +// ---- tokens ----------------------------------------------------------------------------- + +pub fn f64_token(x: f64) -> String { + if !x.is_finite() { + return "nonfinite".to_string(); + } + let x = if x == 0.0 { 0.0 } else { x }; // -0.0 is written as +0.0 + format!("f64:{:016x}", x.to_bits()) +} + +/// Scaled decimal >= b: the exact binary64 value times 10^20, rounded up in exact integer +/// arithmetic, plus one unit of slack; the canonical form strips trailing zeros. A bound at +/// or above 1e18 (or not finite) is written as 1e18 plus one unit (never reached by a valid +/// case; it would only make every comparison indeterminate). Review finding 10: no float +/// multiply happens before the rounding. +pub fn bound_token(b: f64) -> String { + if b == 0.0 { + return "0@0".to_string(); + } + // exact for every finite positive bound (no clip: a clipped bound would be written below + // the estimate, confirmation review); a non-finite or negative estimate is written as + // the largest binary64, which no finite residual can exceed by more than it + let q = if b.is_finite() && b > 0.0 { Q::from_f64(b).expect("finite") } else { Q::from_f64(f64::MAX).expect("finite") }; + let e20 = Nat::from_decimal("100000000000000000000"); + let (mut n, r) = q.num.mag.mul(&e20).divrem(&q.den); + if !r.is_zero() { + n = n.add(&Nat::one()); + } + n = n.add(&Nat::one()); + let mut digits = n.to_decimal(); + let mut k = 20u32; + while k > 0 && digits.ends_with('0') { + digits.pop(); + k -= 1; + } + format!("{}@{}", digits, k) +} + +/// Exact value of a value token: Ok(Some) for `f64:`, Ok(None) for `undefined`/`nonfinite`. +pub fn value_exact(tok: &str) -> Result, String> { + if tok == "undefined" || tok == "nonfinite" { + return Ok(None); + } + let hex = tok.strip_prefix("f64:").filter(|h| h.len() == 16 && h.bytes().all(|c| c.is_ascii_digit() || (b'a'..=b'f').contains(&c))).ok_or_else(|| format!("bad value token {}", tok))?; + let bits = u64::from_str_radix(hex, 16).map_err(|_| format!("bad value token {}", tok))?; + Q::from_f64(f64::from_bits(bits)).map(Some).ok_or_else(|| "non-finite bit pattern written as f64:".to_string()) +} + +pub fn bound_exact(tok: &str) -> Result { + let (s, canonical) = super::case::parse_scaled(tok).map_err(|e| e.detail)?; + if !canonical || s.k > 40 { + return Err(format!("bad bound token {}", tok)); + } + Ok(s.exact()) +} + +/// Label status rule (AT1_RESULT_V1 section 3) on exact written value and bound. +pub fn status(p: &Q, b: &Q, tol_zero: &Q) -> &'static str { + if p.add_raw(b) <= *tol_zero { + "UNDEFINED" + } else if p.sub_raw(b) > *tol_zero { + "DEFINED" + } else { + "INDETERMINATE" + } +} + +fn status_of(p: f64, bound_tok: &str, tol_zero: &Q) -> &'static str { + match (Q::from_f64(p), bound_exact(bound_tok)) { + (Some(pq), Ok(bq)) => status(&pq, &bq, tol_zero), + _ => "INDETERMINATE", // a non-finite value cannot be judged defined + } +} + +// ---- values block ------------------------------------------------------------------------- + +pub struct Computed { + pub levels: Levels, + pub matrix: MatrixValues, + pub interacting: Vec, + pub ideal: Vec, + pub values: Vec, + pub verdict: Verdict, + pub verdict_lines: Vec, + pub verdict_id: String, +} + +pub fn values_block(c: &Case, lv: &Levels, mat: &MatrixValues, inter: &[LabelRef], ideal: &[IdealRef]) -> Vec { + let m = c.labels.len(); + let tol_zero = c.tol_zero.exact(); + let mut out = vec!["begin values".to_string(), format!("physical_state_kernel_dim {}", lv.kernel_dim)]; + let trivial = lv.trivial; + match (&mat.constraint, trivial) { + (Some((v, b)), false) => out.push(format!("constraint_residual {} {}", f64_token(*v), bound_token(*b))), + _ => out.push("constraint_residual undefined 0@0".to_string()), + } + out.push(format!("povm_residual {} {}", f64_token(mat.povm.0), bound_token(mat.povm.1))); + let eng_status: Vec<&str> = (0..m).map(|k| if trivial { "UNDEFINED" } else { status_of(mat.labels[k].p, &bound_token(mat.labels[k].p_bound), &tol_zero) }).collect(); + let ref_status: Vec<&str> = (0..m).map(|k| if trivial { "UNDEFINED" } else { status_of(inter[k].p, &bound_token(inter[k].p_bound), &tol_zero) }).collect(); + for k in 0..m { + out.push(format!("label {} {} {}", k, c.labels[k], eng_status[k])); + } + for k in 0..m { + if trivial { + out.push(format!("clock_probability {} undefined 0@0", k)); + } else { + out.push(format!("clock_probability {} {} {}", k, f64_token(mat.labels[k].p), bound_token(mat.labels[k].p_bound))); + } + } + let six = |out: &mut Vec, key: &str, k: usize, vals: Option<[[f64; 2]; 3]>, bound: [[f64; 2]; 3], defined: bool| { + for (a, an) in AXES.iter().enumerate() { + for (s, sn) in SIGNS.iter().enumerate() { + if !defined { + out.push(format!("{} {} {} {} undefined 0@0", key, k, an, sn)); + } else { + // a DEFINED label always has a state; a missing one is written as nonfinite, never invented + let v = vals.map(|p| p[a][s]).unwrap_or(f64::NAN); + out.push(format!("{} {} {} {} {} {}", key, k, an, sn, f64_token(v), bound_token(bound[a][s]))); + } + } + } + }; + for k in 0..m { + let (vals, b) = if trivial { (None, [[0.0; 2]; 3]) } else { (mat.labels[k].pauli, mat.labels[k].pauli_bound) }; + six(&mut out, "pauli", k, vals, b, eng_status[k] == "DEFINED"); + } + for k in 0..m { + out.push(format!("reference_label {} {} {}", k, c.labels[k], ref_status[k])); + } + for k in 0..m { + if trivial { + out.push(format!("reference_clock_probability {} undefined 0@0", k)); + } else { + out.push(format!("reference_clock_probability {} {} {}", k, f64_token(inter[k].p), bound_token(inter[k].p_bound))); + } + } + for (k, idl) in ideal.iter().enumerate() { + six(&mut out, "reference_ideal", k, Some(idl.pauli), [[idl.bound; 2]; 3], true); + } + for k in 0..m { + let (vals, b) = if trivial { (None, [[0.0; 2]; 3]) } else { (inter[k].pauli, inter[k].pauli_bound) }; + six(&mut out, "reference_interacting", k, vals, b, ref_status[k] == "DEFINED"); + } + out.push("end values".to_string()); + out +} + +// ---- parsed values (a verifier's view of the written block) ------------------------------- + +type VB = (Option, Q); // value (None for undefined or nonfinite), bound + +#[derive(Default)] +pub struct Values { + pub kernel_dim: usize, + pub nonfinite: bool, + pub constraint_undefined: bool, + pub constraint: Option, + pub povm: Option, + pub label: Vec, + pub clock: Vec, + pub pauli: Vec>, // [k][axis*2 + sign] + pub ref_label: Vec, + pub ref_clock: Vec, + pub ref_ideal: Vec>, + pub ref_inter: Vec>, +} + +const STATUSES: [&str; 3] = ["DEFINED", "UNDEFINED", "INDETERMINATE"]; + +/// Parse a values block for M labels, enforcing line order and the placement rules of +/// `undefined` (AT1_RESULT_V1 section 1). +pub fn parse_values(lines: &[String], c: &Case) -> Result { + let m = c.labels.len(); + let mut r = Reader { toks: lines.iter().map(|l| l.split(' ').map(str::to_string).collect()).collect(), pos: 0, nonfinite: false }; + let mut v = Values::default(); + if r.next("begin")? != ["begin", "values"] { + return Err("begin values".into()); + } + let t = r.next("physical_state_kernel_dim")?; + // canonical decimal only: `0` or `[1-9][0-9]*` (no sign, no leading zero) + let kd = t.get(1).filter(|s| !s.is_empty() && s.len() <= 9 && s.bytes().all(|b| b.is_ascii_digit()) && (s.len() == 1 || !s.starts_with('0'))).ok_or("kernel_dim")?; + v.kernel_dim = kd.parse().map_err(|_| "kernel_dim")?; + let t = r.next("constraint_residual")?; + v.constraint_undefined = t.get(1).map(|s| s == "undefined").unwrap_or(false); + v.constraint = Some(r.vb(&t[1..])?); + let t = r.next("povm_residual")?; + if t.get(1).map(|s| s == "undefined").unwrap_or(false) { + return Err("povm_residual is never undefined".into()); + } + v.povm = Some(r.vb(&t[1..])?); + let trivial = v.kernel_dim == 0 || v.constraint_undefined; + v.label = r.labels("label", c, trivial)?; + v.clock = r.clocks("clock_probability", m, trivial)?; + let lab = v.label.clone(); + v.pauli = r.six("pauli", m, Some(&lab), trivial)?; + v.ref_label = r.labels("reference_label", c, trivial)?; + v.ref_clock = r.clocks("reference_clock_probability", m, trivial)?; + v.ref_ideal = r.six("reference_ideal", m, None, trivial)?; + let rl = v.ref_label.clone(); + v.ref_inter = r.six("reference_interacting", m, Some(&rl), trivial)?; + if r.next("end")? != ["end", "values"] { + return Err("end values".into()); + } + if r.pos != r.toks.len() { + return Err("lines after end values".into()); + } + v.nonfinite = r.nonfinite; + Ok(v) +} + +struct Reader { + toks: Vec>, + pos: usize, + nonfinite: bool, +} + +impl Reader { + fn next(&mut self, want: &str) -> Result, String> { + let t = self.toks.get(self.pos).cloned().ok_or_else(|| format!("missing {}", want))?; + self.pos += 1; + if t[0] != want { + return Err(format!("expected {}, got {:?}", want, t.join(" "))); + } + Ok(t) + } + fn vb(&mut self, t: &[String]) -> Result { + if t.len() != 2 { + return Err("value and bound".into()); + } + if t[0] == "nonfinite" { + self.nonfinite = true; + } + let val = value_exact(&t[0])?; + let b = bound_exact(&t[1])?; + if t[0] == "undefined" && !b.is_zero() { + return Err("undefined with a nonzero bound".into()); + } + Ok((val, b)) + } + fn labels(&mut self, key: &str, c: &Case, trivial: bool) -> Result, String> { + let mut out = Vec::new(); + for k in 0..c.labels.len() { + let t = self.next(key)?; + if t.len() != 4 || t[1] != k.to_string() || t[2] != c.labels[k] || !STATUSES.contains(&t[3].as_str()) { + return Err(format!("{} line {}", key, k)); + } + if trivial && t[3] != "UNDEFINED" { + return Err("trivial kernel requires UNDEFINED".into()); + } + out.push(t[3].clone()); + } + Ok(out) + } + fn clocks(&mut self, key: &str, m: usize, trivial: bool) -> Result, String> { + let mut out = Vec::new(); + for k in 0..m { + let t = self.next(key)?; + if t.len() != 4 || t[1] != k.to_string() { + return Err(format!("{} line {}", key, k)); + } + if (t[2] == "undefined") != trivial { + return Err(format!("{} {}: undefined exactly on a trivial kernel", key, k)); + } + out.push(self.vb(&t[2..])?); + } + Ok(out) + } + /// `statuses` None: reference_ideal (always a value). Some: undefined exactly where the + /// label is not DEFINED (always on a trivial kernel). + fn six(&mut self, key: &str, m: usize, statuses: Option<&[String]>, trivial: bool) -> Result>, String> { + let mut out = Vec::new(); + for k in 0..m { + let mut row = Vec::new(); + for an in AXES { + for sn in SIGNS { + let t = self.next(key)?; + if t.len() != 6 || t[1] != k.to_string() || t[2] != an || t[3] != sn { + return Err(format!("{} line {} {} {}", key, k, an, sn)); + } + let must_undef = match statuses { + None => false, + Some(st) => trivial || st[k] != "DEFINED", + }; + if (t[4] == "undefined") != must_undef { + return Err(format!("{} {} {} {}: misplaced or missing undefined", key, k, an, sn)); + } + row.push(self.vb(&t[4..])?); + } + } + out.push(row); + } + Ok(out) + } +} + +// ---- checks ------------------------------------------------------------------------------ + +fn abs_form(v: &Q, b: &Q, tol: &Q) -> &'static str { + let a = v.abs(); + if a.add_raw(b) <= *tol { + "PASS" + } else if a.sub_raw(b) > *tol { + "FAIL" + } else { + "INDETERMINATE" + } +} + +fn signed_form(v: &Q, b: &Q, tol: &Q) -> &'static str { + if v.add_raw(b) <= *tol { + "PASS" + } else if v.sub_raw(b) > *tol { + "FAIL" + } else { + "INDETERMINATE" + } +} + +fn combine(results: &[&'static str]) -> &'static str { + if results.is_empty() { + "NOT_EVALUATED" + } else if results.contains(&"FAIL") { + "FAIL" + } else if results.contains(&"INDETERMINATE") { + "INDETERMINATE" + } else { + "PASS" + } +} + +#[derive(Clone, Debug)] +pub struct Verdict { + pub checks: Vec<(&'static str, &'static str)>, + pub outcome: &'static str, + pub codes: Vec<&'static str>, +} + +/// Decide the twelve checks of AT1_RESULT_V1 section 4 from a written values block. +pub fn judge(c: &Case, vlines: &[String], bound_kind: &str) -> Result { + let v = parse_values(vlines, c)?; + let tol_c = c.tol_constraint.exact(); + let tol_p = c.tol_povm.exact(); + let tol_pr = c.tol_probability.exact(); + let tol_s = c.tol_schrodinger.exact(); + let ideal_target = c.prediction_target == "IDEAL"; + let mut checks: Vec<(&'static str, &'static str)> = Vec::new(); + let mut codes: Vec<&'static str> = Vec::new(); + let mut set = |name: &'static str, res: &'static str, code: &'static str| { + checks.push((name, res)); + if res == "FAIL" && !codes.contains(&code) { + codes.push(code); + } + if res == "INDETERMINATE" && !codes.contains(&"PRECISION_INSUFFICIENT") { + codes.push("PRECISION_INSUFFICIENT"); + } + }; + let bk = BOUND_KINDS.iter().position(|b| *b == bound_kind).ok_or("bound_kind")?; + let mk = BOUND_KINDS.iter().position(|b| *b == c.min_bound_kind).ok_or("min_bound_kind")?; + set(CHECK_NAMES[0], if bk >= mk { "PASS" } else { "FAIL" }, "BOUND_KIND_INSUFFICIENT"); + set(CHECK_NAMES[1], if v.nonfinite { "FAIL" } else { "PASS" }, "NONFINITE_VALUE"); + let live = v.kernel_dim >= 1 && !v.constraint_undefined; + set(CHECK_NAMES[2], if live { "PASS" } else { "FAIL" }, "TRIVIAL_PHYSICAL_STATE"); + let cr = v.constraint.clone().unwrap(); + set(CHECK_NAMES[3], if !live { "NOT_EVALUATED" } else { cr.0.as_ref().map(|x| abs_form(x, &cr.1, &tol_c)).unwrap_or("NOT_EVALUATED") }, "CONSTRAINT_RESIDUAL_EXCEEDED"); + let pr = v.povm.clone().unwrap(); + set(CHECK_NAMES[4], pr.0.as_ref().map(|x| abs_form(x, &pr.1, &tol_p)).unwrap_or("NOT_EVALUATED"), "POVM_NORMALIZATION_EXCEEDED"); + if !live { + for name in &CHECK_NAMES[5..] { + set(name, "NOT_EVALUATED", ""); + } + } else { + // 6: sum of the clock marginal + let sum = if v.clock.iter().all(|x| x.0.is_some()) { + let mut s = Q::int(-1); + let mut sb = Q::zero(); + for (p, b) in &v.clock { + s = s.add_raw(p.as_ref().unwrap()); + sb = sb.add_raw(b); + } + abs_form(&s, &sb, &tol_pr) + } else { + "NOT_EVALUATED" + }; + set(CHECK_NAMES[5], sum, "PROBABILITY_SUM_EXCEEDED"); + // 7: range of every written clock_probability and pauli value (reference lines excluded) + let one = Q::one(); + let mut rng = Vec::new(); + for (p, b) in v.clock.iter().chain(v.pauli.iter().flatten()) { + if let Some(p) = p { + rng.push(signed_form(&p.neg(), b, &tol_pr)); + rng.push(signed_form(&p.sub_raw(&one), b, &tol_pr)); + } + } + set(CHECK_NAMES[6], combine(&rng), "PROBABILITY_OUT_OF_RANGE"); + // 8: PLUS + MINUS - 1 per defined label and axis + let mut pairs = Vec::new(); + for (k, st) in v.label.iter().enumerate() { + if st != "DEFINED" { + continue; + } + for a in 0..3 { + if let ((Some(pp), bp), (Some(pm), bm)) = (&v.pauli[k][2 * a], &v.pauli[k][2 * a + 1]) { + pairs.push(abs_form(&pp.add_raw(pm).sub_raw(&one), &bp.add_raw(bm), &tol_pr)); + } + } + } + set(CHECK_NAMES[7], combine(&pairs), "PROBABILITY_SUM_EXCEEDED"); + // 9: no label UNDEFINED + set(CHECK_NAMES[8], if v.label.iter().any(|s| s == "UNDEFINED") { "FAIL" } else { "PASS" }, "CONDITIONAL_UNDEFINED"); + // 10 and 11 on labels DEFINED on both sides + let both: Vec = (0..c.labels.len()).filter(|&k| v.label[k] == "DEFINED" && v.ref_label[k] == "DEFINED").collect(); + let w_over_n = c.weight.div(&Q::int(c.clock_dim as i64)); + let compare = |k: usize, refs: &[Vec], clock_ref: Option<&VB>, out: &mut Vec<&'static str>| { + for i in 0..6 { + if let ((Some(p), bp), (Some(r), br)) = (&v.pauli[k][i], &refs[k][i]) { + out.push(abs_form(&p.sub_raw(r), &bp.add_raw(br), &tol_s)); + } + } + if let (Some(p), bp) = &v.clock[k] { + match clock_ref { + None => out.push(abs_form(&p.sub_raw(&w_over_n), bp, &tol_pr)), + Some((Some(r), br)) => out.push(abs_form(&p.sub_raw(r), &bp.add_raw(br), &tol_pr)), + Some((None, _)) => {} + } + } + }; + let mut agree = Vec::new(); + for &k in &both { + if ideal_target { + compare(k, &v.ref_ideal, None, &mut agree); + } else { + compare(k, &v.ref_inter, Some(&v.ref_clock[k]), &mut agree); + } + } + set(CHECK_NAMES[9], combine(&agree), if ideal_target { "SCHRODINGER_DEVIATION_EXCEEDED" } else { "INTERACTING_DEVIATION_EXCEEDED" }); + let cross = if ideal_target { + let mut cr = Vec::new(); + for &k in &both { + compare(k, &v.ref_inter, Some(&v.ref_clock[k]), &mut cr); + } + combine(&cr) + } else { + "NOT_EVALUATED" + }; + set(CHECK_NAMES[10], cross, "ORACLE_DISAGREEMENT"); + // 12: label status agreement + let st: Vec<&'static str> = (0..c.labels.len()) + .map(|k| { + let (a, b) = (v.label[k].as_str(), v.ref_label[k].as_str()); + if a == "INDETERMINATE" || b == "INDETERMINATE" { + "INDETERMINATE" + } else if a != b { + "FAIL" + } else { + "PASS" + } + }) + .collect(); + set(CHECK_NAMES[11], combine(&st), "ORACLE_DISAGREEMENT"); + } + if v.label.iter().chain(v.ref_label.iter()).any(|s| s == "INDETERMINATE") && !codes.contains(&"PRECISION_INSUFFICIENT") { + codes.push("PRECISION_INSUFFICIENT"); + } + codes.sort(); + let outcome = if codes.is_empty() { "PASS" } else { "FAIL" }; + Ok(Verdict { checks, outcome, codes }) +} + +pub fn verdict_block(c: &Case, v: &Verdict) -> Vec { + let mut lines = vec!["begin verdict".to_string()]; + for (name, res) in &v.checks { + lines.push(format!("check {} {}", name, res)); + } + lines.push(format!("outcome {}", v.outcome)); + lines.push(format!("failure_codes {}", if v.codes.is_empty() { "none".to_string() } else { v.codes.join(",") })); + lines.push("error_code none".to_string()); + let exp: Vec<&str> = c.expected_codes.iter().map(String::as_str).collect(); + let met = v.outcome == c.expected_outcome && exp == v.codes; + lines.push(format!("expectation_met {}", if met { "YES" } else { "NO" })); + lines.push("end verdict".to_string()); + lines +} + +pub fn verdict_id(c: &Case, vlines: &[String]) -> String { + let mut body = format!("case_id {}\nacceptance_id {}\n", c.case_id, c.acceptance_id); + for l in vlines { + body.push_str(l); + body.push('\n'); + } + tagged_hex(VERDICT_DOMAIN, body.as_bytes()) +} + +pub fn evidence_digest(lines_above: &[String]) -> String { + let body: String = lines_above.iter().map(|l| format!("{}\n", l)).collect(); + tagged_hex(EVIDENCE_DOMAIN, body.as_bytes()) +} + +pub fn compute(c: &Case) -> Computed { + let levels = model::levels(c); + let matrix = matrix::evaluate(c, &levels); + let interacting = if levels.trivial { Vec::new() } else { closed::interacting(c, &levels) }; + let ideal = closed::ideal(c); + let values = values_block(c, &levels, &matrix, &interacting, &ideal); + let verdict = judge(c, &values, "ESTIMATED").expect("own values block parses"); + let verdict_lines = verdict_block(c, &verdict); + let verdict_id = verdict_id(c, &verdict_lines); + Computed { levels, matrix, interacting, ideal, values, verdict, verdict_lines, verdict_id } +} + +fn provenance_text_ok(val: &str) -> bool { + !val.is_empty() && val.len() <= 200 && val.trim() == val && val.bytes().all(|b| (0x20..=0x7E).contains(&b)) +} + +/// Full AT1_RESULT_V1 record. `provenance` holds PROVENANCE_KEYS in order. The writer +/// refuses anything that is not marked as an oracle record (AT1_RESULT_V1 section 1: +/// `build_cc` begins with `oracle ` and `engine_sha256` equals `oracle_sha256`), and +/// refuses blocks that do not reproduce the copied identities. +pub fn result_bytes(c: &Case, computed: &Computed, provenance: &[(&str, String)]) -> Result, String> { + if super::case::case_id(&c.semantic_block) != c.case_id || super::case::acceptance_id(&c.acceptance_block) != c.acceptance_id { + return Err("blocks do not reproduce the copied identities".into()); + } + let mut lines = vec![RESULT_HEADER.to_string(), format!("domain {}", RESULT_DOMAIN), format!("contract {}", RESULT_CONTRACT), "case_contract AT1_CASE_V1".to_string(), format!("case_name {}", c.name)]; + lines.extend(c.semantic_block.lines().map(str::to_string)); + lines.extend(c.acceptance_block.lines().map(str::to_string)); + lines.push(format!("case_id {}", c.case_id)); + lines.push(format!("acceptance_id {}", c.acceptance_id)); + lines.push(format!("case_file_sha256 {}", c.file_sha256)); + lines.extend(["begin numerics", "arithmetic BINARY64", "bound_kind ESTIMATED", "threads 1", "end numerics"].iter().map(|s| s.to_string())); + lines.extend(computed.values.iter().cloned()); + lines.extend(computed.verdict_lines.iter().cloned()); + lines.push(format!("verdict_id {}", computed.verdict_id)); + lines.push("begin provenance".to_string()); + if provenance.len() != PROVENANCE_KEYS.len() { + return Err("provenance key count".into()); + } + let find = |k: &str| provenance.iter().find(|(key, _)| *key == k).map(|(_, v)| v.as_str()); + if find("engine_sha256") != find("oracle_sha256") { + return Err("engine_sha256 must equal oracle_sha256 in an oracle-written record".into()); + } + for ((key, val), want) in provenance.iter().zip(PROVENANCE_KEYS.iter()) { + if key != want { + return Err(format!("provenance order: {} vs {}", key, want)); + } + if !provenance_text_ok(val) { + return Err(format!("bad provenance text for {}", key)); + } + if *key == "build_cc" && !val.starts_with("oracle ") { + return Err("build_cc must begin with \"oracle \"".into()); + } + lines.push(format!("{} {}", key, val)); + } + lines.push("end provenance".to_string()); + let ed = evidence_digest(&lines); + lines.push(format!("evidence_digest {}", ed)); + lines.push("end".to_string()); + Ok(lines.iter().map(|l| format!("{}\n", l)).collect::().into_bytes()) +} + diff --git a/research/atemporal/at1/oracle/src/at1/sha256.rs b/research/atemporal/at1/oracle/src/at1/sha256.rs new file mode 100644 index 000000000..3e2e815ae --- /dev/null +++ b/research/atemporal/at1/oracle/src/at1/sha256.rs @@ -0,0 +1,99 @@ +//! SHA-256 (FIPS 180-4), written here so the oracle shares no digest code with +//! the engine or with omega's src/sha256.c. Verified against the contract's +//! published known-answer digests and the "abc" test vector. + +const K: [u32; 64] = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, +]; + +pub fn sha256(data: &[u8]) -> [u8; 32] { + let mut h: [u32; 8] = [ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, + ]; + let mut msg = data.to_vec(); + let bitlen = (data.len() as u64).wrapping_mul(8); + msg.push(0x80); + while msg.len() % 64 != 56 { + msg.push(0); + } + msg.extend_from_slice(&bitlen.to_be_bytes()); + for chunk in msg.chunks(64) { + let mut w = [0u32; 64]; + for i in 0..16 { + w[i] = u32::from_be_bytes([chunk[4 * i], chunk[4 * i + 1], chunk[4 * i + 2], chunk[4 * i + 3]]); + } + for i in 16..64 { + let s0 = w[i - 15].rotate_right(7) ^ w[i - 15].rotate_right(18) ^ (w[i - 15] >> 3); + let s1 = w[i - 2].rotate_right(17) ^ w[i - 2].rotate_right(19) ^ (w[i - 2] >> 10); + w[i] = w[i - 16].wrapping_add(s0).wrapping_add(w[i - 7]).wrapping_add(s1); + } + let [mut a, mut b, mut c, mut d, mut e, mut f, mut g, mut hh] = h; + for i in 0..64 { + let s1 = e.rotate_right(6) ^ e.rotate_right(11) ^ e.rotate_right(25); + let ch = (e & f) ^ (!e & g); + let t1 = hh.wrapping_add(s1).wrapping_add(ch).wrapping_add(K[i]).wrapping_add(w[i]); + let s0 = a.rotate_right(2) ^ a.rotate_right(13) ^ a.rotate_right(22); + let maj = (a & b) ^ (a & c) ^ (b & c); + let t2 = s0.wrapping_add(maj); + hh = g; + g = f; + f = e; + e = d.wrapping_add(t1); + d = c; + c = b; + b = a; + a = t1.wrapping_add(t2); + } + for (slot, v) in h.iter_mut().zip([a, b, c, d, e, f, g, hh]) { + *slot = slot.wrapping_add(v); + } + } + let mut out = [0u8; 32]; + for (i, v) in h.iter().enumerate() { + out[4 * i..4 * i + 4].copy_from_slice(&v.to_be_bytes()); + } + out +} + +pub fn hex(bytes: &[u8]) -> String { + const DIGITS: &[u8; 16] = b"0123456789abcdef"; + let mut s = String::with_capacity(bytes.len() * 2); + for b in bytes { + s.push(DIGITS[(b >> 4) as usize] as char); + s.push(DIGITS[(b & 15) as usize] as char); + } + s +} + +pub fn sha256_hex(data: &[u8]) -> String { + hex(&sha256(data)) +} + +/// Domain-separated digest: SHA-256(domain || 0x00 || body). +pub fn tagged_hex(domain: &str, body: &[u8]) -> String { + let mut buf = Vec::with_capacity(domain.len() + 1 + body.len()); + buf.extend_from_slice(domain.as_bytes()); + buf.push(0); + buf.extend_from_slice(body); + sha256_hex(&buf) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_vectors() { + assert_eq!(sha256_hex(b"abc"), "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); + assert_eq!(sha256_hex(b""), "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); + let long = vec![b'a'; 1000]; + assert_eq!(sha256_hex(&long), "41edece42d63e8d9bf515a9ba6932e1c20cbc9f5a5d134645adb5db1b9737ea3"); + } +} diff --git a/research/atemporal/at1/oracle/src/main.rs b/research/atemporal/at1/oracle/src/main.rs new file mode 100644 index 000000000..efdc349ba --- /dev/null +++ b/research/atemporal/at1/oracle/src/main.rs @@ -0,0 +1,200 @@ +//! AT-1 reference oracle, outer layer: the only place that touches files, the process +//! table and the wall clock. Everything that computes lives in src/at1/. +//! +//! Usage: +//! at1-oracle emit [-o ] write an AT1_RESULT_V1 oracle record +//! at1-oracle fixtures write the calibration fixtures +//! at1-oracle check validate only; print the ids +//! A refused case prints exactly `AT1_CASE_REFUSED ` on stderr and exits 2. + +mod at1; + +use at1::case::{parse_case, CONTRACT_COMMIT}; +use at1::result::{compute, result_bytes, PROVENANCE_KEYS}; +use at1::sha256::sha256_hex; +use std::io::Write; +use std::process::Command; +use std::time::{SystemTime, UNIX_EPOCH}; + +fn git(args: &[&str]) -> Option { + let dir = std::env::current_exe().ok()?.parent()?.parent()?.to_path_buf(); + let out = Command::new("git").args(args).current_dir(dir).output().ok()?; + if out.status.success() { + Some(String::from_utf8_lossy(&out.stdout).trim().to_string()) + } else { + None + } +} + +/// UTC timestamp at second resolution without any calendar library. +fn utc_now() -> String { + let secs = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs() as i64).unwrap_or(0); + let (days, rem) = (secs.div_euclid(86400), secs.rem_euclid(86400)); + let (h, m, s) = (rem / 3600, (rem % 3600) / 60, rem % 60); + // civil from days (Howard Hinnant) + let z = days + 719468; + let era = z.div_euclid(146097); + let doe = z.rem_euclid(146097); + let yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; + let y = yoe + era * 400; + let doy = doe - (365 * yoe + yoe / 4 - yoe / 100); + let mp = (5 * doy + 2) / 153; + let d = doy - (153 * mp + 2) / 5 + 1; + let mo = if mp < 10 { mp + 3 } else { mp - 9 }; + let y = if mo <= 2 { y + 1 } else { y }; + format!("{:04}-{:02}-{:02}T{:02}:{:02}:{:02}Z", y, mo, d, h, m, s) +} + +fn run_text(cmd: &str, args: &[&str]) -> Option { + let o = Command::new(cmd).args(args).output().ok().filter(|o| o.status.success())?; + let s = String::from_utf8_lossy(&o.stdout).split_whitespace().collect::>().join(" "); + if s.is_empty() { None } else { Some(s) } +} + +/// `host` (AT1_RESULT_V1 section 7: free text that, for a replication run, names the +/// machine and the OS): host name from /etc/hostname (Linux) or `uname -n` (macOS has no +/// /etc/hostname), then the OS product line from `sw_vers` when it exists (macOS) and +/// `uname -srm`. Whitespace runs collapse to one space; anything outside 0x20..0x7E becomes +/// `_`; at most 200 bytes. +fn host() -> String { + let name = std::fs::read_to_string("/etc/hostname").ok().map(|s| s.trim().to_string()).filter(|s| !s.is_empty()).or_else(|| run_text("uname", &["-n"])).unwrap_or_else(|| "unknown".to_string()); + let mut parts = vec![name]; + if let (Some(p), Some(v)) = (run_text("sw_vers", &["-productName"]), run_text("sw_vers", &["-productVersion"])) { + parts.push(format!("{} {}", p, v)); + } + if let Some(u) = run_text("uname", &["-srm"]) { + parts.push(u); + } + let raw = parts.join(" ").split_whitespace().collect::>().join(" "); + let mut clean: String = raw.chars().map(|c| if (' '..='~').contains(&c) { c } else { '_' }).collect(); + clean.truncate(200); + let clean = clean.trim().to_string(); + if clean.is_empty() { "unknown".to_string() } else { clean } +} + +fn exe_sha256() -> String { + std::env::current_exe().ok().and_then(|p| std::fs::read(p).ok()).map(|b| sha256_hex(&b)).unwrap_or_else(|| "0".repeat(64)) +} + +fn emit(args: &[String]) -> i32 { + let out_path = args.iter().position(|a| a == "-o").and_then(|i| args.get(i + 1)).cloned(); + let inputs: Vec<&String> = args.iter().filter(|a| !a.starts_with('-') && Some(*a) != out_path.as_ref()).collect(); + if inputs.len() != 1 { + eprintln!("usage: at1-oracle emit [-o ]"); + return 1; + } + let started = utc_now(); + let data = match std::fs::read(inputs[0]) { + Ok(d) => d, + Err(e) => { + eprintln!("cannot read {}: {}", inputs[0], e); + return 1; + } + }; + let case = match parse_case(&data) { + Ok(c) => c, + Err(r) => { + eprintln!("AT1_CASE_REFUSED {}", r.code); + return 2; + } + }; + let computed = compute(&case); + // source provenance is the state the binary was BUILT from (AT0_RESULT_V2 section 7), + // captured by build.sh; a binary built without build.sh falls back to the checkout it + // runs from and never claims a clean tree + let (commit, clean) = match (option_env!("AT1_SOURCE_COMMIT"), option_env!("AT1_SOURCE_CLEAN")) { + (Some(c), Some(k)) if c.len() == 40 => (Some(c.to_string()), k == "YES"), + // built by build.sh outside a git checkout: no commit to name (all zeros, NO) + (Some(_), Some(_)) => (None, false), + _ => (git(&["rev-parse", "HEAD"]), false), + }; + let exe = exe_sha256(); + let rustc = option_env!("AT1_RUSTC_VERSION").unwrap_or("rustc unknown (built without build.sh)"); + let flags = option_env!("AT1_BUILD_FLAGS").unwrap_or("unknown"); + let values: Vec = vec![ + "aien-dev/omega".to_string(), + commit.clone().unwrap_or_else(|| "0".repeat(40)), + if commit.is_some() && clean { "YES" } else { "NO" }.to_string(), + CONTRACT_COMMIT.to_string(), + exe.clone(), + "aien-dev/omega".to_string(), + commit.unwrap_or_else(|| "0".repeat(40)), + exe, + format!("oracle {} {}", rustc, option_env!("AT1_RUSTC_HOST").unwrap_or("unknown-host")), + format!("rustc {} src/main.rs", flags), + host(), + started, + utc_now(), + ]; + let prov: Vec<(&str, String)> = PROVENANCE_KEYS.iter().cloned().zip(values).collect(); + let record = match result_bytes(&case, &computed, &prov) { + Ok(r) => r, + Err(e) => { + eprintln!("internal: {}", e); + return 1; + } + }; + match out_path { + Some(p) => std::fs::write(&p, &record).map(|_| 0).unwrap_or_else(|e| { + eprintln!("cannot write {}: {}", p, e); + 1 + }), + None => std::io::stdout().write_all(&record).map(|_| 0).unwrap_or(1), + } +} + +fn fixtures(dir: &str) -> i32 { + if let Err(e) = std::fs::create_dir_all(dir) { + eprintln!("cannot create {}: {}", dir, e); + return 1; + } + let rendered = at1::fixtures::render(); + for (name, bytes) in &rendered.files { + if let Err(e) = std::fs::write(format!("{}/{}", dir, name), bytes) { + eprintln!("cannot write {}: {}", name, e); + return 1; + } + } + println!("wrote {} files to {}", rendered.files.len(), dir); + for line in &rendered.summary { + println!("{}", line); + } + 0 +} + +fn check(path: &str) -> i32 { + let data = match std::fs::read(path) { + Ok(d) => d, + Err(e) => { + eprintln!("cannot read {}: {}", path, e); + return 1; + } + }; + match parse_case(&data) { + Ok(c) => { + println!("case_id {}\nacceptance_id {}\ncase_file_sha256 {}", c.case_id, c.acceptance_id, c.file_sha256); + 0 + } + Err(r) => { + eprintln!("AT1_CASE_REFUSED {}", r.code); + 2 + } + } +} + +fn main() { + let args: Vec = std::env::args().skip(1).collect(); + let code = match args.first().map(String::as_str) { + Some("emit") => emit(&args[1..]), + Some("fixtures") if args.len() == 2 => fixtures(&args[1]), + Some("check") if args.len() == 2 => check(&args[1]), + _ => { + eprintln!("usage: at1-oracle emit [-o out] | fixtures | check "); + 1 + } + }; + std::process::exit(code); +} + +#[cfg(test)] +mod tests; diff --git a/research/atemporal/at1/oracle/src/tests.rs b/research/atemporal/at1/oracle/src/tests.rs new file mode 100644 index 000000000..6c2101c39 --- /dev/null +++ b/research/atemporal/at1/oracle/src/tests.rs @@ -0,0 +1,602 @@ +//! Test suite of the AT-1 reference oracle. Expectations come from the frozen contracts +//! (AT1_CASE_V1, AT1_RESULT_V1 at aien-architecture cbe4c8e) and from AT1_SPEC.md section +//! 13 (81047f5); none is copied from a run of this oracle. + +use super::at1::big::Q; +use super::at1::case::{parse_case, refresh_ids, Spec}; +use super::at1::fixtures::{self, calibrate, q, qi, Fixture}; +use super::at1::result::{bound_exact, bound_token, compute, evidence_digest, judge, parse_values, result_bytes, value_exact, Computed, CHECK_NAMES, PROVENANCE_KEYS}; + +const KAT_FILE: &str = "76e282fecf21025c9dd675378244e90ff192822a4c49d6cb812c9fe84b3f9ba4"; +const KAT_CASE_ID: &str = "890980a43bd189494c2c922d2bf0049cbffb07f1090f578e04e1142aee7525f1"; +const KAT_ACC_ID: &str = "d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f"; + +fn fixture(name: &str) -> Fixture { + fixtures::all().into_iter().find(|f| f.name == name).unwrap_or_else(|| panic!("no fixture {}", name)) +} +fn p2_text() -> String { + String::from_utf8(fixture("at1-kat-rotated-level-n4").spec.bytes()).unwrap() +} +fn run(spec: &Spec) -> (super::at1::case::Case, Computed) { + let c = parse_case(&spec.bytes()).expect("case parses"); + let comp = compute(&c); + (c, comp) +} +fn check_result<'a>(comp: &'a Computed, name: &str) -> &'a str { + comp.verdict.checks.iter().find(|(n, _)| *n == name).map(|(_, r)| *r).unwrap() +} +fn provenance(started: &str) -> Vec<(&'static str, String)> { + let exe = "ab".repeat(32); + let commit = "cd".repeat(20); + let vals = [ + "aien-dev/omega".to_string(), + commit.clone(), + "YES".to_string(), + "cbe4c8ed88d28bb96d5209327ecd30aa9cddaf7a".to_string(), + exe.clone(), + "aien-dev/omega".to_string(), + commit, + exe, + "oracle rustc test".to_string(), + "rustc test src/main.rs".to_string(), + "testhost".to_string(), + started.to_string(), + "2026-10-10T00:00:09Z".to_string(), + ]; + PROVENANCE_KEYS.iter().cloned().zip(vals).collect() +} + +// ---------------------------------------------------------------- identities (KAT) + +#[test] +fn worked_example_identities_are_byte_exact() { + let text = p2_text(); + let c = parse_case(text.as_bytes()).expect("worked example parses"); + assert_eq!(c.file_sha256, KAT_FILE); + assert_eq!(c.case_id, KAT_CASE_ID); + assert_eq!(c.acceptance_id, KAT_ACC_ID); + let comp = compute(&c); + assert_eq!(comp.levels.kernel_dim, 2); + assert!(!comp.levels.trivial); + // the AT1_SPEC worked example table: p = 5/28, 1/4, 9/28, 1/4 + let want = [5.0 / 28.0, 0.25, 9.0 / 28.0, 0.25]; + for k in 0..4 { + assert!((comp.interacting[k].p - want[k]).abs() < 1e-15); + assert!((comp.matrix.labels[k].p - want[k]).abs() < 1e-15); + } + assert_eq!(comp.verdict.outcome, "PASS"); +} + +// ---------------------------------------------------------------- section 13 tables + +#[test] +fn every_section13_table_matches_on_both_routes_within_bounds() { + let all = fixtures::all(); + assert_eq!(all.len(), 21, "P1a, P1b, P1c, P2, P3, P3b, P4, P5, P6, N1 to N1f, N2, N3, N4a, N4b, N5, N6"); + for f in &all { + let (_c, comp) = run(&f.spec); + assert_eq!(comp.levels.kernel_dim, f.kernel_dim, "{} kernel dim", f.name); + assert_eq!(comp.levels.trivial, f.trivial, "{} trivial", f.name); + assert_eq!(comp.matrix.trivial, f.trivial, "{} matrix trivial", f.name); + let cal = calibrate(f, &comp); + assert_eq!(cal.bound_violations, 0, "{}: an actual error exceeds its written bound", f.name); + assert!(cal.max_dev_matrix <= 1e-14 && cal.max_dev_closed <= 1e-14 && cal.max_dev_ideal <= 1e-14, "{}: deviation", f.name); + assert!(cal.max_bound < 1e-12, "{}: a bound reaches the tolerance", f.name); + assert!(cal.values_checked >= 25, "{}", f.name); + } +} + +#[test] +fn every_case_meets_its_own_expectation() { + for f in fixtures::all() { + let (_c, comp) = run(&f.spec); + let exp: Vec<&str> = f.spec.expected_codes.iter().map(String::as_str).collect(); + assert_eq!(comp.verdict.outcome, f.spec.expected_outcome, "{}", f.name); + assert_eq!(comp.verdict.codes, exp, "{}", f.name); + assert!(comp.verdict_lines.contains(&"expectation_met YES".to_string()), "{}", f.name); + } +} + +#[test] +fn n1_family_fails_check_10_and_passes_check_11() { + for name in ["at1-n1-p2-ideal", "at1-n1b-p3-ideal", "at1-n1c-p3b-ideal", "at1-n1d-p4-ideal", "at1-n1e-p5-ideal", "at1-n1f-p6-ideal"] { + let (_c, comp) = run(&fixture(name).spec); + assert_eq!(check_result(&comp, "target_agreement"), "FAIL", "{}", name); + assert_eq!(check_result(&comp, "oracle_cross_check"), "PASS", "{}", name); + assert_eq!(check_result(&comp, "label_status_agreement"), "PASS", "{}", name); + assert_eq!(comp.verdict.codes, vec!["SCHRODINGER_DEVIATION_EXCEEDED"], "{}", name); + } + // under INTERACTING check 11 is not run + let (_c, comp) = run(&fixture("at1-kat-rotated-level-n4").spec); + assert_eq!(check_result(&comp, "oracle_cross_check"), "NOT_EVALUATED"); +} + +#[test] +fn trivial_kernel_rule() { + for name in ["at1-n2-all-levels-out", "at1-n6-zero-projection"] { + let (_c, comp) = run(&fixture(name).spec); + for (i, (n, r)) in comp.verdict.checks.iter().enumerate() { + let evaluated = matches!(i + 1, 1 | 2 | 3 | 5); + assert_eq!(*n, CHECK_NAMES[i]); + assert_eq!(*r == "NOT_EVALUATED", !evaluated, "{} check {} {}", name, i + 1, r); + } + assert_eq!(check_result(&comp, "physical_state_nontrivial"), "FAIL"); + for l in &comp.values { + let t: Vec<&str> = l.split(' ').collect(); + match t[0] { + "label" | "reference_label" => assert_eq!(t[3], "UNDEFINED"), + "constraint_residual" => assert_eq!(&t[1..], ["undefined", "0@0"]), + "clock_probability" | "reference_clock_probability" => assert_eq!(&t[2..], ["undefined", "0@0"]), + "pauli" | "reference_interacting" => assert_eq!(&t[4..], ["undefined", "0@0"]), + "reference_ideal" => assert!(t[4].starts_with("f64:")), + _ => {} + } + } + } +} + +#[test] +fn n3_zero_label_is_undefined_with_zero_bound_lines() { + let (_c, comp) = run(&fixture("at1-n3-swapped-level-zero-label").spec); + assert!(comp.values.contains(&"label 2 t2 UNDEFINED".to_string())); + assert!(comp.values.contains(&"reference_label 2 t2 UNDEFINED".to_string())); + assert!(comp.values.contains(&"pauli 2 Y MINUS undefined 0@0".to_string())); + assert!(comp.values.contains(&"reference_interacting 2 X PLUS undefined 0@0".to_string())); + assert_eq!(check_result(&comp, "conditional_defined"), "FAIL"); +} + +// ---------------------------------------------------------------- refusals + +fn edit(text: &str, from: &str, to: &str) -> String { + assert_eq!(text.matches(from).count(), 1, "defect anchor {:?} must occur once", from); + text.replacen(from, to, 1) +} +fn refused(bytes: &[u8]) -> &'static str { + match parse_case(bytes) { + Ok(_) => "ACCEPTED", + Err(r) => r.code, + } +} +fn refused_fresh(text: &str) -> &'static str { + refused(refresh_ids(text).as_bytes()) +} + +#[test] +fn spec_13_5_refusal_classes() { + let t = p2_text(); + assert_eq!(refused(t.as_bytes()), "ACCEPTED"); + let pe = "CASE_PARSE_ERROR"; + let nc = "CASE_NONCANONICAL"; + let uv = "CASE_UNSUPPORTED_VERSION"; + let ip = "CASE_INVALID_PARAMETER"; + // R0 + assert_eq!(refused_fresh(&edit(&t, "system_dim 2\n", "")), pe); + assert_eq!(refused(t.replace('\n', "\r\n").as_bytes()), pe); + // R1 + assert_eq!(refused_fresh(&edit(&t, "povm_tau_turns 1/4", "povm_tau_turns 2/8")), nc); + // R2, R2b, R2c + assert_eq!(refused_fresh(&edit(&t, "OMEGA-AT1-CASE v1", "OMEGA-AT1-CASE v2")), uv); + assert_eq!(refused_fresh(&edit(&t, "domain omega.at1.case.v1", "domain omega.at1.case.v2")), uv); + assert_eq!(refused_fresh(&edit(&t, "contract AT1_CASE_V1", "contract AT1_CASE_V2")), uv); + // R3: 65 levels with 65 couplings; R3b: one level with one coupling + let mut s = fixture("at1-kat-rotated-level-n4").spec; + s.energies = (0..65).map(qi).collect(); + s.v = vec![[Q::zero(), Q::zero(), Q::zero()]; 65]; + assert_eq!(refused(&s.bytes()), ip); + s.energies = vec![q(-1, 2)]; + s.v = vec![[Q::zero(), Q::zero(), Q::zero()]]; + assert_eq!(refused(&s.bytes()), ip); + // R4: per-level irrational spectrum while |h| is rational + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 2 3/10,0/1,-1/10", "interaction_pauli 2 1/2,0/1,-1/10")), "CASE_IRRATIONAL_SPECTRUM"); + // R5, R5b: identities not refreshed + assert_eq!(refused(edit(&t, &format!("case_id {}", KAT_CASE_ID), &format!("case_id 0{}", &KAT_CASE_ID[1..])).as_bytes()), "CASE_ID_MISMATCH"); + assert_eq!(refused(edit(&t, &format!("acceptance_id {}", KAT_ACC_ID), &format!("acceptance_id 0{}", &KAT_ACC_ID[1..])).as_bytes()), "CASE_ID_MISMATCH"); + // R6, R6b + assert_eq!(refused_fresh(&edit(&t, "expected_outcome PASS", "expected_outcome FAIL")), ip); + let neg = edit(&edit(&t, "control_kind POSITIVE", "control_kind NEGATIVE"), "expected_outcome PASS", "expected_outcome FAIL"); + assert_eq!(refused_fresh(&edit(&neg, "expected_failure_codes none", "expected_failure_codes NOT_AN_AT1_CODE")), ip); + // R7 coupling count, R8 coupling order + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 3 0/1,0/1,0/1\n", "")), pe); + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 1 0/1,0/1,0/1\ninteraction_pauli 2 3/10,0/1,-1/10\n", "interaction_pauli 2 3/10,0/1,-1/10\ninteraction_pauli 1 0/1,0/1,0/1\n")), pe); + // R9 to R12 fixed literals and enumeration + assert_eq!(refused_fresh(&edit(&t, "interaction CLOCK_DIAGONAL_PAULI", "interaction NONE")), pe); + assert_eq!(refused_fresh(&edit(&t, "model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG", "model_family PAGE_WOOTTERS_FINITE_IDEAL")), pe); + assert_eq!(refused_fresh(&edit(&t, "constraint SUM_HC_HS_V", "constraint SUM_HC_HS")), pe); + assert_eq!(refused_fresh(&edit(&t, "prediction_target INTERACTING", "prediction_target BOTH")), pe); + assert_eq!(refused_fresh(&edit(&t, "prediction_target INTERACTING\n", "")), pe); + // R13 non-canonical coupling component, R14 over the token limit + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 1 0/1,0/1,0/1", "interaction_pauli 1 2/10,0/1,0/1")), nc); + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 1 0/1,0/1,0/1", "interaction_pauli 1 1048577/1,0/1,0/1")), ip); + // two defects: the earlier rule wins (R1 noncanonical before R4 spectrum) + let two = edit(&edit(&t, "povm_tau_turns 1/4", "povm_tau_turns 2/8"), "interaction_pauli 2 3/10,0/1,-1/10", "interaction_pauli 2 1/2,0/1,-1/10"); + assert_eq!(refused_fresh(&two), nc); +} + +#[test] +fn inherited_at0_refusal_rows_on_p2() { + let t = p2_text(); + let pe = "CASE_PARSE_ERROR"; + let nc = "CASE_NONCANONICAL"; + let uv = "CASE_UNSUPPORTED_VERSION"; + let ip = "CASE_INVALID_PARAMETER"; + let rows: Vec<(&str, String, &str)> = vec![ + ("R07 crlf", t.replace('\n', "\r\n"), pe), + ("R08 tab", edit(&t, "clock_dim 4", "clock_dim\t4"), pe), + ("R09 blank-line", edit(&t, "system_dim 2\n", "system_dim 2\n\n"), pe), + ("R10 trailing-space", edit(&t, "system_dim 2\n", "system_dim 2 \n"), pe), + ("R11 double-space", edit(&t, "system_dim 2", "system_dim 2"), pe), + ("R12 missing-key", edit(&t, "interaction CLOCK_DIAGONAL_PAULI\n", ""), pe), + ("R13 unknown-key", edit(&t, "system_dim 2\n", "system_dim 2\nfoo bar\n"), pe), + ("R14 duplicate-key", edit(&t, "interaction CLOCK_DIAGONAL_PAULI\n", "interaction CLOCK_DIAGONAL_PAULI\ninteraction CLOCK_DIAGONAL_PAULI\n"), pe), + ("R15 out-of-order", edit(&t, "system_hamiltonian_pauli 0/1,0/1,0/1,1/2\ninteraction CLOCK_DIAGONAL_PAULI\n", "interaction CLOCK_DIAGONAL_PAULI\nsystem_hamiltonian_pauli 0/1,0/1,0/1,1/2\n"), pe), + ("R16 float-text", edit(&t, "povm_tau_turns 1/4", "povm_tau_turns 0.25"), pe), + ("R19 label-uppercase", edit(&edit(&t, "reference_clock_label t0", "reference_clock_label T0"), "clock_label 0 t0", "clock_label 0 T0"), pe), + ("R31 control-kind-bad", edit(&t, "control_kind POSITIVE", "control_kind MAYBE"), pe), + ("R32 case-name-two-tokens", edit(&t, "case_name at1-kat-rotated-level-n4", "case_name at1 kat"), pe), + ("R35 trailing-line", format!("{}extra\n", t), pe), + ("R36 label-count-mismatch", edit(&t, "clock_label_count 4", "clock_label_count 5"), pe), + ("R37 model-family-bad", edit(&t, "model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG", "model_family PAGE_WOOTTERS_INTERACTING"), pe), + ("R01 noncanonical-rational", edit(&t, "povm_weight 1/1", "povm_weight 2/2"), nc), + ("R17 noncanonical-integer", edit(&t, "clock_dim 4", "clock_dim 04"), nc), + ("R18 noncanonical-scaled", edit(&t, "tol_probability 1@12", "tol_probability 10@13"), nc), + ("R30 negative-zero", edit(&t, "system_hamiltonian_pauli 0/1,", "system_hamiltonian_pauli -0/1,"), nc), + ("R02 header-v2", edit(&t, "OMEGA-AT1-CASE v1", "OMEGA-AT1-CASE v2"), uv), + ("R24 wrong-domain", edit(&t, "domain omega.at1.case.v1", "domain omega.at1.case.v2"), uv), + ("R25 wrong-contract", edit(&t, "contract AT1_CASE_V1", "contract AT1_CASE_V2"), uv), + ("R20 energies-not-increasing", edit(&t, "clock_energies -3/2,-1/2,", "clock_energies -1/2,-3/2,"), ip), + ("R21 psi-zero", edit(&t, "reference_system_state (1/1;0/1),(1/1;0/1)", "reference_system_state (0/1;0/1),(0/1;0/1)"), ip), + ("R22 tau-zero", edit(&t, "povm_tau_turns 1/4", "povm_tau_turns 0/1"), ip), + ("R23 weight-negative", edit(&t, "povm_weight 1/1", "povm_weight -1/1"), ip), + ("R27 rational-over-limit", edit(&t, "clock_energies -3/2,", "clock_energies -1048577/1,"), ip), + ("R28 duplicate-label", edit(&t, "clock_label 2 t2", "clock_label 2 t1"), ip), + ("R29 ref-label-missing", edit(&t, "reference_clock_label t0", "reference_clock_label t9"), ip), + ("R39 huge-digits-tau", edit(&t, "povm_tau_turns 1/4", "povm_tau_turns 340282366920938463463374607431768211457/4"), ip), + ("R06 codes-with-pass", edit(&t, "expected_failure_codes none", "expected_failure_codes TRIVIAL_PHYSICAL_STATE"), ip), + ("R04 irrational-spectrum", edit(&t, "system_hamiltonian_pauli 0/1,0/1,0/1,1/2", "system_hamiltonian_pauli 0/1,1/1,0/1,1/1"), "CASE_IRRATIONAL_SPECTRUM"), + ]; + for (name, text, code) in &rows { + let got = if name.starts_with("R07") { refused(text.as_bytes()) } else { refused_fresh(text) }; + assert_eq!(got, *code, "{}", name); + } + let neg = edit(&edit(&t, "control_kind POSITIVE", "control_kind NEGATIVE"), "expected_outcome PASS", "expected_outcome FAIL"); + assert_eq!(refused_fresh(&edit(&neg, "expected_failure_codes none", "expected_failure_codes PROBABILITY_SUM_EXCEEDED,POVM_NORMALIZATION_EXCEEDED")), ip, "R06b codes-unsorted"); + assert_eq!(refused_fresh(&edit(&neg, "expected_failure_codes none", "expected_failure_codes FOO_BAR")), ip, "R06c codes-unknown"); + assert_eq!(refused_fresh(&neg), ip, "R06d fail-without-codes"); + assert_eq!(refused(t.trim_end_matches('\n').as_bytes()), pe, "R33 missing-final-lf"); + assert_eq!(refused(b""), pe, "R34 empty"); +} + +#[test] +fn charter_readings_d_and_e_and_declared_token_readings() { + let t = p2_text(); + // (d) the first token of a version line is its key: an AT-0 header is a parse error + assert_eq!(refused_fresh(&edit(&t, "OMEGA-AT1-CASE v1", "OMEGA-AT0-CASE v1")), "CASE_PARSE_ERROR"); + assert_eq!(refused_fresh(&edit(&t, "contract AT1_CASE_V1", "contract AT0_CASE_V1")), "CASE_UNSUPPORTED_VERSION"); + assert_eq!(refused_fresh(&edit(&t, "domain omega.at1.case.v1", "domain omega.at0.case.v1")), "CASE_UNSUPPORTED_VERSION"); + // (e) index tokens by parsed value: 01 at position 1 is non-canonical, x or 5 is shape + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 1 ", "interaction_pauli 01 ")), "CASE_NONCANONICAL"); + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 1 ", "interaction_pauli x ")), "CASE_PARSE_ERROR"); + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 1 ", "interaction_pauli 5 ")), "CASE_PARSE_ERROR"); + assert_eq!(refused_fresh(&edit(&t, "clock_label 1 t1", "clock_label 01 t1")), "CASE_NONCANONICAL"); + // (b) shape before range, non-canonical decided after the whole shape pass + let shape_late = edit(&edit(&t, "povm_weight 1/1", "povm_weight 2/2"), "observables PAULI_X,PAULI_Y,PAULI_Z", "observables PAULI_X"); + assert_eq!(refused_fresh(&shape_late), "CASE_PARSE_ERROR"); + // declared readings (README): integer grammar -?[0-9]+, fixed arities, d < 1 + assert_eq!(refused_fresh(&edit(&t, "clock_dim 4", "clock_dim +4")), "CASE_PARSE_ERROR"); + // declared reading: `clock_dim 0` cannot match a non-empty clock_energies line, so it is a + // count mismatch (shape, CASE_PARSE_ERROR) before the range rule N >= 2 is reached + assert_eq!(refused_fresh(&edit(&t, "clock_dim 4", "clock_dim 0")), "CASE_PARSE_ERROR"); + assert_eq!(refused_fresh(&edit(&t, "interaction_pauli 1 0/1,0/1,0/1", "interaction_pauli 1 0/1,0/1")), "CASE_PARSE_ERROR"); + assert_eq!(refused_fresh(&edit(&t, "system_hamiltonian_pauli 0/1,0/1,0/1,1/2", "system_hamiltonian_pauli 0/1,0/1,1/2")), "CASE_PARSE_ERROR"); + assert_eq!(refused_fresh(&edit(&t, "povm_weight 1/1", "povm_weight 1/0")), "CASE_NONCANONICAL"); + assert_eq!(refused_fresh(&edit(&t, "tol_probability 1@12", "tol_probability 1@41")), "CASE_INVALID_PARAMETER"); +} + +// ---------------------------------------------------------------- judge and mutants + +/// Values block whose engine lines (label, clock_probability, pauli and the residuals) +/// come from `mutant` and whose reference lines come from `orig`. +fn splice(orig: &[String], mutant: &[String]) -> Vec { + assert_eq!(orig.len(), mutant.len()); + orig.iter() + .zip(mutant) + .map(|(o, m)| { + let key = o.split(' ').next().unwrap(); + if matches!(key, "label" | "clock_probability" | "pauli") { + m.clone() + } else { + o.clone() + } + }) + .collect() +} + +fn mutant_verdict(orig: &Spec, mutant: &Spec) -> super::at1::result::Verdict { + let (c, comp) = run(orig); + let (_m, mcomp) = run(mutant); + judge(&c, &splice(&comp.values, &mcomp.values), "ESTIMATED").expect("spliced block parses") +} + +fn result_of(v: &super::at1::result::Verdict, name: &str) -> &'static str { + v.checks.iter().find(|(n, _)| *n == name).map(|(_, r)| *r).unwrap() +} + +#[test] +fn mutant_m1_drop_v() { + let p2 = fixture("at1-kat-rotated-level-n4").spec; + let mut m1 = p2.clone(); + m1.v = vec![[Q::zero(), Q::zero(), Q::zero()]; 4]; + let v = mutant_verdict(&p2, &m1); + assert_eq!(v.codes, vec!["INTERACTING_DEVIATION_EXCEEDED"]); + // under IDEAL (N1): check 10 passes, check 11 fails + let n1 = fixture("at1-n1-p2-ideal").spec; + let mut m1i = n1.clone(); + m1i.v = vec![[Q::zero(), Q::zero(), Q::zero()]; 4]; + let v = mutant_verdict(&n1, &m1i); + assert_eq!(result_of(&v, "target_agreement"), "PASS"); + assert_eq!(result_of(&v, "oracle_cross_check"), "FAIL"); + assert_eq!(v.codes, vec!["ORACLE_DISAGREEMENT"]); + // blind on P1c (coupling outside the kernel); P1 itself has V = 0, so dropping V is a no-op there + let p1c = fixture("at1-p1c-spectator-coupling").spec; + let mut m1c = p1c.clone(); + m1c.v = vec![[Q::zero(), Q::zero(), Q::zero()]; 4]; + assert_eq!(mutant_verdict(&p1c, &m1c).outcome, "PASS"); +} + +#[test] +fn mutants_m3_m4_are_visible_on_p2() { + let p2 = fixture("at1-kat-rotated-level-n4").spec; + // M2 (sign of V flipped) is not expressible as a valid case on P2: h - v_2 has the + // irrational |n|^2 = 9/20, so it stays with Agent 4's engine mutants. + // M3 v_j applied to level j + 1 + let mut m3 = p2.clone(); + m3.v.rotate_right(1); + assert_eq!(mutant_verdict(&p2, &m3).codes, vec!["INTERACTING_DEVIATION_EXCEEDED"]); + // M4 pre-freeze phase sign: with r = 0 and a complete clock, label k of the mutant is + // label (M - k) mod M of the correct engine + let (c, comp) = run(&p2); + let m = 4; + let permuted: Vec = comp + .values + .iter() + .map(|l| { + let t: Vec<&str> = l.split(' ').collect(); + if matches!(t[0], "clock_probability" | "pauli") { + let k: usize = t[1].parse().unwrap(); + let src = format!("{} {} ", t[0], (m - k) % m); + let found = comp.values.iter().find(|x| x.starts_with(&src) && (t[0] == "clock_probability" || x.split(' ').nth(2) == Some(t[2]) && x.split(' ').nth(3) == Some(t[3]))).unwrap(); + let ft: Vec<&str> = found.split(' ').collect(); + let mut out = t[..2].to_vec(); + out.extend_from_slice(&ft[2..]); + out.join(" ") + } else { + l.clone() + } + }) + .collect(); + let v = judge(&c, &permuted, "ESTIMATED").unwrap(); + assert_eq!(v.codes, vec!["INTERACTING_DEVIATION_EXCEEDED"]); +} + +#[test] +fn label_status_mismatch_fails_check_12() { + let (c, comp) = run(&fixture("at1-kat-rotated-level-n4").spec); + let lines: Vec = comp + .values + .iter() + .map(|l| { + if l == "label 2 t2 DEFINED" { + "label 2 t2 UNDEFINED".to_string() + } else if l.starts_with("pauli 2 ") { + let t: Vec<&str> = l.split(' ').collect(); + format!("pauli 2 {} {} undefined 0@0", t[2], t[3]) + } else { + l.clone() + } + }) + .collect(); + let v = judge(&c, &lines, "ESTIMATED").unwrap(); + assert_eq!(result_of(&v, "label_status_agreement"), "FAIL"); + assert!(v.codes.contains(&"ORACLE_DISAGREEMENT")); +} + +#[test] +fn values_parser_enforces_undefined_placement() { + let (c, comp) = run(&fixture("at1-kat-rotated-level-n4").spec); + let bad: Vec = comp.values.iter().map(|l| if l.starts_with("clock_probability 1 ") { "clock_probability 1 undefined 0@0".to_string() } else { l.clone() }).collect(); + assert!(parse_values(&bad, &c).is_err()); + let bad: Vec = comp.values.iter().map(|l| if l.starts_with("reference_ideal 0 X PLUS ") { "reference_ideal 0 X PLUS undefined 0@0".to_string() } else { l.clone() }).collect(); + assert!(parse_values(&bad, &c).is_err()); + let bad: Vec = comp.values.iter().map(|l| if l.starts_with("povm_residual ") { "povm_residual undefined 0@0".to_string() } else { l.clone() }).collect(); + assert!(parse_values(&bad, &c).is_err()); + let mut swapped = comp.values.clone(); + let i = swapped.iter().position(|l| l.starts_with("pauli 0 X PLUS")).unwrap(); + swapped.swap(i, i + 1); + assert!(parse_values(&swapped, &c).is_err()); + for tok in ["+2", "02", "-2", "2.0", ""] { + let bad: Vec = comp.values.iter().map(|l| if l.starts_with("physical_state_kernel_dim ") { format!("physical_state_kernel_dim {}", tok) } else { l.clone() }).collect(); + assert!(parse_values(&bad, &c).is_err(), "kernel_dim token {:?}", tok); + } + assert!(parse_values(&comp.values, &c).is_ok()); +} + +#[test] +fn nonfinite_value_fails_check_2() { + let (c, comp) = run(&fixture("at1-kat-rotated-level-n4").spec); + let lines: Vec = comp.values.iter().map(|l| if l.starts_with("pauli 1 Z PLUS ") { "pauli 1 Z PLUS nonfinite 1@20".to_string() } else { l.clone() }).collect(); + let v = judge(&c, &lines, "ESTIMATED").unwrap(); + assert_eq!(result_of(&v, "values_finite"), "FAIL"); + assert!(v.codes.contains(&"NONFINITE_VALUE")); +} + +// ---------------------------------------------------------------- invariance tests (spec 9.1) + +fn table(comp: &Computed) -> Vec<(f64, [[f64; 2]; 3])> { + comp.interacting.iter().map(|l| (l.p, l.pauli.unwrap())).collect() +} +fn close(a: &[(f64, [[f64; 2]; 3])], b: &[(f64, [[f64; 2]; 3])], tol: f64) -> bool { + a.len() == b.len() + && a.iter().zip(b).all(|(x, y)| (x.0 - y.0).abs() <= tol && (0..3).all(|i| (0..2).all(|s| (x.1[i][s] - y.1[i][s]).abs() <= tol))) +} + +#[test] +fn t4_t5_global_phase_and_scale() { + let p4 = fixture("at1-p4-complex-state-ref-t1").spec; + let (_c, base) = run(&p4); + let i = super::at1::big::GQ::new(Q::zero(), qi(1)); + let mut ph = p4.clone(); + ph.psi = [p4.psi[0].mul(&i), p4.psi[1].mul(&i)]; + let (_c, phc) = run(&ph); + let mut sc = p4.clone(); + sc.psi = [p4.psi[0].scale(&qi(2)), p4.psi[1].scale(&qi(2))]; + let (_c, scc) = run(&sc); + assert!(close(&table(&base), &table(&phc), 1e-15)); + assert!(close(&table(&base), &table(&scc), 1e-15)); + assert_eq!(base.verdict_lines, phc.verdict_lines); + assert_eq!(base.verdict_lines, scc.verdict_lines); +} + +#[test] +fn t6_purity_of_every_defined_label() { + for f in fixtures::all() { + let (_c, comp) = run(&f.spec); + for l in &comp.matrix.labels { + if let Some(p) = l.pauli { + let s: f64 = (0..3).map(|a| (2.0 * p[a][0] - 1.0).powi(2)).sum(); + assert!((s - 1.0).abs() <= 8e-12, "{}", f.name); + } + } + for l in &comp.interacting { + if let Some(p) = l.pauli { + let s: f64 = (0..3).map(|a| (2.0 * p[a][0] - 1.0).powi(2)).sum(); + assert!((s - 1.0).abs() <= 8e-12, "{}", f.name); + } + } + } +} + +#[test] +fn t7_reference_shift_relabels() { + let p4 = fixture("at1-p4-complex-state-ref-t1").spec; // r = 1 + let mut r0 = p4.clone(); + r0.ref_label = 0; + let (_c, a) = run(&p4); + let (_c, b) = run(&r0); + let (ta, tb) = (table(&a), table(&b)); + for k in 0..4 { + let shifted = [tb[(k + 3) % 4]]; + assert!(close(&[ta[k]], &shifted, 1e-15), "label {}", k); + } +} + +#[test] +fn t9_wall_clock_independence_and_record_shape() { + let f = fixture("at1-kat-rotated-level-n4"); + let (c, a) = run(&f.spec); + let (_c, b) = run(&f.spec); + assert_eq!(a.values, b.values); + assert_eq!(a.verdict_id, b.verdict_id); + let r1 = String::from_utf8(result_bytes(&c, &a, &provenance("2026-10-10T00:00:01Z")).unwrap()).unwrap(); + let r2 = String::from_utf8(result_bytes(&c, &b, &provenance("2026-10-10T00:00:02Z")).unwrap()).unwrap(); + let l1: Vec<&str> = r1.lines().collect(); + let l2: Vec<&str> = r2.lines().collect(); + let vid = |l: &[&str]| l.iter().find(|x| x.starts_with("verdict_id ")).unwrap().to_string(); + let ed = |l: &[&str]| l.iter().find(|x| x.starts_with("evidence_digest ")).unwrap().to_string(); + assert_eq!(vid(&l1), vid(&l2)); + assert_ne!(ed(&l1), ed(&l2)); + // shape: header lines, copied blocks, numerics, values, verdict, provenance, digest, end + assert_eq!(&l1[..5], ["OMEGA-AT1-RESULT v1", "domain omega.at1.result.v1", "contract AT1_RESULT_V1", "case_contract AT1_CASE_V1", "case_name at1-kat-rotated-level-n4"]); + assert_eq!(*l1.last().unwrap(), "end"); + assert!(r1.ends_with("end\n") && !r1.contains('\r')); + let at = |p: &str| l1.iter().position(|x| x.starts_with(p)).unwrap(); + assert!(at("begin semantic") < at("begin acceptance") && at("begin acceptance") < at("case_id ") && at("case_id ") < at("acceptance_id ")); + assert!(at("case_file_sha256 ") < at("begin numerics") && at("begin numerics") < at("begin values") && at("end values") < at("begin verdict")); + assert!(at("verdict_id ") < at("begin provenance") && at("end provenance") < at("evidence_digest ")); + assert_eq!(l1[at("case_file_sha256 ")], format!("case_file_sha256 {}", KAT_FILE)); + let above: Vec = l1[..at("evidence_digest ")].iter().map(|s| s.to_string()).collect(); + assert_eq!(ed(&l1), format!("evidence_digest {}", evidence_digest(&above))); + // values block: 4 + 4 M + 6 M + 4 M + ... lines for M = 4, in contract order + let m = 4; + let nv = at("end values") - at("begin values") + 1; + assert_eq!(nv, 2 + 3 + m + m + 6 * m + m + m + 6 * m + 6 * m); +} + +#[test] +fn oracle_record_marking_is_enforced() { + let f = fixture("at1-kat-rotated-level-n4"); + let (c, a) = run(&f.spec); + let mut p = provenance("2026-10-10T00:00:01Z"); + p[8].1 = "rustc test".to_string(); + assert!(result_bytes(&c, &a, &p).is_err(), "build_cc must begin with oracle"); + let mut p = provenance("2026-10-10T00:00:01Z"); + p[4].1 = "ef".repeat(32); + assert!(result_bytes(&c, &a, &p).is_err(), "engine_sha256 must equal oracle_sha256"); + let mut p = provenance("2026-10-10T00:00:01Z"); + p.swap(0, 1); + assert!(result_bytes(&c, &a, &p).is_err(), "provenance order"); +} + +// ---------------------------------------------------------------- tokens + +#[test] +fn bound_tokens_never_round_down() { + for b in [1e-13, 3.3e-16, 2.5e-14, 1.0e-20, 7.77e-17, 0.5, 1.0, 1e18, 3.7e25, 1e300, f64::MAX] { + let tok = bound_token(b); + let exact = bound_exact(&tok).unwrap(); + assert!(exact >= Q::from_f64(b).unwrap(), "{} -> {}", b, tok); + } + assert_eq!(bound_token(0.0), "0@0"); + // non-finite estimates are written as the largest binary64, never below a finite value + for b in [f64::INFINITY, f64::NAN] { + assert!(bound_exact(&bound_token(b)).unwrap() >= Q::from_f64(f64::MAX).unwrap()); + } + assert_eq!(value_exact("f64:3fd0000000000000").unwrap(), Some(q(1, 4))); + assert_eq!(value_exact("undefined").unwrap(), None); + assert!(value_exact("f64:3FD0000000000000").is_err()); +} + +// ---------------------------------------------------------------- review cases (PR body, findings 1 and 2) + +fn review_case(name: &str, energies: Vec, hpauli: [Q; 4], v: Vec<[Q; 3]>, tau: Q, weight: Q, labels: usize) -> Spec { + let mut s = fixture("at1-p1a-zero-coupling").spec; + s.name = name.to_string(); + s.energies = energies; + s.hpauli = hpauli; + s.v = v; + s.tau = tau; + s.weight = weight; + s.labels = labels; + s +} + +fn assert_review_pass(s: &Spec, kernel_dim: usize) { + let (_c, comp) = run(s); + let (val, bound) = comp.matrix.constraint.expect("nontrivial kernel"); + let (pv, pb) = comp.matrix.povm; + eprintln!("{}: constraint {:e} bound {:e}; povm {:e} bound {:e}; outcome {} {:?}", s.name, val, bound, pv, pb, comp.verdict.outcome, comp.verdict.codes); + assert_eq!(comp.matrix.kernel_dim, kernel_dim, "{}", s.name); + assert!(val <= bound, "{}: constraint residual {:e} above its bound {:e}", s.name, val, bound); + assert!(pv <= pb, "{}: povm residual {:e} above its bound {:e}", s.name, pv, pb); + assert_eq!(comp.verdict.outcome, "PASS", "{}: {:?}", s.name, comp.verdict.codes); +} + +#[test] +fn review_finding_1_large_field_cancelling_large_coupling() { + // reviewer's case: h_z = 1048573/15 and v_j = (3/10, 0, -1048567/15) on both levels, so + // n_j = (3/10, 0, 2/5), R_j = 1/2; E = (-1/2, 1/2) puts one kernel vector on each level + let vj = [q(3, 10), Q::zero(), q(-1048567, 15)]; + let s = review_case("at1-review-f1-cancellation", vec![q(-1, 2), q(1, 2)], [Q::zero(), Q::zero(), Q::zero(), q(1048573, 15)], vec![vj.clone(), vj], q(1, 2), qi(1), 2); + assert_review_pass(&s, 2); +} + +#[test] +fn review_finding_2_large_clocks() { + // P1-type kernel on E_j = j, h0 = -1/2, h_z = 1/2 (kernel vectors on levels 0 and 1) + let h = [q(-1, 2), Q::zero(), Q::zero(), q(1, 2)]; + let e64: Vec = (0..64).map(qi).collect(); + let zero_v = vec![[Q::zero(), Q::zero(), Q::zero()]; 64]; + let s = review_case("at1-review-f2-n64-m64", e64.clone(), h.clone(), zero_v.clone(), q(1, 64), qi(1), 64); + assert_review_pass(&s, 2); + let s = review_case("at1-review-f2-n64-m256", e64, h, zero_v, q(1, 256), q(1, 4), 256); + assert_review_pass(&s, 2); +} ```