# Kickoff 12: twenty-seven squares at once on IBM hardware

Date: September 26, 2026. Author: Dogma Guru. Prepared with Mantri (main). For: Claude Code, in a local session on the author's laptop in `mala-ibm/` (not the website repo). Builds on Kickoff 03 (`square_qubit_ibm.py`, ibm_kingston, September 23, job daq3rdeekp0c73aq6aig, transfer 0.9815 on one square).

Goal: run all 27 squares of the mala at the same time on one IBM processor and measure how often every one of them flips. One number was predicted in conversation before this kickoff was written: 0.9815 to the 27th power, which is 0.60, if the squares fail independently. The run tests that.

A correction first, for the record. The square on hardware is the two-qubit encoding: the four beads are the four states of two qubits, and the flip is two single-qubit rotations. So 27 squares at once is 54 qubits, not 108, and what the run measures is whether a machine's errors on 54 qubits are independent of each other. Variant B below is the 108-qubit version, one excitation on four qubits per square, which is the wire the ideal model actually describes. It is a different and harder experiment. Both are demonstrations, not discoveries; say that in the summary.

---

## 0. Rules for this session

- **Never ask for, read, print, log or store the API key.** The author saves it himself with `QiskitRuntimeService.save_account(...)`. If no saved account is found, stop and tell him.
- Reuse `square_qubit_ibm.py` for its circuit definitions where you can; do not change its physics. The new script is `mala27_ibm.py`, in the same folder, same virtual environment.
- Write and hash your own predictions (`predictions-27.md`, SHA-256 in the run notes) before any hardware job: the five numbers in section 4 for Variant A, and the two for Variant B if it runs. The author's are sealed elsewhere.
- Budget: the Open plan gives 10 minutes a month; Kickoff 03 used about 30 seconds. **At most two hardware jobs this session: one for Variant A, one for Variant B.** Do not resubmit a failed job without asking.
- Raw counts only, no readout mitigation, no resilience options, matching Kickoff 03. If the runtime turns mitigation on by default, turn it off and record it.
- Everything hands back into `mala-ibm/run-27/`.

## 1. Setup

1. Activate the `mala-ibm/` virtual environment; `pip install -U qiskit qiskit-ibm-runtime` only if the saved versions from Kickoff 03 fail. Record versions.
2. `python square_qubit_ibm.py --selfcheck` must still pass.
3. `python mala27_ibm.py --selfcheck` (section 2.4) must pass before anything else.

## 2. Variant A: the encoding on record, 54 qubits

### 2.1 Pair selection

Connect to the service, pick the least busy machine of ibm_kingston, ibm_fez, ibm_marrakesh (or the one the author names), and read its coupling map and properties. Choose 27 disjoint pairs of physically coupled qubits, greedily by lowest two-qubit gate error, breaking ties by lowest readout error, no qubit in two pairs. Record the 27 pairs and each pair's reported single-qubit, two-qubit and readout errors in `pairs.json`. Pair 0 is the best pair; if the machine is ibm_kingston, also note whether Kickoff 03's pair is among the 27.

### 2.2 Circuits

Four circuits, each acting on all 27 pairs in parallel, 54 qubits, 4000 shots each. Per pair, exactly the Kickoff 03 constructions:

1. **Floor.** Prepare nothing, measure. Per pair, P(00) is the readout floor; 1 minus it is the machine's error before any gate.
2. **Transfer.** RX(minus pi) on both qubits of every pair, measure. Per pair, success is reading 11 (bead 1 to bead 55). This is the 0.60 test.
3. **In step.** Per pair: H on qubit 0, CX(0, 1), then RX(minus pi over 2) on both, measure. This is the 0 degree Bell state at t = pi over 4; per pair, P(01) + P(10) should be 1.
4. **Out of step.** Same with RZ(pi) on qubit 1 after the CX: the 180 degree dark state at t = pi over 4; per pair, P(01) + P(10) should be 0.

Transpile with optimization level 3 on the chosen layout (the 27 pairs, fixed with `initial_layout`; do not let the transpiler move them). Record the transpiled depth and two-qubit gate count per circuit.

### 2.3 Analysis, from the raw counts

For each circuit and each pair, the marginal: the fraction of shots in which that pair read its target (11 for transfer; 01 or 10 for in step; not 01 or 10 for out of step; 00 for floor). Then, for the transfer circuit:

- **joint_27**: the fraction of shots in which all 27 pairs read 11 at once. This is the number the 0.60 was about.
- **product_27**: the product of the 27 transfer marginals. This is what joint_27 would be if the pairs failed independently.
- **independence gap**: joint_27 minus product_27, with the binomial standard error of joint_27 at 4000 shots.
- **the 0.9815 line**: 0.9815 to the 27th, which is 0.604, beside joint_27.
- The distribution of the 27 marginals: mean, min, max, and which pairs are min and max.
- **any_k**: for k from 0 to 27, the fraction of shots with exactly k pairs succeeding, against the Poisson-binomial distribution built from the marginals. A histogram of the two is the plot.

Same marginals and the same joint versus product for the in-step and out-of-step circuits; for out of step the per-pair number to report is P(01) + P(10), which should sit at the floor.

### 2.4 Selfcheck (no quantum time)

