pdft.circuit.sorted_gate_program

pdft.circuit.sorted_gate_program#

pdft.circuit.sorted_gate_program(gates)[source]#

Return (kind, qubits) per tensor in sorted operand order.

Uses the same Hadamard-first sort compile_circuit applies, so the returned order lines up element-for-element with the tensor list a basis stores. Handy for mapping gates (and the qubits they touch) to tensor indices after compilation.

Parameters:

gates (list[Gate])

Return type:

list[tuple[str, tuple[int, …]]]