Module visibility
Design document · English reading edition
RFCs record designs and changes. A proposal appearing here does not mean its feature is ready to use. Explore current language support
Status recorded in the original: Tooling experimental
Bound original source · SHA-2567b04c505f91a0d970545ec6820bcd4c3c638da58014515706ae26ef1d2a82cea
Reading edition reviewed: 2026-10-02
Purpose and scope
Makes the circuits, observables and constants exported by a module explicit. Changing an implementation helper should not accidentally change the public contract seen by consumers.
Core design rules
publicandprivateapply only to top-levelcircuit,observableandconstdeclarations.- Workspace resolution, package resolution and the language server must carry the same visibility meaning.
- Legacy source without a visibility modifier retains behavior according to the compatibility rules in the transition contract.
Example from the original
This example illustrates the design recorded in the original. It is not by itself a claim of executable or stable support; check required options and the current version.
module bell_library;
private const HALF = PI / 2;
private circuit prepare_phase(data: QReg<2>) {
Ry(data[0], HALF);
}
public circuit prepare_bell(data: QReg<2>) {
H(data[0]);
CNOT(data[0], data[1]);
}
public observable parity = Z(data[0]) Z(data[1]);Limits and interpretation
fn main,param, executable statements and nested declarations are outside this visibility slice.- Visibility checking alone does not establish that a package is published or trusted.
Status and implementation boundary
The source records an experimental tooling slice. Check the current capability record and tool options before assuming that the installed version accepts visibility declarations.
| Review topic | Information to check |
|---|---|
| Source revision | SHA-256 digest bound to this reading edition |
| Availability | Current capability record and tool options |
| Evidence boundary | Model, size and interpretation limits above |