Maxim Moloshenko
unread,Jul 9, 2013, 12:08:18 PM7/9/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to qu...@googlegroups.com
Context: I try to reproduce the results of "Nonequilibrium delocalization-localization transition of photons in circuit quantum elecrodynamics" by Schmidt, Gerace and so on.
Error:
Traceback (most recent call last):
File "/home/user-admin/Documents/Photons/main.py", line 70, in <module>
state = state.unit()
File "/usr/local/lib/python2.7/dist-packages/qutip/qobj.py", line 824, in unit
oper_norm=oper_norm, sparse=sparse, tol=tol, maxiter=maxiter)
File "/usr/local/lib/python2.7/dist-packages/qutip/qobj.py", line 675, in norm
return _sp_L2_norm(self)
File "/usr/local/lib/python2.7/dist-packages/qutip/sparse.py", line 52, in _sp_L2_norm
return la.norm(op.data.data, 2)
File "/usr/local/lib/python2.7/dist-packages/scipy/linalg/misc.py", line 121, in norm
return nrm2(a)
_fblas.error: (offx>=0 && offx<len(x)) failed for 2nd keyword offx: dznrm2:offx=0
Script terminated.
I just don't understand how I should tackle the problem. It seems like something deep inside some BLAS routine, so I am kinda clueless. I would really appreciate if you either told me whats going wrong, or what to do next to find the bug.
Thanks a lot!
Maxim
Here is the essential code:
# Import the amazing QuTiP library
from qutip import *
# Define the start state
state = (tensor(basis(2,0),fock(20,19),basis(2,0),fock(20,0))).unit()
# Define the Hamilton operator (constant part)
# Local JC Hamiltonian:
omega = 0.4
gg = 0.6
HJC = omega*tensor(qeye(2),destroy(20)*create(20),qeye(2),qeye(20))\
+ omega*tensor(sigmap()*sigmam(),qeye(20),qeye(2),qeye(20))\
+ gg*(
tensor(sigmap(),create(20),qeye(2),qeye(20)) +
tensor(sigmam(),destroy(20),qeye(2),qeye(20))
)\
+ omega*tensor(qeye(2),qeye(20),qeye(2),destroy(20)*create(20))\
+ omega*tensor(qeye(2),qeye(20),sigmap()*sigmam(),qeye(20))\
+ gg*(
tensor(qeye(2),qeye(20),sigmap(),create(20)) +
tensor(qeye(2),qeye(20),sigmam(),destroy(20))
)
# Coupling part
J = 0.7
temp = tensor(qeye(2),destroy(20),qeye(2),create(20))
Ham = HJC - J*(temp + temp.conj())
# Simulation of the time development, given a certain start state
# For every timestep, calculate exp(-i H t)|state>, and measure the
# number of photons in the left cavity
Hamtt = qeye(1600)
for t in xrange(0,100):
Hamtt = - 1j * (t) * Ham
state = Hamtt.expm()*state
state = state.unit()
print 'Number of call:',t
print 'Scalar product:',(state.dag()*state).diag()
print 'Photons left:',\
(state.dag()*tensor(qeye(2),num(20),qeye(2),qeye(20))*state).diag()
print 'Qubit state left:',\
(state.dag()*tensor(num(2),qeye(20),qeye(2),qeye(20))*state).diag()
print 'Photons right:',\
(state.dag()*tensor(qeye(2),qeye(20),qeye(2),num(20))*state).diag()
print 'Qubit state right:',\
(state.dag()*tensor(qeye(2),qeye(20),num(2),qeye(20))*state).diag()