Issues with logarithmic_negativity function

33 views
Skip to first unread message

Pradip Laha

unread,
Jan 21, 2022, 3:09:58 AM1/21/22
to QuTiP: Quantum Toolbox in Python
Hi all,

Still new to QuTiP.  Trying  to use the  logarithmic_negativity function (a simple code is attached below). 
I am getting the following error:
TypeError: No loop matching the specified signature and casting was found for ufunc det

What am I missing here?

Thanks in advance.
Pradip
 
########################################################
import numpy as np
from qutip import *

N=15

a = tensor(destroy(N), qeye(N))
b = tensor(qeye(N), destroy(N))

H = a*b.dag()*b.dag() + a.dag()*b*b

x1 = (+1./np.sqrt(2.))*(a + a.dag())
p1 = (-1j/np.sqrt(2.))*(a - a.dag())
x2 = (+1./np.sqrt(2.))*(b + b.dag())
p2 = (-1j/np.sqrt(2.))*(b - b.dag())

ops = [x1, p1, x2, p2]

rho0_a = fock_dm(N, 0)      
rho0_b = thermal_dm(N, 1.0, 'analytic')      
rho0   = tensor(rho0_a, rho0_b)    

tlist = np.linspace(0, 5, 201)  
rhot  = mesolve(H, rho0, tlist, [], [])

for ii in range(201):
    cov_mat = covariance_matrix(ops,  rhot.states[ii])
    log_neg = logarithmic_negativity(cov_mat)

########################################################

Simon Cross

unread,
Jan 27, 2022, 6:19:36 AM1/27/22
to qu...@googlegroups.com
Hi Pradip,

Your code runs without errors for me.

The error you see seems to be from within a core part of numpy itself,
so I would try to pare it down to a smaller example. Perhaps numpy is
not installed correctly, or maybe there is something not working with
numpy on your platform, or maybe QuTiP does something wrong with numpy
on your platform. More digging is needed.

Regards,
Simon

Pradip Laha

unread,
Jan 30, 2022, 5:26:02 AM1/30/22
to QuTiP: Quantum Toolbox in Python
Thanks Simon,

You are right. It runs in other machines with no problems!
Yeah, I need to fix some issues with numpy, it seems.


Pradip
Reply all
Reply to author
Forward
0 new messages