Closed fdmalone closed 1 year ago
Looks like numpy deprecated np.float. I'll open a separate PR to fix this so as to not pollute the git history with changes to mainline openfermion.
note that np.float
was always sortof an accident and was an alias for the built-in float
type. If you wanted the numpy/C type it is spelled np.float_
I'm going to split this PR into several smaller ones to make it a bit more digestible.
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.