Open cgranade opened 5 years ago
After discussing with @anpaz-msft, I think there's two distinct steps that would be needed here:
With the addition of support for target packages, we now have an internal ApplyUncontrolledSWAP
intrinsic (see https://github.com/microsoft/qsharp-runtime/blob/main/src/Simulation/TargetDefinitions/Intrinsic/ApplyUncontrolledSWAP.qs). That might be a good place to plug into the simulator SWAP and then use the decomposition over the uncontrolled SWAP.
Please describe what you would like the feature to accomplish. Currently, the Microsoft.Quantum.Intrinsic.SWAP operation is provided along with a pure-Q# implementation in terms of three
CNOT
calls:The C++ runtime for the
QuantumSimulator
target machine supports, however, an accelerated kernel for applying SWAP gates. It would help with simulator performance to expose this as an implementation of theSWAP
intrinsic operation, similarly to howX
is exposed byQuantumSimulator
.