Symmetry-adapted encodings for qubit number reduction by point-group and other Boolean symmetries

A symmetry-adapted fermion-to-spin mapping or encoding that is able to store information about the occupancy of the n spin-orbitals of a molecular system into a lower number of n − k qubits in a quantum computer (where the number of reduced qubits k ranges from 2 to 5 depending on the symmetry of the system) is introduced. This mapping reduces the computational cost of a quantum computing simulation and at the same time enforces symmetry constraints. These symmetry-adapted encodings (SAEs) can be explicitly seen as a block-diagonalization of the Jordan–Wigner qubit Hamiltonian, followed by an orthogonal projection. We provide the form of the Clifford tableau for a general class of fermion-to-qubit encodings, and then use it to construct the map that block-diagonalizes the Hamiltonian in the SAEs. The algorithm proposed does not require any further computations to obtain this map, which is derived directly from the character table of the molecular point group. An implementation of the algorithm is presented as an open-source Python package, QuantumSymmetry, a user guide and code examples. QuantumSymmetry uses open-source quantum chemistry software PySCF for Hartree–Fock calculations, and is compatible with quantum computing toolsets OpenFermion and Qiskit. QuantumSymmetry takes arbitrary user input such as the molecular geometry and atomic basis set to construct the qubit operators that correspond in the appropriate SAE to fermionic operators on the molecular system, such as the second-quantized electronic structure Hamiltonian. QuantumSymmetry is used to produce numerical examples of variational quantum algorithm simulations to find the ground state energy for a number of example molecules, for both Unitary Coupled Clusters with Singles and Doubles and Adaptive Derivative Assembled Pseudo-Trotter Variational Quantum Eigensolver ansätze. We show that, beyond the advantage given by the lower qubit count, the proposed encodings consistently result in shallower and less complex circuits with a reduced number of variational parameters that are able to reach convergence faster and without any loss of computed accuracy.


Introduction
Quantum computers store information in the form of quantum bits (qubits): a single qubit spans a Hilbert space of infinitely many possible states (isomorphic to the complex projective line CP 1 , the Bloch sphere). By harnessing quantum properties of matter such as superposition and entanglement, quantum computers hold the promise to solve certain complex problems classical computers will never be able to [1,2]. However, even

The JW molecular Hamiltonian
In second quantization, the nonrelativistic electronic molecular HamiltonianĤ can be written as [23]: where the coefficients h pq and h pqrs are known as the one-electron integrals and the two-electron integrals respectively, and are evaluated from the molecular spin-orbitals; the term h nuc is an overall constant in the Figure 1. The commutative diagram shows the action of a symmetry-adapted encoding on a fermionic operator: (a) first, as a map from the infinite-dimensional nonrelativistic Born-Oppenheimer molecular electronic Hamiltonian to a finite-dimensional second-quantized operator written in terms of fermionic creation and annihilation operators; and then mapping it to qubit operators of the same dimensionality by the Jordan-Wigner encoding. (b) Secondly, as conjugation of the Jordan-Wigner qubit operator by a Clifford operatorĈ that corresponds to a permutation or reordering of the 2 n computational basis states of n qubits, where the 2 n−k states in the target eigensector are mapped to the first 2 n−k computational basis states. The action of the Clifford operator on an operator that is symmetric with respect to the Boolean symmetries is a block-diagonalization in the computational basis, where each block corresponds to one of the 2 k different simultaneous eigenspaces of the Boolean symmetries. (c) Finally, as conjugation by the orthogonal projection operatorP, which keeps the first 2 n−k computational basis states and discards the other ones, mapping n-qubit operators to (n − k)-qubit operators. The operator shown is the Hamiltonian for the hydrogen molecule (H2) in a minimal basis, shown in its matrix form in the computational basis in the four-qubit Jordan-Wigner encoding and in the one-qubit symmetry-adapted encoding. In the visualization, the hue of a square corresponds to the phase of the corresponding matrix element, and the brightness to its magnitude: red squares correspond to positive real matrix elements, cyan squares to negative real matrix elements, and black squares to zero elements.
fixed nuclei approximation and is due to the repulsion between the positively charged nuclei of the molecule. a † j andâ j denote (respectively) the creation operator and annihilation operator acting on the jth spin orbital.
In the JW mapping spin-orbitals are mapped one-to-one to qubits in the most straightforward way: for a computational basis state, the jth qubit is in state |1⟩ if the jth spin-orbital is occupied, and in state |0⟩ if it is unoccupied.
To write down the qubit representation of the molecular Hamiltonian in the JW basis it is enough to know the qubit operators corresponding to the fermionic operatorsâ † j andâ j (this will not be the case, however, for the symmetry-adapted encodings).
The Pauli Z, X and Y operators act on the computational basis as: Then we have:â † j → where the Pauli Z operators on qubits j − 1 to 0 enforce the fermionic sign rule. This allows us to write down all of the terms of the qubit representation of the Hamiltonian in the JW basis. For example, the JW encoding maps the number operatorN j (whose eigenvalue +1 corresponds to those states that have an electron in the jth spin orbital, and 0 to states that do not) asN j =â † jâ j → 1−Z j 2 .

Molecular point groups, Boolean groups and their character tables
If a water molecule is rotated by 180 • around its principal axis its two hydrogen atoms exchange places, but the resulting geometry is indistinguishable from the one before the rotation was performed: in this sense, the 180 • rotation around the principal axis C 2 (z) is a symmetry of the water molecule (where we have set according to the usual convention the z-axis to coincide the principal axis, the y-axis to lie on the plane of the molecule, and the x-axis to be perpendicular to it). The geometrical symmetries of the water molecule form what is known as its point group. A point group is a group in the mathematical sense [24][25][26]. The four point group symmetries for the water molecule are shown in figure 2. Its point group is known as the C 2v point group. Each point-group symmetry in C 2v repeated twice gives the identity (for instance C 2 (z) × C 2 (z) = E): C 2v is a Boolean group. A Boolean group is a group where every element is of order 2 (that is, every element is its own inverse). The only eight Boolean molecular point-groups are C 1 , C s , C 2 , C i , C 2v , C 2h , D 2 and D 2h . They must all be Abelian, because every Boolean group is Abelian (although they are not the only Abelian point groups: for instance, the group C n for n > 2 is Abelian, but it is not Boolean).
From a mathematical perspective, these are just four different groups: C 1 is the trivial group, C s , C 2 and C i are all isomorphic to the group Z 2 (the only group of two elements), C 2v , C 2h and D 2 are all isomorphic to the Klein-four group Z 2 2 = Z 2 × Z 2 , and D 2h is isomorphic to the group Z 3 2 = Z 2 × Z 2 × Z 2 . In general, every finite Boolean group is isomorphic to a power of Z 2 (where multiplication is the direct product of groups), and because point groups only act on objects in (at most) three dimensional space, the maximum such power for a point-group is 3 (corresponding to the group D 2h ).
Quantum chemistry software generally works with Boolean groups, and often perform a descent in symmetry to the largest Boolean subgroup of the molecular point group. For instance, the ammonia (NH 3 ) molecule is in the C 3v point group, which is not Boolean: its Boolean subgroup C s will be used in its place in forming symmetry-adapted molecular orbitals. An advantage of this is that for a Boolean group molecular orbitals, constructed as symmetry-adapted linear combinations of atomic orbitals, can naturally be expressed as purely real (instead of complex) functions.
There are two further Boolean symmetries that we are going to be interested in, beyond the point-group ones. In the usual nonrelativistic treatment of molecular system, which ignores effects like the spin-orbit interaction, the operators for the number of electrons with spin up (N ↑ ) and down (N ↓ ) are also symmetries of the Hamiltonian. Then so are the parity operatorsP ↑ andP ↓ defined by: If we multiply them together, these two parity symmetries generate the total electron number parity operator P =P ↑P↓ = (−1)N, forming a group that is also isomorphic to the Klein four-group Z 2 2 . Together, the Boolean point group symmetries and the parity operators form a larger Boolean group, which we are going to refer to as the full Boolean group for the molecule, and that is isomorphic to Z k 2 , where k = 2, 3, 4, 5 is the number of independent generators of the group.
While the geometry of the molecule itself is, by the definition of the point-group, left unchanged by the action of any point-group symmetry, its molecular orbitals might change when acted upon by a point-group symmetry. For a Boolean point group the molecular orbitals can be defined so that there are only two possibilities: either the orbital is symmetric with respect to a point group element (it stays unchanged) or it is antisymmetric with respect to it (it acquires a phase of −1). Each symmetry-adapted orbital is in an (irreducible) representation of the point group, and for a Boolean group knowing which representation it is in amounts to the same as knowing whether the orbital is symmetric or antisymmetric with respect to each point group symmetry. In this sense, Boolean groups are a class of particularly simple groups: for a general Abelian group, there are more possibilities than these two, corresponding to the symmetry-adapted orbitals acquiring complex phases (given by roots of unity); for a non-Abelian group, there are degenerate irreducible representation, and the symmetry-adapted orbitals in the same representations will mix upon the action of a symmetry element.
Information on the behaviour of the symmetry-adapted orbitals can be found in the group's character table [27]. For example, the character table for the point group C 2v , the point group of the water molecule (a Boolean group), is given in figure 3. The water molecule (H2O) and its four point-group symmetries, which form the point-group group C2v (isomorphic to the Boolean group Z 2 2 ): these are the identity element E (which is equivalent to not doing anything at all), the rotation by 180 • along the z-axis C2(z) (shown as a green line in the diagram), the reflection across the xz-plane σ(xz) (blue plane), and the reflection across the yz-plane σ(yz) (red plane). Character table for the point-group group C2v: each column corresponds to a conjugacy class (for an Abelian group, this is the same as the elements of the group: in this case the identity E, the rotation C2(z), and the two reflections σv(xz) and σv(yz)); each row corresponds to an irreducible representation (A1, A2, B1 and B2). As the group C2v is Boolean, every entry in its character table is either 1 or −1.
A representation of a group is a map that sends the group elements to linear transformations on a vector space, in a way that respects the group operation (it is a group homomorphism). A representation is irreducible if those linear transformations do not leave any nontrivial linear subspace of the vector space invariant. Although this is not in general the case, for finite-dimensional groups (like the ones we are interested in) this is equivalent to the claim that any representation of the group that is not one of its irreducible representations can be decomposed into a direct sum of irreducible representations [28][29][30].
The group elements are naturally partitioned into conjugacy classes. For Abelian groups (including Boolean groups), each element forms a conjugacy class of its own, and we can take the columns to refer to the point group elements. Each row of the character tables corresponds to an irreducible representation of the point group.
The character of a group element under a representation is the trace of the corresponding matrix in the representation. Each entry of the character table corresponds to the character of conjugacy classes (the corresponding column) under the irreducible representations (the corresponding row). For an Abelian group all irreducible representations are one-dimensional: the characters on the character table for an Abelian group are the same as the images of its elements under the irreducible representations. For a Boolean group each element must square to the identity, and the characters can then only be either 1 or −1.

