# How to realize momentum Entanglement spectrum in ITensor.jl

**URL:** <https://itensor.discourse.group/t/how-to-realize-momentum-entanglement-spectrum-in-itensor-jl/750>\
**Category:** ITensor Julia Questions\
**Created:** [April 7, 2023, 2:38pm UTC](https://itensor.discourse.group/t/how-to-realize-momentum-entanglement-spectrum-in-itensor-jl/750 "2023-04-07T14:38:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kevinh](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/kevinh/32/139_2.png) [@kevinh](https://itensor.discourse.group/u/kevinh)\
**Post date:** [April 8, 2023, 12:43pm UTC](https://itensor.discourse.group/t/how-to-realize-momentum-entanglement-spectrum-in-itensor-jl/750/3 "2023-04-08T12:43:38Z")

</div>

Hi, miles  
Thanks for your answer, and I still looking forward to share my doubt here. As when we run the code in [ITensors.jl/2d\_hubbard\_conserve\_momentum.jl at e7740ebb8df26cbacc1671113656e702030e43bb · ITensor/ITensors.jl · GitHub](https://github.com/ITensor/ITensors.jl/blob/e7740ebb8df26cbacc1671113656e702030e43bb/examples/dmrg/2d_hubbard_conserve_momentum.jl) in ITensor.jl example, we can obtain a state described by 3 quantum numbers, like

```auto
[1] ((dim=4|id=69|"ElecK,Site,n=1") <Out>
  1: QN(("Ky",0,3),("Nf",0,-1),("Sz",0)) => 1
  2: QN(("Ky",0,3),("Nf",1,-1),("Sz",1)) => 1
  3: QN(("Ky",0,3),("Nf",1,-1),("Sz",-1)) => 1
  4: QN(("Ky",0,3),("Nf",2,-1),("Sz",0)) => 1, (dim=2|id=444|"Link,l =1") <Out>
  1: QN(("Ky",0,3),("Nf",17,-1),("Sz",1)) => 1
  2: QN(("Ky",0,3),("Nf",17,-1),("Sz",-1)) => 1)

```

Generally, the processing of the entanglement spectrum in real space is similar to the process of calculating **entanglement entropy** , reshape the ground state _psi_ into a matrix for svd decomposition, obtain S, and then perform the following operations  
 ![real space](https://global.discourse-cdn.com/free1/uploads/itensor/original/1X/417bb98cb2fb9d3b8da9a95ec118db64b1ec6e7d.png)

If my understanding is correct (and of course it is quite possible to be wrong),  
The momentum entanglement spectrum of the **finite dmrg** , such as Ky=0, is a part of the above ground state _psi_ extracted to perform the above operation in picture?

If so, then one of the difficulties I have encountered is how to get the blocked matrix generated by the ground state according to the quantum number of momentum, because the above svd decomposition process seems to have destroyed the quantum number structure？ This seems very difficult, and there is no template, documentation or sample code that does it.

Thanks to your help,thanks to ITensor Forum.

---

_[View the full topic](https://itensor.discourse.group/t/how-to-realize-momentum-entanglement-spectrum-in-itensor-jl/750)._
