synctools_v0.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:delayCoupledDPLLnet 作者: cuichi23 项目源码 文件源码
def get_couling_derivate_matrix(self, h, twist_number, s):
        if type(twist_number) == InPhase or type(twist_number) == Twist2D:
            if type(twist_number) == InPhase:
                mx = 0
                my = 0
            else:
                mx = twist_number.get_mx()
                my = twist_number.get_my()
            dhdx = h.get_derivative()
            dphi_x = (2 * np.pi * mx) / self.nx
            dphi_y = (2 * np.pi * my) / self.nx

            g = networkx.grid_2d_graph(self.ny, self.nx, periodic=True)
            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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号