# \#qn

**URL:** https://itensor.discourse.group/tag/qn/13.md

[Latest](https://itensor.discourse.group/latest.md) · [Categories](https://itensor.discourse.group/categories.md) · [Tags](https://itensor.discourse.group/tags.md)

---

## [Manually set MPS tensors with QN conservation features enabled](https://itensor.discourse.group/t/manually-set-mps-tensors-with-qn-conservation-features-enabled/2504)

<div class="topic-metadata">

**Author:** [@phx](https://itensor.discourse.group/u/phx)\
**Replies:** 1\
**Last updated:** [November 10, 2025, 3:51pm UTC](https://itensor.discourse.group/t/manually-set-mps-tensors-with-qn-conservation-features-enabled/2504 "2025-11-10T15:51:31Z")

</div>

Hi all, I need some help on the following problem. I have an MPS with the Fermion site type, representing the state \\psi of a many-body fermionic system, and I’d like to use it to create an Electron-type MPS where both …

---

## [Unexpected error with number-conserving MPO when result is zero](https://itensor.discourse.group/t/unexpected-error-with-number-conserving-mpo-when-result-is-zero/2521)

<div class="topic-metadata">

**Author:** [@phx](https://itensor.discourse.group/u/phx)\
**Replies:** 2\
**Last updated:** [November 1, 2025, 7:02pm UTC](https://itensor.discourse.group/t/unexpected-error-with-number-conserving-mpo-when-result-is-zero/2521 "2025-11-01T19:02:55Z")

</div>

The following code gives an error which I don’t understand. I set up two different states with number conservation active: using ITensors, ITensorMPS N = 3 s = siteinds("Electron", N; conserve\_nf=true) x = MPS(s, \["Emp…

---

## [“Eigen currently only supports block diagonal matrices.” when applying an MPO to a MPS with QNs](https://itensor.discourse.group/t/eigen-currently-only-supports-block-diagonal-matrices-when-applying-an-mpo-to-a-mps-with-qns/2520)

<div class="topic-metadata">

**Author:** [@phx](https://itensor.discourse.group/u/phx)\
**Replies:** 3\
**Last updated:** [November 1, 2025, 7:39am UTC](https://itensor.discourse.group/t/eigen-currently-only-supports-block-diagonal-matrices-when-applying-an-mpo-to-a-mps-with-qns/2520 "2025-11-01T07:39:27Z")

</div>

I’m trying to find a way to write the mixed state of a many-body system of spinless fermions as an MPS of the Electron site type. The idea is essentially to map the primed site index of each MPS tensor to the ↑ degree of…

---

## [TDVP for a Mixed Site System](https://itensor.discourse.group/t/tdvp-for-a-mixed-site-system/2463)

<div class="topic-metadata">

**Author:** [@chemicalfiend](https://itensor.discourse.group/u/chemicalfiend)\
**Replies:** 3\
**Last updated:** [August 12, 2025, 3:32am UTC](https://itensor.discourse.group/t/tdvp-for-a-mixed-site-system/2463 "2025-08-12T03:32:46Z")

</div>

Hello! I have a question about running TDVP for a mixed-site system of bosons and fermions. I have a system with nearest-neighbor coupled fermionic sites each coupled locally to bosonic sites (Hamiltonian generated roug…

---

## [Exited state with fixed QN](https://itensor.discourse.group/t/exited-state-with-fixed-qn/2449)

<div class="topic-metadata">

**Author:** [@jackaraz](https://itensor.discourse.group/u/jackaraz)\
**Replies:** 2\
**Last updated:** [July 22, 2025, 7:59pm UTC](https://itensor.discourse.group/t/exited-state-with-fixed-qn/2449 "2025-07-22T19:59:16Z")

</div>

Hi, I’m trying to prepare an excited state that satisfies a certain quantum number at a flavour sector. Normally, I use conserve\_qns=True with the hamiltonian ampo = AutoMPO() sites = siteinds("Fermion", nsites\*nflavour…

---

## [Proper Environment Variables for Managing MKL and Julia Threads](https://itensor.discourse.group/t/proper-environment-variables-for-managing-mkl-and-julia-threads/2305)

<div class="topic-metadata">

**Author:** [@swanchristmas](https://itensor.discourse.group/u/swanchristmas)\
**Replies:** 1\
**Last updated:** [March 14, 2025, 2:43pm UTC](https://itensor.discourse.group/t/proper-environment-variables-for-managing-mkl-and-julia-threads/2305 "2025-03-14T14:43:11Z")

</div>

I’m encountering conflicting threading behavior when running DMRG calculations with Julia (v1.11.3) and MKL. Despite efforts to limit thread counts, CPU usage spikes to ~2000% with degraded performance. Here are key obse…

---

## [The question of calculating the zero-frequency Green's function for a one-dimensional interacting fermion model with open and periodic boundary conditions.](https://itensor.discourse.group/t/the-question-of-calculating-the-zero-frequency-greens-function-for-a-one-dimensional-interacting-fermion-model-with-open-and-periodic-boundary-conditions/2154)

<div class="topic-metadata">

**Author:** [@meng\_0121](https://itensor.discourse.group/u/meng_0121)\
**Replies:** 0\
**Last updated:** [December 6, 2024, 3:07am UTC](https://itensor.discourse.group/t/the-question-of-calculating-the-zero-frequency-greens-function-for-a-one-dimensional-interacting-fermion-model-with-open-and-periodic-boundary-conditions/2154 "2024-12-06T03:07:50Z")

</div>

Hi, Recently, I’ve been calculating the Green’s function G(k, \\omega) = \\langle 0| c\_{k}^{\\dagger} \\frac{1}{\\omega+\\mu+E\_{N}^{0}-H} c\_{k}|0\\rangle +\\langle 0| c\_{k} \\frac{1}{\\omega+\\mu-E\_{N}^{0}+H} c\_{k}^{\\dagger}|0\\…

---

## [Artificially increase bond dimension of MPS with conserved QNs](https://itensor.discourse.group/t/artificially-increase-bond-dimension-of-mps-with-conserved-qns/2133)

<div class="topic-metadata">

**Author:** [@phx](https://itensor.discourse.group/u/phx)\
**Replies:** 4\
**Last updated:** [November 24, 2024, 7:58am UTC](https://itensor.discourse.group/t/artificially-increase-bond-dimension-of-mps-with-conserved-qns/2133 "2024-11-24T07:58:42Z")

</div>

Hi everyone, I’m trying to artificially increase the bond dimensions of a product-state MPS to a given bond dimension N (since I want to use this state in a TDVP evolution algorithm with fixed bond dimensions). I start …

---

## [Issue with ITensor flux while implementing conserved parity in DMRG C++](https://itensor.discourse.group/t/issue-with-itensor-flux-while-implementing-conserved-parity-in-dmrg-c/1958)

<div class="topic-metadata">

**Author:** [@sutapa](https://itensor.discourse.group/u/sutapa)\
**Replies:** 5\
**Last updated:** [November 18, 2024, 5:17am UTC](https://itensor.discourse.group/t/issue-with-itensor-flux-while-implementing-conserved-parity-in-dmrg-c/1958 "2024-11-18T05:17:12Z")

</div>

Hi there! I am trying to implement conserved parity in ITensor C++ version. I consider one dimensional Ising chain with periodic boundary condition. The Hamiltonian is H = -g\\sum\_j \\sigma\_j^z- J\\sum\_j \\sigma\_j^x \\sigma\_…

---

## [Sites with three conserved QNs yield a wrong Hamiltonian](https://itensor.discourse.group/t/sites-with-three-conserved-qns-yield-a-wrong-hamiltonian/1937)

<div class="topic-metadata">

**Author:** [@Tingyu\_Weizmann](https://itensor.discourse.group/u/Tingyu_Weizmann)\
**Replies:** 0\
**Last updated:** [August 20, 2024, 2:05am UTC](https://itensor.discourse.group/t/sites-with-three-conserved-qns-yield-a-wrong-hamiltonian/1937 "2024-08-20T02:05:56Z")

</div>

Hi, I found a way to have two separately conserved QNs in the ITensor documentation. However, I got a problematic Hamiltonian when I did the same procedure for three conserved QNs. The same opsum yields two MPOs with di…

---

## [Mixed site set with conserved total quantum number](https://itensor.discourse.group/t/mixed-site-set-with-conserved-total-quantum-number/1800)

<div class="topic-metadata">

**Author:** [@anaskura](https://itensor.discourse.group/u/anaskura)\
**Replies:** 1\
**Last updated:** [June 12, 2024, 3:17pm UTC](https://itensor.discourse.group/t/mixed-site-set-with-conserved-total-quantum-number/1800 "2024-06-12T15:17:54Z")

</div>

Hi there! I have a question about Mixed state that involve electrons and spin-1/2. I have a system with electrons and one spin-1/2. I would like to conserve fermion parity for electrons only and for the whole system z c…

---

## [Extracting Target Symmetry Sectors to Create Sparse Arrays in ITensor](https://itensor.discourse.group/t/extracting-target-symmetry-sectors-to-create-sparse-arrays-in-itensor/1755)

<div class="topic-metadata">

**Author:** [@swanchristmas](https://itensor.discourse.group/u/swanchristmas)\
**Replies:** 3\
**Last updated:** [May 27, 2024, 4:01pm UTC](https://itensor.discourse.group/t/extracting-target-symmetry-sectors-to-create-sparse-arrays-in-itensor/1755 "2024-05-27T16:01:22Z")

</div>

Thanks for Matt’s previous help in Comparative Analysis of Exact Diagonalization Strategies in ITensor: Index Fusion Techniques and Computational Efficiency. I have 2 more questions which I will ask separately. This pos…

---

## [Comparative Analysis of Exact Diagonalization Strategies in ITensor: Index Fusion Techniques and Computational Efficiency](https://itensor.discourse.group/t/comparative-analysis-of-exact-diagonalization-strategies-in-itensor-index-fusion-techniques-and-computational-efficiency/1745)

<div class="topic-metadata">

**Author:** [@swanchristmas](https://itensor.discourse.group/u/swanchristmas)\
**Replies:** 4\
**Last updated:** [May 22, 2024, 1:22pm UTC](https://itensor.discourse.group/t/comparative-analysis-of-exact-diagonalization-strategies-in-itensor-index-fusion-techniques-and-computational-efficiency/1745 "2024-05-22T13:22:23Z")

</div>

In my exploration of the ED (Exact Diagonalization) technique using ITensor, I’ve encountered five distinct strategies outlined in discussions here: Jan’s approach: This involves creating a combiner that fuses all site…

---

## [apply MPO to MPS that changes quantum number](https://itensor.discourse.group/t/apply-mpo-to-mps-that-changes-quantum-number/143)

<div class="topic-metadata">

**Author:** [@Shengtao](https://itensor.discourse.group/u/Shengtao)\
**Replies:** 13\
**Last updated:** [May 20, 2024, 2:45pm UTC](https://itensor.discourse.group/t/apply-mpo-to-mps-that-changes-quantum-number/143 "2024-05-20T14:45:10Z")

</div>

Hi Miles and Matt, I would like to construct an MPO that has a definite change of quantum number (e.g. a sum of C^dag\_i C^dag\_j terms) and apply it to an MPS that has this quantum number. One way I can do it is change …

---

## [Why the constant maxQNs is set to 4?](https://itensor.discourse.group/t/why-the-constant-maxqns-is-set-to-4/1495)

<div class="topic-metadata">

**Author:** [@Tingyu\_Weizmann](https://itensor.discourse.group/u/Tingyu_Weizmann)\
**Replies:** 2\
**Last updated:** [February 24, 2024, 7:08am UTC](https://itensor.discourse.group/t/why-the-constant-maxqns-is-set-to-4/1495 "2024-02-24T07:08:36Z")

</div>

Hi all, I recently tried to simulate a system with U(1) \\times U(1) \\times U(1) \\times U(1) symmetry but encountered an error Cannot add QNVal, QN already contains maximum number of QNVals from the qn.jl. The error occu…

---

## [Calculation of two-point correlator in the quantum number conservation framework](https://itensor.discourse.group/t/calculation-of-two-point-correlator-in-the-quantum-number-conservation-framework/1349)

<div class="topic-metadata">

**Author:** [@navnishu2010](https://itensor.discourse.group/u/navnishu2010)\
**Replies:** 3\
**Last updated:** [December 28, 2023, 7:00pm UTC](https://itensor.discourse.group/t/calculation-of-two-point-correlator-in-the-quantum-number-conservation-framework/1349 "2023-12-28T19:00:42Z")

</div>

Hi all I am trying to calculate the two-point correlator of the following form in the context of a chain of spin-half particles C(x,t)=\\langle\[\\sigma\_x^+(t), \\sigma\_x^-(0)\]\\rangle I am doing calculations for XXX chain…

---

## [Is there any way to implement DMRG on a MPS with custom quantum numbers?](https://itensor.discourse.group/t/is-there-any-way-to-implement-dmrg-on-a-mps-with-custom-quantum-numbers/1047)

<div class="topic-metadata">

**Author:** [@nothingham](https://itensor.discourse.group/u/nothingham)\
**Replies:** 0\
**Last updated:** [July 21, 2023, 4:15pm UTC](https://itensor.discourse.group/t/is-there-any-way-to-implement-dmrg-on-a-mps-with-custom-quantum-numbers/1047 "2023-07-21T16:15:43Z")

</div>

I am trying to do quadratic constrained binary optimization using a custom MPS which supports multiple quantum numbers at each site corresponding to the constraints. The implementation I’m trying to replicate can be foun…

---

## [How is the link representation optimized in the quantum-number conserving DMRG algorithm](https://itensor.discourse.group/t/how-is-the-link-representation-optimized-in-the-quantum-number-conserving-dmrg-algorithm/999)

<div class="topic-metadata">

**Author:** [@Kat](https://itensor.discourse.group/u/Kat)\
**Replies:** 1\
**Last updated:** [July 5, 2023, 3:35am UTC](https://itensor.discourse.group/t/how-is-the-link-representation-optimized-in-the-quantum-number-conserving-dmrg-algorithm/999 "2023-07-05T03:35:46Z")

</div>

Hi, I’m studying quantum-number (QN) conserving DMRG calculation. In the normal DMRG, it is sufficient to only optimize the MPS elements, but in the QN calculation, I think the representations of QNs in each link shoul…
