严格网表导出

oracq.infrastructure.backends.strict

Toffoli+Clifford+T+QRAM strict netlist export.

Runs one more U3 classification pass over the output of basis.lower_toffoli_u3_cz: rotations whose angles are integer multiples of π/4 fall into exact Clifford+T atoms (H/S/SDG/T/TDG/Z/X/Y), while the rest stay as RZ/RY rotation atoms pending synthesis; module calls, Repeat symbolic structures and QRAM lines remain unexpanded. Atom set: TOFFOLI, CZ, H, S, SDG, T, TDG, X, Y, Z, RZ, RY, QRAM. Angle classification shares the same implementation with the estimate module, keeping netlist counts and resource estimation consistent item by item (the tests cross-check them line by line).

class oracq.infrastructure.backends.strict.StrictArtifact(text, counts, registers, resources, workspace_qubits, qram_queries, qram_writes=<factory>)[源代码]

基类:object

Strict netlist: text + per-atom counts + layout information.

text
counts
registers
resources
workspace_qubits
qram_queries
qram_writes
oracq.infrastructure.backends.strict.lower_strict(artifact)[源代码]

Further lower a Toffoli+U3+CZ netlist into a strict atom netlist.

U3 lines are rewritten by the angle classification shared with estimate: angles that are integer multiples of π/4 emit exact Clifford+T atoms, while the rest stay as RZ/RY rotation atoms pending synthesis; every other line is kept verbatim, while atom counts, QRAM queries (ram_ lines) and random writes (QRAMWRITE lines) are accumulated line by line.

参数:

artifact -- The netlist produced by lower_toffoli_u3_cz.

返回:

The strict netlist text, per-atom counts and original layout information.

返回类型:

StrictArtifact

抛出:

ValidationError -- A U3 line does not carry three angle parameters.

oracq.infrastructure.backends.strict.export_strict(program)[源代码]

Compile to a module-preserving netlist at the Toffoli+Clifford+T(+rotations pending synthesis)+QRAM level.

参数:

program -- The closed RIR program to export.

返回:

The netlist text, together with Toffoli/CZ gate counts, QRAM query and write statistics, and the register and resource mappings.

返回类型:

StrictArtifact