Skip to content

Orbital optimization fix#223

Open
jrm874 wants to merge 8 commits intoQiskit:mainfrom
jrm874:main
Open

Orbital optimization fix#223
jrm874 wants to merge 8 commits intoQiskit:mainfrom
jrm874:main

Conversation

@jrm874
Copy link
Copy Markdown
Collaborator

@jrm874 jrm874 commented Jun 24, 2025

The aim of this PR is to provide a stable implementation of the orbital optimization functions in the fermion module. The optimizer uses gradient descent with the ADAM update rule.

Additionally, I have included a beta implementation of configuration recovery using numpy broadcasting in the configuration_recovery module: recover_configurations_bcast(). If we see that this later changes are not needed I can remove them.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 24, 2025

CLA assistant check
All committers have signed the CLA.

@kevinsung
Copy link
Copy Markdown
Collaborator

We should split this into several PRs so that each PR only does one thing.

@jrm874 How does your implementation differ from the old implementation prior to #130? Do you think simply reverting #130 is an acceptable fix?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num_params = num_orbitals**2 # antisymmetric, specified by upper triangle

The comment should be deleted now.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just modified the docstrings to reflect the changes in the parameterization.

A couple of changes relative to #130 are present:

1.- Use ADAM as the optimizer instead of gradient descent with momentum

2.- Removal of some redundant permutations of indices in the eri and 2rdms

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment I mentioned above is actually in the notebook.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I just saw it. I removed the comment :)

@jrm874
Copy link
Copy Markdown
Collaborator Author

jrm874 commented Jun 25, 2025

@kevinsung , I have removed the implementation of configuration recovery that uses broadcasting for performance to include it in a separate PR :)

# ``1.0`` as the occupation deviates further from the expected ratio
if ratio_exp == 1.0:
return eps
return 1.0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unrelated, right? Please revert it. Why did you make it though? Are you fixing something?

k_flat: 1D array defining the orbital transform, ``K``. The array should specify the upper
triangle of the anti-symmetric transform operator in row-major order, excluding the diagonal.
k_flat: 1D array defining the orbital transform, ``K``. The anti-symmetric
matrix defining the transfomration is construccted by the anti-symmetrization
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling mistakes

  • "transformation"
  • "constructed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants