You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the introduction of InterleavedQubitMapper (#1046) the FermiHubbardModel class doesn't behave consistently with this feature, producing an interleaved-encoded hamiltonian when used together with JordanWignerMapper, and a block-encoded hamiltonian when used together with InterleavedQubitMapper.
In qiskit_nature/second_q/hamiltonians/fermi_hubbard_model.py, change the "index" variables everywhere from index = 2 * node + spin to index = node + spin * num_nodes. I am happy to open a PR with this change!
The text was updated successfully, but these errors were encountered:
I think unifying the behavior of the FermiHubbardModel with the block-ordering of the ElectronicEnergy class is a good idea! Please go ahead and open a PR as you had suggested 🙂
ialsina
added a commit
to ialsina/qiskit-nature
that referenced
this issue
Sep 5, 2023
Environment
What is happening?
Since the introduction of
InterleavedQubitMapper
(#1046) theFermiHubbardModel
class doesn't behave consistently with this feature, producing an interleaved-encoded hamiltonian when used together withJordanWignerMapper
, and a block-encoded hamiltonian when used together withInterleavedQubitMapper
.How can we reproduce the issue?
What should happen?
For consistency with the other uses of
JordanWignerMapper
andInterleavedQubitMapper
, the outcomes of the prints should be:Any suggestions?
In
qiskit_nature/second_q/hamiltonians/fermi_hubbard_model.py
, change the "index" variables everywhere fromindex = 2 * node + spin
toindex = node + spin * num_nodes
. I am happy to open a PR with this change!The text was updated successfully, but these errors were encountered: