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

Block invariant symmetry shift (DF+LRPS) functionality #901

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SmikPatel
Copy link

Added functions to implement the DF + LRPS method of https://arxiv.org/abs/2409.18277, along with functions to calculate the associated LCU 1-norm.

@ncrubin
Copy link
Collaborator

ncrubin commented Jan 8, 2025

Thanks for this contribution! I'll take a look ASAP

@ncrubin ncrubin self-requested a review January 8, 2025 01:03
Copy link
Collaborator

@ncrubin ncrubin left a comment

Choose a reason for hiding this comment

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

Please add tests and translate your documentation to an example notebook

@@ -0,0 +1,195 @@
# Code for implementing the DF + LRPS decomposition found in https://arxiv.org/abs/2409.18277
#
# Notes:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be in a function somewhere or in some tutorial / testing.

Copy link
Collaborator

@ncrubin ncrubin left a comment

Choose a reason for hiding this comment

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

some comments on naming conventions. I thoroughly read your paper and I couldn't remember (out of the many abbreviations) what these were. Just say what they are in plain english.

shift = np.median(eps)
return np.sum(np.abs(eps - shift))

def l1norm_lr_twobody_spatial(eps_params):
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't abbreviate low-rank with lr.

"""
return np.sum(np.abs(np.linalg.eigh(obt)[0]))

def l1norm_onebody_NSS_spatial(obt):
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is NSS


# second set of functions is for calculating the DF decomposition.

def obtain_lowrank_decomposition(tbt):
Copy link
Collaborator

Choose a reason for hiding this comment

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

hardcoded cutoffs. 1) can you use existing openfermion infrastructure 2) make cutoffs inputs or optional inputs


return h_list, eps_params, lambda_params, Us

def obtain_fermionic_unitarized_obt_spatial(obt, tbt):
Copy link
Collaborator

Choose a reason for hiding this comment

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

whats obt?


# third set of functions is for calculating LRPS part of DF + LRPS decomposition

def obtain_lrps_shifts(eps_params):
Copy link
Collaborator

Choose a reason for hiding this comment

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

LRPS?

eps_lrps.append(eps_params[alpha] - cur_shift)
return shifts, eps_lrps

def obtain_lrps_fermionic_unitarized_obt_spatial(obt, eps_params, Us, shifts, eps_lrps, Ne):
Copy link
Collaborator

Choose a reason for hiding this comment

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

lrps? But now correctly lower cased

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.

2 participants