Safe Haskell | None |
---|

This module provides the main circuit for the GSE algorithm. This circuit consists of a state preparation, followed by a large number of Hamiltonian simulation terms for small time steps, followed by an inverse Quantum Fourier Transform and a final measurement.

- exp_pq :: ((Int, Int) -> Double) -> Double -> [Qubit] -> Qubit -> Circ ()
- exp_pqrs :: ((Int, Int, Int, Int) -> Double) -> Double -> [Qubit] -> Qubit -> Circ ()
- exp_pqrs_orthodox :: ((Int, Int, Int, Int) -> Double) -> Double -> [Qubit] -> Qubit -> Circ ()
- unitary_hat_at :: GSEData -> Int -> Double -> Double -> Bool -> Int -> [Qubit] -> Qubit -> Circ ()
- gse :: Int -> Int -> Int -> GSEData -> Double -> Double -> (Int -> Int) -> Bool -> Circ [Bit]

# Basic time step

These functions provide one- and two-electron operators for an individual Trotter time step θ. Each operator consists of a large number of individual Hamiltonian terms.

exp_pq :: ((Int, Int) -> Double) -> Double -> [Qubit] -> Qubit -> Circ () Source #

Apply the one-electron operator *e*^{-iθH}, where
*H* = *h*_{pq} *a*_{p}^{†}*a*_{q} if *p* = *q* and
*H* = *h*_{pq} (*a*_{p}^{†}*a*_{q}
+ *a*_{q}^{†}*a*_{p}) otherwise, to every pair of
qubits *p*≥*q* in a register |ψ〉. The inputs are Hamiltonian data
*h*, the angle θ, the register |ψ〉, and a control qubit.

exp_pqrs :: ((Int, Int, Int, Int) -> Double) -> Double -> [Qubit] -> Qubit -> Circ () Source #

Apply the two-electron operator *e*^{-iθH}, where
*H* = *h*_{pqrs}
*a*_{p}^{†}*a*_{q}^{†}*a*_{r}*a*_{s} if
(*p*,*q*) = (*s*,*r*) and *H* =
*a*_{p}^{†}*a*_{q}^{†}*a*_{r}*a*_{s} +
*a*_{s}^{†}*a*_{r}^{†}*a*_{q}*a*_{p}
otherwise, to every quadruple (*p*, *q*, *r*, *s*) of qubits in a
register |ψ〉. To ensure that terms are enumerated exactly once, we
only consider indices where (*p*, *q*) ≥ (*s*, *r*) in the
lexicographic order (i.e., *p*>*s* or (*p*=*s* and *q*≥*r*). The
inputs are Hamiltonian data *h*, the angle θ, the register |ψ〉,
and a control qubit.

exp_pqrs_orthodox :: ((Int, Int, Int, Int) -> Double) -> Double -> [Qubit] -> Qubit -> Circ () Source #

Like `exp_pqrs`

, but use the "orthodox" circuit template for
the Coulomb operator.

# Iteration

The following function iterates the basic Trotter timestep
*N*_{k} times, and also normalizes the maximum energy
*E*_{max}.

:: GSEData | The integral data |

-> Int | The Trotter iteration count |

-> Double | The Hamiltonian scaling parameter τ. |

-> Double | The maximum energy |

-> Bool | Use the "orthodox" Coulomb operator? |

-> Int | The control qubit index |

-> [Qubit] | The state |ψ〉. |

-> Qubit | The control qubit |

-> Circ () |

Apply the operator Û_{k} ≈
*e*^{iEmaxτ2k}*e*^{-iHτ2k} to |ψ〉.

# Main circuit

The main circuit for the GSE Algorithm. This consists of the initial state preparation, the Trotterized phase estimation circuit, the Quantum Fourier Transform, and the final measurement.

:: Int | The number of precision qubits |

-> Int | The number of basis functions |

-> Int | The number of occupied orbitals |

-> GSEData | The integral data |

-> Double | The Hamiltonian scaling parameter τ. |

-> Double | The maximum energy |

-> (Int -> Int) | The function |

-> Bool | Use the "orthodox" Coulomb operator? |

-> Circ [Bit] |

The main circuit for the GSE Algorithm.