qiskit-community / qiskit-nature

Qiskit Nature is an open-source, quantum computing, framework for solving quantum mechanical natural science problems.
https://qiskit-community.github.io/qiskit-nature/
Apache License 2.0
299 stars 201 forks source link

Support multiple spin lengths in SpinOp #515

Open eggerdj opened 2 years ago

eggerdj commented 2 years ago

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.

mrossinek commented 2 years ago

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

ikkoham commented 2 years ago

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

fretchen commented 2 years ago

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).

mrossinek commented 1 year ago

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 commented 1 year ago

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