def get_couling_derivate_matrix(self, h, twist_number, s):
if type(twist_number) == InPhase:
dhdx = h.get_derivative()
dphi_x = 0.0
dphi_y = 0.0
g = networkx.grid_2d_graph(self.ny, self.nx, periodic=False)
g = networkx.convert_node_labels_to_integers(g, ordering='sorted')
c = _networkx2mat(g, self.n)
a = _build_2d_dhdx_matrix(dhdx, self.nx, self.ny, self.n, dphi_x, dphi_y, s)
d = c * a
return d
else:
raise Exception('Topology not compatible with state')
评论列表
文章目录