Succinct Fermion Data Structures
Abstract
Simulating fermionic systems on a quantum computer requires representing fermionic states using qubits. The complexity of many simulation algorithms depends on the complexity of implementing rotations generated by fermionic creation-annihilation operators, and the space depends on the number of qubits used. While standard fermion encodings like Jordan-Wigner are space optimal for arbitrary fermionic systems, physical symmetries like particle conservation can reduce the number of physical configurations, allowing improved space complexity. Such space saving is only feasible if the gate overhead is small, suggesting a (quantum) data structures problem, wherein one would like to minimize space used to represent a fermionic state, while still enabling efficient rotations.
We define a structure which naturally captures mappings from fermions to systems of qubits. We then instantiate it in two ways, giving rise to two new second-quantized fermion encodings of fermions in modes. An information theoretic minimum of qubits is required for such systems, a bound we nearly match over the entire parameter regime.
-
1.
Our first construction uses qubits when , and allows rotations generated by creation-annihilation operators in gates and depth.
-
2.
Our second construction uses qubits when , and allows rotations generated by creation-annihilation operators in gates.
In relation to comparable prior work, the first represents a polynomial improvement in both space and gate complexity (against Kirby et al. 2022), and the second represents an exponential improvement in gate complexity at the cost of only a constant number of additional qubits (against Harrison et al. or Shee et al. 2022), in the described parameter regimes.
Keywords and phrases:
quantum computing, data structures, fermion encodingsFunding:
Joseph Carolan: supported by the US Department of Energy grant no. DESC0020264.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Quantum computation theory ; Theory of computation Data compressionAcknowledgements:
The authors thank James Watson for helpful conversation about fermion encodings, and Andrew Childs for providing feedback on an early draft of this manuscript. LS thanks the Joint Center for Quantum Information and Computer Science (QuICS) where a large portion of this research occurred.Editors:
Raghu MekaSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
| Encoding | Qubits | Gates |
|---|---|---|
| Regime and . | ||
| Optimal Degree[19] | ||
| Qubit Tapering/Segment[6, 25, 24] | ||
| Permutation Basis[14] | ||
| Theorem 3 | ||
| Regime | ||
| Qubit Tapering/Segment[6, 25, 24] | ||
| Permutation Basis[14] | ||
| Theorem 2 | ||
| General regime | ||
| Theorem 3 | ||
| Theorem 2 | ||
The simulation of many interacting fermions is a promising application of quantum computers. Such systems quickly become difficult to simulate classically, with accurate simulation being computationally intractable for complex systems [28]. A quantum computer can perform highly accurate simulations with only polynomial resources for local systems, a wide and powerful class beyond what can be simulated classically.
Many quantum algorithms for fermionic simulation require a mapping from fermionic Fock states and creation/annihilation operators to qubit states and operators. Two of the most well known such mappings are the ones due to Jordan-Wigner [17] and Bravyi-Kitaev [7]. These require qubits to represent a fermion system with modes, which is prohibitive in some cases. In particular, for particle preserving systems where the number of fermions is much smaller than , these encodings have a large amount of redundancy. In this case, the information theoretic lower bound of
| (1) |
qubits is potentially much smaller than .
Encodings which take advantage of this fact are relevant whenever the number of fermions is small compared to the number of modes, for instance in quantum chemistry simulations where the number of electrons () is fixed by a physical system yet the orbital basis size () should be as large as possible to correctly resolve the continuum behaviour. The discretization error in such systems scales like for reasonable bases [26], so large is required for high accuracy – this is especially important when using basis sets that have not been classically optimized, such as the plane wave basis. This motivates developing simulation algorithms with as mild a dependence on as possible in both space and gate usage, and a key component of many simulation algorithms is the qubit-to-fermion mapping used. Utilizing as few qubits as possible is important both for near term and fault tolerant devices, due to their limited size and the expense of qubits. However, space savings that incur an exponential gate overhead are not scalable. We therefore seek to minimize space complexity while still allowing relevant operations to be performed efficiently.
1.1 Prior work
There has been a line of work on second-quantized fermion encodings for saving space when the number of fermions is fixed. Bravyi et al. give a scheme for utilizing symmetries in particle preserving Hamiltonians to remove degrees of freedom, using parity symmetries to achieve qubits generically and LDPC codes for few fermion systems to achieve qubits [6], but with gate overhead in the worst case111Gate complexity here refers to the complexity of performing a single , for some angle and number-preserving product of many creation/annihilation operators . For our discussions, we will not consider geometric locality.. Steudtner and Wehner give a scheme based on segmenting the space of fermions which again achieves qubits, though allows more efficient gate overhead [25, 24]. The same work also proposed a binary addressing code which shares some similarities with the encodings described here, but did not provide circuits for fermion operations nor bound the resource costs in the general case. The work of Babbush et al. [2] describes a way to store and manipulate few fermion systems using a sparse oracle, but do not provide explicit circuits for particle preserving rotations generated by creation-annihilation operators.
The work of Kirby et al. [19] describes a second quantized fermion encoding achieving space complexity and gate complexity, subject to a certain conjecture about Hermite interpolation. Additionally, the work of Harrison et al. [14] and Shee et al. [23] give methods for achieving exactly qubit usage in second quantization, but at the cost of an exponential gate complexity.
There are also first-quantized representations of fermion systems [26, 18, 1], where a list of occupied fermion modes is anti-symmetrized. This can save significant space when is much smaller than . However, such encodings allow for a different class of operations222In particular, first-quantized operations. See [26] for examples of usage of these encodings in quantum simulation. to be performed efficiently as compared to second quantized encodings, making circuit complexity results within these two paradigms not directly comparable. Other works consider utilizing more than qubits and restricting to an entangled subspace, allowing certain sets of -local fermion operations to be extremely efficient (see e.g. [29, 30, 11, 7]). These encodings are most relevant for geometrically local systems, and in fact increase space beyond the standard Jordan-Wigner encoding – we therefore omit them from comparisons.
1.2 Contributions
We describe a quantum data structure which naturally captures the problem of encoding (second quantized) fermion systems in qubits. This structure represents bitstrings of length and Hamming weight , which naturally correspond to fermionic Fock states. We consider the (quantum circuit) gate/depth complexity of a sgn-rank (“sign rank”) operator, which applies a phase conditioned on how many ones exist in some prefix of the bitstring, as well as a bit-flip operator which flips one of the bits. These operators allow us to straightforwardly express the fermionic operations which are relevant to quantum simulation, as we show in Section 3.
Within this framework, the Jordan-Wigner encoding can be seen as a data structure which encodes bitstring by the quantum state , e.g. the trivial encoding. The sign rank operation is then simply a contiguous string of operators on some prefix, and the bit flip operator is a single operator. Our encodings employ a different representation of bitstrings which is more efficient when is small, requiring different quantum circuits.
1.2.1 Succinct structure
We first give a second quantized encoding for number preserving fermion systems which is nearly optimal in space usage, yet allows fermionic rotations with linear complexity and low depth. Our encoding uses sublinear redundancy, i.e. it is within a factor of optimal space usage (this is the meaning of “succinct” in the context of data structures) whenever . In particular, we prove the following theorem.
Theorem 1 (Informal).
A system of fermions in modes can be represented by qubits such that particle preserving fermionic rotations333By fermionic rotation, we mean the unitary for angle , where is a number-preserving product of creation/annihilation operators, e.g. for some . We require that is local in the sense that it is the product of creation/annihilation operators (but not geometrically local). have circuits of complexity and depth .
A summary of comparable prior work is shown in Table 1; notably, all previous second-quantized encodings either incur a polynomial overhead in space complexity444i.e. have asymptotic space usage for some when ., or the gate complexity of fermionic rotations is exponential in the number of qubits. We build up to this main result by presenting intermediary encodings achieving some, but not all of the aforementioned scalings. These encodings may be of independent interest due to their simplicity.
1.2.2 Implicit structure
We also give a construction which uses essentially the exact information-theoretic space minimum, except for an number of ancilla (at constant filling). This construction achieves gate complexity. The relevant regime for this encoding is constant filling, e.g. or more generally . In this regime, the prior space complexity of may be a significant overhead, whereas when the additive term is asymptotically negligible. The information theoretic limit in the regime goes like , meaning there can be significant space to save if is any constant fraction below .
Theorem 2 (Informal).
A system of fermions in modes can be represented by qubits such that particle preserving fermionic rotations have circuits of complexity .
The most comparable prior work is that of Harrison et al. [14] and Shee et al. [23], which both achieve exactly qubit complexity. However, these require an (e.g. exponential in at constant filling) circuit complexity overhead for performing rotations generated by creation-annihilation operators, in the worst case. Our encoding improves exponentially on this gate complexity, achieving in this regime. We do this at the cost of ancilla qubits.
1.3 Technical overview
We begin in Section 3 by developing a data structure which naturally captures fermion to qubit mappings of number preserving systems. This definition is not fully general, but provides a framework for thinking about such mappings. We then instantiate this data structure in two ways.
1.3.1 First result: a succinct structure
To build up to the first main result, we begin by developing a fermion data structure in Section 4 based on a straightforward idea. Instead of storing the explicit string of ones and zeros, store a sorted list of pointers to the positions containing a one. This approach builds off ideas presented in prior fermion encodings [2, 25] as well as work compressing quantum states [8, 13], though we present these ideas in a way which will facilitate understanding our full encoding. Observe that, in contrast to first quantized representations [26] (which also store a list of pointers to occupied positions), we will not antisymmetrize the state. This enables us to efficiently implement and queries (analogous to second-quantized rather than first-quantized operations), which we provide in Section 4.2. In Section 4.3 we describe a procedure using buffer registers that reduces the depth in this construction to logarithmic.
From this simple starting point, our next fermion data structure in Section 5 reduces the space requirements using combinatorial ideas, without affecting gate complexity. We accomplish this by splitting the most and least significant bits of each register, and using different representations for each. The most significant bits have a large amount of redundancy from being non-increasing, which we avoid by storing them using the stars and bars method. We give circuits for combining information between these two representations to efficiently implement the required operations.
We combine the two previous ideas with a succinct data structure that enables low-depth access to the most significant bits to show Theorem 3, with details given in the full version.
The key technical idea in this construction is a tree data structure used to store prefix sums related to the most significant bits. This prefix sum tree allows retrieving information about any specific entry in low depth, but requires less total space than a sorted list of numbers. This data structure therefore allows log depth fermionic rotations while being near-optimal in space usage, our first main result.
1.3.2 Second result: an implicit structure
Using a different approach, detailed in the full version, our second data structure achieves qubits and gate complexity when . We represent a bit string (which itself represents a Fock state) by storing ’s rank among feasible strings, where we determine rank by the number of bit-strings which are lexicographically before or have a smaller Hamming weight than . This encoding uses many qubits, but it is unclear how to interpret the encoded string to perform efficient operations. This obscurity is, essentially, the reason for the exponential gate overhead in prior works achieving this level of space efficiency.
We show how to perform both bit-flip and sign-rank efficiently on the first (unencoded) position, intuitively because the first and most-significant bit determines whether a given string has rank at most (first bit a ) or rank above (first bit a ) among strings of a given Hamming weight. This means that we can extract the first bit by comparing the encoded label against a fixed value, which can be done efficiently and with a small number of ancilla.
We then transform the ordering to one in which bit-flip and sign-rank can be performed efficiently on the second bit, and so on for each position. This is based on a construction of a certain set of orderings, which we denote for , of the labels. These orderings have the property that, given just the rank of a configuration over order , operations on the -th encoded bit can be performed efficiently ( gates) and with few ancillas on the label string. Further, we show how to transform a label under the order to a label under either or in the same complexity. By cycling over the possible orderings, we can perform relevant operations with gates and ancillas.
2 Preliminaries
2.1 Fermions
A system of fermions with modes can be defined by the algebra of creation ( for ) and annihilation ( for ) operators – this formalism is referred to as second quantization. These operators are determined by the anti-commutation relations
| (2) |
Let denote the vacuum state, the unique state which is not annihilated by any of the . We will primarily work with the Fock states, which are of the form
| (for all ) | |||||
| (3) | |||||
We denote the span of these states . Note that the -mode Fock states are in natural correspondence with -bit strings – this observation underlies the famous Jordan Wigner encoding [17], and will similarly underlie our data structures. It will be convenient for us to work in the Majorana basis determined by for . These operators are defined as follows:
| (4) |
The action of Majorana operators on the Fock states can now be written as follows, where is the negation of bit ,
| (5) |
In particular, these operators flip the occupation of a certain mode and apply a phase depending on the occupation of all preceding modes.
2.2 Fermion to Qubit Mappings
A fermion to qubit mapping can be defined by a linear mapping from Fock states to qubit states, as well as a mapping from Majorana operators to qubit operators. The qubit states/operators should be isomorphic to Fock states and Majorana operators, i.e. satisfy Equations 4, 5. Though some encodings do not fit into this paradigm (discussed in Section 1.1), this definition suffices for the encodings relevant to this paper. In particular, to define a mapping of an mode system it suffices to construct mutually anti-commuting qubit operators which each square to the identity.
We note that it is not always necessary to encode every possible Fock state, e.g. when simulating a system that does not explore every state. Particularly relevant for us will be particle preserving systems, which live in the subspace of Fock states with exactly many fermions.
A well known example of a fermion-to-qubit mapping is the Jordan-Wigner encoding [17], which defines -qubit operators as follows (where denotes a Pauli on the -th qubit, acting trivially on the rest)
| (6) |
The mapped qubit operators in this encoding act on qubits, which means qubits are used to store fermionic states. Additionally, the circuit complexity of the mapped operators is , as some mapped operators act non-trivially on all qubits.
2.3 Simulating Fermions
The main use case for fermion to qubit mappings is in the simulation of interacting fermions. In many such applications the dynamics are governed by a Hamiltonian which is both -local and term-wise number preserving (i.e. each term commutes with ). If we wish to simulate such a system with modes, the most general Hamiltonian is
| (7) |
where the indices run over the modes and denotes the hermitian conjugate of the preceding term. This type of system is ubiquitous in quantum chemistry and physics. To simulate a fermionic system, one requires a mapping from fermion states/operators to qubit states/operators, as discussed in Section 2.2. Almost all second quantized algorithms for approximating evolution involve performing rotations generated by terms in [9, 10, 4, 3, 20, 5, 21], so it is better for these rotations to require few gates and act on few qubits. Let be a product of Majorana operators, where is even. Our encodings give efficient circuits for rotations of the form ( a multiple of ) or ( not a multiple of )555Actually, in most places we give circuits for the operator up to a global phase. In the full version, we discuss how to generically implement the aforementioned rotations in the same complexity. Further, whether is a multiple of dictates whether or is unitary; we implement the unitary one.. This is sufficient to implement any rotation generated by the product of creation/annihilation operators and its hermitian conjugate. For an illustrative example, consider a hopping term for ,
from which it is clear that it suffices to implement two Majorana rotations. Note that although each Majorana operator itself need not preserve particle number, it changes the occupation number by at most (in this case at most two). Further, the whole operator does preserve particle number. Therefore, so long as our encoding has enough “space” to fit the intermediate states, we will remain in the proper subspace after implementing the full operator . We refer the reader to the full version for a more general discussion of this procedure.
3 Fermion Data Structures
In this section we introduce an alternative perspective of fermion encodings, in a way which makes the connection to data structures explicit. This perspective will facilitate the development of efficient fermion-to-qubit mappings later on.
3.1 Definitions
We first define two useful combinatorial operations, and . These are analogous to rank and bit flip queries respectively, which are well-studied in succinct classical data structures for bit-vectors [15, 22]666Note that the differing models of complexity (RAM programs/cell probe versus quantum circuits) prevent most of these classical results from being directly applicable to our problems.. These operators act on a bit string and depend on an index , and are combinatorial operations with no direct relation to fermions. However, they both show up naturally when writing down the action of fermionic creation-annihilation operators on Fock states: one can notice the similarities between Definitions 3, 4 and the action of Majorana operators in Equation 5.
Definition 3.
The operator (“sign rank”) of an index and bit string is the operator which returns the parity of the first bits of (represented as for even, for odd). In particular,
Definition 4.
The operator of an index and bit string flips the -th bit of . In particular, we have the following, where is logical negation,
With these two operations in hand, we can now describe the relevant type of (quantum) data structure for encoding fermionic states. Intuitively, we would like to represent a bit string in such a way that both and queries can be implemented efficiently. Furthermore, in the settings we will care about we will be promised that the Hamming weight of (the number of ’s) will never exceed or subceed , for some and constant (see the full version for more discussion). We use the notation to denote the Fock space of an -mode system of fermions, restricted to states with occupation between and : we call this range the capacity. We use the notation to denote the Hilbert space of qubits.
Definition 5.
A fermion data structure of size and capacity is a qubit representation of Fock states with modes and occupation at most and at least , i.e. a linear and invertible mapping that maps Fock states to computational basis states. We denote as . We further require two -qubit quantum circuit families and , answering and queries respectively. Formally, we require
| (8) | |||||
| (9) | |||||
The gate/depth complexity of the above structure is the max gate count/depth, respectively, of the over all . The space complexity is – note that ancillas used in , are counted in this complexity, as they are circuits acting on exactly qubits.
We remark that we consider quantum circuit complexity as the relevant cost measure, which prevents us from using many standard data structures results. Classical results often use the cell probe model [12], which is based on a RAM machine that allows random access to data. This model may not capture complexity in a real world quantum computer [16]. This necessitates new data structures and new ideas, which will be the focus of this paper.
3.2 Properties of fermion data structures
We first observe a subtlety in Definition 5: the operation of is only required to be “correct” so long as the capacity is not exceeded. When one is interested in simulating a -local Hamiltonian on a system with exactly Fermions, then it often suffices to instantiate a Fermion data structure with capacity 777Note that this does incur some space overhead, but it is only an additive (if ) or (if ). In particular, it is straightforward to show that such a data structure can be used to instantiate a Trotterization scheme, or any simulation algorithm which relies on applying -local particle-preserving rotations generated by products of creation/annihilation operators. Intuitively, so long as we can “fit” the intermediate states necessary while performing these rotations, we will be able to perform any arbitrary sequence of rotations.
Proposition 6.
Let be a fermionic Fock state of fermions in modes, and be a sequence of -local fermionic rotations which preserve particle number, followed by a measurement in the Fock basis. If there is a fermion data structure of size and capacity , using space and gate complexity , then there is a qubit state on qubits and a quantum circuit of size such that measuring in the computational basis samples from the same distribution as (up to permuting bit-string labels).
Proof.
The initial state is simply the encoding . To construct the circuit , we will replace every gate of (which are of the form for -local, particle preserving ) with the corresponding encoded circuit for performing the rotation, as detailed in Section 2.3. Let us call this encoded circuit . Letting be some superposition of Fock states with fermions, then with a data structure of capacity we have the guarantee that
as corresponds to a sequence of and operations satisfying the necessary promises. Noting that will also have fermions by the hypothesis that preserves particle number, we can similarly perform this transformation for every following gate. Finally, by the invertibility of we will obtain the same final output distribution by measuring in the computational basis, up to decoding the bit-strings (i.e. some permutation on the labels).
Given the above discussion, the curious reader may note that our definition of fermionic data structures encodes all states of Hamming weight between and for some constant . This is redundant in that , and also that there are more states having Hamming weight between and than there are of Hamming weight exactly equal to . However, both of these redundancies result in negligible additive space overheads (either or depending on the regime). The conclusions we draw about space efficiency includes these overheads.
We remark that our encoding can also apply to some post-Trotter methods, e.g. certain linear combination of unitaries algorithms. We also remark for clarity that the encodings leading up to Footnote 3 will allow encoding every Fock state of occupation at most (though those leading up to Theorem 2 will only encode occupations through ).
4 Sorted List Fermion Data Structure
In this section, we describe a fermion data structure (Definition 5) based on storing a sorted list of pointers, rather than a full sparse string. While this encoding has some similarities to first-quantized encodings [26] and sparse oracle encodings [2], we emphasize that we present a generic second-quantized encoding capable of performing any -local particle preserving rotation generated by creation/annihilation operators in the described complexity. Furthermore, this encoding will lay the groundwork for our later, more efficient encodings.
Theorem 7.
There is a fermion data structure for strings of qubits having Hamming weight at most that uses qubits, with gate complexity .
We will constructively establish this theorem throughout Section 4.1 and 4.2 – in particular Lemma 9 and Lemma 10 demonstrate the requisite circuit complexities. An immediate corollary is that a similar statement holds for fermion encodings.
Corollary 8.
There exists a fermion encoding of an mode system having at most fermions which uses qubits such that any -local, particle preserving rotation can be implemented with gates.
4.1 Algebraic Definition
We formally define the state encoding function and give the algebraic properties it satisfies. Let be a binary string that is all ’s, except for a single at position (using -based indexing). Consider strings of the form
with . Define , where is the set of strings of Hamming weight at most , as
| (10) |
where is a placeholder for “no fermion”, and is the larger of any comparison with a non-. Concretely, we adopt the convention that is represented by a register of all ’s. We can interpret the output as a sorted array of elements, each element (also referred to as register) of size , and padded out to entries by ’s. We will now describe the action of sign-rank and bit-flip queries on this list.
-
1.
A query should apply a phase if there are an odd number of registers having values less than or equal to . Otherwise, it should act like the identity.
-
2.
A should insert a register into the list if it is not present, and otherwise delete . This operation should maintain sorted order, and act as described so long as both input and output states have Hamming weight less or equal to .
Observe that both of the aforementioned operations are reversible. This suffices to define a fermion data structure.
4.2 Efficient Circuits
We will utilize comparison circuits between unsigned integers as a black box. As described in Section 4.1, we will assume an upper limit on the number of pointers we will ever need to store, and therefore only utilize this many registers.
Lemma 9.
For the sorted list encoding described in Section 4.1, a query has a circuit of gates and ancilla.
Proof.
Such a circuit should induce a phase for every present (in the original bit string) before position . To achieve this, for each pointer register we compute , apply a to the outcome bit, then uncompute. Each comparison takes gates to compare size numbers, and there are comparisons to make; the overall circuit complexity is therefore .
Lemma 10.
For the sorted list encoding described in Section 4.1, a query has a circuit of gates and ancilla.
Proof.
Such a circuit should add a pointer to the list if there is none, otherwise it should remove the pointer . At a high level, we will do this in three steps.
-
1.
If exists, move it to the last register
-
2.
On the last register exchange and
-
3.
If the last register is , move it to the sorted position
To accomplish this reversibly, we first implement a reversible ordered-swap . This operator swaps two registers if one is and the other is . By chaining these together in ascending order, we will move to the end if it exists. Exchanging classical states can be easily done, then chaining more together in descending order will move to sorted order if it was at the end. The full circuit requires calls to subroutine , and each takes (from comparisons); exchanging two classical values on a register has negligible complexity. The overall complexity is therefore .
4.3 Lower Depth
A notable problem with the previously described encoding is the serial nature of the bit flip operator. In particular, the depth of the circuits as described is , primarily due to sequentially “bubbling” a targeted register to the end of the list when implementing a operation. In this section, we describe a modification using ancillas that allows exponentially smaller depth, . Further, the buffer register idea developed here will prove useful when lowering depth in our succinct construction.
To achieve depth, we will pad the encoded state with an between registers and on either end. We will refer to these as buffer registers, in contrast with logical registers representing pointers. We will also pad the start with a and the end with logical registers for convenience. Formally, consider strings of the form
where . Define as
| (11) |
where every other register is a buffer (coloured blue, but this is purely conceptual; the same data is stored in each). This leaves qubits, as the buffer registers are just a constant factor overhead. The correct action of and exactly mirrors that of Section 4 on the logical registers (excluding the initial padded ), except now we must also leave the buffer registers invariant after the computation is finished.
Lemma 11.
Under the list-with-buffers encoding described in Section 4.3, a query has a circuit of depth, gates, and ancilla.
Proof.
This operation can be done in a similar way to Section 4.2. We again apply a conditional phase to each logical register (note we do not do this on any buffer register, nor the padded at the beginning). The gate count follows from the analysis in Lemma 9, and one can see that the depth is fully determined by the depth of a comparison. By simple facts about comparator circuits, these can be done in depth using linearly many ancillae, so the overall depth is .
Lemma 12.
Under the list-with-buffers encoding described in Section 4.3, a query has a circuit of depth, gates, and ancilla.
Proof.
We are promised that whenever an insertion is made, the last element will be an . Conversely, whenever a deletion is made, the element added to the end will be an . This prevents us from needing to perform a full cycle, instead relying on the buffer registers to provide ’s wherever needed. At a high level, it suffices to do the following:
-
1.
Compute a flag depending on whether appears in the logical registers, and fan it out to all registers.
-
2.
If is not present (), insert at the buffer register between it’s immediate predecessor and successor.
-
3.
If is present, shuffle registers upwards one position, and move to it’s preceding buffer. Otherwise, shuffle all registers downwards one position, and move out of it’s preceding buffer.
-
4.
If was present (), remove from the buffer between ’s predecessor and successor.
-
5.
Uncompute .
Note that steps (2) and (4) do not need to explicitly be controlled by due to the assumed structure of the data. In step (3) however, the direction in which to shuffle depends on whether is present or not, so a light cone argument implies that the local operations must depend on whether is present. It is worth pointing out that, except for the fan-in/fan-out of , all operations are nearest-register in a one dimensional layout, which could aid implementation on a quantum computer with geometric constraints.
Using linearly many ancilla registers, a comparison between bit integers can be done in depth . Swaps between registers can be done in depth, the largest comparison is between bit integers, and a single bit can be fanned out to positions (one for each register) in depth . The total depth is therefore (or with unbounded fan-in and fan-out), using ancillae. Each register of size is acted on by only a constant number of comparison/swaps, so the gate complexity is .
5 Achieving Succinctness
Recall that the information theoretic limit for encoding fermions in modes is qubits. From Stirling’s approximation we have
so the encoding in Section 4.1 is redundant – for instance when , approximately half of the qubits are unnecessary. Here we present an encoding in which only a sublinear many qubits are unnecessary (there are known constructions that achieve the exact information theoretic minimum [14, 23], but the gate complexity becomes ). For the example of , this new encoding has only a negligible fraction of unnecessary qubits, i.e. it is roughly twice as space efficient as in Section 4. These techniques make crucial use of the fact that the list is not anti-symmetrized.
5.1 Succinct encoding
We formally state the main theorem of this section below.
Theorem 13.
There is a fermion data structure for strings of qubits having Hamming weight at most that uses qubits, with gate complexity .
Such an encoding is constructed in the remainder of this section, with Lemma 15 and Lemma 16 demonstrating that it satisfies the requisite efficiencies. Similar to Corollary 8, this implies a fermion to qubit mapping with the same complexities.
Corollary 14.
There exists a fermion encoding of an mode system having at most fermions which uses qubits such that any -local, particle preserving rotation can be implemented with gates.
To reduce the number of necessary qubits, the key insight is noting that the most significant qubits in each register of the encoding in Section 4.1 are not pulling their weight. They use qubits to encode integers in the range to , but they are in sorted order, reducing the number of possible sequences – see Figure 1 for an illustration. We can instead store the same data (the most significant bits) in space as a bit string where zeroes delimit bins, and ones correspond to fermions. The -th bin is the space from the -th zero (or the start of the bit string) to the -st zero (or the end of the bit string), and the number of ones in that range indicate elements with most significant bits . This idea is commonly referred to as the stars and bars method.
The remaining least-significant bits can be stored in the usual way, where the order depends on the value determined by both least significant and most significant parts. So long as this order is maintained, the least-significant bits can be paired with the corresponding most-significant bits by the order in which they appear. This saves qubits and adds many, so the total qubit usage is
To define the encoding formally, for strings of the form
for , let denote the most significant bits of , and denote the remaining least significant bits. Let be the number of pointers having most significant bits equal to , i.e. the number of values of such that . Now define as
| (12) |
Where is a conceptual divider between information about the most and least significant bits, and denotes many ’s. The bits to the left of store the least significant bits of each pointer, and are referred to as or LSBs, and -th register in this section is . The bits to the right of are referred to as or MSBs and store the most significant bits of each pointer. Define as the unique linear extension of . A simple example of this encoding is shown in Figure 2.
For correctness, it suffices if encoded and operators satisfy the rules described in Section 4.1, on the list implicitly represented by our succinct string. In particular, the encoded operator should unitarily insert/delete from the sorted list defined by the information stored in the MSBs and LSBs, and update this data accordingly. The operator should apply a minus phase if and only if there are an odd number of elements less or equal to in the sorted list.
5.2 Efficient circuits
We now turn to constructing efficient circuits for the necessary operations on this succinct encoding. We note that retaining our space complexity advantage limits the number of ancillas that can be used to perform our operations to be (and, naturally, we require these ancillas to be uncomputed by the end of each operation).
Lemma 15.
Under the succinct list encoding described in Section 5.1, a query has a circuit of gates, and ancilla.
Proof.
At a high level, this operation can be performed as follows:
-
1.
Scan the most significant bits to determine a range of least significant bit registers whose most significant bits match
-
2.
Use this range to implement comparisons on all registers
-
3.
Phase the result of this comparison with a gate
-
4.
Uncompute comparisons, then and
Scanning the register takes iterations costing each. Each comparison afterwards costs gates, and there are many to make, so the total gate complexity is . The only space used beyond comparisons are registers of size , satisfying the ancilla requirement.
Lemma 16.
Under the succinct list encoding described in Section 5.1, a query has a circuit of gates, and ancilla.
Proof.
Comparisons require information from the most significant bits, which is gathered first. Following this, analogous to the approach in Lemma 10 we will bubble the target element to the end if present, exchange with , and then bubble back. At a high level:
-
1.
Compute and store a pointer to the target position in the list of elements, defined as the first register with value (based on both it’s most and least significant bits).
-
2.
Compute a flag , which is on if and only if is present in the list.
-
3.
If , shuffle to the end of .
-
4.
Exchange on the last register of .
-
5.
If not , shuffle the end of to .
-
6.
If , shuffle the -th bit of to the end
-
7.
If not , shuffle the last bit of to the -th position.
-
8.
Uncompute and .
Steps (1) and (2) can be done in gates by computing temporary ranges of indices in which have the same most significant bits as , implementing comparisons using these, then uncomputing. Steps (3), (4), (6), (7) are simple swap ladders which can be performed in gates, and Step (5) has negligible complexity. Step (8) has the same cost as steps (1), (2), so the overall gate complexity is . Again, the only additional space stored is size pointers and , satisfying the ancilla requirement.
6 Applications
In this section we give a more detailed comparison of our encoding to prior encodings, and outline scenarios where ours outperforms prior work. We will focus on the succinct construction, e.g. Footnote 3, as it is likely the more practical of the two constructions.
For concreteness we consider the parameter regime where the number of fermions is polynomially smaller than the number of modes, i.e. for some constant , though we note that our encoding is efficient outside this regime as well. This regime is well motivated for applications such as quantum chemistry, where the number of modes is preferred to be as large as possible to accurately model the continuum, but algorithm’s polynomial scaling with prevents from being exponentially larger than .
The primary application we find is in randomized simulation algorithms such as qDRIFT [9], where our encoding gives a polynomial space savings with only logarithmic depth overhead. We also show that our encoding allows for an optimal implementation of a second quantized SELECT subroutine, used in linear combination of unitary methods [10], no matter how and relate.
6.1 Space Efficient Randomized Simulation
Randomized product formulas like the qDRIFT algorithm [9] are strong candidates where our encoding will be useful, as the complexity of such algorithms depend heavily on the fermion encoding used. The qDRIFT algorithm requires fermionic rotation operators to evolve for time within error , where is the sum of the magnitude of Hamiltonian coefficients when written in a second quantized basis. The scaling with is preferable to scaling with when the magnitude of coefficients varies drastically, as is often the case for quantum chemistry Hamiltonians.
Theorem 17.
For a particle preserving local fermionic Hamiltonian on an mode system, there is a second quantized algorithm for evolving an fermion state to time using space , with gate complexity , and circuit depth , where denotes the sum of magnitudes of coefficients in and denotes the target diamond-norm error.
This theorem follows straightforwardly from using the qDRIFT algorithm [9] with our Footnote 3 In the regime discussed above, the space complexity of this algorithm is
with gate complexity
and circuit depth
We now compare these complexities against those achieved by other second-quantized encodings in our parameter regime.
6.1.1 Space Complexity
The most space-efficient prior second quantized encodings in this regime that are amenable to randomized simulation methods are the qubit efficient [23] and permutation basis [14], but these encodings would incur an exponential () gate and depth overhead. Barring these encodings, the next best are the segment code [25, 24], and the optimal degree code [19]. We use polynomially less space than the former ( vs. ) and quadratically less than the latter ( vs. ).
6.1.2 Circuit Complexity
When , the prior best second quantized encoding in terms of space usage (barring codes with exponential gate overhead) is the optimal degree code [19]. Compared to this encoding, along with better space efficiencies we also improve on the gate complexity of fermion operations. Our scaling of (with ) is always quadratically better in dependence on , and at least four powers better in dependence on . Further, while the depth is not analyzed in the optimal degree encoding a simple counting argument implies that it is at least , which is at most a negligible better than our encoding. Compared to other space efficient second-quantized encodings, we give at least a quadratic improvement in circuit complexity while also removing many log factors.
Allowing space inefficient encodings, the most gate efficient prior encoding in our regime is the Bravyi-Kitaev encoding [7], which uses gates to implement a fermionic rotation. This is the encoding used in the original resource estimates for the qDRIFT algorithm, making it a natural competitor. When the order of fermionic rotations is selected randomly, the Bravyi-Kitaev encoding of these operators cannot be significantly parallelized. The depth for full simulation will generically be (and potentially larger if fermion operations take super-constant depth to implement), which is only a logarithmic factor lower than in our encoding. Furthermore, the Bravyi-Kitaev encoding requires polynomially more qubits ( versus ) than our encoding in this regime – though fewer gates ( versus ). This trade-off is therefore more beneficial the smaller is.
6.2 Optimal SELECT Subroutine
In the context of post-Trotter methods, our encoding method can be relevant not only for saving space but also for saving gates. We illustrate this by giving a provably optimal implementation of the SELECT subroutine, a key component in the linear combination of unitaries algorithm for Hamiltonian simulation [10]. This algorithm involves expressing the Hamiltonian as a linear combination of unitaries
then block encoding the Hamiltonian using a PREPARE oracle that creates a superposition over every number in , weighted by amplitude , in conjunction with as a so-called SELECT oracle. The SELECT oracle has a control wire indicating a number , and conditioned on performs the unitary on the physical state – this oracle is the only part whose implementation is dependent on the fermion encoding used. One way to split a -local second quantized fermionic Hamiltonian into a linear combination of unitaries is to split every into Majoranas . The operators are unitary, meaning the full Hamiltonian is now a linear combination of unitaries. Using our encoding, we can perform a SELECT oracle in the optimal complexity. Specifically, we show how to perform an -local product of Majorana operators, given index wires denoting which Majoranas appear in the product. This translates to a sequence of many and operations, so in particular it suffices to do a single or operator controlled on an index wire .
Theorem 18.
Using the encoding described in Footnote 3, we can perform a coherently controlled or with gates.
Proof.
Consider the fermion Hamiltonian
where every is a product of Majorana operators. When the fermionic Hamiltonian is -local, then every appearing in has -many Majorana operators. It follows that we can implement the action of within the encoding described in Footnote 3 with complexity . We can further coherently condition which is performed using a control register (see the full version for details), introducing at most a constant factor overhead. For this SELECT oracle we therefore obtain circuits of size . Note that in general there are many ways to split a Hamiltonian into a linear combination of unitaries, and we leave to future work whether SELECT has an efficient implementation under alternative choices.
As argued above, this is sufficient to implement a SELECT oracle in the same complexity. We now turn to lower bounds.
Theorem 19.
Using any fermion to qubit mapping, a coherently controlled, second-quantized, -local particle preserving fermion operation (a SELECT oracle) requires gates.
Proof.
The lower bound for representing fermions in modes is qubits, due to a straightforward counting argument. Suppose there were a generic implementation of the second quantized SELECT oracle of the aforementioned kind which used one- and two-qubit gates, and implemented any -local fermion term for a . It follows that such an oracle would act on at most qubits, so consider keeping only the qubits it acts on. We are then left with a fermion encoding on qubits, as by assumption the SELECT oracle is capable of performing arbitrary pairs of Majorana operators; a contradiction. Hence, any generic implementation of the SELECT oracle requires gates, matching our upper bound up to constant factors.
To compare this result against existing second quantized encodings, note that in all prior encodings (summarized in Table 1) the complexity of a coherently controlled fermion operator is at least linear in the number of qubits, or exponential in the case of prior succinct encodings. For every gate-efficient encoding, the number of qubits is polynomially larger than in our regime , from which it follows that the gate complexity is at least polynomially larger than . Concretely, when the best prior implementation of the select oracle is the optimal degree encoding, with gate complexity . Our implementation of complexity where is quadratically better in dependence, and at least four powers better in dependence. We note also that in the parameter regime our encoding maintains at least a factor advantage in gate complexity over prior work, giving a polynomial advantage over the whole regime.
6.3 Comparison to First Quantized Encodings
First quantized algorithms maintain a list of pointers representing fermion positions similar to the encoding described in Section 4, but antisymmetrize the state over all possible permutations. The fermion phases then arise from the exchange statistics of the registers, allowing for a different class of efficient operations. Comparisons against first quantization are subtle, as algorithms within these two paradigms can have drastically different complexities for simulating similar systems. In general one would expect first quantized algorithms to outperform second quantized algorithms when is extremely small compared to , but there is evidence that second quantized algorithms can remain advantageous when is polynomially smaller than [27]. This motivates the parameter regime we consider here.
6.3.1 Space Complexity
Using Stirling’s approximation we can rewrite
| (13) |
In our parameter regime of interest, we therefore have
| (14) |
Note that the term is asymptotically less than the term, and as a corollary the asymptotic space usage of our encoding () is a factor from optimal, i.e. it is succinct. Standard first-quantized encodings [26] use , which is asymptotically a factor above , which is not succinct. Our encodings saves more space the closer is to .
6.3.2 Gate Complexity
Both our representation and first-quantized representations support efficient (i.e. at most linear in the number of qubits) fermion operations of the first-quantized or second-quantized variety, respectively. Differences in gate complexity, therefore, stem primarily from differences in algorithms built in a first-quantized versus second-quantized picture. Many of the algorithms in these different paradigms are designed for different contexts, making a fair comparison difficult.
7 Conclusion and Open Problems
We presented two second-quantized fermion encodings which are almost exactly optimal in terms of space usage, yet allows gate efficient and low depth second-quantized fermion rotations. In the context of randomized simulation algorithms, the succinct encoding allows for a polynomial space savings with only a logarithmic depth overhead. Along the way, we presented a more simple succinct encoding which did not achieve low depth, as well as a low depth encoding that did not achieve succinctness, though both of these encodings may be of independent interest due to their simplicity. This work leaves open the following questions.
-
1.
In first quantization, a list of positions is stored in an antisymmetrized wavefunction with qubits in standard encodings, allowing for efficient first quantized fermion operations. Can such a representation be made succinct while still antisymmetrizing?
-
2.
Is there an efficient fermionic Fourier transform circuit for our encodings?
-
3.
Can the qubit count be improved beyond without exceeding gate complexity ? We conjecture a lower bound on the qubits required to maintain this gate complexity is .
-
4.
When compiled to a universal gate set like , the complexities of each gate is the same as the overall complexity in our encodings. In many error correcting codes certain gates are harder than others (for instance gates are more expensive in a surface code), motivating analysis of each gate individually. Can the number of gates be reduced in this construction?
-
5.
Can the degree of the circuit complexity scaling in our implicit encoding be improved?
References
- [1] Ryan Babbush, Dominic W. Berry, Jarrod R. McClean, and Hartmut Neven. Quantum simulation of chemistry with sublinear scaling in basis size. npj Quantum Information, 5(1):92, November 2019. doi:10.1038/s41534-019-0199-y.
- [2] Ryan Babbush, Dominic W Berry, Yuval R Sanders, Ian D Kivlichan, Artur Scherer, Annie Y Wei, Peter J Love, and Alán Aspuru-Guzik. Exponentially more precise quantum simulation of fermions in the configuration interaction representation. Quantum Science and Technology, 3(1):015006, December 2017. doi:10.1088/2058-9565/aa9463.
- [3] D. W. Berry, A. M. Childs, and R. Kothari. Hamiltonian simulation with nearly optimal dependence on all parameters. In 2015 IEEE 56th Annual Symposium on Foundations of Computer Science (FOCS), pages 792–809, Los Alamitos, CA, USA, October 2015. IEEE Computer Society. doi:10.1109/FOCS.2015.54.
- [4] Dominic W. Berry, Andrew M. Childs, Richard Cleve, Robin Kothari, and Rolando D. Somma. Simulating hamiltonian dynamics with a truncated taylor series. Phys. Rev. Lett., 114:090502, March 2015. doi:10.1103/PhysRevLett.114.090502.
- [5] Dominic W. Berry, Andrew M. Childs, Yuan Su, Xin Wang, and Nathan Wiebe. Time-dependent Hamiltonian simulation with -norm scaling. Quantum, 4:254, April 2020. doi:10.22331/q-2020-04-20-254.
- [6] Sergey Bravyi, Jay M. Gambetta, Antonio Mezzacapo, and Kristan Temme. Tapering off qubits to simulate fermionic Hamiltonians, 2017. arXiv:1701.08213.
- [7] Sergey B. Bravyi and Alexei Yu Kitaev. Fermionic Quantum Computation. Annals of Physics, 298(1):210–226, May 2002. doi:10.1006/aphy.2002.6254.
- [8] Harry Buhrman, Bruno Loff, Subhasree Patro, and Florian Speelman. Memory compression with quantum random-access gates. In Theory of Quantum Computation, Communication, and Cryptography, 2022. URL: https://api.semanticscholar.org/CorpusID:247411405.
- [9] Earl Campbell. Random compiler for fast Hamiltonian simulation. Phys. Rev. Lett., 123:070503, August 2019. doi:10.1103/PhysRevLett.123.070503.
- [10] Andrew M. Childs and Nathan Wiebe. Hamiltonian simulation using linear combinations of unitary operations. Quantum Info. Comput., 12(11–12):901–924, November 2012. doi:10.26421/QIC12.11-12-1.
- [11] Charles Derby, Joel Klassen, Johannes Bausch, and Toby Cubitt. Compact fermion to qubit mappings. Phys. Rev. B, 104:035118, July 2021. doi:10.1103/PhysRevB.104.035118.
- [12] Anna Gál and Peter Bro Miltersen. The cell probe complexity of succinct data structures. Theoretical Computer Science, 379(3):405–417, 2007. Automata, Languages and Programming. doi:10.1016/j.tcs.2007.02.047.
- [13] Craig Gidney. Quantum dictionaries without QRAM, 2022. arXiv:2204.13835.
- [14] Brent Harrison, Dylan Nelson, Daniel Adamiak, and James Whitfield. Reducing the qubit requirement of Jordan-Wigner encodings of -mode, -fermion systems from to , November 2022. arXiv:2211.04501.
- [15] Guy Joseph Jacobson. Succinct static data structures. PhD thesis, Carnegie Mellon University, USA, 1988. AAI8918056.
- [16] Samuel Jaques and Arthur G. Rattew. Qram: A survey and critique, 2023. arXiv:2305.10310.
- [17] P. Jordan and E. Wigner. On the Paulian prohibition of equivalence. Z. Physik, 47:631–651, 1928. doi:10.1007/BF01331938.
- [18] Ivan Kassal, Stephen P. Jordan, Peter J. Love, Masoud Mohseni, and Alán Aspuru-Guzik. Polynomial-time quantum algorithm for the simulation of chemical dynamics. Proceedings of the National Academy of Sciences, 105(48):18681–18686, 2008. doi:10.1073/pnas.0808245105.
- [19] William Kirby, Bryce Fuller, Charles Hadfield, and Antonio Mezzacapo. Second-quantized fermionic operators with polylogarithmic qubit and gate complexity. PRX Quantum, 3:020351, June 2022. doi:10.1103/PRXQuantum.3.020351.
- [20] Guang Hao Low and Isaac L. Chuang. Optimal hamiltonian simulation by quantum signal processing. Phys. Rev. Lett., 118:010501, January 2017. doi:10.1103/PhysRevLett.118.010501.
- [21] Guang Hao Low and Isaac L. Chuang. Hamiltonian Simulation by Qubitization. Quantum, 3:163, July 2019. doi:10.22331/q-2019-07-12-163.
- [22] Gonzalo Navarro. Compact Data Structures: A Practical Approach. Cambridge University Press, 2016.
- [23] Yu Shee, Pei-Kai Tsai, Cheng-Lin Hong, Hao-Chung Cheng, and Hsi-Sheng Goan. Qubit-efficient encoding scheme for quantum simulations of electronic structure. Phys. Rev. Res., 4:023154, May 2022. doi:10.1103/PhysRevResearch.4.023154.
- [24] Mark Steudtner. Methods to simulate fermions on quantum computers with hardware limitations. PhD thesis, Leiden University, 2019.
- [25] Mark Steudtner and Stephanie Wehner. Fermion-to-qubit mappings with varying resource requirements for quantum simulation. New Journal of Physics, 20(6):063010, June 2018. doi:10.1088/1367-2630/aac54f.
- [26] Yuan Su, Dominic W. Berry, Nathan Wiebe, Nicholas Rubin, and Ryan Babbush. Fault-tolerant quantum simulations of chemistry in first quantization. PRX Quantum, 2:040332, November 2021. doi:10.1103/PRXQuantum.2.040332.
- [27] Yuan Su, Hsin-Yuan Huang, and Earl T. Campbell. Nearly tight Trotterization of interacting electrons. Quantum, 5:495, July 2021. doi:10.22331/q-2021-07-05-495.
- [28] Matthias Troyer and Uwe-Jens Wiese. Computational complexity and fundamental limitations to fermionic quantum monte carlo simulations. Phys. Rev. Lett., 94:170201, May 2005. doi:10.1103/PhysRevLett.94.170201.
- [29] F Verstraete and J I Cirac. Mapping local Hamiltonians of fermions to local Hamiltonians of spins. Journal of Statistical Mechanics: Theory and Experiment, 2005(09):P09012, September 2005. doi:10.1088/1742-5468/2005/09/P09012.
- [30] James D. Whitfield, Vojtěch Havlíček, and Matthias Troyer. Local spin operators for fermion simulations. Phys. Rev. A, 94:030301, September 2016. doi:10.1103/PhysRevA.94.030301.
