QCLang Design Rules and Constraints =================================== **Design Rules** QCLang enforces design rules automatically. All constraints are defined in ```` rules.json ```` and loaded at parser startup. Violations produce error JSON rather than partial outputs. Qubit count limits ------------------ **Min: 1 qubit.** **Max: 5 qubits.** Prompts requesting 0 or more than 5 qubits return a Pydantic validation error. This reflects Qiskit Metal layout constraints in the current implementation. Geometry rules -------------- **Min qubit spacing: 1000 μm (1 mm)** between qubit centers. Edge margin: 200 μm from chip boundary. All positions are calculated automatically — the parser enforces spacing, not the user. Frequency rules --------------- Qubit frequency must be between **1.0 and 10.0 GHz** . Resonator frequency must be between **1.0 and 12.0 GHz** . Min frequency detuning between adjacent qubits: **100 MHz** (alternating 5.0 / 5.2 GHz pattern). Anharmonicity rules ------------------- Anharmonicity must be **negative (≤ 0 MHz)** . Default starts at −330 MHz for Q0 and increases by +5 MHz per qubit (Q1: −325 MHz, Q2: −320 MHz…). Positive anharmonicity will fail Pydantic validation. Full constraints from rules.json .. code-block:: none "constraints": { "max_qubits": 5, "min_qubits": 1, "min_qubit_spacing_um": 1000, "edge_margin_um": 200, "min_frequency_detuning_mhz": 100 }