qiskit-nature
qiskit-nature copied to clipboard
Support multiple spin lengths in SpinOp
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.
Thanks for the suggestion, @eggerdj! @ikkoham and I will take a look at this :+1:
Thank you. This enhancement is useful. It would be even more useful if we could also get the tensor product between FermionicOp and SpinOp.
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).
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 VibrationalOp
s 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:
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