qojulia / QuantumCumulants.jl

Generalized mean-field equations in open quantum systems
Other
70 stars 13 forks source link

scale sums: prefactor N or (N-1) #169

Closed tnadolny closed 1 year ago

tnadolny commented 1 year ago

Hi, I noticed that some terms in the mean field equation scale like N, while others scale like N-1. For example:

#v0.2.19
@cnumbers N
h= NLevelSpace(:s,2)
i1 = Index(h,:i1,N,h)
i2 = Index(h,:i2,N,h)
s(α,β,i) = IndexedOperator(Transition(h, :σ, α, β),i)

scale(average(Σ(s(1,2,i1)*s(2,2,i2),i1,[i2]))) # (−1+𝑁)⟨𝜎121𝜎222⟩
scale(average(Σ(s(1,2,i1),i1,[i2]))) #𝑁⟨𝜎121⟩

Is this intended? Importantly, I get

scale(average(Σ(s(1,2,i1)*s(1,1,i2),i1,[i2]))) # 𝑁⟨𝜎121⟩+(1−1𝑁)⟨𝜎121𝜎222⟩

and because of such terms, I sometimes cannot divide some other parameter by N to eliminate N from the mean field equations.

ChristophHotter commented 1 year ago

Hi @tnadolny Yes, that is intended. For Σ(s(1,2,i1)*s(2,2,i2),i1,[i2]) you have a sum over all i1 but with i1 ≠ i2. This means you only have N-1 elements in the sum, therefore you get (𝑁-1)⟨𝜎121𝜎222⟩

For scale(average(Σ(s(1,2,i1)*s(2,2,i2),i1))) you get (N-1)⟨𝜎121𝜎222⟩ + ⟨𝜎121⟩, the last term is for i1 = i2 which appears exactly once.

tnadolny commented 1 year ago

Thanks @ChristophHotter, I believe I understand your examples. However, what about scale(average(Σ(s(1,2,i1),i1,[i2]))) which gives 𝑁⟨𝜎121⟩, even though one index (i2) should not be included in the sum?

ChristophHotter commented 1 year ago

Yes, it is more natural to obtain 𝑁⟨𝜎121⟩ from scale(average(Σ(s(1,2,i1),i1,[i2]))). For the derivation of the equations this makes no difference, so we never thought about it. Anyway, @j-moser changed it now. In version 0.2.20 it should work as you would expect.

Just out of curiosity, do you need this for anything in particular?

tnadolny commented 1 year ago

I was comparing the equations obtained with QuantumCumulant.jl to equations describing the same problem obtained in a different way. The two sets of equations were equal up to factors N/(N-1). Of course this does not matter for large N. Nevertheless, I wanted to ask in order to understand better the behaviour of the Sum terms. Thank you!