Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ill-defined behavior of stack when using odd num_spin_orbitals #820

Closed
kevinsung opened this issue Sep 6, 2022 · 2 comments · Fixed by #880
Closed

Ill-defined behavior of stack when using odd num_spin_orbitals #820

kevinsung opened this issue Sep 6, 2022 · 2 comments · Fixed by #880
Assignees
Milestone

Comments

@kevinsung
Copy link
Contributor

What is the expected enhancement?

AngularMomentum is currently initialized by specifying the number of spin orbitals. This is confusing because it doesn't make sense to have an odd number of spin orbitals, and passing an odd number seems to give the same operator as the next lowest even number:

from qiskit_nature.second_q.properties import AngularMomentum

op1 = AngularMomentum(2).second_q_ops()['AngularMomentum']
op2 = AngularMomentum(3).second_q_ops()['AngularMomentum']
print(op1.equiv(op2))
True

I think it should take the number of spatial orbitals as input instead.

@mrossinek
Copy link
Member

This was a design flaw of the properties framework. This will be addressed as part of 0.5. It is blocked by:

Once all of the above is done, all of the existing classes in qiskit_nature.second_q.properties which build out a FermionicOp will be revisited and improved 👍

@mrossinek mrossinek self-assigned this Sep 7, 2022
@mrossinek mrossinek added this to the 0.5.0 milestone Sep 7, 2022
mrossinek added a commit to mrossinek/qiskit-nature that referenced this issue Oct 14, 2022
@mrossinek mrossinek changed the title AngularMomentum should take number of spatial orbitals as input (not spin) Ill-defined behavior of stack when using odd num_spin_orbitals Oct 14, 2022
@mrossinek
Copy link
Member

This issue is actually more general with respect to the usage of odd values for num_spin_orbitals against which no guards are in place. A proper solution would be to consistently switch over to num_spatial_orbitals, instead 👍

mrossinek added a commit to mrossinek/qiskit-nature that referenced this issue Oct 14, 2022
@mergify mergify bot closed this as completed in #880 Oct 14, 2022
@mergify mergify bot closed this as completed in 8795f7c Oct 14, 2022
Anthony-Gandon pushed a commit to Anthony-Gandon/qiskit-nature that referenced this issue May 25, 2023
* refactor: replace Property base class with Protocols

- removes the Property base class and its legacy HDF5 integration
- adds the new SparseLabelOpFactory Protocol in its place
- actually makes use of the Interpretable Protocol

* refactor: migrate Property attributes onto ElectronicStructureProblem

* refactor: update InitialPoint attribute naming

* refactor: switch to use num_spatial_orbitals everywhere

Closes qiskit-community#820

* Docs and other improvements

* refactor: align signatures of ansatzes and initial_states

* refactor: migrate ElectronicBasis to problems module

* Updates after code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants