# Green's function via method:apply(Jordan-wigner..."Cdagup"|0\>)

**URL:** <https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628>\
**Category:** ITensor Julia Questions\
**Tags:** mps, mpo\
**Created:** [July 13, 2026, 6:31pm UTC](https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628 "2026-07-13T18:31:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@Leon](https://itensor.discourse.group/u/Leon)\
**Post date:** [July 13, 2026, 6:31pm UTC](https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628/1 "2026-07-13T18:31:38Z")

</div>

Hello there,

I was planning to compute greater and lesser Green’s functions for an tight binding model I was intereseted in. After some try and error, I noticed my implementation was lagging the Jordan Wigner string operators (JW) to respect the fermionic statistics. I did so in the following code

```julia
using ITensors, ItensorsMPW

function yield_proper_Cdag_(sites, j)

    JW_dagup_j = ITensor[]
    JW_up_j = ITensor[]
    JW_dagdn_j = ITensor[]
    JW_dn_j = ITensor[]

    push!(JW_dagup_j, op(sites, "Cdagup", j)) #creation
    push!(JW_dagdn_j, op(sites, "Cdagdn", j)) #creation

    push!(JW_dn_j, op(sites, "F", j)) #additional JW for creation spin_dn
    for k in 1:(j-1)
        push!(JW_up_j, op(sites, "F", k)) 
        push!(JW_dn_j, op(sites, "F", k)) 
        push!(JW_dagup_j, op(sites, "F", j-k)) #reversed order due to ^dagger
        push!(JW_dagdn_j, op(sites, "F", j-k)) #reversed order due to ^dagger
    end
    push!(JW_dn_j, op(sites, "F", j)) #additional JW for annihilation spin_dn

    push!(JW_up_j, op(sites, "Cup", j))
    push!(JW_dn_j, op(sites, "Cdn", j))

    
    return JW_dagup_j, JW_dagdn_j, JW_up_j, JW_dn_j
end

```

However, I was told, that there are implementation procedures, which already engage at least the local parity behavior. This would otherwise be fixed by adding an JW-Operator on the actual site, where an “Cdn” is added (that corresbosnds to the two push! statements right before and after my Code example).

My question is therefore:  
Does the ITensor implementation already fix the local behaviour, or am I supposed to add the additional ones?

Note:  
I am not using the MPO method, since I have to apply a “C(dag)” operator to perform time evolution for my calculation of Greens functions. I am also open for better suggestions to implement this too :).

---

<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:** [July 17, 2026, 7:33pm UTC](https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628/2 "2026-07-17T19:33:08Z")

</div>

This library should work with non QN conserving operators. Let me know how it goes.

> **[GitHub - ITensor/ITensorMPOConstruction.jl: Alternative backends for constructing MPOs from...](https://github.com/ITensor/ITensorMPOConstruction.jl)**
>
> Alternative backends for constructing MPOs from sums of operators.

---

<div class="post-metadata">

**Author:** ![Leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@Leon](https://itensor.discourse.group/u/Leon)\
**Post date:** [July 17, 2026, 10:27pm UTC](https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628/3 "2026-07-17T22:27:25Z")

</div>

Thank you for your responds.  
If you are implying to use **MPO\_new** to avoid manual wigner string handling by staying within the MPO enviroment, I have to report, that using this raises the same error as the usual MPO method:

`Odd parity fermion terms not supported: OpID{Int64}[OpID{Int64}(2, 2), OpID{Int64}(0, 0)]`

Would you expect other behaviour?

---

<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:** [July 18, 2026, 5:46am UTC](https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628/4 "2026-07-18T05:46:33Z")

</div>

Oh my mistake. I forgot about the parity restriction. Let me think if I can add support for odd parity operators.

---

<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:** [July 20, 2026, 1:30am UTC](https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628/5 "2026-07-20T01:30:37Z")

</div>

If you update ITensorMPOConstruction to the newly released v0.2.2, you should be able to create odd parity MPOs now. Let me know how it goes.

---

<div class="post-metadata">

**Author:** ![Leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@Leon](https://itensor.discourse.group/u/Leon)\
**Post date:** [July 20, 2026, 12:05pm UTC](https://itensor.discourse.group/t/greens-function-via-method-apply-jordan-wigner-cdagup-0/2628/6 "2026-07-20T12:05:20Z")

</div>

hm, the operator gets initialized and as simulations show, they handle the parity properly. However, this and the manual handling of the “Cdagup/dn” operators yield the same behaviour of creating ghost particles, which I would identify as another problem being not related to the Jordan-wigner string handling. I assumed this to be a problem related to the non fermionic operators, which is apparently not.

Since I want to use the ITensor library to run simulations for my thesis, I suppose I will switch to another MPS implementation. I did see too many weird things happening working with this library. I may write an report together with my supervisor soon.

But thank you anyway for your effort.
