Toffoli / U3 / CZ 降低¶
oracq.infrastructure.backends.basis
Lower the gate set within OriginIR DEF boundaries; module calls and QRAM declarations remain unexpanded.
- oracq.infrastructure.backends.basis.export_toffoli_u3_cz(program)[源代码]¶
Export an OriginIR-ext netlist over the Toffoli+U3+CZ gate set.
Equivalent to
lower_toffoli_u3_cz(export_originir(program)); module calls and QRAM declarations remain unexpanded.- 参数:
program -- The closed RIR program to compile.
- 返回:
The lowered netlist;
workspace_qubitsincludes the newly addedpb_workancilla bit indices.- 返回类型:
- oracq.infrastructure.backends.basis.lower_toffoli_u3_cz(artifact)[源代码]¶
Lower the gates of an OriginIR-ext netlist to Toffoli, U3 and CZ.
Multi-controlled X-type gates (CNOT included, SWAP expanded into three swaps) are implemented with a Toffoli ladder per the
mcxrecipe, and controlled single-qubit gates per thecontrolled_u3recipe; both share thepb_workancilla pool allocated by the maximum control count; pool bits are appended toQINIT,DEFformals andm_call lines.DAGGER, QRAM andCREGlines are kept verbatim.- 参数:
artifact -- The OriginIR-ext netlist produced by
export_originir.- 返回:
The lowered netlist;
workspace_qubitsappends the newly added ancilla bit indices, whileregistersandresourcespass through unchanged.- 返回类型:
- 抛出:
ValidationError -- A target gate unsupported by the parameter table was encountered.