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
I'm hitting the limit of ints in python, which causes troubles with large ket vectors.
Minimal example (I can go up to size 16 before it crashes):
ket = tensor([basis(2,0) for i in range(0,20)])
ket.ptrace(1)
Returns:
OverflowError Traceback (most recent call last)
<ipython-input-22-8485eed3b16f> in <module>()
1 ket = tensor([basis(2,0) for i in range(0,20)])
----> 2 ket.ptrace(1)
/usr/lib/python2.7/site-packages/qutip-4.3.0.dev0+0b068fc4-py2.7-linux-x86_64.egg/qutip/qobj.pyc in ptrace(self, sel)
1282 """
1283 q = Qobj()
-> 1284 q.data, q.dims, _ = _ptrace(self, sel)
1285 return q.tidyup() if settings.auto_tidyup else q
1286
/usr/lib/python2.7/site-packages/qutip-4.3.0.dev0+0b068fc4-py2.7-linux-x86_64.egg/qutip/cy/ptrace.pyx in qutip.cy.ptrace._ptrace()
89 perm = fast_csr_matrix((data,ind,ptr),shape=(M * M, N * N))
90 # No need to sort here, will be sorted in reshape
---> 91 rhdata = zcsr_mult(perm, zcsr_reshape(rho.data, np.prod(rho.shape), 1), sorted=0)
92 rho1_data = zcsr_reshape(rhdata, M, M)
93 dims_kept0 = np.asarray(rho.dims[0], dtype=np.int32).take(sel)
/usr/lib/python2.7/site-packages/qutip-4.3.0.dev0+0b068fc4-py2.7-linux-x86_64.egg/qutip/cy/spconvert.pyx in qutip.cy.spconvert.zcsr_reshape()
187 @cython.boundscheck(False)
188 @cython.wraparound(False)
--> 189 def zcsr_reshape(object A not None, int new_rows, int new_cols):
190 """
191 Reshapes a complex CSR matrix.
OverflowError: value too large to convert to int
Similar code works fine in MS LiQui|> using the same workstation so my hardware should be able to support this state size. What is the current ket size limit that is officially supported in qutip? 16?
The text was updated successfully, but these errors were encountered:
I spent some time looking into patching this last night, but it seems like it would require a complete overhaul of many parts of the code so not an easy fix unfortunately. Perhaps this is something to put on the todo/request list, because without this, most ML QIP research that I've been looking at would not be implementable (need around 10-20 qubits, just a 2 qubit QRAM already requires 11 working qubits).
I'm hitting the limit of ints in python, which causes troubles with large ket vectors.
Minimal example (I can go up to size 16 before it crashes):
Returns:
Similar code works fine in MS LiQui|> using the same workstation so my hardware should be able to support this state size. What is the current ket size limit that is officially supported in qutip? 16?
The text was updated successfully, but these errors were encountered: