Demonstrating Bayesian Quantum Phase Estimation with Quantum Error Detection

Quantum phase estimation (QPE) serves as a building block of many different quantum algorithms and finds important applications in computational chemistry problems. Despite the rapid development of quantum hardware, experimental demonstration of QPE for chemistry problems remains challenging due to its large circuit depth and the lack of quantum resources to protect the hardware from noise with fully fault-tolerant protocols. In the present work, we take a step towards fault-tolerant quantum computing by demonstrating a QPE algorithm on a Quantinuum trapped-ion computer. We employ a Bayesian approach to QPE and introduce a routine for optimal parameter selection, which we combine with a $[[ n+2,n,2 ]]$ quantum error detection code carefully tailored to the hardware capabilities. As a simple quantum chemistry example, we take a hydrogen molecule represented by a two-qubit Hamiltonian and estimate its ground state energy using our QPE protocol. In the experiment, we use the quantum circuits containing as many as 920 physical two-qubit gates to estimate the ground state energy within $6\times 10^{-3}$ hartree of the exact value.


I. INTRODUCTION
Classically hard computational chemistry problems are some of the most promising applications that the advance of quantum computing technologies will allow us to tackle [1][2][3][4].Chemical properties are generally calculated by solving the electronic structure problem for a given nuclear configuration [5].Some systems (e.g., chemical reactions involving transition metal complexes [6,7]) require many one-electron orbitals to represent their electronic states, making it challenging to accurately calculate their properties, even with state-of-theart high-performance computers.Harnessing the ability to efficiently simulate quantum systems, quantum computers will potentially facilitate those calculations to extend the scope of computational chemistry.
Quantum phase estimation is a heavily used subroutine in various quantum algorithms.The QPE algorithm, provided a unitary operator U with eigenvector |ϕ⟩ and associated eigenvalue e iϕ , computes an estimate of the phase ϕ.The iterative scheme of QPE, originally proposed by Kitaev [8,9], runs a set of Hadamard-test-like circuits, each of which reads off the partial information about ϕ.The obtained measurement outcomes are classically post-processed to estimate ϕ up to specified accuracy.Relative to the QPE based on the quantum Fourier transform (QFT) [10][11][12], the iterative scheme uses shallower circuits at the cost of more samples and hence, makes its execution amenable on noisy quantum hardware.The iterative QPE algorithm has since been improved to reduce the required quantum resources [13][14][15][16][17][18][19][20][21][22].For example, the authors of [17] proposed an approach based on Bayesian inference to make the phase estimation * kentaro.yamamoto@quantinuum.com protocol more efficient and robust against experimental errors.
Such algorithmic improvements, along with the remarkable development of quantum computing devices, have led to successful demonstrations of QPE algorithms on several different platforms.Experimental realizations of QPE on a quantum chemistry system were initiated in [23], where the iterative QPE was applied to a twoqubit molecular Hamiltonian on a superconducting processor.This was soon followed by an experiment using Bayesian QPE on a silicon photonic device [24].More recently, a different type of statistical phase estimation has been tested on a superconducting processor [25].In this algorithm, the trade-off between the number of samples and circuit depth is nicely controlled, which makes it more favourable to be run on early fault-tolerant hardware [21,22].However, experimental demonstration of QPE remains challenging due to the depth of the circuits.
In the present work, we demonstrate Bayesian QPE on a quantum charge-coupled device trapped-ion quantum computer to push forward such limitations [26][27][28][29][30].We calculate the ground-state energy of the minimal-basis molecular hydrogen system described by the spin Hamiltonian [31], where {X i , Y i , Z i } are the Pauli-X, Y , Z operators acting on ith qubit, I is the identity operator, and {h j } are real coefficients.The spin Hamiltonian is obtained with the Jordan-Wigner transformation from its fermionic Hamiltonian [3].
1 The coefficients {h j } are evaluated on classical computers by performing the restricted Hartree-Fock method with the STO-3G atomic basis set [5] followed by the two qubits tapered off using spin and particle number conservations [31].

arXiv:2306.16608v2 [quant-ph] 8 Sep 2023
To enhance the performance of the Bayesian QPE protocol, we develop a subroutine for the selection of circuit parameters.Our routine analytically extracts the optimal parameters by minimising a natural choice of utility function.This improves on previous works based on heuristics with certain assumptions [17].
We perform the QPE experiments by adopting two different techniques to alleviate hardware noise effects.First, we employ the Bayesian QPE with a noise-aware updating rule.The hardware noise is incorporated into the likelihood function in the form of depolarizing channel to mitigate decoherence.Second, in order to run the QPE with deep circuits, we encode four logical qubits with a 6, 4, 2 quantum error detection code [32][33][34][35].The code detects an arbitrary single-qubit error and discards the associated result to reduce the error rate at the cost of more circuit executions as well as small overhead in circuit depth and width.In particular, the code is carefully tailored to various features of the quantum hardware, such as high-fidelity gate operations, all-to-all connectivity, and conditional exit operations [30,36,37].See [38][39][40][41][42][43][44][45] for previous experimental studies with a 4, 2, 2 code.The rest of the paper is organized as follows.In Section II, we review the Bayesian QPE protocol, introduce our parameter selection rule and demonstrate its benefits numerically.In Section III, the 6, 4, 2 error detection code is introduced with a sketch of the encoded QPE circuit.The experimental results from Quantinuum's H1 quantum computer are presented in Section IV.We give conclusions and outlook in Section V. Technical aspects of the Bayesian QPE, error detection code, experimental setup, and more data are found in Appendices A, B, and C.

II. BAYESIAN QUANTUM PHASE ESTIMATION
In Bayesian QPE [17], measurement outcomes are generated from the following QFT-free QPE circuit parametrised by k ∈ N and β ∈ [0, 2π), with probability where m ∈ {0, 1} is the measurement outcome in X-basis on the top qubit in (2) and ϕ ∈ [0, 2π) is the unknown angular phase we wish to determine.The equation ( 3) is termed the likelihood function.R Z (β) = e −iβZ/2 is a rotation gate.In our experiment, we consider an approximate eigenstate of U as an input state |ϕ⟩ that has a sufficiently small approximation error. 2  Taking a Bayesian approach, we instantiate a prior distribution p(ϕ), which can be uniform.After R measurement outcomes, we probabilistically quantify the value of ϕ through the posterior distribution ( The posterior can be updated iteratively Bayesian posterior distributions are typically approximated numerically as in [17].However, in this setting, it was noted in [18] that the posterior is analytically tractable in the form of a Fourier distribution where the number of coefficients J R grows at least quadratically in the number of experiments, as J R = J R−1 + k R .To mitigate memory requirements, the authors in [46] described an adaptive approach where after a suitable number of shots, the posterior representation is converted to a wrapped Gaussian distribution which is fully specified by a mean and variance parameter and can also be updated analytically (using moment-matching) on receipt of further measurements.The conversion from Fourier to wrapped Gaussian distribution is approximate, however after a sufficient number of shots, the posterior will be peaked and well approximated by the wrapped Gaussian distribution.In this work, we adopt an equivalently adaptive approach only we favour a von Mises distribution over the wrapped Gaussian since it is the maximum entropy distribution for wrapped random variables (with a specified first circular moment) [47] and has a simple closed-form probability density function.A von Mises representation of the posterior is similarly fully specified by a mean and precision parameter and can also be updated analytically using moment-matching.Some example posterior distributions are visualised in Fig. A1, Appendix A 3. Details of the tractable Bayesian updates can be found in Appendix A 1 and a lightweight, easy-to-use implementation can be found in the Python package phayes [48]. 2 When the input state is given by i c i |ϕ i ⟩ with U |ϕ i ⟩ = e iϕ i |ϕ i ⟩, we can use the likelihood of the form Ignoring all {c i } i≥1 , where c 0 is the coefficient of the dominant eigenstate (e.g.ground state) |ϕ 0 ⟩, Eq. ( 4) reduces to Eq. ( 3).The error in the estimated phase, ϕ 0 , due to the neglected contributions from excited states is bounded by (1 − |c 0 | 2 )/|c 0 | 2 in the case data is taken only from k = 1.See e.g.[18] for further discussion.

A. Parameter selection for k and β
We have yet to specify a method to select the circuit parameters k and β.Existing approaches [17,18,46] typically use the heuristic k = 1.25/Var H [ϕ] and sample β randomly.Here we introduce an approach for deterministically selecting these parameters.
We first note that it is important to quantitatively assess our posterior uncertainty over the phase ϕ, e.g. to determine a stopping criterion.This might be done by assessing the variance of the posterior distribution.However, for wrapped distributions, the standard variance Var is not well-behaved due to the misalignment of the squared error and the wrapped property [47,49].As such, two alternative circular metrics are used to assess concentration The Holevo variance is often favoured due to it being unbounded above (akin to the standard variance).
For sharply peaked distributions we have that Var For both Fourier and von Mises distributions, the circular and Holevo variances are analytically tractable.Moreover, for the circular variance, we can calculate the expected post-measurement posterior circular variance to form a utility function A utility function [50] describes some measure of information gained from an experiment as a function of the experiment parameters which we look to maximise, i.e. k r , β r = arg max k,β U C (k, β).In this specific case (circular variance utility and either Fourier or von Mises prior) we can analytically maximise the utility and therefore minimise the expected posterior variance (see Appendix A 2 for calculations and phayes [48] for implementation).
We numerically compare Bayesian QPE approaches.For a given true phase ϕ * ∈ [0, 2π) to be estimated, the measurement outcomes are collected from synthetic experiments, where noiseless QPE circuits are simulated pseudo-randomly directly from the likelihood (3).This process is repeated over 100 different values ϕ * .Displayed in Fig. 1 is the mean with min/max error bars of the expected posterior cosine distance from the target angle ϕ * .In green, we make a von Mises approximation throughout and choose parameters according to the heuristic above, i.e., k = 1.25/Var H [ϕ] , β sampled uniformly in [0, 2π).This approach is reminiscent of [17] only with a von Mises distribution, rather than Gaussian, and Bayesian updates implemented via exact momentmatching rather than approximately with Monte Carlo.In orange, we update the true Fourier posterior again  with the above heuristic parameter selection, matching the approach of [18].In blue, we apply the adaptive procedure described above and akin to [46] where we convert the exact posterior to von Mises after reaching J max = 2000 coefficients.In this adaptive implementation, we also apply the optimal parameter selection as described above and in Appendix A 2. We observe that the optimal parameter selection ensures the Bayesian phase estimation is significantly more accurate, allowing the posterior to efficiently rule out incorrect modes and consistently hone in on the true phase.

B. Noise-aware likelihood
The likelihood in (3) assumes a noiseless implementation of the circuit (2).In the presence of noise, it is more realistic to consider a noise-aware likelihood of the form [17] where q is an error parameter due to decoherence.The noise-aware likelihood (8) remains in a convenient Fourier form and still admits the same analytical Bayesian updates as (3) [46] as well as the aforementioned optimal parameter selection.
The error parameter q is typically determined as a function of the quantum device specifications and the depth parameter k.Naturally, deeper circuits suffer from an increased error rate.It is therefore common in practice to consider some k max to limit the depth of the circuits and control the error rate.For example, one finds is modelled by the depolarizing channel that maps a density matrix ρ to with the depolarizing error rate p 2 of two-qubit gates and the number of two-qubit gates N 2Q = O(k) in the circuit.

III. ERROR DETECTION WITH 6, 4, 2 CODE
Aiming at hardware demonstration of the aforementioned QPE protocol, we consider how to protect our quantum circuit from errors caused by noisy quantum hardware.Quantum error detection (QED) codes provide such protection with limited quantum resources by discarding erroneous executions of quantum circuits.For instance, the n + 2, n, 2 code for even n is a stabilizer code whose code space is stabilized by X ⊗n+2 and Z ⊗n+2 [32][33][34][35] (dubbed Iceberg code in [37]).In this work, we employ the code with n = 4, i.e. 6, 4, 2 code, to encode four logical qubits.The logical qubits and two redundant physical qubits, denoted by L := {1, 2, 3, 4} and A := {a X , a Z }, form the six-qubit code on T := L ∪ A. More concretely, the three-qubit QPE circuit, with one dummy qubit appended, is encoded into six physical qubits.We introduce two additional ancillary qubits to carry out fault-tolerant state preparation, syndrome extractions, and final measurement, leading to eight qubits used in total.We denote the two stabilizers by S X := i∈T X i and S Z := i∈T Z i , and their simultaneous eigenstates associated with the eigenvalue +1 define the four-qubit logical space.Reading out −1 upon measuring {S X , S Z } signals the errors that do not commute with the stabilizer operators, and thus such circuit executions are discarded.The undetectable errors by stabilizer (syndrome) measurements lead to logical errors disturbing the encoded system.
The encoded quantum states are manipulated by logical Pauli operators Xi which commute with the stabilizers and obey { Xi , Zi } = [ Xi , Zj ] = 0 for i ̸ = j.All the logical operations are compiled to the universal logical gate set, which, in the form of physical gates, is given by3 [37] where we have defined a Pauli exponential operator R P (θ) := e −iθP/2 for a rotation angle θ and a Pauli operator P .
Figure 2 shows the entire structure of the encoded QPE circuit.See Appendix B for explicit compilation of each component.For concreteness, we let the operator, U k , in the QPE circuit an approximation to e −iHkt with Hamiltonian (1) and t ∈ R by the Lie-Trotter first-order product formula [51], Here, the integer s is the number of discretized time steps.Then, the controlled version of the unitary u := e −i h 1 t s Z1 e −i h 2 t s Z2 e −i h 3 t s Y1Y2 is compiled to logical operators, which is denoted by ctrl-u in Fig. 2. The remaining part v := e −ih4ktZ1Z2 e −ih5ktI is similarly compiled to logical operators ctrlu-v and applied at the end because it commutes with u and does not require the Lie-Trotter decomposition.
The encoded circuit starts with encoding the initial state.The two extra ancillary qubits are dedicated to performing the fault-tolerant initialization.We split the logical operation (ctrl-u) ks into ⌊ks/f ⌋ blocks.Application of each block is followed by a syndrome measurement to inspect whether the encoded state is stabilized by {S X , S Z }.As soon as one syndrome measurement is read off as −1, the circuit execution is aborted.Furthermore, we insert a stabilizer S X in the middle of each block, which acts on the code space as the identity.However, it suppresses the coherent physical errors in the form of a single-qubit Z rotation accumulating in time (Appendix B 3).After all the logical unitary operations are performed, we make a final measurement to ensure that both stabilizers are measured to 1 and read off logical Pauli expectation values.
We remark on some features of the code exploiting the capability of Quantinuum's H1-1 trapped-ion computer [36,37].The state preparation, syndrome measurements, and projective measurement are performed in a fault-tolerant manner [38,[52][53][54].While non-faulttolerantly implemented, a logical operator R PiPj (θ) (12) is, up to single-qubit Clifford gates, compiled to a single Mølmer-Sørensen (MS) gate, R ZiZj (θ), which is natively implemented on the trapped-ion computer with the gate infidelity ∼ 2 × 10 −3 [55,56].As such, Quantinuum's high-fidelity MS gate operations combined with the allto-all connectivity is expected to lead to logical circuit executions with a low logical error rate. 4Lastly, the A sketch of the entire encoded QPE circuit.It starts with the state preparation with two ancillary qubits at the bottom.Then, the logical controlled unitary operations, ctrl-u, are sequentially applied with the syndrome measurements interweaved.In every f step of time evolution, a syndrome measurement is performed and executions are discarded upon detecting errors.A stabilizer SX is inserted in each block to alleviate physical memory errors.The ctrl-v operation is applied right before the measurement (the logical RZ (β) is absorbed into ctrl-v).After all the logical unitary operations are performed, the final fault-tolerant measurement is made to read off logical Pauli expectation values.
Quantinuum device is equipped with conditional exit, a functionality to immediately abort the circuit execution conditioned on classical registers.Thanks to this feature, one can save runtime by discarding calculations as soon as a syndrome measurement detects errors without running the remaining calculations in vain.

IV. EXPERIMENTS
We experimentally demonstrate the Bayesian QPE protocol adopting the parameter selection introduced in Sec.II A with and without the 6, 4, 2 error detection code on the Quantinuum H1-1 quantum computer, after calibrating the individual QPE circuit (2).We calculate the ground state energy of the Hamiltonian (1) with the coefficients (h 1 , h 2 , h 3 , h 4 , h 5 ) = (−0.3980,−0.3980, −0.1809, 0.0112, −0.3322) hartree.It describes the equilibrium geometry of the hydrogen molecule with the inter-atomic distance R HH = 0.73486 Å.The experimental results shown in this section are calculated using the product formula (13) with t = 0.1π and s = 1 in atomic unit of time.This yields −2.0 × 10 −4 hartree of systematic error.The estimated energy E is related to the estimated phase ϕ by E = −ϕ/t.
The present experiments rely on the following software packages.

A. Calibration of QPE
We start by calibrating the performance of individual QPE circuits.The benchmark informs us of the quantitative relationship between the circuit depth k and noise level q, which limits the precision of phase estimation.It also showcases that the QED primitive can suppress hardware noise to enable experiments with deeper circuits.
To this end, we evaluate the probability of obtaining the measurement outcome "0" from the QPE circuit (2) in comparison with what one would expect from a noiseless experiment.In order to reduce the source of systematic errors, we use the exact eigenstate |ϕ 0 ⟩ of the operator U with the eigenvalue ϕ 0 , giving an approximation to the ground state energy of H up to the error of product formula (13).
The unencoded circuit (2) (see B1-B3 for details) contains where ∆ init = 0 (1) when the input state is the Hartree-Fock state (exact eigenstate).For the experiment with QED, we use the encoded circuit (Fig. 2), which contains The frequency of syndrome measurements is fixed to f = 8 throughout the encoded experiments presented in this section.
For calibration the integer k is chosen from {20, 40, 60, 80, 100}, and for each k, we pick β from the four sample points {−kϕ 0 −π, −kϕ 0 −π/2, −kϕ 0 , −kϕ 0 + π/2}.We run 500 shots of calculations for each parameter set {k, β} and fit the experimental data with the function, to extract the parameters q and ω that characterize the amplitude damping and the shift in the estimated phase, respectively.In the absence of hardware noise, both q and ω vanish to recover the noiseless likelihood (3).The experimental results with and without QED are shown in Fig. 3.The k-dependence of q obtained from the experiments with unencoded circuits is captured by the following function, with p 2 = 1.6 × 10 −3 .Equation ( 17) is derived assuming the depolarizing noise model ( 9).The parameter p 2 gives a rough estimate of average two-qubit gate infidelity, whose order of magnitude matches the value reported in [56].While q rapidly grows as the circuit depth k increases in the unencoded case, it is well suppressed in the encoded case thanks to the protection by the 6, 4, 2 code.As presented in Appendix C, for both unencoded and encoded benchmarks, the phase shifts ω are of order 10 −3 (Fig. C1).In this work, we omit ω in the noiseaware likelihood function (8) in the Bayesian QPE and leave it as future work to explore coherent error mitigation techniques [60][61][62][63][64].
The suppression of error rate with QED is accomplished at the cost of discarding faulty computations that are detected by syndrome measurements.The discard rate d, the ratio of the number of discarded circuits to the total number of executed circuits, with respect to the circuit depth k is shown in Fig. 4. The same error model (17), with p 2 = 1.6 × 10 −3 recovers the experimentally obtained discard rate.It is, however, not obvious that the discard rate d is explained by (18), which is based on the depolarizing noise model.The increase of q of (16) in the unencoded case mainly stems from incoherent errors.On the other hand, the errors detected by the QED contain all the single-qubit errors, and thus, the discard rate is generally influenced by a wider class of errors.However, we inserted an X-stabilizer S X in the middle of each block in the encoded circuit (Fig. 2) to suppress the dominant source of coherent errors.While S X acts as the identity on logical states, we confirm that the stabilizer insertion suppresses coherent error, which in turn reduces d and q as further discussed in Appendix B 3 (see Fig. B1).Consequently, the discard rate in the current encoded experiments is dominated by incoherent errors and is well captured by the depolarizing model.

B. Bayesian QPE
Having calibrated the performance of QPE circuits, we turn to the Bayesian QPE experiments with and without QED.As an input state |ϕ⟩ of QPE, we prepare the Hartree-Fock state |00⟩.The Hartree-Fock state provides the mean-field approximation to the ground state of H and is commonly used in computational chemistry to evaluate the electronic correlation energy.For the Hamiltonian given at the beginning of the section, the fidelity between the Hartree-Fock state and the exact ground state is 0.981.Therefore, it is not expected that our demonstration of Bayesian QPE is significantly influenced by contamination from the other eigenstates.In Appendix A 4, we numerically confirm this by conducting noiseless QPE simulations.
The number of Fourier coefficients in ( 6) is set to J max = 2000, and the maximum depth is specified by k max = 120.The number of 2Q gates in the unencoded QPE circuit is up to N (u) 2Q (k max ) = 604, while it is as many as N (e) 2Q (k max ) = 920 in the encoded circuit with the expected discard rate d(k max ; p 2 ) = 0.77.We use p 2 = 1.6 × 10 −3 throughout the subsection.
The estimated energy E is plotted against the number of circuit executions in Fig. 5.To take into account the discarded experiments in the QPE with QED, we use the rescaled number of experiments given by where k r stands for the depth of the circuit in the rth round of the Bayesian QPE experiment, n shots (k r ) is an average number of experiments until the circuit of depth k r is executed without any error detected, and R is the number of Bayesian updates (5).The calculated energies E with the noise-aware likelihood is −1.185 ± 0.009 hartree after 125 Bayesian updates of distributions for the exact ground state energy E 0 = −1.1375hartree.On the other hand, with the QED, we find E = −1.131± 0.007 hartree after 44 Bayesian updates.There are two main sources of the systematic error observed in the unencoded experiment [Fig.5(a)].
One is the coherent errors that our noise-aware likelihood function ( 8) fails to capture.It implies that, with the use of the noise-aware likelihood based on better characterizations of coherent errors, the precision can be further improved.This also shows the benefit of using the QED, which does not require aggressive characterization of hardware noise.The other source is that the unencoded experiment has less informative measurements (larger error parameter q of (8)), and therefore, the adaptive Bayesian inference scheme necessarily converts to a von Mises approximation earlier than in the encoded case for the same J max .This leads to a higher probability of algorithmic error as observed in the synthetic experiments (Fig. 1).Finally, we remark that in the encoded experiments the conditional exit operation provided by the H1 computer is used to reduce the total runtime.The feature allows one to abort the calculation as soon as the error is detected by a syndrome measurement.For example, provided the encoded QPE circuits of depth k = {40, 80, 120}, the ratios of the average number of 2Q gates before the exit to the total number of 2Q gates are given by {0.83, 0.67, 0.56}.This ratio becomes 0.60 if we accumulate the average and total number of 2Q gates along the Bayesian QPE experiment.It should be, however, noted that whether the reduction of depth by the conditional exit leads to the reduction of actual runtime depends on various other overheads.

V. CONCLUSION
We conducted QPE experiments on the hydrogen molecule Hamiltonian to estimate its ground state energy using the Quantinuum H1-1 trapped-ion quantum device.To the best of our knowledge, it is the first experiment where the QPE on logical qubits is applied to a quantum chemistry problem.We note that [44,45] addressed the same problem using the variational quantum eigensolver and the 4, 2, 2 code.We obtained good agreement with the exact ground state energy, which is due to both the algorithmic advances we have applied and the capability of the H1-1 device.
To make the best use of the limited circuit volume that can be reliably run, we employed the Bayesian approach to the QPE with an enhanced parameter selection which we have demonstrated to have significantly improved robustness properties.Furthermore, we tested two approaches to cope with the hardware noise and imperfections.In the first approach, we adopted the noiseaware likelihood function for Bayesian update, assuming that the depolarizing channel models the dominant source of errors.We calculated the energy with the error 0.048 ± 0.009 hartree using the QPE circuit containing up to 604 two-qubit gates.In the second approach, the QPE circuit is encoded with the 6, 4, 2 quantum error detection code.In the encoded circuit, a simple coherent error mitigation via X-stabilizer insertions is applied to achieve lower discard and logical error rates.With the encoded circuits, the ground state energy was estimated within 0.006 ± 0.007 hartree of the exact value.The largest circuit contains 920 physical two-qubit gates with the discard rate ∼ 77%.While our experimental results show a slightly better performance with the QED, there is room for improvement in both approaches.For instance, more elaborate characterizations of hardware noise and error mitigation strategies can be deployed [63,65,66].This allows one to alleviate the coherent errors which were omitted in our noise-aware likelihood function for the unencoded experiment [60][61][62]64].The error mitigation also helps the encoded experiment by reducing the discard rate and logical error rate.
In the present work, we focused on a specific QPE algorithm, taking advantage of the capability of the device, for which the error detection code is highly optimized.In the future, it will be interesting to investigate other types of QPE algorithms such as the one suggested in [21,22] to further improve the performance of ground state energy estimation towards its application to more practical problems.
Example posteriors for the three Bayesian phase estimation approaches discussed in II A and Figure 1.The posteriors are from noiseless synthetic phases estimation experiments and are displayed after five experiments have been measured.Each curve represents one of five independent runs with a different pseudo-random seed.Note that with just five measurements the adaptive approach never converts to von Mises.

