Strict netlist export¶
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>)[source]¶
Bases:
objectStrict netlist: text + per-atom counts + layout information.
- text¶
- counts¶
- registers¶
- resources¶
- workspace_qubits¶
- qram_queries¶
- qram_writes¶
- oracq.infrastructure.backends.strict.lower_strict(artifact)[source]¶
Further lower a Toffoli+U3+CZ netlist into a strict atom netlist.
U3lines are rewritten by the angle classification shared withestimate: angles that are integer multiples of π/4 emit exact Clifford+T atoms, while the rest stay asRZ/RYrotation atoms pending synthesis; every other line is kept verbatim, while atom counts, QRAM queries (ram_lines) and random writes (QRAMWRITElines) are accumulated line by line.- Parameters:
artifact – The netlist produced by
lower_toffoli_u3_cz.- Returns:
The strict netlist text, per-atom counts and original layout information.
- Return type:
- Raises:
ValidationError – A
U3line does not carry three angle parameters.
- oracq.infrastructure.backends.strict.export_strict(program)[source]¶
Compile to a module-preserving netlist at the Toffoli+Clifford+T(+rotations pending synthesis)+QRAM level.
- Parameters:
program – The closed RIR program to export.
- Returns:
The netlist text, together with Toffoli/CZ gate counts, QRAM query and write statistics, and the register and resource mappings.
- Return type: