Skip to content

Bug in group_by_operators #12

@akhmerov

Description

@akhmerov

Hello sympt team!

While implementing second quantization in pymablock, @iarayad and I believe that we saw a bug in your implementation of group_by_operators, which influences the example https://qcode-uni-a.github.io/sympt/examples/I1_Transmon_resonator/ or any other Hamiltonian where $H_0$ isn't linear in boson number. In those cases, perturbation theory generates terms like $a^\dagger (a^\dagger a + x)^{-1} a$. group_by_operators will process this term as $a^\dagger a: (a^\dagger a + x)^{-1}$, which is incorrect because the energy denominator does not commute with $a$. Because group_by_operators is used in all examples as a way to examine the results, it seems like a serious issue.

To be able to manipulate expressions with energy denominators, where normal ordering does not work, and also to be able to use sympy simplification routines with operator expressions, we developed a number ordering scheme. Please find its implementation over here:

https://github.com/quantum-tinkerer/pymablock/blob/745a68291e5ae5c1c6c4a1bbfad73c70cf26a20c/pymablock/second_quantization.py#L64-L327

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions