How to get a Hamiltonian with consant

Hi everyone
I want to add a constant value to Hamiltonian, e.g. H=fermion term + mu (mu=fixed constant). I use code like os + = mu, but I always get the following errors
QQ图片20230928101953

I can not find related contents in the guidline or forum. Who can help me ? Thanks.

It depends on what you mean, but a constant shift to the Hamiltonian H -> H + µI can be done by

os += μ,"I",j

(This is different than say a chemical potential µ where one does something like os += μ,"Ntot",j)

1 Like