本文整理匯總了Python中qutip.odedata.Odedata.jump_op_idx方法的典型用法代碼示例。如果您正苦於以下問題:Python Odedata.jump_op_idx方法的具體用法?Python Odedata.jump_op_idx怎麽用?Python Odedata.jump_op_idx使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qutip.odedata.Odedata
的用法示例。
在下文中一共展示了Odedata.jump_op_idx方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: smepdpsolve_generic
# 需要導入模塊: from qutip.odedata import Odedata [as 別名]
# 或者: from qutip.odedata.Odedata import jump_op_idx [as 別名]
def smepdpsolve_generic(ssdata, options, progress_bar):
"""
For internal use.
.. note::
Experimental.
"""
if debug:
print(inspect.stack()[0][3])
N_store = len(ssdata.tlist)
N_substeps = ssdata.nsubsteps
N = N_store * N_substeps
dt = (ssdata.tlist[1] - ssdata.tlist[0]) / N_substeps
NT = ssdata.ntraj
data = Odedata()
data.solver = "smepdpsolve"
data.times = ssdata.tlist
data.expect = np.zeros((len(ssdata.e_ops), N_store), dtype=complex)
data.jump_times = []
data.jump_op_idx = []
# Liouvillian for the deterministic part.
# needs to be modified for TD systems
L = liouvillian_fast(ssdata.H, ssdata.c_ops)
progress_bar.start(ssdata.ntraj)
for n in range(ssdata.ntraj):
progress_bar.update(n)
rho_t = mat2vec(ssdata.rho0.full()).ravel()
states_list, jump_times, jump_op_idx = \
_smepdpsolve_single_trajectory(data, L, dt, ssdata.tlist,
N_store, N_substeps,
rho_t, ssdata.c_ops, ssdata.e_ops)
data.states.append(states_list)
data.jump_times.append(jump_times)
data.jump_op_idx.append(jump_op_idx)
progress_bar.finished()
# average density matrices
if options.average_states and np.any(data.states):
data.states = [sum(state_list).unit() for state_list in data.states]
# average
data.expect = data.expect / ssdata.ntraj
# standard error
if NT > 1:
data.se = (data.ss - NT * (data.expect ** 2)) / (NT * (NT - 1))
else:
data.se = None
return data
示例2: sepdpsolve_generic
# 需要導入模塊: from qutip.odedata import Odedata [as 別名]
# 或者: from qutip.odedata.Odedata import jump_op_idx [as 別名]
def sepdpsolve_generic(ssdata, options, progress_bar):
"""
For internal use.
.. note::
Experimental.
"""
if debug:
print(inspect.stack()[0][3])
N_store = len(ssdata.tlist)
N_substeps = ssdata.nsubsteps
N = N_store * N_substeps
dt = (ssdata.tlist[1] - ssdata.tlist[0]) / N_substeps
NT = ssdata.ntraj
data = Odedata()
data.solver = "spdpsolve"
data.times = ssdata.tlist
data.expect = np.zeros((len(ssdata.e_ops), N_store), dtype=complex)
data.ss = np.zeros((len(ssdata.e_ops), N_store), dtype=complex)
data.jump_times = []
data.jump_op_idx = []
# effective hamiltonian for deterministic part
Heff = ssdata.H
for c in ssdata.c_ops:
Heff += -0.5j * c.dag() * c
progress_bar.start(ssdata.ntraj)
for n in range(ssdata.ntraj):
progress_bar.update(n)
psi_t = ssdata.psi0.full()
states_list, jump_times, jump_op_idx = \
_sepdpsolve_single_trajectory(Heff, dt, ssdata.tlist,
N_store, N_substeps,
psi_t, ssdata.c_ops, ssdata.e_ops,
data)
# if average -> average...
data.states.append(states_list)
data.jump_times.append(jump_times)
data.jump_op_idx.append(jump_op_idx)
progress_bar.finished()
# average
data.expect = data.expect / NT
# standard error
if NT > 1:
data.ss = (data.ss - NT * (data.expect ** 2)) / (NT * (NT - 1))
return data
示例3: sepdpsolve_generic
# 需要導入模塊: from qutip.odedata import Odedata [as 別名]
# 或者: from qutip.odedata.Odedata import jump_op_idx [as 別名]
def sepdpsolve_generic(ssdata, options, progress_bar):
"""
For internal use.
.. note::
Experimental.
"""
if debug:
print(inspect.stack()[0][3])
N_store = len(ssdata.tlist)
N_substeps = ssdata.nsubsteps
N = N_store * N_substeps
dt = (ssdata.tlist[1] - ssdata.tlist[0]) / N_substeps
NT = ssdata.ntraj
data = Odedata()
data.solver = "sepdpsolve"
data.times = ssdata.tlist
data.expect = np.zeros((len(ssdata.e_ops), N_store), dtype=complex)
data.ss = np.zeros((len(ssdata.e_ops), N_store), dtype=complex)
data.jump_times = []
data.jump_op_idx = []
# effective hamiltonian for deterministic part
Heff = ssdata.H
for c in ssdata.c_ops:
Heff += -0.5j * c.dag() * c
progress_bar.start(ssdata.ntraj)
for n in range(ssdata.ntraj):
progress_bar.update(n)
psi_t = ssdata.psi0.full().ravel()
states_list, jump_times, jump_op_idx = \
_sepdpsolve_single_trajectory(Heff, dt, ssdata.tlist,
N_store, N_substeps,
psi_t, ssdata.c_ops, ssdata.e_ops,
data)
data.states.append(states_list)
data.jump_times.append(jump_times)
data.jump_op_idx.append(jump_op_idx)
progress_bar.finished()
# average density matrices
if options.average_states and np.any(data.states):
data.states = [sum(state_list).unit() for state_list in data.states]
# average
data.expect = data.expect / NT
# standard error
if NT > 1:
data.se = (data.ss - NT * (data.expect ** 2)) / (NT * (NT - 1))
else:
data.se = None
# convert complex data to real if hermitian
data.expect = [np.real(data.expect[n,:]) if e.isherm else data.expect[n,:]
for n, e in enumerate(ssdata.e_ops)]
return data