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
165 stars 40 forks source link

`bloq_is_clifford` treats `MultiTargetCNOT` as a single clifford gate #1318

Open anurudhp opened 3 weeks ago

anurudhp commented 3 weeks ago

https://github.com/quantumlib/Qualtran/blob/683472a25a1bafb64fd5e5c58f79405737a4afd4/qualtran/resource_counting/classify_bloqs.py#L140

Is this the expected behaviour due to some possibly optimized implementation?

@tanujkhattar @mpharrigan

mpharrigan commented 3 weeks ago

instead of $n$ cliffords?

The notion of clifford counting is pretty poorly defined. In the surface code, you can do a multi-target cnot in 1 step (d cycles) -- the same speed as any other single clifford gate

anurudhp commented 3 weeks ago

Ah! I think we should document this in the code clearly.

mpharrigan commented 2 weeks ago

The old t complexity code counts all the constituent CNOTs. Since it has a decomposition (isn't an atomic/leaf bloq) maybe we should keep counting them. However: there's no support for symbolic bitsize, which causes tests to fail. This bloq could probably do with a re-write to make it more readable and including a build_call_graph