How we can define the spin-1 Boson site for the following Hamiltonian:

\(H = - t \sum_{i, \sigma} \left(b^\dagger_{i, \sigma} b_{i+1, \sigma} + H.c. \right) + U_1 \sum_i n_{i, \sigma}\left(n_{i, \sigma}-1\right) + U_2 \sum_i \mathbf{S}_i^2\)

where spin operator \(\mathbf{S}_i = \sum_{\sigma,\sigma'} b^\dagger_{\sigma,\sigma'} S_{\sigma,\sigma'} b_{\sigma,\sigma'} \), with standard spin-1 matrice \(S_{\sigma,\sigma'}\).

Is it right like this?

Code: Select all

```
# Set site
boson_site_1 = BosonSite(Nmax=n_max, conserve='N') # spin component 1
boson_site_2 = BosonSite(Nmax=n_max, conserve='N') # spin component 0
boson_site_3 = BosonSite(Nmax=n_max, conserve='N') # spin component -1
# Set lattice
lat = Lattice([L], [boson_site_1, boson_site_2, boson_site_3], bc=bc, bc_MPS=bc_MPS)
# Add terms of the Hamiltonian
self.add_coupling(-t,0,'Bd',0,'B',1)
self.add_coupling(-t,1,'Bd',1,'B',1)
self.add_coupling(-t,2,'Bd',2,'B',1)
```

How to define spin operators and add Last term when adding terms of the Hamiltonian?