Skip to content

Cannot use tensor_contract and TextbookQPE together #1861

@BrendanKKrueger

Description

@BrendanKKrueger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions