Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.28k stars 2.37k forks source link

Compiler: noise reduction for terminating quantum Fourier transforms #3129

Closed gillenhaalb closed 5 years ago

gillenhaalb commented 5 years ago

What is the expected behavior?

Just submitted a PR to Aqua for the "semiclassical" Fourier transform option, but as its use depends on the FT directly preceding measurement, it could be complimented by having this checked in the compilation pass. I.e. if a circuit has a standard QFT directly preceding a measurement, the compiler could automatically change that QFT into the semiclassical.

This reduces noise effects drastically by replacing quantum two-qubit control gates with a measurement and classical control. See the noise reduction demo here: SemiclassFTdemo.zip

1ucian0 commented 5 years ago

Not sure if Im fully following. Are you suggesting a transpiler pass?

gillenhaalb commented 5 years ago

Ah sorry, yes a transpiler pass. I will be generalizing the circuit in Aqua to inverse and approximate QFTs as well, and I figured adding a transpiler pass in Terra that returns an optimized circuit with the final QFT replaced by the reduced noise version may make sense. If so, should I simply follow the pattern and submit it in a PR with the rest of them in https://github.com/Qiskit/qiskit-terra/tree/master/qiskit/transpiler/passes?

ajavadia commented 5 years ago

I think this makes more sense in Aqua right now. It's not so easy for the compiler to automatically detect that a (sub-)circuit is a quantum fourier transform. Ultimately when we have better library support for these kinds of things it could be done. But for now I think it's easier for the circuit constructor to request this optimization. Also it's not clear that this optimization is always worth it. It depends on the latency and error of measurement+feed-forward. Current devices don't support feed-forward at all.

gillenhaalb commented 5 years ago

That makes a lot of sense, thanks for letting me know!