Boolean symmetries in the JW representation
Boolean point-group symmetries have a particularly simple form in the JW basis, as long as the qubits represent symmetry-adapted molecular spin-orbitals (as an example, the symmetry-adapted molecular orbitals for the water molecule are shown in figure 4). We present a straightforward rule to construct them: one just needs to look up the column corresponding to that point group element in the character table for the relevant symmetry group. A symmetry will act as a Pauli Z on the jth qubit if the corresponding spin-orbital is in a representation that is antisymmetric with respect to that symmetry (corresponding to a value of −1 in the character table), and it will act as the identity if it is in a representation that is symmetric with respect to that symmetry (a value of +1 in the character table). The resulting qubit operator has its +1 eigenspace spanned by the computational basis states corresponding to Slater determinants that are symmetric under that symmetry (those that have an even number of antisymmetric spin-orbitals in them), and its −1 eigenspace spanned by the computational basis states corresponding to Slater determinants that . Isosurfaces for the molecular orbitals of the water molecule (H2O) in a minimal basis constructed as symmetry-adapted linear combinations of atomic orbitals, in order of ascending energy starting from the right (this follows the convention that will be used for the rest of the article). The orbitals are named by the irreducible point group (C2v) representation they lie in (in this case A1, B1 and B2). Of the 2 14 = 16 384 possible Slater determinants that can be formed from the molecular orbitals, exactly 2 12 = 4096 lie in each of the four irreducible representations: for instance the four computational states corresponding to the configuration 2b21b13a 2 1 1b 2 2 2a 2 1 1a 2 1 all lie in the A2 irreducible representation. Each of the seven molecular orbitals corresponds to two spin-orbitals, each of which in turn corresponds to a qubit in the JW encoding, for a total of 14 qubits. In the symmetry-adapted encoding for the water molecule this number is reduced to 10 qubits.

Figure 5.
In the Jordan-Wigner encoding, where each qubit corresponds to a spin-orbital given by the symmetry-adapted linear combinations of molecular orbitals, the qubit operators corresponding to Boolean symmetries have a particularly simple form. We see that the three non-identity elements of the point-group C2v are mapped to a (tensor) product of Pauli Z operators acting on the orbitals that are antisymmetric with respect to them, using the information contained in the point-group character table that was given in figure 3. It is easy to see that the group operation is respected by the mapping, as for example the product of symmetry operators C2(z) × σv(xz) = σv(yz) is mirrored by the product of qubit operators Z13Z12Z9Z8Z5Z4 × Z13Z12Z5Z4 = Z9Z8. Finally, the two parity operators P ↑ and P ↓ are mapped to Pauli Z operators on those qubits that correspond to spin-up and spin-down spin-orbitals respectively.
are antisymmetric under that symmetry (an odd number of antisymmetric spin-orbitals). This simple rule allows one to construct the qubit representations of Boolean point group symmetries just from knowledge of the point group character table.
For example, in the character table for the point group D 2h the 180 • rotation along the y-axis C 2 (y) is symmetric with respect to orbitals in the A g irreducible representation (a value of +1 in the character table), but antisymmetric with respect to orbitals in the B 1u irreducible representation (a value of −1 in the character table). If in a simulation for the hydrogen molecule (H 2 ) in the minimal basis the third, second, first and zeroth qubit correspond respectively to the 1b 1u↓ , 1b 1u↑ , 1a g↓ and 1a g↑ spin-orbitals, the qubit operator corresponding to the rotation C 2 (y) will be Z 3 Z 2 .
Number parity symmetries have a similar form as Pauli Z operators as well: in the JW basis, the operator P ↑ corresponds to Pauli Z operators on half of the qubits, the ones that correspond to the spin-orbitals with spin up, andP ↓ will correspond to Z operators on the other half (the qubits corresponding to the spin-orbitals with spin down).
A marginally more involved example for the qubit form of symmetry operators, for the water molecule (H 2 O) in the minimal basis, is shown in figure 5.
For example, in the same qubit assignment as given before,P ↑ corresponds to Z 2 Z 0 , andP ↓ , corresponds to Z 3 Z 1 .

The symmetry-adapted encoding of qubit states
Allowed states of electrons correspond to antisymmetrized products of spin-orbital functions (where the requirement for antisymmetrization with respect to interchange of the two electrons comes from the Pauli principle), the Slater determinants, and their linear combinations. In the JW encoding, computational basis states are in one-to-one correspondence to Slater determinants. A spin-orbital can only be either symmetric or antisymmetric with respect to a Boolean symmetry, and hence these are also the only two possibilities for a Slater determinant. In fact, a Boolean symmetry will partition the set of all possible Slater determinants (where each determinant is counted once irrespective of the overall phase, and we are considering all possible occupancies) in two: half of the determinants will be in the symmetric eigenspace of the symmetry, and the either half in the antisymmetric one. The Slater determinants that are symmetric with respect to the symmetry are the ones for which the number of occupied antisymmetric spin-orbitals is even, and the Slater determinants that are antisymmetric with respect to the symmetry are the ones for which it is odd. For the Boolean symmetry group Z k 2 , where k is the number of independent generators for the point group, this translates into a set of k constraints in the form of linear equations for the occupancies of the spin orbitals, where addition is taken modulo 2.
Formally, let: • g 0 , . . . , g k−1 be k independent generators of the Boolean symmetry group Z k 2 ; • A 0 , . . . , A k−1 be the sets of spin-orbitals that are antisymmetric with respect to the symmetry g 0 , . . . , g k−1 respectively; 1} be equal to 0 if the target irreducible representation is symmetric with respect to the symmetry g 0 , . . . , g k−1 respectively (there character in the corresponding entry of the character table +1) and 1 if it is antisymmetric with respect to it (−1 in the character table); • p 0 , . . . , p n−1 ∈ {0, 1} be the spin-orbital occupancies (equivalently, the qubit states for a computational basis state in the JW encoding).
We then have a set of k binary constraints each of the form: ⊕ where ⊕ denotes addition in modulo 2. This in turn means that the occupancies of k of the spin-orbitals in We will consider the example of H 2 in the minimal basis, where even qubits correspond to spin-orbitals with spin up and odd qubits to spin-orbitals with spin down, where the generators of the Boolean symmetry group Z 3 2 are P ↑ , P ↓ and C(y). The requirement that for the ground state there is an odd number of electrons with spin up (corresponding to the −1 eigenspace of the P ↑ symmetry) can be expressed in terms of the four spin orbital occupancies p 0 , p 1 , p 2 , p 3 as: (in the formalism of equation (5), the generator g 0 = P ↑ is antysimmetric with the set of spin-orbitals/JW qubits A 0 = {p 0 , p 2 }, and the target eigensector is the one for which c 0 = 1) Similarly, the requirement that there is an odd number of electrons with spin down (corresponding to the −1 eigenspace of the P ↓ symmetry) can be expressed as: Finally, the requirement that the ground state function is symmetric with respect to a rotation along the y-axis, where the z-axis lies along the bond (corresponding to the +1 eigenspace of the C(y) symmetry), means that the number of occupied spin-orbitals that are antisymmetric with respect to it is even: The three symmetry constraints together take the number of degrees of freedom of the occupancies of the spin-orbitals from four to one. We can set q ∈ {0, 1}, and then we have: For q = 0 we obtain the JW state |0011⟩, and for q = 1 the state |1100⟩. The first state is the Hartree-Fock (HF) state, and the second one is the doubly excited state with two electrons: these two states correspond to the only Slater determinants to appear in the full configuration interaction ground state for the hydrogen atom in the minimal basis. In fact, the symmetry-adapted encoding for the ground state eigensector of H 2 in the minimal basis leads to exactly this parameterization. A symmetry-adapted encoding for the hydrogen atom in the minimal basis can then be constructed as a mapping from the 4-qubit JW computational basis states to 1-qubit computational basis states, where the two states in the target eigensector are mapped as: And the component of states that lies outside of the target eigensector is projected out: This mapping reduces the dimensionality of Hilbert space from a four-qubit space to the space of a single qubit.
In general, by enforcing k independent Boolean symmetry conditions (corresponding to k independent Boolean symmetry generators) the symmetry-adapted encoding reduces the Hilbert space by k qubits.

The Clifford map for the symmetry-adapted encoding
The Clifford group is the group of unitary operators that map Pauli operators to Pauli operators by conjugation: that is, C is an element of the Clifford group if and only if C is an operator such for any element P of the Pauli group, P ′ = CPC † is also an element of the Pauli group.
The Clifford group is important for classical simulation of quantum computers and quantum error correction [1,31,32], as well as in quantum randomized benchmarking [33] and quantum tomography. Their investigation has recently led to an unexpected proof of quantum advantage [34].
In order to completely characterise (up to a unimportant overall phase) the Clifford operator C, it is enough to consider its action on the one-qubit Z and X operators (the action on one-qubit Y operators follows from Y = −iZX and preservation of multiplication, and similarly the action on Pauli operators acting on more than one qubit follows from the action on one-qubit Pauli operators). This is referred to as writing down the Clifford tableau for C [32].
An example of a Clifford tableau is given by: We are able to read off the action of a Clifford operator on any Pauli operator from its tableau. For example, we can see that the Clifford operator given maps More formally, the tableau of the Clifford operator C corresponds to a 2n × 2n binary matrix M (where the first n columns correspond to the images under the action of the Clifford operator on Z 0 , Z 1 , . . . , Z n and the last n columns correspond to the action on X 0 , X 1 , . . . , X n ), together with a 2 n dimensional binary vector s (where each entry corresponds to the sign of the corresponding column in the matrix: the image of each one-qubit Pauli picks up a factor of −1 if the corresponding entry of s equals 1, and it does not if it equals 0). The Clifford tableau for the example given is shown in figure 6.
In order to find the form of operators such as the qubit Hamiltonian in the symmetry-adapted encodings, we first perform a transformation from the JW states to an encoding where k of the n qubits correspond each Figure 6. The Clifford tableau for the example given by equation (12), where red squares correspond to a matrix element equal to 1 and white squares to 0, and the columns (rows) of the matrix M correspond to the Pauli operators Z0, Z1, Z2, Z3, X0, X1, X2, X3 from left to right (from top to bottom). The corresponding Clifford operator followed by a projection maps qubit operators in the Jordan-Wigner encoding to the corresponding symmetry-adapted encoding qubit operators, for the example of the ground state eigensector of H2 on a minimal basis.
to the parity of the set of qubits that are antisymmetric with respect to one of the k generators), and the remaining n − k non-redundant qubits are left unchanged. For the example from the previous section we let: where the first three qubits (q 0 , q 1 , q 2 ) specify the symmetry eigensector (symmetry qubits), whilst the last one (q 3 ) is left unchanged (nonredundant qubits). In particular, all states in the ground state eigensector have q 0 , q 1 and q 2 each in state |0⟩ (corresponding respectively to eigenstates −1, −1 and +1 for P ↑ , P ↓ and C(y)). Furthermore, we are able to recover the occupancy of all spin-orbitals in a given symmetry sector from knowledge of the state of the nonredundant qubits (q 3 in the example) only (as shown in equation (9)).
In what follows we consider the space Z n 2 of 2 n bitstrings of length n (which correspond to the computational basis states for the projective Hilbert space of n qubits CP 2 n −1 ). Formally, the map from |p 3 p 2 p 1 p 0 ⟩ to |q 3 q 2 q 1 q 0 ⟩ can be written as the action of an affine transformation C under the operation ⊕ of bitwise addition modulo 2 (XOR) on the space of bitstrings Z n 2 of the form: where the binary matrix T and the bitstring b for the example given can be read from equation (13) and are shown explicitly below (here red squares correspond to a matrix element equal to 1 and white squares to 0): The matrix T acts as a permutation of computational basis states linearly on the space of bitstrings Z n 2 (a stronger requirement than the usual sense of linearity on the Hilbert space of qubits CP 2 n −1 ). The vector |b⟩ acts to flip those qubits that correspond to a constraint with c i = 1.
For example, one can check that the map in equations (13) and (15) maps the state |0011⟩ to |0000⟩ and the state |1100⟩ to |1000⟩.
The affine map on bitstrings C naturally induces a linear operatorĈ on the whole Hilbert space of qubits CP 2 n −1 whose action on any element of the Hilbert space follows from the action on the computational basis states and from the linearity requirement. For example, the state 0.99361|0011⟩ − 0.11283|1100⟩ is mapped to the state 0.99361|0000⟩ − 0.11283|1000⟩ (where the rightmost three qubits correspond to information about which irreducible representation of the Boolean symmetry group the states lie in: if we then project these out we obtain a one-qubit state 0.99361|0⟩ − 0.11283|1⟩). ) .
This allows us to find the Clifford tableau, and consequently the form of qubit operators given their JW form, for any given such encoding. In particular, the tableau shown in figure 6 corresponds to our example of symmetry-adapted encoding for H 2 in a minimal basis.
The encoding thus obtained maps the k generators of the Boolean symmetry operators to one-qubit Pauli Z operators with a phase of +1 or −1 that depends on whether the target eigenspace for that operator is the +1 or −1 eigenspace, each acting on a different symmetry qubit. In our example we have: The result stated above also immediately yields the Clifford tableaux for the Bravyi-Kitaev encoding (shown in figure 7), which allow an alternative derivation of the form of qubit operators in those encodings to the one given in the literature [20,21,35].

Operators in the symmetry-adapted encoding
A 2 n -dimensional linear operatorM can be written with respect to a Boolean operatorB (an operator which has half of its eigenvalues equal to +1 and the other half equal to −1) of the same dimensionality in terms of a commuting part and an anticommuting part:M whereB andM C commute (BM C =M CB ), andB andM A anticommute (BM A = −M AB ). One can pick a basis whereB is a one-qubit Z Pauli operator. Any 2 n -dimensional linear operatorM can be written as a linear combination of Pauli operators in that basis, its Pauli expansion. Each Pauli operator in turn either commutes or anticommutes withB. The sum of the Pauli terms that commute withB give the commuting partM C , and the sum of the Pauli terms that anticommute withB give the anticommuting part A. IfM itself commutes withB (such is the case ifM is the Hamiltonian,B one of its Boolean symmetries) we haveM =M C andM A = 0.
For a general operatorM that does not commute with each of the Boolean symmetries, the map from operators in the JW basis to the symmetry-adapted encoding discards the anticommuting part for each of the Boolean symmetries, and preserves only the part that commutes with all of them. Operationally, in the basis given by the Clifford map, where Boolean symmetries correspond to one-qubit Pauli Z operators on the symmetry qubits, this is achieved simply by discarding a term from the Pauli sum for the operator if it contains a X or a Y operator on any of the symmetry qubits, and keeping it if it contains only either Z operators or identity on all of the symmetry qubits. The Pauli operators that act on the symmetry qubits are then simply removed (the remaining nonredundant qubits are then relabelled accordingly): on each of the terms that commute with the symmetries these will only either be Pauli Z operators or identity operators; Pauli Z operators act as the identity on |0⟩ qubits; and the target eigenspace after action of the Clifford map is exactly (by construction) that of states with their symmetry qubits each in state |0⟩.
If, after action of the Clifford map (and before the projection), the order of the qubits is swapped so that the symmetry qubits correspond to the leftmost (highest) qubits, the matrix form in the computational basis of an operator that commutes with the Boolean symmetries (such as the molecular Hamiltonian) is explicitly block-diagonal, and the target eigensector corresponds to the top-left block.
In short, the symmetry-adapted encoding restricts states and operators to a given common eigenspace of the Boolean symmetries of the Hamiltonian: it corresponds to the action of a Clifford transformation C on states in the JW representation, followed by an orthogonal projectionP. The k symmetry qubits are qubits that are made rendundant by k linearly independent Boolean symmetry constraints. The Clifford transformation C acts as a permutation of computational basis states such that those states in the common eigenspace of the Boolean symmetries are mapped to the states that have each of their symmetry qubits equal to |0⟩. Conjugation by the orthogonal projection operatorP is equivalent to keeping only the component of states that lies in the target eigenspace, and discarding the component orthogonal to it.
Qubit states are mapped from their JW n qubit encoding to the n − k qubit symmetry-adapted encoding as: And operators are mapped from their JW n qubit encoding to the n − k qubit symmetry-adapted encoding as:Ĥ →PĈĤĈ TPT (19) where, for both states and operators, only the component in the common eigenspace of interest is kept by the projectionP.
In particular, single excitation operatorsâ † iâ j (double excitation operatorsâ † iâ † jâ kâl ) either commute or anticommute with each of the Boolean molecular symmetries. This can be seen as follows: the single (double) excitation operators act on Slater determinants by flipping the occupancies of the ith and jth (the ith, jth, kth and lth) spin-orbitals, up to multiplication by a factor of 0, 1 or −1; a Boolean molecular symmetry operator acts as the identity on those Slater determinants for which the number of occupied spin-orbitals that are antisymmetric with respect to it is even, and as multiplication by a phase of −1 on Slater determinants for which it is odd; hence, if the number of orbitals that are antisymmetric with respect to the symmetry in the set {i, j} (in the set {i, j, k, l} is even then the two operators commute; if it is odd they anticommute. The symmetry-adapted encoding maps those nonzero operators that anticommute with at least one of the Boolean molecular symmetries to the zero operator. These are the operators that map all states in the target symmetry sector to either zero or states that lie outside it. In the example of H 2 O in the minimal basis given in figure 8, the single excitationâ † 1b2↑â 3a1↑ anticommutes with the symmetry σ(yz): it maps states in the target symmetry sector, the states in the totally symmetric point-group representation A 1 , to either zero or states in the B 2 representation; on the other hand, the single excitationâ † 2a1↑â 3a1↑ commutes with all Boolean molecular symmetries: it preserves the point-group symmetry by mapping states in A 1 to either zero or states in A 1 . While both fermionic operators correspond to nonzero qubit operators in the JW encoding, the former is mapped to the zero operator in a symmetry-adapted encoding, and the latter is mapped to a nonzero operator.
A symmetry-adapted encoding E does not preserve the multiplication properties of general operators, so that, for instance, However, E does preserve multiplication between those operators that commute with all the Boolean molecular symmetries, and therefore it also preserves exponentiation of those operators, so that if the operatorâ † iâ j commutes with the symmetries we have E(e i θ(â † iâ j +â † jâ i ) ) = Figure 8. Commutative diagrams for a symmetry-adapted encoding of the water molecule (H2O) in the minimal basis (C2v Boolean point group) for fermionic operatorsâ † 1b2↑â 3a1↑ (a) andâ † 2a1↑â 3a1↑ (b). The Clifford operatorĈ acts by mapping each one-qubit Pauli operator in the Jordan-Wigner encoding to a Pauli term according to its tableau, so that the state of each symmetry qubit (here the 0th, 1st, 4th and 8th qubits) corresponds to whether a Slater determinant is symmetric or antisymmetric with respect to a symmetry operator (respectively P ↑ , P ↓ , σ(yz) and σ(xz)); the projectionP acts by discarding the Pauli terms that anticommute with one of the symmetries (those acting as X or Y operators on any of the symmetry qubits, red), and by keeping only the ones commuting with all symmetries (acting as Z operators or the identity on the symmetry qubits, green), and then removing the symmetry qubits and relabelling the remaining qubits (the nonredunant qubits). In the case of a fermionic excitation operator either all Pauli terms commute with all the Boolean molecular symmetries or they all anticommute with at least one of them. e i θE(â † iâ j +â † jâ i ) . This observation allows a straightforward application of symmetry-adapted encodings to variational ansätze where the circuit is composed of unitary gates that each correspond to an exponential of excitation operators such as e i θ(â † iâ j +â † jâ i ) , which we discuss in the following sections of this article.

The QuantumSymmetry package
We present an implementation of our algorithm to reduce the number of qubits by point group symmetries for arbitrary molecules as QuantumSymmetry, an open-source Python package, whose source code is hosted online as GitHub and Zenodo repositories [36]. Users can install QuantumSymmetry by running the following command from terminal:

pip install quantumsymmetry
QuantumSymmetry employs open-source quantum chemistry package PySCF [37,38] to perform HF calculations, for the calculation of one-and two-electron integrals and the construction of symmetry-adapted molecular orbitals. It automatically retrieves from PySCF the largest Boolean symmetry group for the input molecular geometry, as well as the irreducible representation of its HF ground state. It is compatible with both quantum computing toolsets OpenFermion and Qiskit. QuantumSymmetry takes arbitrary user input such as the molecular geometry and the atomic basis set and outputs the qubit operators that correspond in the appropriate symmetry-adapted encoding to fermionic operators on the molecular system, namely the second-quantized electronic structure Hamiltonian. For instance, the following minimal code returns the symmetry-adapted encoding Hamiltonian for the ground state of the ethene molecule (C 2 H 4 ) in the minimal basis (STO-3G) as an OpenFermion [39] qubit operator object: The user can set the optional argument output_format = 'qiskit' to obtain the symmetry-adapted Hamiltonian as a Qiskit [40] Pauli sum operator object instead.
The user can set the optional argument irrep to manually specify the target irreducible representation (and hence the target eigensector): if no such argument is given, QuantumSymmetry defaults to the irreducible representation of the HF ground state.
The interested reader can find a user guide to OpenFermion and example code and visualizations (at https://colab.research.google.com/drive/17grKKkyGxCfo0QXCDeDz6rrfkOi-bf1J), which we invite them to experiment with. The examples given in the Supplementary Information are covered.
QuantumSymmetry also allows the user to create an encoding object that stores information about the symmetry-adapted encoding for the molecule of interest; the encoding object can then be used to encode operators other than the Hamiltonian in the corresponding symmetry-adapted encoding. An example of minimal code is given below:

Numerical results
In order to assess the performance of the symmetry-adapted encoding (SAE) against that of the JW encoding, we have run numerical simulations for several molecular systems employing QuantumSymmetry in conjunction with Qiskit. We have assessed the performance of both SAE and JW when running: (a) VQE with a Unitary Coupled Clusters with Singles and Doubles ansatz (UCCSD); and (b) An Adaptive Derivative Assembled Pseudo-Trotter Variational Quantum Eigensolver (ADAPT-VQE).
We have done so by considering a number of molecular systems, namely: The number of qubits required for their simulation was respectively 6, 8, 12, 14 and 14 in the JW encoding; in the corresponding symmetry-adapted encoding this was reduced to 3, 5, 8, 9 and 10 qubits. The number of variational parameters in the UCCSD ansatz was respectively 8, 15, 92, 204 and 140 in the JW encoding when the spin symmetries were already accounted for; in the corresponding symmetry-adapted encoding this was reduced by virtue of the Boolean point-group symmetries to 4, 7, 34, 38 and 48 parameters (a reduction in the dimensionality of the parameter space by as much as 80% in the case of BeH 2 ).
A summary of our numerical results is shown in figure 9. The unitary coupled clusters (UCC) ansatz [41] was one of earliest circuit proposals to appear in the VQE literature. Inspired by a standard method in computational quantum chemistry, the coupled clusters technique, UCC furnishes a parameterised circuit composed of a series of exponential qubit gates that correspond to fermionic excitation operators. In its most common form, UCCSD, these operators correspond to single (S) and double (D) excitations only, and the circuit is initialised in the state that corresponds to the HF wave function. This results in an ansatz that is able to capture corrections of the HF ansatz by exploring only a significantly smaller subspace of the total qubit Hilbert space, while at the same time enforcing some symmetry constraints such as conservation of electron number. However, because UCCSD only takes into account single and double excitations, it is unable to take into account higher-order corrections, something that can be improved by adding higher-order excitations. We note that many later ansatz proposals in the VQE literature can be understood as modifications of the original UCC, notably the adaptive derivative assembled pseudo-trotter variational quantum eigensolver (ADAPT-VQE) [42] and more recent proposed variations of it [43]. Unlike the fixed circuit of UCC, where optimisation happens only at the level of circuit parameters, ADAPT-VQE iteratively constructs its circuit step by step, gradually adding new gates to it that are chosen from a pre-selected pool of fermionic excitations. This requires estimating a different expectation value for each operator in the pool at each iteration, in order to each time select the operator that will result in the lowest energy.
Based on the results of our numerical simulations we have found that, besides the obvious advantage in terms of the reduction in qubit count, there are further significant advantages in the performance of the SAE over that of JW: the number of cost function evaluations to convergence to the same accuracy was consistently found to be significantly lower for SAE over JW in both UCCSD and ADAPT-VQE; measures of circuit complexity such as circuit depth (defined as the number of gates in the longest path in the circuit) and CNOT gate count (the total number of CNOT gates in the circuit) were also consistently found to be significantly lower in SAE than in JW in both UCCSD and ADAPT-VQE.
As expected, we found that within the same encoding ADAPT-VQE performs worse than UCCSD in terms of cost function evaluations, but better in terms of circuit complexity. However, in contrast to earlier claims [42], we found that ADAPT-VQE does not perform significantly better than UCCSD in terms of the accuracy of the computed ground state energy in the example systems. We have also found that in all examples under consideration SAE UCCSD performs better than JW ADAPT-VQE also in terms of circuit complexity (and in some cases also better than SAE ADAPT-VQE).
In all our numerical results we have employed the Sequential Least SQuares Programming optimizer (SLSQP) as the classical optimisation routine, which we have found to perform better than alternatives. Although the goal of the numerical results was not a comparison between the performance of UCCSD and ADAPT-VQE, but between SAE and JW, in order to take into account the full computational cost of ADAPT-VQE the number of cost function evaluations for ADAPT-VQE includes the energy evaluations for each operator in the pool. The measures of circuit complexity were evaluated by a circuit decomposition into Hadamard, S-gates, RZ-gates and CNOT gates without any form of circuit optimisation (consistently for all the numerical experiments).
The observed faster convergence in terms of energy function evaluations was not due to the reduced qubit count itself (as the variational procedure is hardware-agnostic), but to the number of variational parameters in UCCSD, and similarly to the reduced pool size in ADAPT-VQE. As mentioned previously, the SAE maps certain nonzero excitation operators to the zero operator, namely those that do not respect (anticommute with) at least one of the Boolean symmetries. These excitations correspond to redundant parameters that, if included, are left constant during the variational optimization procedure. Discarding them results in both faster convergence and a shallower circuit. We note that the same improvement in performance in terms of number of parameters and operator pool size could be obtained in JW or other encoding by only including excitations that preserve point-group symmetries. However, SAE have the further advantage of implementing this symmetry constraint automatically, without any further computation needed.
The reduced circuit complexity observed for SAE over JW can be attributed to a combination of both the reduction in the UCCSD variational parameters and ADAPT-VQE operator pool size and the reduction in qubit count.  Furthermore, the symmetry-adapted encodings can be used to extend the application of NISQ-friendly variational algorithms to the problem of finding energies beyond the ground state's: notably, the first excited state of a molecular system often lies in a different point-group irreducible representation than its ground state. Figure 10 shows the potential energy curves that we have obtained through numerical simulations of the VQE with a UCCSD ansatz for both the ground state 1 Σ + g (which lies in the totally symmetric A 1 representation of the C 2v point group) and the triplet first excited state 3 Σ + u (which instead lies in its B 1 representation) of the hydrogen molecule (H 2 ) in the double-zeta basis (corresponding to five-qubit systems under the symmetry-adapted encodings). The iterative procedure started from reference states corresponding respectively to the Slater determinants 1a 1↑ 1a 1↓ (the HF state) and 1a 1↑ 1b 1↓ . All energies we have obtained have an error from their exact values in the order of 10 −6 Ha or lower. The number of cost function evaluations required for each simulation was in the range 52 − 90 for both 1 Σ + g and 3 Σ + u .

Conclusions
In this paper we have shown how symmetry-adapted encodings allow one to reduce the number of qubits in the JW Hamiltonian by k qubits (where the number of reduced qubits k ranges from 2 to 5 depending on the symmetry of the system). Unlike earlier work in the literature [19,22], they do so at minimal computational cost: finding the correct encoding only requires knowledge of the character table of the Boolean point group, a subgroup of the molecular point group, and knowledge of the representations in which the molecular orbitals lie; the encoding acts simply as a relabelling of the Pauli terms of the JW Hamiltonian (followed by a simplification of like terms). The eigenvalues of the symmetry-adapted encoding are exactly the same as the eigenvalues of the JW Hamiltonian in the symmetry target eigensector, with no approximation.
In this encoding computational basis states are in one-to-one correspondence to Slater determinants. Information about the occupancy of spin-orbitals can be immediately read off from the qubit states, according to rules that are immediately derived from knowledge of the character table and of the orbital's irreducible representations. The encoding can be explicitly seen as a block-diagonalization of the Hamiltonian into symmetry eigensectors, followed by a projection onto the target eigensector.
By making use of molecular orbitals, instead of atomic orbitals, we do not run the risk of finding artificially low energies due use of a non-orthogonal orbital set, as is the case for the previous attempt to use point group symmetry to reduce the size of molecular electronic structure calculations [22].
The reduction in qubit count is an obvious advantage of the method we presented that is particularly relevant in the context of near-term (NISQ) quantum computing. Although the reduction in qubit count due to the exact Boolean symmetries we have investigated is at most by five qubits and does not scale with the size of the molecule, the method can be extended to further symmetries such as approximate Boolean symmetries, which will be the subject of further work. Furthermore, recent work in the literature has shown that larger molecules can be studied with a mixture of classical and quantum resources through projection-based embeddings [44]: a symmetry-adapted encoding can straightforwardly be applied in conjunction with such methods to allow a further reduction in the quantum resources necessary for the simulation of larger molecules.
The Hilbert space on which the second-quantized Hamiltonian acts contains states of all possible occupancies and numbers of electrons. In certain cases, its lowest eigenvalue will not correspond to a desired ground state of the system, but to an unstable system (an example of this is the H 3 + example in the supplemental material). In order to determine whether a molecular species is stable, by which we mean energetically favourable, and hence naturally occurring (and not in the chemical sense of being non-reactive) the energy given by the Hamiltonian does not give enough information, and we need to also consider the bond dissociation energy. Because of this, it is possible that the lowest eigenvalue of the second-quantized Hamiltonian belongs to an unstable species with a different occupancy. That the lowest eigenvalue of the second-quantized Hamiltonian might in some cases not be the same as the ground state of the stable species is conventionally addressed by an appropriate choice of circuit such as unitary-coupled cluster circuit [41] or more recently introduced variations [45], or by adding penalty terms in the classical step of hybrid quantum-classical algorithms [46]. However, as we have just seen, enforcing symmetries with the symmetry-adapted encoding is able to address this problem on its own, independently of the choice of ansatz.
The symmetry-adapted encodings also allow us to purposely restrict the Hamiltonian to irreducible representations of the Boolean point group symmetry that are different from the one of the ground state. This is something that the QuantumSymmetry package provides for, by allowing the user to choose the irreducible representation of interest (although this defaults to the ground state representation). This allows use of a variational algorithm to minimize the energy and find, for example, the first excited state, as opposed to the ground state, as the two lie usually in different point-group representations. We have shown numerically that, for example, symmetry adapted-encodings can yield through a variational algorithm an accurate potential energy curve for an excited energy state in the same way as for the ground state.
Importantly, we have shown that the symmetry-adapted encodings map excitation operators that do not respect the symmetries to the zero operator, and that this allows a significant reduction in the number of variational parameters, and consequently in the number of iterations to convergence in variational algorithms. They also result in more shallow and less complex circuits, extending the possibility of executing variational algorithms on near-term devices hardware even for the currently limited number of available qubits.
In light of these results, it is our hope that symmetry-adapted encodings will become a useful and common feature in the quantum computing simulation of quantum chemistry, especially in the context of variational methods for near-term (NISQ) quantum devices.

Data availability statement
The data that support the findings of this study are openly available at the following URL/DOI: https:// github.com/dariopicozzi/quantumsymmetry. The code implementation described in the paper is available as an open-source Python package, whose source code is hosted online as GitHub and Zenodo repositories [36]. Example code is available as an interactive Python notebook on Google Colab [47].