Improved techniques for preparing eigenstates of fermionic Hamiltonians

Modeling low energy eigenstates of fermionic systems can provide insight into chemical reactions and material properties and is one of the most anticipated applications of quantum computing. We present three techniques for reducing the cost of preparing fermionic Hamiltonian eigenstates using phase estimation. First, we report a polylogarithmic-depth quantum algorithm for antisymmetrizing the initial states required for simulation of fermions in first quantization. This is an exponential improvement over the previous state-of-the-art. Next, we show how to reduce the overhead due to repeated state preparation in phase estimation when the goal is to prepare the ground state to high precision and one has knowledge of an upper bound on the ground state energy that is less than the excited state energy (often the case in quantum chemistry). Finally, we explain how one can perform the time evolution necessary for the phase estimation based preparation of Hamiltonian eigenstates with exactly zero error by using the recently introduced qubitization procedure. Improved quantum algorithm can now simulate the electronic structure of materials and molecules much faster than what was possible before. A team involving researchers from Macquarie University, Microsoft Research, and Google has developed theoretical tools to efficiently prepare the initial “guess” for the electronic state one wants to simulate, in a way that it correctly includes the property of fermionic systems called “anti-symmetrization”, which means that the total wavefunction changes sign if two particles exchange their positions. The team also managed to reduce the number of physical operations that the quantum computer should perform to evolve the initial guess up to the final solution. Future large-scale quantum simulations should be able to model electronic structure much more efficiently than standard computers, with significant impact in chemistry, biochemistry and material science.


INTRODUCTION
One of the most important applications of quantum simulation (and of quantum computing in general) is the Hamiltonian simulation based solution of the electronic structure problem. The ability to accurately model ground states of fermionic systems would have significant implications for many areas of chemistry and materials science and could enable the in silico design of new solar cells, batteries, catalysts, pharmaceuticals, etc. 1,2 The most rigorous approaches to solving this problem involve using the quantum phase estimation algorithm 3 to project to molecular ground states starting from a classically guessed state. 4 Beyond applications in chemistry, one might want to prepare fermionic eigenstates in order to simulate quantum materials 5 including models of high-temperature superconductivity. 6 In the procedure introduced by Abrams and Lloyd, 7 one first initializes the system in some efficient-to-prepare initial state φ j i which has appreciable support on the desired eigenstate k j i of Hamiltonian H. One then uses quantum simulation to construct a unitary operator that approximates time evolution under H. With these ingredients, standard phase estimation techniques invoke controlled application of powers of U(τ) = e −iHτ . With probability α k ¼ φjk h i j j 2 , the output is then an estimate of the corresponding eigenvalue E k with standard deviation σ E k = O ðτMÞ À1 À Á , where M is the total number of applications of U(τ). The synthesis of e −iHτ is typically performed using digital quantum simulation algorithms, such as by Lie-Trotter product formulas, 8 truncated Taylor series, 9 or quantum signal processing. 10 Since the proposal by Abrams and Lloyd, 7 algorithms for timeevolving fermionic systems have improved substantially. [11][12][13][14][15][16][17][18] Innovations that are particularly relevant to this paper include the use of first quantization to reduce spatial overhead [19][20][21][22][23][24] from where η is number of particles and N ≫ η is number of single-particle basis functions (e.g., molecular orbitals or plane waves), and the use of post-Trotter methods to reduce the scaling with time-evolution error from O(poly(1/ϵ)) to O (polylog(1/ϵ)). [24][25][26] The algorithm of ref. 24 makes use of both of these techniques to enable the most efficient first quantized quantum simulation of electronic structure in the literature.
Unlike second quantized simulations which necessarily scale polynomially in N, first quantized simulation offers the possibility of achieving total gate complexity O(poly(η)polylog(N, 1/ϵ)). This is important because the convergence of basis set discretization error is limited by resolution of the electron-electron cusp, 27 which cannot be resolved faster than O(1/N) using any single-particle basis expansion. Thus, whereas the cost of refining second quantized simulations to within δ of the continuum basis limit is necessarily O(poly(1/δ)), first quantization offers the possibility of suppressing basis set errors as O(polylog(1/δ)), providing essentially arbitrarily precise representations.
In second quantized simulations of fermions the wavefunction encodes an antisymmetric fermionic system, but the qubit representation of that wavefunction is not necessarily antisymmetric. Thus, in second quantization it is necessary that operators act on the encoded wavefunction in a way that enforces the proper exchange statistics. This is the purpose of second quantized fermion mappings such as those explored in refs. [28][29][30][31][32][33][34] By contrast, the distinguishing feature of first quantized simulations is that the antisymmetry of the encoded system must be enforced directly in the qubit representation of the wavefunction. This often simplifies the task of Hamiltonian simulation but complicates the initial state preparation.
In first quantization there are typically η different registers of size log N (where η is the number of particles and N is number of spin-orbitals) encoding integers indicating the indices of occupied orbitals. As only η of the N orbitals are occupied, with η log N qubits one can specify an arbitrary configuration. To perform simulations in first quantization, one typically requires that the initial state φ j i is antisymmetric under the exchange of any two of the η registers. Prior work presented a procedure for preparing such antisymmetric states with gate complexity scaling as O η 2 ð Þ. 35,36 In Section IA we provide a general approach for antisymmetrizing states via sorting networks. The circuit size is O ηlog c ηlog N ð Þ and the depth is O log c ηlog log N ð Þ , where the value of c ≥ 1 depends on the choice of sorting network (it can be 1, albeit with a large multiplying factor). In terms of the circuit depth, these results improve exponentially over prior implementations. 35,36 They also improve polynomially on the total number of gates needed. We also discuss an alternative approach, a quantum variant of the Fisher-Yates shuffle, which avoids sorting, and achieves a size-complexity of O(η 2 log N) with lower spatial overhead than the sort-based methods.
Once the initial state φ j i has been prepared, it typically will not be exactly the ground state desired. In the usual approach, one would perform phase estimation repeatedly until the ground state is obtained, giving an overhead scaling inversely with the initial state overlap. In Section IB we propose a strategy for reducing this cost, by initially performing the estimation with only enough precision to eliminate excited states.
In Section IC we explain how qubitization 37 provides a unitary sufficient for phase estimation purposes with exactly zero error (provided a gate set consisting of an entangling gate and arbitrary single-qubit rotations). This improves over proposals to perform the time evolution unitary with post-Trotter methods at cost scaling as O(polylog(1/ϵ)). We expect that a combination of these strategies will enable quantum simulations of fermions similar to the proposal of 24 with substantially fewer T gates than any method suggested in prior literature.

Exponentially faster antisymmetrization
Here we present our algorithm for imposing fermionic exchange symmetry on a sorted, repetition-free quantum array target. Specifically, the result of this procedure is to perform the transformation where π(σ) is the parity of the permutation σ, and we require for the initial state that r p < r p+1 (necessary for this procedure to be unitary). Although we describe the procedure for a single input r 1 Á Á Á r η , our algorithm may be applied to any superposition of such states.
Our approach is a modification of that proposed in refs. 35,36 ; namely, to apply the reverse of a sort to a sorted quantum array. Whereas refs. 35,36 provide a gate count of Oðη 2 ðlog NÞ 2 Þ, we can report a gate count of Oðη log η log NÞ and a runtime of Oðlog η log log NÞ.
This section proceeds as follows. We begin with a summary of our algorithm. We then explain the reasoning underlying the key step (Step 4) of our algorithm, which is to reverse a sorting operation on target. Next we discuss the choice of sorting algorithm, which we require to be a sorting network. Then, we assess the cost of our algorithm in terms of gate complexity and runtime and we compare this to previous work in refs. 35,36 . Finally, we discuss the possibility of antisymmetrizing without sorting and propose an alternative, though more costly, algorithm based on the Fisher-Yates shuffle. Our algorithm consists of the following four steps: 1. Prepare seed. Let f be a function chosen so that f(η) ≥ η 2 for all η. We prepare an ancillary register called seed in an even superposition of all possible length-η strings of the numbers 0, 1, …, f(η) − 1. If f(η) is a power of two, preparing seed is easy: simply apply a Hadamard gate to each qubit. 2. Sort seed. Apply a reversible sorting network to seed. Any sorting network can be made reversible by storing the outcome of each comparator in a second ancillary register called record. There are several known sorting networks with polylogarithmic runtime, as we discuss below. 3. Delete collisions from seed. As seed was prepared in a superposition of all length-η strings, it includes strings with repeated entries. As we are imposing fermionic exchange symmetry, these repetitions must be deleted. We therefore measure seed to determine whether a repetition is present, and we accept the result if it is repetition-free. We prove in Supplementary Materials that choosing f(η) ≥ η 2 ensures that the probability of success is greater than 1/2. We further prove that the resulting state of seed is disentangled from record, meaning seed can be discarded after this step. 4. Apply the reverse of the sort to target. Using the comparator values stored in record, we apply each step of the sorting network in reverse order to the sorted array target. The resulting state of target is an evenly weighted superposition of each possible permutation of the original values.
To ensure the correct phase, we apply a controlled-phase gate after each swap.
Step 4 is the key step. Having prepared (in Step 1-Step 3) a record of the in-place swaps needed to sort a symmetrized, collision-free array, we undo each of these swaps in turn on the sorted target. We employ a sorting network, a restricted type of sorting algorithm, because sorting networks have comparisons and swaps at a fixed sequence of locations. By contrast, many common classical sorting algorithms (like heapsort) choose locations depending on the values in the list. This results in accessing registers in a superposition of locations in the corresponding quantum algorithm, incurring a linear overhead. As a result, a quantum heapsort requires e O η 2 ð Þ operations, not e OðηÞ. By contrast, no overhead is required for using a fixed sequence of locations. The implementation of sorting networks in quantum algorithms has previously been considered in refs. 38,39 .
Sorting networks are logical circuits that consist of wires carrying values and comparator modules applied to pairs of wires, that compare values and swap them if they are not in the correct order. Wires represent bit strings (integers are stored in binary) in classical sorting networks and qubit strings in their quantum analogs. A classical comparator is a sort on two numbers, which gives the transformation (A, B) ↦ minðA; BÞ; maxðA; BÞ ð Þ . A quantum comparator is its reversible version where we record whether the items were already sorted (ancilla state 0 j i) or the comparator needed to apply a swap (ancilla state 1 j i); see Fig. 1. The positions of comparators are set as a predetermined fixed sequence in advance and therefore cannot depend on the inputs. This makes sorting networks viable candidates for quantum Fig. 1 The standard notation for a comparator is indicated on the left. Its implementation as a quantum circuit is shown on the right. In the first step, we compare two inputs with values A and B and save the outcome (1 if A > B is true and 0 otherwise) in a single-qubit ancilla. In the second step, conditioned on the value of the ancilla qubit, the values A and B in the two wires are swapped Improved techniques for preparing eigenstates D.W. Berry et al. computing. Many of the sorting networks are also highly parallelizable, thus allowing low-depth, often polylogarithmic, performance.
Our algorithm allows for any choice of sorting network. Several common sort algorithms such as the insert and bubble sorts can be represented as sorting networks. However, these algorithms have poor time complexity even after parallelization. More efficient runtime can be achieved, for example, using the bitonic sort, 40,41 which is illustrated for 8 inputs in Fig. 2. The bitonic sort uses O(η log 2 η) comparators and O(log 2 η) depth, thus achieving an exponential improvement in depth compared to common sorting techniques.
Slightly better performance can be obtained using an odd-even mergesort. 40 The asymptotically best sorting networks have depth O(log η) and complexity O(η log η), though there is a large constant which means they are less efficient for realistic η. 42,43 There is also a sorting network with O(η log η) complexity with a better multiplicative constant, 44 Assuming we use an asymptotically optimal sorting network, the circuit depth for our algorithm is O(log η log log N) and the gate complexity is O(η log η log N). The other two steps in our algorithm have smaller cost.
Step 1 has constant depth and O(η log η) complexity.
Step 3 requires O(η) comparisons because only nearest-neighbor comparisons need be carried out on seed after sorting. These comparisons can be parallelized over two rounds, with complexity O(η log η) and circuit depth O(log log η). Then the result for any of the registers being equal is computed in a single qubit, which has complexity O (η) and depth O(log η). Thus the complexity of Step 3 is O(η log η) and the total circuit depth is O(log η). We give further details in Supplementary Materials. Thus, our algorithm has an exponential runtime improvement over the proposal in refs. 35,36 . We also have a quadratic improvement in gate complexity, which is e OðηÞ for our algorithm but e O η 2 ð Þ for refs. 35,36 . Our runtime is likely optimal for symmetrization, at least in terms of the η scaling. Symmetrization takes a single computational basis state and generates a superposition of η! computational basis states. Each single-qubit operation can increase the number of states in the superposition by at most a factor of two, and two-qubit operations can increase the number of states in the superposition by at most a factor of four. Thus, the number of oneand two-qubit operations is at least log 2 (nǃ) = O(η log η). In our algorithm we need this number of operations between the registers. If that is true in general, then η operations can be parallelized, resulting in minimum depth O(log η). It is more easily seen that the total number of registers used is optimal. There are O(η log η) ancilla qubits due to the number of steps in the sort, but the number of qubits for the system state we wish to symmetrize is O(η log N), which is asymptotically larger.
Our quoted asymptotic runtime and gate complexity scalings assume the use of sorting networks that are asymptotically optimal. However, these algorithms have a large constant overhead making it more practical to use an odd-even mergesort, leading to depth O(log 2 η log log N). Note that is possible to obtain complexity O(η log η log N) and number of ancilla qubits O (η log η) with a better scaling constant using the sorting network of ref. 44 .
Given that the cost of our algorithm is dictated by the cost of sorting algorithms, it is natural to ask if it is possible to antisymmetrize without sorting. Though the complexity and runtime both turn out to be significantly worse than our sortbased approach, we suggest an alternative antisymmetrization algorithm based on the Fisher-Yates shuffle. The Fisher-Yates shuffle is a method for applying to a length-η target array a permutation chosen uniformly at random using a number of operations scaling as O(η). Our algorithm indexes the positions to be swapped, thereby increasing the complexity toÕ η 2 ð Þ. Briefly put, our algorithm generates a superposition of states as in Step II of ref. 36 , then uses these as control registers to apply the Fisher-Yates shuffle to the orbital numbers. The complexity is O(η 2 log N), with a factor of log N due to the size of the registers. We reset the control registers, thereby disentangling them, using O(η log η) ancillae. We provide more details of this approach in Supplementary Materials.
To conclude this section, we have presented an algorithm for antisymmetrizing a sorted, repetition-free quantum register. The dominant cost of our algorithm derives from the choice of sorting network, whose asymptotically optimal gate count complexity and runtime are, respectively, O(η log η log N) and O(log η log log N). This constitutes a polynomial improvement in the first case and exponential in the second case over previous work in refs. 35,36 . As in ref. 36 , our antisymmetrization algorithm constitutes a key step for preparing fermionic wavefunctions in first quantization.
Fewer phase estimation repetitions by partial eigenstate projection rejection Once the initial state φ j i has been prepared, it typically will not be exactly the ground state (or other eigenstate) desired. In the usual approach, one would perform phase estimation repeatedly, in order to obtain the desired eigenstate k j i. The number of repetitions needed scales inversely in α k = φjk h i j j 2 , increasing the complexity. We propose a practical strategy for reducing this cost which is particularly relevant for quantum chemistry. Our approach applies if one seeks to prepare the ground state with knowledge of an upper bound on the ground state energyẼ 0 , together with the promise that E 0 Ẽ 0 <E 1 . With such bounds available, one can reduce costs by restarting the phase estimation procedure as soon as the energy is estimated to be aboveẼ 0 with high probability. That is, one can perform a phase estimation procedure that gradually provides estimates of the phase to greater and greater accuracy, for example as in ref. 45 If at any stage the phase is estimated to be aboveẼ 0 with high probability, then the initial state can be discarded and re-prepared.
Performing phase estimation within error ϵ typically requires evolution time for the Hamiltonian of 1/ϵ, leading to complexity scaling as 1/ϵ. This means that, if the state is the first excited state, then an estimation error less than E 1 ÀẼ 0 will be sufficient to show that the state is not the ground state. The complexity needed would then scale as 1= E 1 ÀẼ 0 À Á . In many cases, the final error required, ϵ f , will be considerably less than E 1 ÀẼ 0 , so the majority of the contribution to the complexity comes from measuring the phase with full precision, rather than just rejecting the state as not the ground state.
Given the initial state φ j i which has initial overlap of α 0 with the ground state, if we restart every time the energy is found to be aboveẼ 0 , then the contribution to the complexity is 1= α 0 E 1 ÀẼ 0 À Á Â Ã . There will be an additional contribution to the complexity of 1/ϵ f to obtain the estimate of the ground state energy with the desired accuracy, giving an overall scaling of the complexity of In contrast, if one were to perform the phase estimation with full accuracy every time, then the scaling of the complexity would be O(1/(α 0 ϵ f )). Provided α 0 E 1 ÀẼ 0 À Á >ϵ f , the method we propose would essentially eliminate the overhead from α 0 .
In cases where α 0 is very small, it would be helpful to apply amplitude amplification. A complication with amplitude amplification is that we would need to choose a particular initial accuracy to perform the estimation. If a lower bound on the excitation energy,Ẽ 1 , is known, then we can choose the initial accuracy to bẽ E 1 ÀẼ 0 . The success case would then correspond to not finding that the energy is aboveẼ 0 after performing phase estimation with that precision. Then amplitude amplification can be performed in the usual way, and the overhead for the complexity is 1= ffiffiffiffiffi α 0 p instead of 1/α 0 .
All of this discussion is predicated on the assumption that there are cases where α 0 is small enough to warrant using phase estimation as part of the state preparation process and where a bound meeting the promises ofẼ 0 is readily available. We now discuss why these conditions are anticipated for many problems in quantum chemistry. Most chemistry is understood in terms of mean-field models (e.g., molecular orbital theory, ligand field theory, the periodic table, etc.). Thus, the usual assumption (empirically confirmed for many smaller systems) is that the ground state has reasonable support on the Hartree-Fock state (the typical choice for φ j i). [46][47][48][49] However, this overlap will decrease as a function of both basis size and system size. As a simple example, consider a large system composed of n copies of non-interacting subsystems. If the Hartree-Fock solution for the subsystem has overlap α 0 , then the Hartree-Fock solution for the larger system has overlap of exactly α n 0 , which is exponentially small in n.
It is literally plain-to-see that the electronic ground state of molecules is often protected by a large gap. The color of many molecules and materials is the signature of an electronic excitation from the ground state to first excited state upon absorption of a photon in the visible range (around 0.7 Hartree); many clear organics have even larger gaps in the UV spectrum. Visible spectrum E 1 −E 0 gaps are roughly a hundred times larger than the typical target accuracy of ϵ f = 0.0016 Hartree ("chemical accuracy") (The rates of chemical reactions are proportional to e −βΔA /β where β is inverse temperature and ΔA is a difference in free energy between reactants and the transition state separating reactants and products. Chemical accuracy is defined as the maximum error allowable in ΔA such that errors in the rate are smaller than a factor of ten at room temperature 4 ). Furthermore, in many cases the first excited state is perfectly orthogonal to the Hartree-Fock state for symmetry reasons (e.g., due to the ground state being a spin singlet and the excited state being a spin triplet). Thus, the gap of interest is really E * −E 0 where E Ã ¼ min k>0 E k subject to φjk h i j j 2 >0. Often the E * −E 0 gap is much larger than the E 1 −E 0 gap.
For most problems in quantum chemistry a variety of scalable classical methods are accurate enough to compute upper bounds on the ground state energyẼ 0 such that E 0 Ẽ 0 <E Ã , but not accurate enough to obtain chemical accuracy (which would require quantum computers). Classical methods usually produce upper bounds when based on the variational principle. Examples include mean-field and Configuration Interaction Singles and Doubles (CISD) methods. 50 As a concrete example, consider a calculation on the water molecule in its equilibrium geometry (bond angle of 104.5°, bond length of 0.9584 Å) in the minimal (STO-3G) basis set performed using OpenFermion 51 and Psi4. 52 For this system, E 0 = −75.0104 Hartree and E 1 = −74.6836 Hartree. However, φj1 h i= 0 and E * = −74.3688 Hartree. The classical mean-field energy provides an upper bound on the ground state energy ofẼ 0 ¼ À74:9579 Hartree. Therefore E Ã ÀẼ 0 % 0:6 Hartree, which is about 370 times ϵ f . Thus, using our strategy, for α 0 > 0.003 there is very little overhead due to the initial state φ j i not being the exact ground state. In the most extreme case for this example, that represents a speedup by a factor of more than two orders of magnitude. However, in some cases the ground state overlap might be high enough that this technique provides only a modest advantage. While the Hartree-Fock state overlap in this small basis example is α 0 = 0.972, as the system size and basis size grow we expect this overlap will decrease (as argued earlier).
Another way to cause the overlap to decrease is to deviate from equilibrium geometries. 46,47 For example, we consider this same system (water in the minimal basis) when we stretch the bond lengths to 2.25× their normal lengths. In this case, E 0 = −74.7505 Hartree, E * = −74.6394 Hartree, and α 0 = 0.107. The CISD solution provides an upper boundẼ 0 = −74.7248. In this case, E Ã ÀẼ 0 % 0:085 Hartree, about 50 times ϵ f . Since α 0 > 0.02, here we speed up state preparation by roughly a factor of α À1 0 (more than an order of magnitude).
Phase estimation unitaries without approximation Normally, the phase estimation would be performed by Hamiltonian simulation. That introduces two difficulties: first, there is error introduced by the Hamiltonian simulation that needs to be taken into account in bounding the overall error, and second, there can be ambiguities in the phase that require simulation of the Hamiltonian over very short times to eliminate.
These problems can be eliminated if one were to use Hamiltonian simulation via a quantum walk, as in refs. 53,54 . There, steps of a quantum walk can be performed exactly, which have eigenvalues related to the eigenvalues of the Hamiltonian. Specifically, the eigenvalues are of the form ± e ± iarcsin E k =λ ð Þ . Instead of using Hamiltonian simulation, it is possible to simply perform phase estimation on the steps of that quantum walk, and invert the function to find the eigenvalues of the Hamiltonian. That eliminates any error due to Hamiltonian simulation. Moreover, the possible range of eigenvalues of the Hamiltonian is automatically limited, which eliminates the problem with ambiguities.
The quantum walk of ref. 54 does not appear to be appropriate for quantum chemistry, because it requires an efficient method of calculating matrix entries of the Hamiltonian. That would be expensive for the Hamiltonians of quantum chemistry, but they can be expressed as sums of unitaries, as for example discussed in ref. 25 . It turns out that the method called qubitization 37 allows one to take a Hamiltonian given by a sum of unitaries, and construct a new operation with exactly the same functional dependence on the eigenvalues of the Hamiltonian as for the quantum walk in refs. 53,54 .
Next, we summarize how qubitization works. 37 One assumes black-box access to a signal oracle V that encodes H in the form: where 0 j i a is in general a multi-qubit ancilla state in the computational basis, 1 s is the identity gate on the system register and λ ! H k k is a normalization constant. For Hamiltonians given where A is an operator for state preparation acting as with λ = P dÀ1 j¼0 a j , and For U that is Hermitian, we can simply take V = U. This is the case for any local Hamiltonian that can be written as a weighted sum of tensor products of Pauli operators, since tensor products of Pauli operators are both unitary and Hermitian. More general strategies for representing Hamiltonians as linear combinations of unitaries, as in Eq. (4), are discussed in, 55 related to the sparse decompositions first described in. 56 If U is not Hermitian, then we may construct a Hermitian V as The multiqubit ancilla labeled "a" would then include this additional qubit, as well as the ancilla used for the control for SELECT-U. In either case we can then construct a unitary operator called the qubiterate as follows: The qubiterate transforms each eigenstate k j i of H as where 0k ? j i as has no support on 0 j i a . Thus, W performs rotation between two orthogonal states 0 j i a k j i s and 0k ? j i as . Restricted to this subspace, the qubiterate may be diagonalized as This spectrum is exact, and identical to that for the quantum walk in refs. 53,54 . This procedure is also simple, requiring only two queries to U and a number of gates to implement the controlled-Z operator 2 0 j i 0 h j a 1 s À 1 À Á scaling linearly in the number of controls.
We may replace the time evolution operator with the qubiterate W in phase estimation, and phase estimation will provide an estimate of arcsin E k =λ ð Þ or π À arcsin E k =λ ð Þ. In either case taking the sine gives an estimate of E k /λ, so it is not necessary to distinguish the cases. Any problems with phase ambiguity are eliminated, because performing the sine of the estimated phase of W yields an unambiguous estimate for E k . Note also that λ ! H k k implies that E k =λ j j 1. More generally, any unitary operation e if(H) that has eigenvalues related to those of the Hamiltonian would work so long as the function f(⋅) : R ! ðÀπ; πÞ is known in advance and invertible. One may perform phase estimation to obtain a classical estimate of f(E k ), then invert the function to estimate E k . To first order, the error of the estimate would then propagate like In our example, with standard deviation σ phase in the phase estimate of W, the error in the estimate is Obtaining uncertainty ϵ for the phase of W requires applying W a number of times scaling as 1/ϵ. Hence, obtaining uncertainty ϵ for E k requires applying W a number of times scaling as λ/ϵ. For Hamiltonians given by sums of unitaries, as in chemistry, each application of W uses O(1) applications of state preparations and SELECT-U operations. In terms of these operations, the complexities of Section IB have multiplying factors of λ.

DISCUSSION
We have described three techniques which we expect will be practical and useful for the quantum simulation of fermionic systems. Our first technique provides an exponentially faster method for antisymmetrizing configuration states, a necessary step for simulating fermions in first quantization. We expect that in virtually all circumstances the gate complexity of this algorithm will be nearly trivial compared to the cost of the subsequent phase estimation. Then, we showed that when one has knowledge of an upper bound on the ground state energy that is separated from the first excited state energy, one can prepare ground states using phase estimation with lower cost. We discussed why this situation is anticipated for many problems in chemistry and provided numerics for a situation in which this trick reduced the gate complexity of preparing the ground state of molecular water by more than an order of magnitude. Finally, we explained how qubitization 37 provides a unitary that can be used for phase estimation without introducing the additional error inherent in Hamiltonian simulation. We expect that these techniques will be useful in a variety of contexts within quantum simulation. In particular, we anticipate that the combination of the three techniques will enable exceptionally efficient quantum simulations of chemistry based on methods similar to those proposed in ref. 24 While specific gate counts will be the subject of a future work, we conjecture that such techniques will enable simulations of systems with roughly a hundred electrons on a million point grid with fewer than a billion T gates. With such low T counts, simulations such as the mechanism of Nitrogen fixation by ferredoxin, explored for quantum simulation in ref. 57 should be practical to implement within the surface code in a reasonable amount of time with fewer than a few million physical qubits and error rates just beyond threshold. This statement is based on the time and space complexity of magic state distillation (usually the bottleneck for the surface code) estimated for superconducting qubit architectures in ref. 58 and in particular, the assumption that with a billion T gates or fewer one can reasonably perform state distillation in series using only a single T factory.

Data availability
The data sets generated during and analyzed during the current study are available from the corresponding author on reasonable request. All code is available in the open source library OpenFermion. 51 McClean for discussions about molecular excited state gaps. We note that arguments relating the colors of compounds to their molecular excited state gaps in the context of quantum computing have been popular for many years, likely due to comments of Alán Aspuru-Guzik. D.W.B. is funded by an Australian Research Council Discovery Project (Grant No. DP160102426).