Negativity error fixed

33 views
Skip to first unread message

Joan Agusti

unread,
Nov 9, 2022, 8:07:43 AM11/9/22
to QuTiP: Quantum Toolbox in Python
Dear group,

I realized the code for negativity in qutip.entropy only allows us to take partitions with respect to one subsystem. If one has multiple subsystems, one can be interested to study the negativity with respect to multiple partitions. This can be fixed in the code by the following change: instead of creating the mask as

mask = [idx == subsys for idx, n in enumerate(rho.dims[0])]

just create a mask as    
mask=[]
    for idx, n in enumerate(rho_ss.dims[0]):
        if idx in subsys:
            mask.append(True)
        else:
            mask.append(False)

Notice the change idx in subsys, instead idx==subsys.

Now, one is able to define subsys=[0,3,4, etc.] and this will perform the partial transpose with respect to those systems and find the negativity.

Nathan Shammah

unread,
Nov 9, 2022, 8:11:29 AM11/9/22
to qu...@googlegroups.com
Dear Joan,

Thanks for sharing! Would you be keen in opening a pull request on the QuTiP GitHub repository about it? If you need help with that do let us know. 


Bests,

Nathan 

--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/2350beb7-532c-43b6-99dd-68968e8b525fn%40googlegroups.com.
--
Dr. Nathan Shammah
Reply all
Reply to author
Forward
0 new messages