qat.plugins.RepairPermutation

The RepairPermutation is designed to be used after the Localizer plugin. This plugin resets the qubits to their initial permutation at the end of the output circuit that has passed through the Localizer. This is necessary for the new DNoisy emulator since it put the state probabilities to be sampled back on the diagonal of the density matrix. It is applied by default by DNoisy after the Localizer plugin.

class qat.plugins.RepairPermutation(*args, **kwargs)

Swap insertion plugin that adds in SWAP gates at the end of the circuit to reset the qubits to their initial position It uses the meta data added by the Localizer to get the permutations. This additional step is required for noisy simulation to reset the qubits permutation and put the state probabilities back on the diagonal of the density matrix.

compile(batch, specs)

Compiles the batch to add in SWAP gates, returning the qubits to their initial positions according to the qubit permutations passed in the batch’s meta data.

Parameters: