You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Chi representation of channels is introduced in the documentation using an orthonormal basis, which happens to be the {Eye(2), Pauli matrices} / sqrt(2) for the case of a qubit.
However, the implementation in the code uses an unnormalized one, yielding wrong results.
In the file superops_reps.py, the variable _SINGLE_QUBIT_PAULI_BASIS is defined as:
import numpy as np
import qutip as qu
#Let's compute the chi matrix for F(rho) = -i[H, rho] for one qubit #We define the channel F(rho) = A_1 rho B^dag_1 + A_2 rho B^dag_2#where #A_1 = -iH, B^dag_1 = Id(2) #A_2 = Id(2), B^dag_2 = iH#With an example Hamiltonian
delta = 0.127
Omega = 0.5
H = qu.Qobj(np.array([[delta, Omega/2], [Omega/2, 0]]))
print(H)
#We define the Pauli basis as G = (Id(2), sigmax(2), sigmay(2), sigmaz(2))/np.sqrt(2)
G = np.array([qu.identity(2), qu.sigmax(), qu.sigmay(), qu.sigmaz()])/np.sqrt(2)
#The chi matrix is computed as: chi[i][j] = sum_k Tr(G[i]@A[k]) Tr(G[j]@B^dag[k])
chi = np.zeros([4, 4], dtype=np.complex64)
foriin range(4):
forjin range(4):
chi[i,j] = np.trace(G[i]@A[0])*np.trace(G[j]@Bdag[0]) + np.trace(G[i]@A[1])*np.trace(G[j]@Bdag[1])
print(chi)
#If we compare with the method from qutip, we see that the latter is off by a factor of 2
print(qu.to_chi(qu.liouvillian(H)))
Bug Description
The Chi representation of channels is introduced in the documentation using an orthonormal basis, which happens to be the {Eye(2), Pauli matrices} / sqrt(2) for the case of a qubit.
However, the implementation in the code uses an unnormalized one, yielding wrong results.
In the file superops_reps.py, the variable _SINGLE_QUBIT_PAULI_BASIS is defined as:
Code to Reproduce the Bug
Code Output
Expected Behaviour
The result in the Chi representation is off by a factor of 2
Your Environment
Additional Context
I don't know if I am missing something here with the dimensions of the objects.
The text was updated successfully, but these errors were encountered: