# Problem with exp and sparse matrices

**URL:** <https://itensor.discourse.group/t/problem-with-exp-and-sparse-matrices/2589>\
**Category:** DMRG and Numerical Methods\
**Created:** [February 27, 2026, 11:09pm UTC](https://itensor.discourse.group/t/problem-with-exp-and-sparse-matrices/2589 "2026-02-27T23:09:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![corbett5](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/corbett5/32/886_2.png) [@corbett5](https://itensor.discourse.group/u/corbett5)\
**Post date:** [March 2, 2026, 9:05pm UTC](https://itensor.discourse.group/t/problem-with-exp-and-sparse-matrices/2589/2 "2026-03-02T21:05:18Z")

</div>

Change

```julia
siteinds("Electron", 4, conserve_qns = true);

```

to

```julia
siteinds("Electron", 4, conserve_nf = true);

```

With `conserve_qns=true`, the electron site conserves both number and spin. See [SiteTypes Included with ITensor · ITensorMPS.jl](https://docs.itensor.org/ITensorMPS/stable/IncludedSiteTypes.html#%22Electron%22-SiteType)

Also, as demonstrated by the following post you can easily run into issues with constructing fermionic operators directly from `op`. [Problem with TEBD on Fermi-Hubbard model with Electron indices](https://itensor.discourse.group/t/problem-with-tebd-on-fermi-hubbard-model-with-electron-indices/2570)

---

_[View the full topic](https://itensor.discourse.group/t/problem-with-exp-and-sparse-matrices/2589)._
