Matrix representation of dN operator

How do I use this algorithm? What does that parameter do?
Post Reply
jper30
Posts: 1
Joined: 29 Feb 2024, 14:01

Matrix representation of dN operator

Post by jper30 »

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
Jakob
Posts: 3
Joined: 30 Jan 2023, 22:57

Re: Matrix representation of dN operator

Post by Jakob »

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}
Post Reply