As stated in title: Cannot use tensor_contract and TextbookQPE together. The issue is that when you try to raise a Bloq to a power Qualtran becomes inconsistent: it creates something that inherits from cirq.Gate then immediately passes that to BloqAsCirqGate, which asserts that the object is not a cirq.Gate.
I found this problem while using Qualtran 0.4.0 (I'm limited by another dependency that hasn't yet updated), but it appears to still be present in the most current release (0.7.0).
Claude Code diagnosed this problem for me, so I asked it to generate a minimal reproducer and a summary document, both of which I'm attaching. Both look right to me, but I want to explicitly call out the fact that they are LLM generated so that you can apply appropriate caution.
qualtran_bug_reproducer.py
QUALTRAN_BUG_REPORT.md
As stated in title: Cannot use
tensor_contractandTextbookQPEtogether. The issue is that when you try to raise a Bloq to a power Qualtran becomes inconsistent: it creates something that inherits fromcirq.Gatethen immediately passes that toBloqAsCirqGate, which asserts that the object is not acirq.Gate.I found this problem while using Qualtran 0.4.0 (I'm limited by another dependency that hasn't yet updated), but it appears to still be present in the most current release (0.7.0).
Claude Code diagnosed this problem for me, so I asked it to generate a minimal reproducer and a summary document, both of which I'm attaching. Both look right to me, but I want to explicitly call out the fact that they are LLM generated so that you can apply appropriate caution.
qualtran_bug_reproducer.py
QUALTRAN_BUG_REPORT.md