In [1]:
from qutip import *
In [2]:
N = 15
H = rand_dm(N) - rand_dm(N)
In [3]:
H.isherm = False
e, eket1 = H.groundstate()
In [4]:
e
Out[4]:
In [5]:
eket1
Out[5]:
In [6]:
(H * eket1).full() / (eket1).full()
Out[6]:
In [7]:
H.isherm = True
e, eket2 = H.groundstate()
In [8]:
e
Out[8]:
In [9]:
eket2
Out[9]:
In [10]:
(H * eket2).full() / (eket2).full()
Out[10]:
In [11]:
eket1.full() / eket2.full()
Out[11]:
In [12]:
abs(eket1.full() / eket2.full()).T
Out[12]:
In [13]:
evals, evecs = la.eig(H.full())
In [14]:
evals
Out[14]:
In [15]:
H.eigenstates()[0]
Out[15]:
In [16]:
H.isherm = True
In [17]:
H.eigenstates(sparse=False, eigvals=5, sort='low')[0]
Out[17]:
In [18]:
H.eigenstates(sparse=False, eigvals=5, sort='high')[0]
Out[18]:
In [19]:
H.eigenstates(sparse=True, eigvals=5, sort='low')[0]
Out[19]:
In [20]:
H.eigenstates(sparse=True, eigvals=5, sort='high')[0]
Out[20]:
In [21]:
H.isherm = False
In [22]:
H.eigenstates(sparse=False, eigvals=5, sort='low')[0]
Out[22]:
In [23]:
H.eigenstates(sparse=False, eigvals=5, sort='high')[0]
Out[23]:
In [24]:
H.eigenstates(sparse=True, eigvals=5, sort='low')[0]
Out[24]:
In [25]:
H.eigenstates(sparse=True, eigvals=5, sort='high')[0]
Out[25]:
In [26]:
H.isherm = True
In [27]:
H.eigenenergies(sparse=False, eigvals=5, sort='low')
Out[27]:
In [28]:
H.eigenenergies(sparse=False, eigvals=5, sort='high')
Out[28]:
In [29]:
H.eigenenergies(sparse=True, eigvals=5, sort='low')
Out[29]:
In [30]:
H.eigenenergies(sparse=True, eigvals=5, sort='high')
Out[30]:
In [31]:
H.isherm = False
In [32]:
H.eigenenergies(sparse=False, eigvals=5, sort='low')
Out[32]:
In [33]:
H.eigenenergies(sparse=False, eigvals=5, sort='high')
Out[33]:
In [34]:
H.eigenenergies(sparse=True, eigvals=5, sort='low')
Out[34]:
In [35]:
H.eigenenergies(sparse=True, eigvals=5, sort='high')
Out[35]:
In [36]:
from qutip.ipynbtools import version_table
version_table()
Out[36]: