qiskit-nature icon indicating copy to clipboard operation
qiskit-nature copied to clipboard

Support multiple spin lengths in SpinOp

Open eggerdj opened this issue 3 years ago • 5 comments

What is the expected enhancement?

Currently SpinOp has an intrinsic limitation where all spins have the same dimension. For example, SpinOp("ZZ", spin=5/2) represents a ZZ coupling between two spins with spin 5/2. However, it does not seem possible to have spins of different lengths in the same spin op. This could be represented if SpinOp were extended to also accept a list of spin values. For example, SpinOp("ZZ", spin=[5/2, 1/2]) would represent a ZZ coupling between a spin of length 5/2 and 1/2.

eggerdj avatar Sep 30 '21 12:09 eggerdj

Thanks for the suggestion, @eggerdj! @ikkoham and I will take a look at this :+1:

mrossinek avatar Oct 06 '21 13:10 mrossinek

Thank you. This enhancement is useful. It would be even more useful if we could also get the tensor product between FermionicOp and SpinOp.

ikkoham avatar Oct 12 '21 02:10 ikkoham

Indeed, the proposition by @ikkoham would certainly simplify life for people working on lattice gauge theories and things like the Kondo problem (me for example).

fretchen avatar Nov 30 '21 07:11 fretchen

The implications of supporting this feature request not only extend to the SpinOp but also to the LinearMapper and LogarithmicMapper which would need to understand the various spins being expanded to differing numbers of qubits. (One would assume that the DirectMapper for VibrationalOps shows how this is done, but this is actually not the case, because the VibrationalOp already includes the expanded modals of each mode so the DirectMapper just maps each modal to one qubit.)

All that is to say, that this feature is slightly more complex than originally anticipated, but I am adding it to the 0.6 milestone :+1:

mrossinek avatar Nov 14 '22 15:11 mrossinek

It would be even more useful if we could also get the tensor product between FermionicOp and SpinOp.

This will be dealt with via the #795

mrossinek avatar Nov 14 '22 15:11 mrossinek