qlinks architecture diagnosis
b9e2e3751a60Package dependency overview
Arrows point from a package to the package it imports. Vertical placement follows dependency depth, so lower nodes tend to be architectural foundations. Edge thickness represents the number of resolved internal import references.
Click a package to highlight its immediate dependencies and dependents. Click empty graph space to reset.
Module explorer
Use this view for targeted diagnosis inside one top-level package. This keeps the report readable even when the repository has hundreds of modules.
Package metrics
| Package | Files | Lines | Fan-in | Fan-out | Imports in | Imports out |
|---|---|---|---|---|---|---|
| qlinks.caging | 58 | 39555 | 4 | 8 | 5 | 25 |
| qlinks.open_system | 30 | 24099 | 0 | 5 | 0 | 34 |
| qlinks.visualizer | 18 | 11002 | 0 | 3 | 0 | 15 |
| qlinks.models | 10 | 5106 | 3 | 9 | 12 | 37 |
| qlinks.qec | 10 | 4690 | 0 | 6 | 0 | 15 |
| qlinks.constraints | 11 | 3479 | 3 | 2 | 13 | 15 |
| qlinks.operators | 11 | 3053 | 4 | 3 | 14 | 16 |
| qlinks.basis | 9 | 2030 | 7 | 2 | 20 | 9 |
| qlinks.lattice | 8 | 1985 | 7 | 0 | 32 | 0 |
| qlinks.encoded | 5 | 1690 | 4 | 5 | 11 | 8 |
| qlinks.io | 3 | 829 | 0 | 1 | 0 | 1 |
| qlinks.builders | 4 | 718 | 2 | 3 | 2 | 6 |
| qlinks.variables | 5 | 654 | 8 | 0 | 43 | 0 |
| qlinks.local_structure | 4 | 551 | 2 | 0 | 25 | 0 |
| qlinks.distributed | 1 | 274 | 0 | 0 | 0 | 0 |
| qlinks.backends | 2 | 224 | 3 | 0 | 4 | 0 |
| qlinks.conventions | 2 | 105 | 1 | 1 | 1 | 1 |
| qlinks | 1 | 28 | 0 | 0 | 0 | 0 |
| qlinks.exceptions | 1 | 17 | 0 | 0 | 0 | 0 |
Coupling hotspots
Highest fan-out
| Module | Fan-out | Import refs | Lines |
|---|---|---|---|
| qlinks.caging | 18 | 18 | 395 |
| qlinks.open_system.constructions.deprecated.cage | 16 | 16 | 4361 |
| qlinks.open_system.constructions.cage_lindblad | 15 | 15 | 3327 |
| qlinks.open_system | 13 | 13 | 315 |
| qlinks.caging.local_search | 10 | 10 | 189 |
| qlinks.constraints | 10 | 10 | 97 |
| qlinks.models.qlm | 10 | 10 | 1200 |
| qlinks.operators | 10 | 10 | 117 |
| qlinks.caging.analysis.environment.diagnosis | 9 | 9 | 342 |
| qlinks.caging.local_search.qdm | 9 | 9 | 584 |
| qlinks.models | 9 | 9 | 118 |
| qlinks.qec.profile | 8 | 14 | 733 |
| qlinks.qec.sector_matching | 8 | 11 | 710 |
| qlinks.caging.local_search.certification | 8 | 8 | 1124 |
| qlinks.caging.stability.qdm | 8 | 8 | 1690 |
Highest fan-in
| Module | Fan-in | Import refs | Lines |
|---|---|---|---|
| qlinks.variables | 43 | 43 | 23 |
| qlinks.lattice | 32 | 32 | 37 |
| qlinks.basis | 20 | 20 | 49 |
| qlinks.caging.local_search.types | 14 | 14 | 1749 |
| qlinks.constraints | 12 | 12 | 97 |
| qlinks.caging.nullspace | 11 | 11 | 86 |
| qlinks.operators | 11 | 11 | 117 |
| qlinks.constraints.base | 10 | 10 | 267 |
| qlinks.models.base | 10 | 10 | 970 |
| qlinks.open_system.backend | 10 | 10 | 174 |
| qlinks.caging.analysis.environment.contracts | 9 | 9 | 357 |
| qlinks.caging.candidate | 9 | 9 | 37 |
| qlinks.models.local_terms | 9 | 9 | 68 |
| qlinks.operators.base | 9 | 9 | 257 |
| qlinks.visualizer.basis.styles | 9 | 9 | 155 |
Cycle diagnostics
Import-time SCCs use only eager module-scope imports and are split into API/re-export cycles (package initializers or known compatibility facades) versus implementation cycles. The secondary “type/lazy static” entries appear only when TYPE_CHECKING and function-local imports are included, so intentional typing or cycle-breaking imports are not mistaken for eager import cycles. Package-level import-time cycles are reported separately in the summary.
| Kind | Modules | Strongly connected component | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| None detected. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Architecture guardrails
The report mirrors the broad dependency rules in AGENTS.md: caging/open-system separation, neutral local structure, temporary-facade isolation, and the focused local-search ordering. The dedicated pytest architecture tests remain the blocking source of truth for CI.
| Rule | Source | Target | Location | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| None detected. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||