`--selfcheck`: build the four circuits for 27 pairs, run them on the statevector simulator, and assert transfer marginals all 1.000, joint_27 = 1.000, in step all 1.000, out of step all 0.000 to 1e-12. `--ideal`: the same on the sampler simulator at 4000 shots; expect joint_27 within shot noise of 1. Save as `results27_ideal.json`.

## 3. Variant B: the wire, 108 qubits (run only if A succeeds and the author says go)

One excitation on four qubits per square: beads 1, 28, 55, 82 are qubits q0, q1, q2, q3 of a group; the particle on bead 1 is |1000>; the Hamiltonian is minus one half of the sum over the four edges (q0 q1, q1 q2, q2 q3, q3 q0) of XX + YY, which is hopping on the four-cycle inside the one-excitation subspace. Transfer is |1000> to |0010> at t = pi over 2.

### 3.1 Groups

27 disjoint groups of four qubits forming a connected path on the coupling map (a four-cycle does not exist on a heavy-hex lattice, so the fourth edge is routed by the transpiler; record what that costs). Greedy by lowest summed two-qubit error along the path. Record in `groups.json`. If 27 disjoint four-paths cannot be found on the machine, report the largest number that can and run that many; say so everywhere the number 27 would appear.

### 3.2 Circuit

Second-order Trotter of exp(minus i H t) at t = pi over 2 with n steps: the commuting edge pairs (q0 q1 with q2 q3) and (q1 q2 with q3 q0) as the two layers, each XX + YY exchange as one `XXPlusYYGate` (or the equivalent in the installed Qiskit, recorded). Choose n by the simulator first: the smallest n whose ideal transfer is above 0.99, and record the ideal transfer at that n (`results108_ideal.json`). One circuit, 4000 shots; also a floor circuit (prepare |1000>, measure, per group P(1000)) so the group readout error is known.

### 3.3 Analysis

Per group: the transfer marginal (P of reading 0010), the leakage out of the one-excitation subspace (P of reading a weight other than one), and the floor. Then joint_27, product_27, the independence gap, and the histogram, as in 2.3. The comparison line for B is the ideal Trotter transfer at the chosen n, not 1; say which it is.

## 4. Predictions to write before running (the runner's own; the author's are sealed elsewhere)

Variant A: (1) joint_27 to two decimals; (2) the independence gap, sign and size; (3) mean of the 27 transfer marginals; (4) the spread, max minus min, of the marginals; (5) the mean out-of-step P(01) + P(10). Variant B, if run: (6) mean group transfer; (7) joint_27.

## 5. Hand-back, in `mala-ibm/run-27/`

- `mala27_ibm.py`; `pairs.json`; `groups.json` if B ran; `predictions-27.md` with its SHA-256.
- `results27.json` (hardware), `results27_ideal.json`, and for B `results108.json`, `results108_ideal.json`: raw counts per circuit plus every number in 2.3 and 3.3.
- `histogram27.png`: k successes out of 27, measured against Poisson-binomial from the marginals. Same for B if run.
- `run-notes-27.md`: date and time, backend, job ids, versions, shots, transpiled depth and two-qubit count per circuit, wall time, any API call you changed, each prediction marked held or failed without editing, and the numbers below stated plainly.

The numbers to state plainly:

1. joint_27 for transfer, beside 0.604 and beside product_27.
2. The mean, min and max transfer marginal, with the pairs.
3. The independence gap with its standard error, and one sentence saying whether the 27 pairs failed independently within it.
4. The mean in-step and out-of-step numbers beside the floor.
5. For B: mean group transfer beside the ideal Trotter value; joint_27; mean leakage.

One sentence of interpretation, and only this kind: "On <backend>, all 27 squares flipped together in <x> of shots against <y> expected from independent failures; the 27 marginals ran from <min> to <max>." No claims beyond that. If B ran: "One excitation on four qubits transferred in <x> of shots per group against an ideal of <y>; all 27 at once in <z>."

## 6. Where it goes next

The author passes the folder to Mantri for reading and scoring. The website gets a patch later (a second hardware panel under section 8, and the 0.60 line as a prediction kept whether it held or not); do not touch the website repo from this session.

---

## 7. The author's predictions (sealed here; not in the runner copy)

Variant A:

- P1. joint_27 for transfer lands between 0.35 and 0.65. The point prediction from the one pair on record is 0.604; the other 26 pairs will be worse than the one Kickoff 03 got, so I expect below it, near 0.45.
- P2. The pairs fail independently to within measurement: the independence gap is within 0.03 of zero, inside two standard errors.
- P3. The mean transfer marginal is between 0.95 and 0.99.
- P4. The spread of the marginals, max minus min, is at least 0.03: the chip is not uniform and the histogram of k successes is wider than the best pair alone would suggest.
- P5. The out-of-step number sits at the floor: mean P(01) + P(10) below 0.03, and within 0.01 of the floor's mean error.

Variant B, if it runs:

- P6. Mean group transfer between 0.55 and 0.85, against an ideal Trotter value above 0.99: the fourth edge's routing on heavy-hex costs most of it.
- P7. joint_27 below 0.02. The wire does not flip all at once on today's hardware, and that number is the honest distance between the theorem and the machine.
