MPO.py 文件源码

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

项目:HamiltonianPy 作者: waltergu 项目源码 文件源码
def __init__(self,value,site,tag,matrix):
        '''
        Constructor.

        Parameters
        ----------
        value : number
            The overall coefficient of the single site operator.
        site : Label
            The site label of the single site operator.
        tag : any hashable object
            The tag of the single operator.
        matrix : 2d ndarray
            The matrix of the single site operator.
        '''
        assert matrix.ndim==2
        dtype=np.find_common_type([np.asarray(value).dtype,np.asarray(matrix).dtype],[])
        self.value=np.array(value,dtype=dtype)
        self.site=site
        self.tag=tag
        self.matrix=np.asarray(matrix,dtype=dtype)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号