# ED with Itensor

**URL:** <https://itensor.discourse.group/t/ed-with-itensor/1088>\
**Category:** ITensor Julia Questions\
**Created:** [August 13, 2023, 11:22pm UTC](https://itensor.discourse.group/t/ed-with-itensor/1088 "2023-08-13T23:22:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![JanReimers](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/janreimers/32/171_2.png) [@JanReimers](https://itensor.discourse.group/u/JanReimers)\
**Post date:** [August 14, 2023, 2:19am UTC](https://itensor.discourse.group/t/ed-with-itensor/1088/2 "2023-08-14T02:19:00Z")

</div>

Hi Kristin, The short answer is yes. Here is a code sample:

```auto
using ITensors
let
    N=6
    s=siteinds("S=1/2",N;conserve_qns=true)
    os = OpSum()
    for j in 1:(N - 1)
        os += "Sz", j, "Sz", j + 1
        os += 0.5, "S+", j, "S-", j + 1
        os += 0.5, "S-", j, "S+", j + 1
    end
    cb=combiner(dag(s)...)
    cbp=combiner(s'...)
    H = prod(MPO(os, s))*cb*cbp
    E,V=eigen(H,combinedind(cb),combinedind(cbp))
    @show sort(array(real(diag(E))))
end

Efficiency can be improved with ishermitian=true in the eigen call.
I hope this helps.
JR

```

---

_[View the full topic](https://itensor.discourse.group/t/ed-with-itensor/1088)._
