Inside italic/bold code segments every bare word is a variable — including call arguments and method-call receivers — so text literals must be quoted and receivers no longer need backticks. A bare dotted callee `a.b` resolves as a method call when `a` is a local variable, otherwise as a library path (Python-style unified namespace), in both the tree-walk and bytecode backends. Migrate ~70 tests plus ext/web, ext/quantum, ext/ai and the example projects to the new idiom; update SKILL.md and the design docs; fix the web/quantum example data model (db/index.mq.md). Unit and gold suites pass; only the 3 network-live tests fail offline. Co-authored-by: Cursor <cursoragent@cursor.com>
770 B
770 B
title: quantum author API zh smoke description: 屏障 / 测量 / 追加 / 态 / 绘图. 导入 量子:ext/quantum/量子.mq.md
main
qc = > 量子.电路 比特数=2
qc = > qc.哈达玛 比特=0
qc = > qc.屏障
qc = > qc.控非 控制=0 目标=1
qc = > qc.测量
st = > qc.态
dim = st[^dim]
dim== 4
print text=state-ok
print text=state-fail
img = > qc.绘图 路径="quantum-author-zh-draw.svg"
kind = img[^kind]
kind== circuit
print text=draw-ok
print text=draw-fail
other = > 量子.电路 比特数=2
other = > other.泡利X 比特=1
qc2 = > qc.追加 操作=other
ops = qc2[^ops]
n = > len ops
n== 5
print text=append-ok
print text=append-fail