qat.plugins.Remap

class qat.plugins.Remap(keep_topology=False)

Remaps the used qubits of each circuit onto an initial segment of the integers (i.e. [0..N-1] for some N). Unused qubits are removed from the circuit (compiling a circuit could insert unused additional qubits - to match the QPU topology - this plugin can be used to improve the emulation of a compiled circuit)

Note

Classical bits are not remapped in any way!

This plugin will also post-process the result. In sample mode, measured unused qubits are set to zero (each sample is fixed to consider unused measured qubits)

Warning

If the result returned by the QPU contains a statevector, the post-processing step will remove the statevector attribute (each sample composing the result should be fixed)

Parameters

keep_topology (boolean, optional) – keep the topology. If this argument is set to True, a gate applied between qubits q1 and q2 will still be applied between those two qubits, otherwise, this gate can be applied on another pair of qubits. Default: False

compile(batch, specs)

Compile the batch

Parameters