# Hamiltonian of Bose-Hubbard model

In https://medium.com/qiskit/introducing-bosonic-qiskit-a-package-for-simulating-bosonic-and-hybrid-qubit-bosonic-circuits-1e1e528287bb , could anyone explain the rationale behind the use of beamsplitter Ubs and SNAP gate Usnap ? What does it mean by n is the occupancy of site i ?

The Hamiltonian of the Bose-Hubbard model is: $$H=-J\sum_{\langle i,j\rangle}(a^\dagger_ia_j+a_ia_j^\dagger)+\frac{U}{2}\sum_i a_i^\dagger a_i^\dagger a_i a_i.$$ Here, $$\langle i, j\rangle$$ denotes summation over all neighboring lattice sites $$i$$ and $$j$$, while $$a_i^\dagger(a_i)$$ is the creation (annihilation) operators which increases (decreases) the occupancy at site $$i$$ by one. To study the time evolution under this Hamiltonian, we need to implement the unitary time evolution operator $$e^{-iHt}$$ (we have set $$\hbar = 1$$). To achieve this, we rely on the Trotter formula: $$e^{A+B}=\lim_{n\to\infty}(e^{A/n}e^{B/n})^n$$ Which allows us to approximate the full time evolution operator via alternation of: $$U_1=e^{-iH_1\Delta t}\mathrm{\:and\:}U_2=e^{-iH_2\Delta t}$$ Where $$H_1$$ and $$H_2$$ refer to the first (hopping) and second interaction) term of $$H$$, respectively.

Below, we demonstrate a simple simulation of the 1D Bose-Hubbard model using Bosonic Qiskit. In particular, we use beamsplitters of the form: $$U_\mathrm{BS}(\theta)=e^{i\theta(a_i^\dagger a_j+a_i a_j^\dagger)}$$ to realize $$U_1$$, and use SNAP gates, $$U_\mathrm{SNAP}(\theta_n,n)=e^{i\theta_n|n\rangle\langle n|}$$ to realize $$U_2$$ (i.e., one can show that $$a_i^\dagger a_i^\dagger a_i a_i=\Sigma \_n(n_i(n_i-1)|n_i\rangle\langle n_i|)$$ where $$n$$ is the occupancy of site $$i$$, which enables synthesis of $$U_2$$ through application of SNAP for each $$\{n,i\}$$ and an appropriate choice of the phase $$\theta_n$$).