Package Dependency Rules
Layers (lower -> higher)
exceptions, utils, logging — no internal dependencies
config, io, security — depend only on layer 1
foundation — depends only on exceptions
core — depends on foundation, exceptions
math — depends on foundation, exceptions
runtime, compiler, providers — depend on core, foundation, exceptions
optimization — depends on math, foundation, exceptions
simulation — depends on foundation, core, math
- Domain packages:
quantum (+runtime/compiler/providers), physics,
chemistry (-> physics), biology (-> chemistry), astronomy (->
physics), cosmology (-> astronomy, physics), ai, finance (->
math, optimization, ai)
visualization, datasets, plugins, telemetry — depend on
lower layers only, never on domain packages
Hard rules
- No circular imports between packages, ever.
- Domain packages never import each other except via the explicit
arrows above (e.g.
chemistry -> physics is allowed; physics ->
chemistry is not).
- Only
providers may reference vendor-specific SDKs, and only behind
optional extras in pyproject.toml.