How to define composite Hamiltonian in composite Hilbert space #1598
-
I want to define an Hamiltonian of the type Let's say the spaces are 2 Fock spaces. Then
and I now define the 2 Hamiltonians
To my understanding in order to create the Hamiltonian I need to define the 2 identity matrices, which, in a tricky way, can be defined
and then
Here I get the error Thank you for any help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Two things
Ok, the error is because our operators must be defined over the total Hilbert space. You cannot compose operators on different subspaces (we technically don't have the kronecker product between operators) but only allow multiplication/addition between operators on the same space. So to properly implement your example you need to define your hamiltonian with for i in range(0,n_modes_A):
ham_A += Delta*adag(H,i) * a(H,i)
for r in range(n_modes_A,n_modes_A+n_modes_B):
ham_B += epsilon*r* adag(H,r) * c(H,r)
ham = ham_A + ham_B |
Beta Was this translation helpful? Give feedback.
So you are getting an imperscrutable error message, which I'm fixing. After the fix you'll see this error
which is telling you exactly that: you can't as of now mix and match operators of two different kinds.
In short, it means you cannot combine fermions with bosons because we have not implemented the logic for it... yet.
It's possible to implement it with some care but requires getting your hands dirty