entropy_vn_dicke

61 views
Skip to first unread message

Alberto Biella

unread,
May 27, 2022, 5:06:29 AM5/27/22
to QuTiP: Quantum Toolbox in Python
Hello everyone,
I am having problems using the funciton entropy_vn_dicke.
I attach here a specific example where I compute the steady-state of a spin system for a given value of parameter such that I known that the steady-state is almost a pure state (very low entropy). The function entropy_vn_dicke gives me -Inf and it does that for a wide range of values of g where indeed the state is very pure. If instead I pay the 2^N overheads the standard "entropy_vn" gives the correct results (see https://nbviewer.org/github/qutip/qutip-notebooks/blob/master/examples/piqs-entropy_purity.ipynb). When g is large both the methods work well and give the same result. Any idea to fix this issue?

Thanks in advance for your help !

"""
Created on Thu May 19 10:29:10 2022

@author: albertobiella
"""
from qutip import *
from qutip.piqs import *
import numpy as np
import numpy.random
from scipy.linalg import eig
from scipy.sparse import block_diag


N = 10
system = Dicke(N)
[jx, jy, jz] = jspin(N,basis="dicke")
jx=jx*2
jy=jy*2
jz=jz*2

V=3
g=1
system.emission = 1
system.hamiltonian = V/(2*(N-1)) * jz*jz + g/2 * jx
D_tls = system.liouvillian()
#calculating the steady state
rho_ss = steadystate(D_tls,method='eigen',)
#calculating vn entropy in the Dicke basis
vn_dicke=entropy_vn_dicke(rho_ss)
#calculating vn entropy in the Dicke basis (with overhead)
vn_dicke_over=entropy_vn(Qobj(block_diag(dicke_blocks_full(rho_ss))))


print(vn_dicke,vn_dicke_over)

Christian Staufenbiel

unread,
Jun 6, 2022, 5:47:47 AM6/6/22
to QuTiP: Quantum Toolbox in Python
Hey Alberto,
I looked into this and found that this is an internal problem of the entropy_vn_dicke function. It calculates the eigenvalues of the steady-state rho_ss. In your case many eigenvalues are zero. Due to the numerical calculation the eigenvalues are not exactly zero, but might take small negative values. The negative eigenvalues then lead to -Inf entropy. I will open an issue in the GitHub repository for QuTiP regarding this problem and link the issue here.

For now, you can overcome this issue by using the function "dicke_function_trace" and a modified entropy definition (which rounds away the small negative values). For example like this:

from scipy.special import entr
def entropy(x):
      x[(x < 0) & (x > -10**-5)] = 0
      return entr(x)

vn_dicke = dicke_function_trace(entropy, rho_ss)


This should solve the problem for now. Let me know if it works :)
Best,
Chris

Alberto Biella

unread,
Jun 15, 2022, 4:39:32 AM6/15/22
to qu...@googlegroups.com
Dear Christian,
Thanks a lot for your clear answer. It works :)

Have a nice day,
Alberto



--
You received this message because you are subscribed to a topic in the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/F7tOoZzMjto/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/905d581d-1518-486d-bb8d-a42c2cc8f7ebn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages