AttributeError: 'int' object has no attribute 'isherm' for Lecture notebook 14

95 views
Skip to first unread message

QD_NA

unread,
Feb 28, 2021, 1:45:33 PM2/28/21
to QuTiP: Quantum Toolbox in Python
Dear All,
I am trying to simulate Spin Photonic States in Kerr Cavities.
I started with the simple Hamiltonian  as described in Lecture 14 in the Qutip notebook examples written by J.R. Johansson.
And I am not being able to re-produce the output as in the lecture notebook from the 
section:
plot_expect_with_variance(N, [n, x, p], [r'n', r'x', r'p'], result.states);

I have attached my notebook herewith.

Additionally I want to introduce Spin Operators and excitation of the system with periodic signals as mentioned in Equation 2 of https://arxiv.org/abs/2005.07582. I am not very sure how to define the Jx,J+,Jy spin operators. 
In QuTip documentaion there are some mention about similar problems ( for example defining sz,sx,sy or sm as Pauli Spin Operator from the CavityQED notebook examples ) but i am unsure if  they are  same as Jx, or if J+= sm.dag, Jy=sm from the Spin Operator of the paper as I got errors) . I did fine examples like Spin j operators: from 
http://qutip.org/docs/4.0.2/modules/qutip/operators.html but cound't  manage to incorporate them in the given notebook correctly.

  It would be of great help to hear back .

Thanks and Regards,
Haima 
HaimaModifed_Lecture-14-Kerr-nonlinearities.pdf

Boxi Li

unread,
Mar 7, 2021, 8:35:15 AM3/7/21
to QuTiP: Quantum Toolbox in Python
Hi Haima,

The notebook is using an old version of QuTiP so I'm afraid not everything will work properly (e.g. the animation). Nevertheless, I can run the original notebook to the function `plot_expect_with_variance` without problems. From your error message, it seems that what should have been a Qobj was given as an integer. Please check if your n, x, p are all Qobjs. It is a bit hard to follow with pdf file. The original ipynb file would be easier.

About your second questions, your definition of J seems to be correct. It will be easier to identify the error source if you can provide an executable code example and the error message.

Best
Boxi

QD_NA

unread,
Mar 8, 2021, 3:01:48 PM3/8/21
to QuTiP: Quantum Toolbox in Python
Thank you Boxi for your help. 
Here is my updated notebook attached

HaimaModifed_Lecture-14-Kerr-nonlinearities.ipynb
Reply all
Reply to author
Forward
0 new messages