pdft.circuit.compile_circuit#
- pdft.circuit.compile_circuit(gates, m, n, *, inverse)[source]#
Build a JIT-compiled stepped circuit closure.
Returns
(code, tensors)wherecode(*tensors, pic_reshaped)applies the gates one at a time viajnp.tensordot(), recycling contraction labels across steps so the 52-character a-zA-Z label pool of the legacy single-einsum path is never reached. Each step consumes at most ~22 wire labels regardless of circuit size.The returned
tensorslist preserves the Hadamard-first sort applied by the legacy builder, so saved trained checkpoints (which serialize tensors in this order) continue to load consistently.