Hello,
Is there an easy way to access the matrix representation of the dN operator for fermion sites? Specifically if the filling is 0.5, and so dN = n - 0.5, how can this be represented as a matrix?
Thank you
Matrix representation of dN operator
Re: Matrix representation of dN operator
Yes, you can have a look at the operator in the site
Code: Select all
In [3]: import tenpy as tp
In [4]: site = tp.FermionSite(filling=0.5)
In [5]: site.dN
Out[5]: <npc.Array shape=(2, 2) labels=['p', 'p*']>
In [6]: site.dN.to_ndarray()
Out[6]:
array([[-0.5, 0. ],
[ 0. , 0.5]])
In[7]: # The basis is { |empty> , |full> } as we can check by looking at the state_labels:
In [8]: site.state_labels
Out[8]: {'empty': 0, 'full': 1}