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

More efficient implementation of LinearOperator for FermionOperator #50

Open
kevinsung opened this issue Oct 20, 2023 · 1 comment
Open
Labels
rust Involves writing Rust
Milestone

Comments

@kevinsung
Copy link
Collaborator

kevinsung commented Oct 20, 2023

A FermionOperator that conserves particle number and spin Z can be converted to a LinearOperator, and the current implementation is here:

def _fermion_operator_to_linear_operator(

Currently, the implementation uses the functions des_a, des_b, cre_a, cre_b from pyscf.fci.addons. These functions don't preserve symmetries, and indeed they change the shape of the vector. The efficiency can be vastly improved by implementing a function that can directly apply a number- and spin-Z-conserving term to a vector. This should be implemented in Rust, but it can take as an argument a linkstr_index produced by pyscf.fci.cistring.gen_linkstr_index (or rather, the cached wrapper in ffsim).

Recommended approach:

  1. Rewrite _apply_fermion_term in Python to apply the fermion term in a more efficient manner.
  2. Port the function to Rust.

After doing this, we can increase the maximum norb covered by some tests.

@kevinsung kevinsung added the rust Involves writing Rust label Oct 20, 2023
@kevinsung kevinsung added this to the v0.1 milestone Oct 20, 2023
@kevinsung kevinsung added the help wanted Extra attention is needed label Apr 10, 2024
@bartandrews
Copy link
Contributor

I would like to help with this issue!

@kevinsung kevinsung removed the help wanted Extra attention is needed label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Involves writing Rust
Projects
None yet
Development

No branches or pull requests

2 participants