def partial_dynamics(self, level, node=None):
"""
Return the time evolution of the specific `level` and of the specific
`node`; if `node` is not specified, the method returns the time evolution
of the given `level` (all the nodes).
:param int level: the index of the level from where the time evolution
is extracted.
:param int node: the index of the node from where the time evolution is
extracted; if None, the time evolution is extracted from all the
nodes of the given level. Default is None.
"""
def dynamic(eigs, amplitudes, step, nsamples):
omega = old_div(
np.log(np.power(eigs, old_div(1., step))),
self.original_time['dt']
)
partial_timestep = np.arange(nsamples) * self.dmd_time['dt']
vander = np.exp(np.multiply(*np.meshgrid(omega, partial_timestep)))
return (vander * amplitudes).T
if node:
indeces = [self._index_list(level, node)]
else:
indeces = [self._index_list(level, i) for i in range(2**level)]
level_dynamics = [
dynamic(
self._eigs[idx], self._b[idx], self._steps[idx],
self._nsamples[idx]
) for idx in indeces
]
return scipy.linalg.block_diag(*level_dynamics)
评论列表
文章目录