system_parameters.py 文件源码

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

项目:quantum-optimal-control 作者: SchusterLab 项目源码 文件源码
def approx_exp(self,M,exp_t, scaling_terms): 
        # the scaling and squaring of matrix exponential with taylor expansions
        U=1.0
        Mt=1.0
        factorial=1.0 #for factorials

        for ii in xrange(1,exp_t):
            factorial*=ii
            Mt=M*Mt
            U+=Mt/((2.**float(ii*scaling_terms))*factorial) #scaling by 2**scaling_terms


        for ii in xrange(scaling_terms):
            U=np.dot(U,U) #squaring scaling times

        return U
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号