Open zpy2001 opened 3 months ago
UCC (and its variants) is currently hard-coding a check to ensure that no spin register is completely occupied: https://github.com/qiskit-community/qiskit-nature/blob/cbba76c516cbf372903a336b17fdeb2c31cd6d57/qiskit_nature/second_q/circuit/library/ansatzes/ucc.py#L394
I think that the code itself should be able to handle the case where the number of particles in a spin exactly fills that spin register but there are no unittests to ensure this. Lifting this limitation will enable this use case to run.
You can already use generalized=True
which will ignore the actual occupation that you start from to run the code. But your ansatz will be longer.
Environment
What is happening?
When I use QEOM, I set the
driver
asIt is right in pyscf:![2611712584314_ pic](https://github.com/qiskit-community/qiskit-nature/assets/71128917/38c7ff8f-b48d-4b57-8959-b0c205f7c979)
but meets bug in ansatz:![截屏2024-04-08 下午10 20 36](https://github.com/qiskit-community/qiskit-nature/assets/71128917/99ff4031-55fb-4cfc-918c-94305663a2f4)
How can we reproduce the issue?
In
docs/tutorials/04_excited_states_solvers.ipynb
, input thedriver
as data above.What should happen?
It throw out an error
ValueError: The number of spatial orbitals 2must be greater than number of particles of any spin kind (2, 1).
Any suggestions?
No response