quantumlib / Qualtran

Qᴜᴀʟᴛʀᴀɴ is a Python library for expressing and analyzing Fault Tolerant Quantum algorithms.
https://qualtran.readthedocs.io/en/latest/
Apache License 2.0
164 stars 40 forks source link

`MultiAnd` call graph returns x gates #1253

Open mpharrigan opened 1 month ago

mpharrigan commented 1 month ago

In #1015 the callees of MultiAnd with not-all-ones control variables was changed. It used to propagate the cvs to the two bit And gates. Now it uses all And(cv1=1, cv2=1) gates and XGates. Was there a reason for this change? I would think philosophically that it can always be considered to use n And gates and those and gates might be hiding some cliffords; but really it would be architecture-dependent how the negative controls would be implemented in e.g. a surface code

cc @tanujkhattar

mpharrigan commented 1 month ago

The knock-on effect is this messes up the narrative of the call graph notebook / documentation which used MultiAnd as motivation for generalizer, so if we keep it as-is; that will need to be re-written