fevangelista / wicked

A Wick theorem kernel written in C++ and interfaced with Python
MIT License
37 stars 10 forks source link

Support for mixed fermion/boson and odd number of `sqops` #6

Open obackhouse opened 2 years ago

obackhouse commented 2 years ago

I'd like to use this as a drop-in for wick and just wanted to check a couple of things. Your paper states that

Similarly, it would be desirable to expand WICK&D to mixed fermionic/bosonic fields to enable the derivation of many-body equations for strongly interacting electron–phonon and electron–photon systems.

is this already supported? It seems that I can define bosonic spaces, but for my use case I get:

RuntimeError:

  WickTheorem::canonicalize_contraction cannot yet handle operators with an even number of sqops.

which I assume is supposed to say "odd number"? This would also presumably prevent me from generating EOM expressions?

fevangelista commented 2 years ago

@obackhouse: Currently there is no working support for bosonic spaces. I started writing some of the infrastructure (as you might see in the code), but then removed part of it. Thanks for catching the typo, it should be "odd number" (I am about to push an update). I need to double check what is going on here with the odd number of operators. The reason this error was added is because I wasn't sure I handled the sign correctly for the odd number case. This might not be an issue anymore, but I want to run/add tests before removing the error message.

fevangelista commented 2 years ago

I checked and in the current code the sign associated with the rearrangement of the operators during canonicalization is never computed (which means that currently it can only handle operators with an even number of second quantized operators). I'll put this on my todo list.

obackhouse commented 2 years ago

Great - thanks for your response

fevangelista commented 1 year ago

@obackhouse: I just pushed changes to the code that should enable odd number of sqops. This is not tested extensively yet, so if you are interested in playing with this feature I would be happy to hear about your experience.

obackhouse commented 1 year ago

Great - I will check this out in the week.