01 / WHAT THE PROGRAM KNOWS
First it reads the problem and the chip.
create_dicke_state(N, n, ...) is the main function the challenge runner calls. N is how many qubits should join the state; n is how many 1s each valid answer should contain. Four dictionaries describe the current hardware.
How risky each available two-qubit connection is. Missing connections are unusable.
How risky individual rotations are, and which qubits are available.
Separate chances of misreading a 0 and a 1. These matter because qubits are measured at the end.
The dictionaries also give uncertainty. The code uses a cautious value, usually the measured rate plus one reported uncertainty, when comparing placements. It builds a graph containing only qubits and connections that have the needed calibration entries.
02 / WORKED EXAMPLE
What happens for ten qubits and five 1s?
The target D¹⁰₅ means every 10-bit answer with exactly five 1s should appear with equal amplitude. There are C(10,5) = 252 such answers. The code does not write all 252 answers by hand; its gates generate the superposition.
Read the target
N = 10, n = 5, so k = min(5, 5) = 5. No final all-qubit flip is needed.
Pick the portfolio branch
k is at least 3 and N is at least 9. The program therefore asks a builder to make several connected candidates. One useful shape splits the work across two arms.
Choose physical qubits
Candidate circuits are placed on working qubits and couplers. A rough error estimate considers gate failures, readout failures, and time spent waiting.
Clean up the gates
Several single-qubit rotations in a row become one equivalent rotation. The resulting circuit is expressed using Willow-compatible CZ and PhasedXZ gates.
Echo long pauses and return
If a qubit would wait through a long idle window, the code may insert an X–Y–X–Y echo. It returns the circuit and the actual physical qubits where the state now lives.
If the first builder cannot produce a circuit under the supplied calibration, the code tries its core path-based constructions. The attached folder reports 85 CZ gates for one chosen D¹⁰₅ circuit, compared with 185 for an earlier local circuit; that is a circuit count, not a measured fidelity gain.
03 / THE CHOICE RULE
A simple decision tree controls many methods.
Set k = min(n, N−n). This lets the program prepare the state with fewer 1s when the target has more than half of its qubits excited. Then it flips every qubit at the end.
if k == 0:
choose good readout qubits; make all 0s or all 1s
elif k == 1:
spread one excitation through a branching tree
elif k == 2 and N >= 6, or k >= 3 and N >= 9:
try the calibrated circuit portfolio
if it fails, use the core builder
else:
use a small exact template when one fits
otherwise build along a connected path
merge redundant one-qubit gates
echo sufficiently long idle windows
return the circuit and its physical qubitsThe interactive selector on the home page shows this first-choice rule. It does not execute Cirq in the browser. The actual Python code handles calibration, exceptions, and fallbacks.
04 / WHY THESE ALGORITHMS
Each recipe saves a different resource.
Branching W tree → save time
For one excitation, a chain passes amplitude to one new qubit at a time. A tree lets several active branches split in parallel. The code grows candidate trees from low-cost roots and compares them.
Offline exact synthesis → save gates
For small states, a classical optimizer (L-BFGS) adjusted rotation angles until a short CZ-and-rotation pattern produced the exact target. It then tried to remove unnecessary CZs. The search happens before submission; the saved angles are not recomputed on Willow. Some patterns have several exact angle sets, so the team also compared how sensitive they were to small rotation errors.
Two-arm and path portfolio → handle bigger states
The portfolio generates paths and two-arm splits on connected regions, then rates their estimated errors. A two-arm design can do parts of the work at the same time; a single path may fit better on a particular calibration.
Beam search → find a usable path
A full search of every path would grow too large. Beam search extends promising partial paths one neighbor at a time, keeping only a limited number after each step. Its cost uses qubit and connection errors.
Small path blocks → avoid extra routing
The Bärtschi–Eidenbenz construction builds the state through repeated “split and cyclic shift” steps. The team replaced some of those steps with precomputed exact blocks that already act on neighboring qubits. A general version plus routing remains as a fallback.
The website's route game runs classical Dijkstra on one source-to-target path. The submission solves a broader placement and circuit-generation problem with tree growth, beam search, candidate comparison, and routing when needed. The game illustrates one tradeoff; it is not the production algorithm. The offline angle search resembles the classical optimization part of VQE, but no hardware VQE loop runs during grading. No trained AI router chooses the displayed paths.
05 / FROM IDEA TO CHIP GATES
Make the circuit legal, then remove waste.
A logical circuit may contain convenient high-level gates. The code compiles them into CZ operations between working neighbors and PhasedXZ rotations on single working qubits. It can combine several rotations between two CZ interactions into one equivalent rotation. This changes the instructions without changing the ideal state.
Waiting can let a qubit's phase drift. The program places four echo pulses, X–Y–X–Y, only in idle stretches with at least four free single-qubit slots. The sequence cancels ideally up to a global phase. On real hardware, the extra pulses may also fail; the attached folder's simulations say the tradeoff depends on the noise assumptions.
The program's sparse threshold is a design decision, not a guarantee that echo pulses improve every hardware run.
06 / THE BONUS ENTRY POINT
Build many exact options; keep the shortest in time.
create_dicke_state_adaptive(N, n) is the bonus function. Despite its name, the chosen implementation uses ordinary circuits with no mid-circuit measurement. It gathers candidates from the small-state builder, a separate connected construction, branching W trees, two-arm split variants, and precomputed short end blocks.
candidates = build several exact, connected circuits
for each candidate:
count moments (layers of simultaneous gates)
return the candidate with the fewest momentsThe attached folder's checked table has 56 eligible pairs, 2 ≤ N ≤ 15. Its local score_solution() sum is 44.47. This sum is useful for comparing versions; the organizer's stated official bonus rule awards a point to the shallowest submission for each pair.
07 / WHAT THE TESTS PROVE
Exact, valid, and promising are separate claims.
Correct state
Ideal simulation checks the output amplitudes against the Dicke target. It allows a global phase, which cannot affect measurements.
Legal circuit
Tests check physical connectivity, allowed gates, depth, and runtime. Missing hardware can still make some large requests impossible.
Estimated performance
Fake calibrations and noise models compare recipes. Assumed waiting times and unmodeled errors mean this is not a hardware prediction.
The folder reports 419 automated tests and a 969-build robustness sweep. It also records per-case bonus depths in experiments/results/notebook_bonus.csv. The organizer's preliminary three-case hardware email tested an earlier notebook, not this attached submission.ipynb.
08 / FIND YOUR WAY THROUGH THE FILES
Where to look next.
submission.ipynb— the notebook the attached folder names as its challenge entry.main.py— source for the notebook's circuit functions; start atcreate_dicke_stateandbuild.ARCHITECTURE.md— detailed algorithms, assumptions, and measured local comparisons.experiments/synth.py— offline search for short exact small-state circuits.experiments/bonus_depth.py— checks and records bonus moments.experiments/noise.py— local noise model, with its assumptions.tests/— ideal-state, device-rule, and robustness checks.