same_spin_doubles works incorrectly in UCCSD
See original GitHub issueInformation
- Qiskit Aqua version: qiskit-master
- Python version: 3.8
- Operating system: Ubuntu
What is the current behavior?
same_spin_doubles = True
in UCCSD variational form does not work correctly, when only beta same spin double excitations are required.
Steps to reproduce the problem
I faced this problem with triplet O2 molecule. For alpha orbitals there is only one unoccupied spin-orbital, while for beta there are three. I’m expecting to have same spin double excitations only for beta orbitals. However, there are no such excitations when same_spin_doubles = True
.
What is the expected behavior?
Suggested solutions
Change condition here. When this condition is False due to alpha orbitals, beta сondition is omitted. My solution is:
if same_spin_doubles:
if len(active_occ_list_alpha) > 1 and len(active_unocc_list_alpha) > 1:
for i, occ_alpha in enumerate(active_occ_list_alpha[:-1]):
for j, unocc_alpha in enumerate(active_unocc_list_alpha[:-1]):
for occ_alpha_1 in active_occ_list_alpha[i + 1:]:
for unocc_alpha_1 in active_unocc_list_alpha[j + 1:]:
double_excitations.append([occ_alpha, unocc_alpha,
occ_alpha_1, unocc_alpha_1])
up_active_occ_list = active_occ_list_beta
up_active_unocc_list = active_unocc_list_beta
if len(active_occ_list_beta) > 1 and len(active_unocc_list_beta) > 1:
for i, occ_beta in enumerate(up_active_occ_list[:-1]):
for j, unocc_beta in enumerate(up_active_unocc_list[:-1]):
for occ_beta_1 in up_active_occ_list[i + 1:]:
for unocc_beta_1 in up_active_unocc_list[j + 1:]:
double_excitations.append([occ_beta, unocc_beta,
occ_beta_1, unocc_beta_1])
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mrossinek Now it looks fine. I think the issue is solved. Thank you!
Alright I just pushed a fix and the only new excitations are now the following: