Add periodic boundary condition resource estimates and factorizations. #813
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds functionality to:
This code was used to generate the majority of the data in the recent paper: Fault-tolerant quantum simulation of materials using Bloch orbitals
The code follows the structure of the molecular resource estimation code (see #763), and provides utility functions to factorize the integrals if appropriate, compute the lambda value of the hamiltonian and compute fault tolerant resource estimates. A lot of boilerplate can be reduced by using the
generate_costing_table
functions which perform the necessary steps.A minimal example is given below. In depth tutorials are provided in notebooks/isdf.ipynb and notebooks/resource_estimates.ipynb.
The first step is to run a periodic Hartree-Fock calculation for a system of interest (here carbon in the diamond structure)
From this mean field object we can generate a table of resource estimates given a set of threshold parameters. Here we choose the sparse representation so the thresholds correspond to when matrix elements of the Hamiltonian are set to zero.
The output of which is
Note the return type of the costing table is a pandas DataFrame. I decided it was more convenient this way rather than writing to a text file (this can be delegated to pandas to_csv(), to_string(), to_latex() methods), but I'm open to suggestions.
More fine grained control can be achieved through the
compute_lambda
andcompute_cost
functions.The code also implements a k-point dependent THC factorization based upon an interpolative separable density fitting (ISDF) initial guess. This procedure is quite slow and involved but can be accelerated a bit on GPUs. I did not try terribly hard to optimize einsum contractions so there are potentially some optimizations to be had.
Much like the molecular resource estimates, this code is not hooked up to the CI and skips the tests if pyscf is not available. We should probably use markers instead and/or enable the tests on a less frequent / incremental basis if possible.
Major contributions were made by Nick Rubin and Alec White.