Composite Simulation Methods Randomized Partitioning Techniques Matthew Hagan Department of Physics University of Toronto March 4, 2022 1 / 53 Not Another Simulation Paper™ • Many techniques for simulating time dynamics • Higher Order Trotter-Suzuki, Multi-Product Formulas, Randomized Product Formulas • Linear Combination of Unitaries (LCU), Quantum Singular Value Transformation (QSVT), Qubitization • QDrift, Stochastic Sparsification • How do we use information about H to reduce query cost for e −iHt ? • Solely consider time-independent Hamiltonians which can be written as H= L X hi Hi , ||Hi ||∞ = 1 (1) i=1 2 / 53 Review: Trotter and QDrift Trotter • Break evolution up into small enough time slices, iterate through each term in Hamiltonian, repeat. • Number of e −iHi t gates: 1+1/2k O 5k t ϵ1/2k Lαcomm (H, 2k) 3 / 53 Review: Trotter and QDrift Trotter • Break evolution up into small enough time slices, iterate through each term in Hamiltonian, repeat. • Number of e −iHi t gates: 1+1/2k O 5k t ϵ1/2k Lαcomm (H, 2k) QDrift • Pick a random term according to spectral norm Phihi , repeat N times • Number of times you need to sample O 2t 2 P hi ϵ 4 / 53 Preliminaries • How can we use information about Hamiltonian to take advantage of different cost scalings (L vs λ, αcomm vs worse time scaling)? • Split our Hamiltonian up into two partitions A and B e −iHt = e −iAt−iBt ≈ e −iAt e −iBt (2) 5 / 53 Preliminaries • How can we use information about Hamiltonian to take advantage of different cost scalings (L vs λ, αcomm vs worse time scaling)? • Split our Hamiltonian up into two partitions A and B e −iHt = e −iAt−iBt ≈ e −iAt e −iBt (2) 6 / 53 Preliminaries • How can we use information about Hamiltonian to take advantage of different cost scalings (L vs λ, αcomm vs worse time scaling)? • Split our Hamiltonian up into two partitions A and B e −iHt = e −iAt−iBt ≈ e −iAt e −iBt (2) Steps need to take 1. Derive total error bound for combined channel 2. Find query cost 3. Develop partitioning scheme 4. Compare to singular channels 7 / 53 First-Order Trotter & QDrift: Error Bounds • We first have to decompose the ideal unitary evolution, denoting the error induced at each step as E U(ρ; t) = e −iHt ρe +iHt = e −iAt e −iBt ρe +iBt e +iAt + EA,B (ρ; t) = (UA ◦ UB ) (ρ; t) + EA,B (ρ; t) (3) (4) (5) 8 / 53 First-Order Trotter & QDrift: Error Bounds • We first have to decompose the ideal unitary evolution, denoting the error induced at each step as E U(ρ; t) = e −iHt ρe +iHt = e −iAt e −iBt ρe +iBt e +iAt + EA,B (ρ; t) = (UA ◦ UB ) (ρ; t) + EA,B (ρ; t) (3) (4) (5) • Then we can approximate each channel respectively Y Y P P e −iai Ai t + EA (ρ; t, 2k) UA (ρ; t) = e −i i ai Ai t ρe +i i ai Ai t = e −iai Ai t ρ (6) 9 / 53 First-Order Trotter & QDrift: Error Bounds • We first have to decompose the ideal unitary evolution, denoting the error induced at each step as E U(ρ; t) = e −iHt ρe +iHt = e −iAt e −iBt ρe +iBt e +iAt + EA,B (ρ; t) = (UA ◦ UB ) (ρ; t) + EA,B (ρ; t) (3) (4) (5) • Then we can approximate each channel respectively Y Y P P e −iai Ai t + EA (ρ; t, 2k) UA (ρ; t) = e −i i ai Ai t ρe +i i ai Ai t = e −iai Ai t ρ (6) UB (ρ; t, NB ) = e −i P i bi Bi t ρe +i P i bi Bi t = X bi e −ibi Bi τ ρe +ibi Bi τ + EB (ρ; t, NB ) ||b||1 (7)10 / 53 First-Order Trotter & QDrift: Error Bounds • This gives us the Diamond Distance of an approximating channel Ue fA ◦ U fB e = (UA ◦ UB ) + EA,B (t) − U U(t) − U(t) ⋄ fA ≤ UA − U ⋄ fB + UB − U ⋄ ⋄ + ||EA,B (t)||⋄ = ||EA (t)||⋄ + ||EB (t)||⋄ + ||EA,B (t)||⋄ 11 / 53 First-Order Trotter & QDrift: Error Bounds • This gives us the Diamond Distance of an approximating channel Ue fA ◦ U fB e = (UA ◦ UB ) + EA,B (t) − U U(t) − U(t) ⋄ fA ≤ UA − U ⋄ fB + UB − U ⋄ ⋄ + ||EA,B (t)||⋄ = ||EA (t)||⋄ + ||EB (t)||⋄ + ||EA,B (t)||⋄ • EA,B (t) is Splitting/”Outer Loop” error • EA (t) is Trotter Error for A • EB (t) is QDrift error 12 / 53 First Order Trotter & QDrift: Cost • To get total error U − Ue t→ t r ⋄ ≤ ϵ, iterate channel r times with smaller time steps • Straightforward to solve for r 2 2 X λ t r≥ 6 ai aj ||[Ai , Aj ]|| + 6 ||[A, B]|| + 4 B ϵ NB (8) i,j 13 / 53 First Order Trotter & QDrift: Cost • To get total error U − Ue t→ t r ⋄ ≤ ϵ, iterate channel r times with smaller time steps • Straightforward to solve for r 2 2 X λ t r≥ 6 ai aj ||[Ai , Aj ]|| + 6 ||[A, B]|| + 4 B ϵ NB (8) i,j • Cost is r × ( # of Trotter terms + # QDrift Samples). 2 X λ t2 Cost(A, B; t, ϵ, NB ) = (LA + NB ) 6 ai aj ||[Ai , Aj ]|| + 6 ||[A, B]|| + 4 B ϵ NB i,j (9) 14 / 53 First-Order Trotter & QDrift: Partitioning • Idea: Make the partitioning a function of a continuous parameter, compute the cost gradient. • We do this by reweighting our terms hi Hi = pi hi Hi + (1 − pi )hi Hi = pi ai Ai + (1 − pi )bi Bi 15 / 53 First-Order Trotter & QDrift: Partitioning • Idea: Make the partitioning a function of a continuous parameter, compute the cost gradient. • We do this by reweighting our terms hi Hi = pi hi Hi + (1 − pi )hi Hi = pi ai Ai + (1 − pi )bi Bi • This gives a differentiable cost function ! X X t 2 (LA + NB ) ∂C 4 = 6 hi hm ||[Hi , Hm ]|| − hm (1 − pi )hi (10) ∂pm ϵ NB i i with an optimal value for the mth term as pm = 1 − X 3 NB P hj hm ||[Hj , Hm ]|| 2 2 hm i̸=m (1 − pi )hi (11) j 16 / 53 First-Order Trotter & QDrift: Comparison • To compare w/ singular channels consider simple partitions with only 1-2 terms in either A or B 17 / 53 First-Order Trotter & QDrift: Comparison • To compare w/ singular channels consider simple partitions with only 1-2 terms in either A or B • Assume for a given H, t, ϵ that Trotter is cheaper than QDrift. If we put two smallest weight terms in QDrift, set C ≤ CTrotter we get b12 + b22 − 4b1 b2 ||[B1 , B2 ]|| ≤ 3 X ||[Hi , Hj ]|| L−2 (12) i,j 18 / 53 First-Order Trotter & QDrift: Comparison • To compare w/ singular channels consider simple partitions with only 1-2 terms in either A or B • Assume for a given H, t, ϵ that Trotter is cheaper than QDrift. If we put two smallest weight terms in QDrift, set C ≤ CTrotter we get b12 + b22 − 4b1 b2 ||[B1 , B2 ]|| ≤ 3 X ||[Hi , Hj ]|| L−2 (12) i,j • Likewise, consider H, t, ϵ such that QDrift is cheaper than Trotter. Consider partition with only 1 term in Trotter and set C ≤ CQDrift P X X bi 2 (NB + 1)a bi ||[A, Bi ]|| ≤ a + bi a − (13) NB i 19 / 53 Higher-Order Trotter • How to extend this to Higher-Order Trotter formulas? • Revisit our base decomposition, need to derive new bounds on r U(t) ≈ UA (t) ◦ UB (t) (14) U2 (t) ≈ UA (t/2) ◦ UB (t/2) ◦ UB (t/2) ◦ UA (t/2) ... (15) (16) 2 2 U2k (t) ≈ U2k−2 (uk t) ◦ U(1−4uk )t ◦ U2k−2 (uk t) (17) 20 / 53 Higher-Order Trotter: Error • We still have three sources of error: Outer-loop, Trotter, and QDrift e U(t) − U(t) ⋄ ≤ ||EA (t)||⋄ + ||EB (t)||⋄ + ||EA,B (t)||⋄ (18) 21 / 53 Higher-Order Trotter: Error • We still have three sources of error: Outer-loop, Trotter, and QDrift e U(t) − U(t) ⋄ ≤ ||EA (t)||⋄ + ||EB (t)||⋄ + ||EA,B (t)||⋄ (18) • Using Childs et. al [’19] for higher-order errors we get t 2k+1 2Υ2k+1 (αcomm (A, 2k) + αcomm ({A, B} , 2k)) ||EA (t/r )||⋄ + ||EA,B (t/r )||⋄ ≤ r 2k + 1 := P(t/r ) P αcomm (A, 2k) ≤ i1 ,...i2k+1 [Ai2k+1 , [Ai2k [. . . , [Ai2 , Ai1 ] . . .] ≤ 22k λ2k+1 A 22 / 53 Higher-Order Trotter: Error • We still have three sources of error: Outer-loop, Trotter, and QDrift e U(t) − U(t) ⋄ ≤ ||EA (t)||⋄ + ||EB (t)||⋄ + ||EA,B (t)||⋄ (18) • Using Childs et. al [’19] for higher-order errors we get t 2k+1 2Υ2k+1 (αcomm (A, 2k) + αcomm ({A, B} , 2k)) ||EA (t/r )||⋄ + ||EA,B (t/r )||⋄ ≤ r 2k + 1 := P(t/r ) P αcomm (A, 2k) ≤ i1 ,...i2k+1 [Ai2k+1 , [Ai2k [. . . , [Ai2 , Ai1 ] . . .] ≤ 22k λ2k+1 A • t 2 2λ2 B ||EB (t/r )||⋄ ≤ := Q(t/r ) r NB 23 / 53 Higher-Order Trotter: Bounding r • We want our error per iteration to be within budget ϵ/r e U(t/r ) − U(t/r ) ⋄ ≤ P(t) Q(t) ϵ + 2 ≤ r r r 2k+1 (19) 24 / 53 Higher-Order Trotter: Bounding r • We want our error per iteration to be within budget ϵ/r e U(t/r ) − U(t/r ) ⋄ ≤ P(t) Q(t) ϵ + 2 ≤ r r r 2k+1 (19) • Using the fact that Q(t) ≥ 0, we can determine a lower bound on r P(t) ϵ 1/2k + which bounds the cost C (A, B; t, ϵ) = (ΥLA + NB )r ≥ (ΥLA + NB ) Q(t) ≤r ϵ P(t) ϵ 1/2k (20) + Q(t) ϵ 25 / 53 Higher-Order Trotter: Partitioning • Now the difficult part, how do we split up H → A + B? Use same trick as before but use pi as probability and compute expectations. # # " " Q(t) Q(t) P(t)1/2k P(t)1/2k + ΥE LA + E NB E [C (H; t, ϵ)] = ΥE LA 1/2k + E NB 1/2k ϵ ϵ ϵ ϵ 26 / 53 Higher-Order Trotter: Partitioning • Now the difficult part, how do we split up H → A + B? Use same trick as before but use pi as probability and compute expectations. # # " " Q(t) Q(t) P(t)1/2k P(t)1/2k + ΥE LA + E NB E [C (H; t, ϵ)] = ΥE LA 1/2k + E NB 1/2k ϵ ϵ ϵ ϵ • To find a good value for pi (prob. i th term in A) we need to either solve the above for an optimum or introduce a heuristic. ! E P(t)1/2k E [Q(t)] E [C ] ≤ (ΥL + NB ) (21) + ϵ ϵ1/2k 27 / 53 Higher-Order Trotter: Heuristics • To convert heuristic into a concrete expression use upper bound on P and lower bound on Q E [P(t)]1/2k E [Q(t)] = ϵ ϵ1/2k 2 2 t 1+1/2k 2E [λB ] t ≤ 6Υ1+1/k 1/2k (αcomm (A, 2k) + αcomm ({A, B} , 2k)) NB ϵ (22) (23) • Use simple upper bounds on commutator structure αcomm ≤ 22k λ2k+1 and concrete P expression for E [λB ] = i (1 − pi )hi 28 / 53 Higher-Order Trotter: Probabilities E [λB ]2 ≤ 3NB Υ1+1/k (2λ)1+1/2k ϵ 1−1/2k t (24) 29 / 53 Higher-Order Trotter: Probabilities E [λB ]2 ≤ 3NB Υ1+1/k (2λ)1+1/2k ϵ 1−1/2k t • We can explicitly write out the expectation value r ϵ 1−1/2k X E [λB ] = (1 − pi )hi ≤ 3NB Υ1+1/k (2λ)1+1/2k t (24) (25) i 30 / 53 Higher-Order Trotter: Probabilities E [λB ]2 ≤ 3NB Υ1+1/k (2λ)1+1/2k ϵ 1−1/2k t • We can explicitly write out the expectation value r ϵ 1−1/2k X E [λB ] = (1 − pi )hi ≤ 3NB Υ1+1/k (2λ)1+1/2k t (24) (25) i • Which allows us to write an expression for the probability term i ends up in the QDrift Channel that satisfies the above ( ! ) r ϵ 1−1/2k λ χ 1 − pi = min 3NB Υ1+1/k 21+1/2k − 1 , 1 := min ,1 hi L λt hi (26) 31 / 53 Higher-Order Trotter: Bounds • The definition of the probabilities before has a problem, there are λ, ϵ, t such that the probabilities are outside of [0, 1]. The solution for this is to bound NB 1 − pi ≥ 0 =⇒ NB ≥ λt ϵ 1−1/2k 1 3Υ1+1/k 21+1/2k (27) 32 / 53 Higher-Order Trotter: Bounds • The definition of the probabilities before has a problem, there are λ, ϵ, t such that the probabilities are outside of [0, 1]. The solution for this is to bound NB 1 − pi ≥ 0 =⇒ NB ≥ λt ϵ 1−1/2k 1 3Υ1+1/k 21+1/2k (27) • Useful to define the set of indices of probabilities that do not ”clip” the min Ω := {i ∈ {1, 2, . . . , L} : 1 − pi ≤ 1} (28) • i ∈ Ω implies we are sampling, i ∈ {1, 2, . . . , L} − Ω := ΩC implies Hi guaranteed in QDrift 33 / 53 Higher-Order Trotter: Expected Cost • We now have everything we need to compute an upper bound on the expected cost ! p q q E [Q(t)2 ] E [P(t)]1/2k E [C (H; t, ϵ)] ≤ + Υ E L2A + E NB2 (29) ϵ ϵ1/2k E [P(t)] ≤ 3(2Υt)2k+1 λ2k (λΩ − χ|Ω|) (30) 34 / 53 Higher-Order Trotter: Expected Cost • We now have everything we need to compute an upper bound on the expected cost ! p q q E [Q(t)2 ] E [P(t)]1/2k E [C (H; t, ϵ)] ≤ + Υ E L2A + E NB2 (29) ϵ ϵ1/2k E [P(t)] ≤ 3(2Υt)2k+1 λ2k (λΩ − χ|Ω|) (30) q q 2λt 2 2 E [Q(t) ] ≤ χλΩ + (χ|Ω| + λΩC )2 NB (31) 35 / 53 Higher-Order Trotter: Expected Cost • We now have everything we need to compute an upper bound on the expected cost ! p q q E [Q(t)2 ] E [P(t)]1/2k E [C (H; t, ϵ)] ≤ + Υ E L2A + E NB2 (29) ϵ ϵ1/2k E [P(t)] ≤ 3(2Υt)2k+1 λ2k (λΩ − χ|Ω|) q q 2λt 2 2 E [Q(t) ] ≤ χλΩ + (χ|Ω| + λΩC )2 NB X E L2A ≤ |Ω|2 − |Ω| (1 − pi ) (30) (31) (32) i∈Ω 36 / 53 Sanity Check: QDrift Limit E [C (H; t, ϵ)] ≤ E [P(t)]1/2k + ϵ1/2k p E [Q(t)2 ] ϵ ! q q Υ E L2A + E NB2 (33) 37 / 53 Sanity Check: QDrift Limit E [C (H; t, ϵ)] ≤ E [P(t)]1/2k + ϵ1/2k p E [Q(t)2 ] ϵ ! q q Υ E L2A + E NB2 (33) • Check cost as pi → 0, meaning all terms are placed in QDrift. Achieved by sending NB → ∞, causes Ω → ∅ s 1−1/2k λ λt 3NB 21+1/2k Υ1+1/k − 1 , 1 (34) 1 − pi ≤ min hi L ϵ Ω = {i : 1 − pi < 1} (35) 38 / 53 Sanity Check: QDrift Limit E [C (H; t, ϵ)] ≤ E [P(t)]1/2k + ϵ1/2k p E [Q(t)2 ] ϵ ! q q Υ E L2A + E NB2 (33) • Check cost as pi → 0, meaning all terms are placed in QDrift. Achieved by sending NB → ∞, causes Ω → ∅ s 1−1/2k λ λt 3NB 21+1/2k Υ1+1/k − 1 , 1 (34) 1 − pi ≤ min hi L ϵ Ω = {i : 1 − pi < 1} (35) • Trotter Cost: E [P(t)]1/2k ∝ (λΩ − χ|Ω|)1/2k → 0, E L2A ≤ |Ω|2 → 0 (36) 39 / 53 Sanity Check: QDrift Limit • Determine remaining terms: E [C ] ≈ (P + Q)(LA + NB ) → Q · NB 40 / 53 Sanity Check: QDrift Limit • Determine remaining terms: E [C ] ≈ (P + Q)(LA + NB ) → Q · NB • QDrift Contributions: q q 2λt 2 2t 2 λ2 E [Q(t)2 ] ≤ χλΩ + (χ|Ω| + λΩC )2 → NB NB (37) 41 / 53 Sanity Check: QDrift Limit • Determine remaining terms: E [C ] ≈ (P + Q)(LA + NB ) → Q · NB • QDrift Contributions: q q 2λt 2 2t 2 λ2 E [Q(t)2 ] ≤ χλΩ + (χ|Ω| + λΩC )2 → NB NB • Overall Cost: E [C (H, t, ϵ; pi → 0)] → 2t 2 λ2 ϵ (37) (38) which exactly matches the QDrift only cost. 42 / 53 Sanity Check: Trotter Limit • Now for pi → 1 we need 1 − pi → 0 s 1−1/2k λt χ λ 3NB 21+1/2k Υ1+1/k − 1 = 1 − pi = hi L ϵ hi (39) • Key point is NB approaches it’s lower bound sends χ → 0, which sends 1 − pi → 0. Further ΩC → ∅ 43 / 53 Sanity Check: Trotter Limit • Now for pi → 1 we need 1 − pi → 0 s 1−1/2k λt χ λ 3NB 21+1/2k Υ1+1/k − 1 = 1 − pi = hi L ϵ hi (39) • Key point is NB approaches it’s lower bound sends χ → 0, which sends 1 − pi → 0. Further ΩC → ∅ • Contribution from Q q q p 2t 2 λ E [Q(t)2 ] ≤ χλΩ + (χ|Ω| + λΩC )2 ∝ χλ + χ2 L2 → 0 (40) NB 44 / 53 Sanity Check: Trotter Limit • Now for pi → 1 we need 1 − pi → 0 s 1−1/2k λt χ λ 3NB 21+1/2k Υ1+1/k − 1 = 1 − pi = hi L ϵ hi (39) • Key point is NB approaches it’s lower bound sends χ → 0, which sends 1 − pi → 0. Further ΩC → ∅ • Contribution from Q q q p 2t 2 λ E [Q(t)2 ] ≤ χλΩ + (χ|Ω| + λΩC )2 ∝ χλ + χ2 L2 → 0 (40) NB • Now the remaining QDrift term that needs to vanish is q q E NB2 = 0 · Pr [|B| = 0] + 1 · Pr [|B| = 1] + NB2 · Pr [|B| > 1] → 0 (41) 45 / 53 Sanity Check: Trotter Limit • If our cost is schematically (P + Q)(LA + NB ), we need to show P · LA upper bounds converge 46 / 53 Sanity Check: Trotter Limit • If our cost is schematically (P + Q)(LA + NB ), we need to show P · LA upper bounds converge E [P(t)] ≤ 3(2Υt)2k+1 λ2k (λΩ − χ|Ω|) → 3(2Υt)2k+1 λ2k+1 X (1 − pi ) → L2 E L2A ≤ |Ω|2 − |Ω| (42) (43) i∈Ω 47 / 53 Sanity Check: Trotter Limit • If our cost is schematically (P + Q)(LA + NB ), we need to show P · LA upper bounds converge E [P(t)] ≤ 3(2Υt)2k+1 λ2k (λΩ − χ|Ω|) → 3(2Υt)2k+1 λ2k+1 X (1 − pi ) → L2 E L2A ≤ |Ω|2 − |Ω| (42) (43) i∈Ω • So our final cost converges to E [C (H, t, ϵ; pi → 1)] → 31/2k (2Υλt)1+1/2k L ϵ1/2k CTrotter = r ΥL ≤ 2Υ (λt)1+1/2k L ϵ1/2k (44) (45) 48 / 53 Recap • First considered a generic splitting of Hamiltonian into A + B and derived an error bound based on A and B • Use this to give cost function, group into Trotter-like time scaling and QDrift time scaling • Heuristic gives an efficiently computable probability distribution for a partition • We checked that our expected cost matches the extreme partitions (A = 0, B = H) and (A = H, B = 0) as we tweak our distribution 49 / 53 Improvements Analytic • When do we expect to see e −iHt gate cost improvements? • To leading order in L, for critical time such that CTrotter = CQDrift , k = 3 and hi = 2−i , we find 2t 2 (1 + O L−1 )2 E [C (tcrit )] ≤ ϵ 31−1/2k Υ1/2k which approaches 0.104. 50 / 53 Improvements Analytic • When do we expect to see e −iHt gate cost improvements? • To leading order in L, for critical time such that CTrotter = CQDrift , k = 3 and hi = 2−i , we find 2t 2 (1 + O L−1 )2 E [C (tcrit )] ≤ ϵ 31−1/2k Υ1/2k which approaches 0.104. 51 / 53 Conclusion 1. We’ve shown that by decomposing simulation into individual channels for a partitioning of a Hamiltonian is feasible, consistent, and can lead to proven constant factor gate count reductions 2. We only considered Trotter-Suzuki Formulas and QDrift channels, but this approach can flexibly interpolate between any type of ”product formula” 3. We’ve given an efficiently computable heuristic partitioning distribution which avoids 2L optimization 4. Future work: Possibly include alternative simulations methods, numerically investigating cost savings (vs upper bounds), possible ”backpropagation” to graph weights 52 / 53 References • Childs, A.M., Su, Y., Tran, M.C., Wiebe, N. and Zhu, S., 2021. Theory of trotter error with commutator scaling. Physical Review X, 11(1), p.011020. • Campbell, E., 2019. Random compiler for fast Hamiltonian simulation. Physical review letters, 123(7), p.070503. 53 / 53