interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / plans / atemporal / AT1_CASE_V1.md

172 lines · 13202 bytes Raw Blame History Rendered
1# AT1_CASE_V1: AT-1 case interchange contract
2
3**Contract:** `AT1_CASE_V1`. **Domain tags:** `omega.at1.case.v1` (case identity), `omega.at1.acceptance.v1` (acceptance identity).
4**Status:** FROZEN on merge of the pull request that adds this file. After that, any change to this file is a contract change and requires `AT1_CASE_V2` (AT1 charter section 8). Typos are not exempt.
5**Owner:** Agent 0. **Program status:** NOT_RUN. **Predecessor:** `AT0_CASE_V1` (frozen, unchanged, still the AT-0 contract).
6
7## 0. Changes from AT0_CASE_V1
8
9- Header and tags: `OMEGA-AT1-CASE v1`, `domain omega.at1.case.v1`, `contract AT1_CASE_V1`, identity tags `omega.at1.case.v1` and `omega.at1.acceptance.v1`.
10- `model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG`; `interaction CLOCK_DIAGONAL_PAULI`; one new repeated line `interaction_pauli <j> <vx>,<vy>,<vz>` (N entries); `constraint SUM_HC_HS_V`.
11- New acceptance line `prediction_target <IDEAL|INTERACTING>` (which reference the engine must agree with).
12- Validity rule 4 (rational spectrum) is applied per clock level.
13- Everything else is byte-for-byte the AT0_CASE_V1 rule.
14
15## 1. File shape
16
17ASCII text, LF line endings, every line terminated by exactly one LF, including the last. Allowed bytes: 0x20 to 0x7E and 0x0A. No CR, no tab, no blank line, no leading or trailing space, exactly one space between tokens. Lines appear in exactly the order below; a line marked "repeated" appears once per item, in ascending index order. Unknown keys, missing keys, duplicate keys and out-of-order keys are errors (`CASE_PARSE_ERROR`), never warnings. A fixed literal that does not match (for example `model_family` or `constraint`), an enumeration token outside its set, a repeated block whose line count does not match its count line, or a repeated line whose index token is not its zero-based position, is a shape error (`CASE_PARSE_ERROR`), per the AT-0 reading "shape before range". `clock_dim` is the count line for both the `clock_energies` entries and the `interaction_pauli` lines; `clock_label_count` is the count line for the `clock_label` lines. One exception, so that version mismatches are reported as such: the three version-bearing lines (`OMEGA-AT1-CASE v1`, `domain ...`, `contract ...`) are checked for key and placement in step 1 and for their value in step 2 of section 4 (`CASE_UNSUPPORTED_VERSION`).
18
19```
20OMEGA-AT1-CASE v1
21domain omega.at1.case.v1
22contract AT1_CASE_V1
23case_name <name>
24begin semantic
25model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG
26energy_unit DIMENSIONLESS_HBAR_1
27clock_dim <N>
28clock_energies <rational>,<rational>,... (N entries, strictly increasing)
29system_dim 2
30system_hamiltonian_pauli <h0>,<hx>,<hy>,<hz> (rationals)
31interaction CLOCK_DIAGONAL_PAULI
32interaction_pauli <j> <vx>,<vy>,<vz> (repeated, j = 0 .. N-1, rationals)
33constraint SUM_HC_HS_V
34physical_state NULLSPACE_PROJECTION
35reference_clock_label <label>
36reference_system_state <complex>,<complex>
37clock_povm COVARIANT_DISCRETE
38povm_tau_turns <rational>
39povm_weight <rational>
40clock_label_count <M>
41clock_label <k> <label> (repeated, k = 0 .. M-1)
42observables PAULI_X,PAULI_Y,PAULI_Z
43end semantic
44begin acceptance
45control_kind <POSITIVE|NEGATIVE>
46prediction_target <IDEAL|INTERACTING>
47expected_outcome <PASS|FAIL>
48expected_failure_codes <code>,<code>,... | none
49min_bound_kind <RIGOROUS|ESTIMATED|NONE>
50tol_constraint_residual <scaled>
51tol_povm_residual <scaled>
52tol_probability <scaled>
53tol_zero_probability <scaled>
54tol_schrodinger <scaled>
55end acceptance
56case_id <64 lowercase hex>
57acceptance_id <64 lowercase hex>
58end
59```
60
61## 2. Canonical encodings (shared by AT1_CASE_V1 and AT1_RESULT_V1)
62
63Identical to AT0_CASE_V1 section 2, restated so this file stands alone:
64
65- **Integer:** decimal, optional leading `-`, no leading zeros, no `+`. Zero is `0`. `-0` is invalid (`CASE_NONCANONICAL`).
66- **Rational:** `n/d` with `d >= 1`, `gcd(|n|, d) = 1`; integers are written `n/1`; zero is `0/1`. Limits: `|n| <= 1048576`, `1 <= d <= 1048576`. Validators decide rules 3 and 4 of section 4, the kernel test and the zero test of section 3 exactly for every case within these token limits, using arbitrary-precision integers or an equivalent exact method (the sum of three squared rationals can carry a denominator near 2^240). No implementation-defined refusal exists: a validator never refuses a case within the token limits for lack of arithmetic width, and never wraps around.
67- **Complex rational:** `(re;im)`, both rationals, no spaces.
68- **Scaled decimal:** `N@k` meaning `N / 10^k`, `N >= 0` integer, `0 <= k <= 40`; zero is `0@0`; otherwise `N` not divisible by 10 unless `k = 0`.
69- **Lists:** comma separated, no spaces, no trailing comma; the empty list is `none`.
70- **Label:** `[a-z][a-z0-9_]{0,31}`. **Name:** `[A-Za-z0-9][A-Za-z0-9_.-]{0,63}`. **Digest:** 64 lowercase hex.
71- **No floating-point text anywhere in a case file.**
72- A token that parses but is not canonical (`2/4`, `04`, `-0/1`, `10@1`) is `CASE_NONCANONICAL`, decided after the whole shape pass.
73
74## 3. Field meaning (the physics, fixed for V1)
75
76Units: hbar = 1, dimensionless energies, times in the reciprocal unit. Pauli matrices in the computational basis with `Z|0> = +|0>`.
77
78- `clock_energies`: `H_C = sum_j E_j |E_j><E_j|`, `j = 0 .. N-1`, `2 <= N <= 64`, strictly increasing.
79- `system_hamiltonian_pauli`: `H_S = h0 I + hx X + hy Y + hz Z`.
80- `interaction CLOCK_DIAGONAL_PAULI`, `interaction_pauli j vx,vy,vz`: `V = sum_j |E_j><E_j| (x) (vx_j X + vy_j Y + vz_j Z)`. All-zero vectors are allowed (then the case is an AT-0 ideal case written in AT-1 form).
81- `constraint SUM_HC_HS_V`: `H_total = H_C (x) I_S + I_C (x) H_S + V`, clock factor first. Because `V` is diagonal in the clock energy basis, `H_total = sum_j |E_j><E_j| (x) (E_j I + h0 I + (h + v_j).sigma)` with `h = (hx, hy, hz)`. Level `j` has system eigenvalues `e_{j,+-} = h0 +- |h + v_j|` with eigenvectors `|e_{j,+-}>`. Write `n = h + v_j` and `s = +1` or `-1`; the unnormalized eigenvector for eigenvalue `h0 + s|n|` is `(s|n| + n_z, n_x + i n_y)` when that vector is nonzero, else `(n_x - i n_y, s|n| - n_z)`; its components are Gaussian rationals because `|n|` is rational (section 4 rule 4). For `|n| = 0` both eigenvalues equal `h0`, the eigenspace is the whole qubit, and the kernel test below matches both basis vectors `|0>, |1>` or neither.
82- `physical_state NULLSPACE_PROJECTION`: `|Psi> = P_0 (|t_r> (x) |psi_0>)`, `P_0` the orthogonal projector onto the kernel of `H_total`, `|t_r>` the clock state of `reference_clock_label`, `|psi_0>` the unnormalized nonzero `reference_system_state`. The kernel is exact: spanned by `|E_j> (x) |e_{j,s}>` with `E_j + e_{j,s} = 0`.
83- `clock_povm COVARIANT_DISCRETE`, `povm_tau_turns`, `povm_weight`, `clock_label`, `observables`: as AT0_CASE_V1 section 3 (`|t_k> = N^(-1/2) sum_j exp(-2 pi i E_j k tau) |E_j>`, `t_k = 2 pi k tau`, `F_k = w |t_k><t_k|`, `1 <= M <= 256`, labels unique, `reference_clock_label` among them).
84- `Psi` is exactly zero if and only if `<e_{j,s}|psi_0> = 0` for every kernel pair `(j, s)`, decided in exact Gaussian-rational arithmetic with the unnormalized eigenvectors above (the trivial-kernel rule of AT1_RESULT_V1 then applies).
85- Conditional vector: `phi_k = (<t_k| (x) I) Psi = (1/N) sum_{(j,s) in K} exp(+2 pi i E_j (k - r) tau) <e_{j,s}|psi_0> |e_{j,s}>`, `r` the index of the reference label. The sign is plus because the bra `<t_k|` conjugates the phase of `|t_k>`; with `E_j = -e_{j,s}` this is `exp(-i e_{j,s} (t_k - t_r))`, forward evolution, and for zero coupling it reduces to AT-0's `exp(-i H_S (t_k - t_r)) Pi_K psi_0`. Its normalization is the conditional state; `p(k) = w ||phi_k||^2 / ||Psi||^2`. Because the `|e_{j,s}>` differ from level to level, `p(k)` is in general label-dependent and the conditional state is in general not `exp(-i H_S (t_k - t_r)) psi_0`. That is the content AT-1 tests.
86- `prediction_target`: `IDEAL` means the engine's conditional probabilities are judged against Schrodinger evolution under `H_S` alone; `INTERACTING` means they are judged against the oracle's independent computation of the interacting conditional probabilities (AT1_RESULT_V1 section 4). It is an acceptance rule, so it lives in `acceptance_id`, not in `case_id`: the same question can be judged both ways.
87
88No field of a case may hold a wall-clock time, a host name, a run number or anything else about a physical execution.
89
90## 4. Validity rules (exact, before any numerics)
91
92A validator refuses the case with the AT1_RESULT_V1 refusal code shown, on the first failure, in this order:
93
941. Shape and encodings (sections 1, 2): `CASE_PARSE_ERROR` (shape) or `CASE_NONCANONICAL` (parsed, non-canonical token).
952. The values of the three version-bearing lines (`OMEGA-AT1-CASE v1`, `domain omega.at1.case.v1`, `contract AT1_CASE_V1`): `CASE_UNSUPPORTED_VERSION`.
963. Ranges and fixed values of section 3; `reference_system_state` nonzero; `povm_weight > 0`; `povm_tau_turns > 0`: `CASE_INVALID_PARAMETER`. (Counts and index order are shape, step 1.)
974. Rational spectrum per level: for every `j`, `(hx + vx_j)^2 + (hy + vy_j)^2 + (hz + vz_j)^2` is the square of a rational: `CASE_IRRATIONAL_SPECTRUM`.
985. `case_id` and `acceptance_id` equal the recomputed values (section 5): `CASE_ID_MISMATCH`.
996. Acceptance: `expected_failure_codes` is `none` when `expected_outcome PASS`, nonempty, sorted bytewise ascending, no duplicates when `FAIL`, every code an AT1_RESULT_V1 failure code: `CASE_INVALID_PARAMETER`.
100
101## 5. Identity
102
103- `case_id = SHA-256( "omega.at1.case.v1" || 0x00 || B_sem )`, `B_sem` every line from `begin semantic` through `end semantic` inclusive, each followed by LF.
104- `acceptance_id = SHA-256( "omega.at1.acceptance.v1" || 0x00 || B_acc )`, `B_acc` every line from `begin acceptance` through `end acceptance` inclusive, each followed by LF.
105- `case_file_sha256 = SHA-256(whole file bytes)`: artifact digest, not an identity.
106
107Every hashed byte is exact text. Equal digests are evidence of equal exact content, not the definition of equality.
108
109## 6. Worked example (known-answer test for codecs)
110
111Normative for byte layout and digests. The physics table is hand-derived and informational; `AT1_SPEC.md` and the oracle are the authority on values.
112
113```
114OMEGA-AT1-CASE v1
115domain omega.at1.case.v1
116contract AT1_CASE_V1
117case_name at1-kat-rotated-level-n4
118begin semantic
119model_family PAGE_WOOTTERS_FINITE_CLOCKDIAG
120energy_unit DIMENSIONLESS_HBAR_1
121clock_dim 4
122clock_energies -3/2,-1/2,1/2,3/2
123system_dim 2
124system_hamiltonian_pauli 0/1,0/1,0/1,1/2
125interaction CLOCK_DIAGONAL_PAULI
126interaction_pauli 0 0/1,0/1,0/1
127interaction_pauli 1 0/1,0/1,0/1
128interaction_pauli 2 3/10,0/1,-1/10
129interaction_pauli 3 0/1,0/1,0/1
130constraint SUM_HC_HS_V
131physical_state NULLSPACE_PROJECTION
132reference_clock_label t0
133reference_system_state (1/1;0/1),(1/1;0/1)
134clock_povm COVARIANT_DISCRETE
135povm_tau_turns 1/4
136povm_weight 1/1
137clock_label_count 4
138clock_label 0 t0
139clock_label 1 t1
140clock_label 2 t2
141clock_label 3 t3
142observables PAULI_X,PAULI_Y,PAULI_Z
143end semantic
144begin acceptance
145control_kind POSITIVE
146prediction_target INTERACTING
147expected_outcome PASS
148expected_failure_codes none
149min_bound_kind ESTIMATED
150tol_constraint_residual 1@12
151tol_povm_residual 1@12
152tol_probability 1@12
153tol_zero_probability 1@9
154tol_schrodinger 1@12
155end acceptance
156case_id 890980a43bd189494c2c922d2bf0049cbffb07f1090f578e04e1142aee7525f1
157acceptance_id d63246c391296c6cd381f1b654cc625be9f453c77c27c68d9eac240efd5b4d8f
158end
159```
160
161`case_file_sha256` of the 45 lines above, each LF-terminated: `76e282fecf21025c9dd675378244e90ff192822a4c49d6cb812c9fe84b3f9ba4`.
162
163Hand derivation (informational). Levels 0, 1, 3 are uncoupled: `e = +-1/2` with eigenvectors `|0>`, `|1>`. Level 2 has `h + v_2 = (3/10, 0, 4/10)`, `|h + v_2| = 1/2`, so its eigenvalues are also `+-1/2` but along the axis `n = (3/5, 0, 4/5)`: `|e_{2,-}> = (-1/sqrt(10)) |0> + (3/sqrt(10)) |1>`. Kernel: `(j = 1, e = +1/2)` via `|0>` and `(j = 2, e = -1/2)` via `|e_{2,-}>`; dimension 2; both system components survive. The file's `psi_0 = (1, 1)` is proportional to `|+x>`; the values below use the normalized `|+x>` (`p(k)` does not depend on the scale; with the unnormalized vector `||Psi||^2` is `7/20` instead of `7/40`). With `psi_0 = |+x>`: `<0|psi_0> = 1/sqrt(2)`, `<e_{2,-}|psi_0> = 1/sqrt(5)`, `||Psi||^2 = (1/4)(1/2 + 1/5) = 7/40`, and the cross term `<0|e_{2,-}> = -1/sqrt(10)` makes the clock marginal label-dependent: `||phi_k||^2 = (1/16)(7/10 - (1/5) cos(pi k / 2))`, so
164
165| label | p(clock) | ideal model would say |
166|---|---|---|
167| t0 | 5/28 | 1/4 |
168| t1 | 1/4 | 1/4 |
169| t2 | 9/28 | 1/4 |
170| t3 | 1/4 | 1/4 |
171
172The four values sum to 1 (the POVM is complete for this clock), the clock probabilities alone already refute the ideal prediction (AT1_RESULT_V1 check 10 compares them with `w/N` under `prediction_target IDEAL`), and the same case with `prediction_target IDEAL` is the negative class N1 (expected `SCHRODINGER_DEVIATION_EXCEEDED`). The relative phase between the two kernel levels is real here (`cos`), so this table does not depend on the phase sign of section 3; the Y outcomes do. Conditional Pauli values are left to `AT1_SPEC.md`.