Parameter selection
As described in II A, we consider the specific (but well-motivated) choice of negative circular variance utility function It can be shown using (A1-A2) that for both a Fourier or von Mises prior, the posterior first circular moment takes the form where ā, . . ., f are real values independent of β but dependent on k.Thus the circular variance utility for a given value of k becomes where f ± (β) = a ± b cos(β) ± c sin(β) + d cos(2β) + e sin(2β) for new real-valued, k dependent coefficients a, . . ., e.This equation can be maximised in β analytically by considering ∂ β U C (β | k) = 0.After multiplying by f + (β)f − (β), squaring both sides (twice) and simplifying terms, the result is a cubic polynomial in cos 2 (β) which can be solved easily.The roots can then be checked to find the maximiser.A sympy [67] document listing these equations explicitly can be found in phayes [48].
The aforementioned procedure maximises U C (β | k), i.e. for a given k.For a Fourier prior this process can simply be repeated for each k ∈ {1, . . ., J} maintaining the same O(J) complexity of a single posterior update.In the von Mises case, we find that checking a small range of k on either side of Var H [ϕ] − 1 2 finds the maximiser.

Example posteriors
In Fig. A1, we display some example posteriors for a small synthetic phase experiment where five measurements are collected.Observe that the optimal parameter selection allows the posterior to quickly hone in on the correct phase, whilst the heuristic parameter with the analytical Fourier posterior struggles to rule out incorrect modes.The von Mises approach (and similarly Gaussian-based approaches) are uni-modal by design and therefore have to retain a large variance.We also observe over the repeated experiments (and in Fig. 1) that the uni-modal assumption can result in the correct phase being missed entirely.The optimal parameter selection's ability to eliminate incorrect modes means that we more robustly converge to the correct phase and also that the posterior is better approximated by a von Mises distribution when the adaptive procedure reaches conversion time.

Noiseless simulation of Bayesian QPE
To show how much energy estimates vary among different instances of Bayesian QPE experiments, we exemplify the results from the noiseless quantum simulator.The computational setup is the same as that of the Bayesian QPE given in Sec.IV B. The estimated energies E from the Bayesian QPE simulations agree with the exact ground state energy E 0 within ± Var H [E] after 50 Bayesian updates as shown in Fig. A2.Such a reliable convergence is due to the optimal parameter selection method.The results also confirm that the use of Hartree-Fock state as an input does not lead to significant systematic error in estimating the ground state energy with the precision we require.
[Eq. (B6)].The control unitary operations are In the second equality of each equation, we note that a controlled Pauli exponential operator ctrl-R P (θ) can be decomposed into a product of Pauli exponential operators using the following identity, ctrl i -R Pj (θ) = R Pj (θ/2)R ZiPj (−θ/2).(B4) Also, we introduced the shorthand notation of a ctrl-R P (θ) gate that shows only the Pauli operator P on the exponent with the angle θ suppressed.Note that R Z (β) in (B1) can be absorbed into the ctrl-v (B3).
We discuss each component of encoded circuit (2) and how they are compiled to the universal gates (12).For the convenience of discussion, we reproduce the encoded circuit here.

State preparation, syndrome measurements, and final measurement
Fault-tolerant protocols are known for state preparation, syndrome measurements, and final measurement in n + 2, n, 2 QED code.Here, we briefly comment on each primitive by referring to the preceding literature for further details.
• The fault-tolerant syndrome measurements of S X and S Z are performed in the form proposed in [37], which uses 12 two-qubit gates and 2 ancillary qubits.
• The final measurement is based on the implementation in [54].The primitive consists of syndrome measurement of S Z stabilizer and destructive X measurements on all the physical qubits.If no errors are detected, the measurement outcomes are post-processed to extract the observable.There are 8 two-qubit gates and 2 ancillary qubits in the measurement circuit.

Figure 1 .
Figure 1.Comparison of Bayesian phase estimation inference and parameter selection methods.Simulations are noiseless and repeated over 100 different true phases ϕ * .Spots represent mean expected posterior cosine distance from the true phase and error bars display min and max.The adaptive procedure converts to von Mises when the number of Fourier coefficients exceeds Jmax = 2000.The selection of k was capped at kmax = 120.

Figure 3 .Figure 4 .
Figure 3. Parameter q obtained by fitting the experimental results with the function (16) for the unencoded (black triangles) and encoded (red circles) cases.The error bars represent the statistical uncertainties due to a finite number of measurements.The black dashed curve shows the function (17) with p2 = 1.6 × 10 −3 .

Figure 5 .
Figure 5.Estimated energies plotted against the number of experiments R for the unencoded QPE (a) and against the rescaled number of experiments R for the encoded experiments (b).The black circles represent the estimated energies with the error bars representing VarH [E].The purple dashed lines indicate when the distributions are converted from Fourier to von Mises representations.

Figure A2 .
Figure A2.Energy estimate plotted along the number of experiments calculated with a noiseless quantum simulator.The four panels correspond to different runs with the same computational setup as those given in Sec.IV B.

Figure C1 .
Figure C1.Phase shift ω in (16) evaluated for unencoded (red circle) and encoded (black triangle) QPE circuits for each sample point of k.