Quantum Computing Asked by Soulfulnerds on December 28, 2020
Is there a quantum circuit (preferably on Quirk as an example) that will enable me to find the maximum from two inputs?
Example
Expected output: 11100
The easiest way is with a temporary comparison to decide which input to copy over:
If you want it to run without the extra output register, you can instead CSWAP the inputs based on the comparison bit, sorting them. You can't uncompute the comparison bit until you unsort them though.
Answered by Craig Gidney on December 28, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP