如何确定非标准内积空间中矩阵的伴随(python语言)

2024-05-16 03:42:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图计算一个非标准内积空间中10000×10000稀疏矩阵的伴随。在

(对于物理学家来说:矩阵是Fokker-Planck operator的表示,在这种情况下不是自伴的。)

我想计算伴随的内积空间是由对应于矩阵的第一个特征值的特征向量加权的(它对应于平衡概率密度)

scipy函数scipy.sparse.linalg.LinearOperator或{}似乎没有不同内积空间的选项。在


Tags: 函数空间情况矩阵scipyoperator非标准特征值
1条回答
网友
1楼 · 发布于 2024-05-16 03:42:16

计算矩阵的伴随矩阵a非常简单。在

如果你的内积空间是用矩阵M加权的,你只需计算M^-1a^tmm,其中T是(共轭)转置,第一项是矩阵M的逆。在

在稀疏矩阵的代码中,这将是:

import scipy.sparse as sparse

def computeAdjoint(A,measure):
    """Compute the adjoint matrix our inner product space by multiplying
    with the kernel of integration/weighting function inverse on the left
    and weighting function itself on the right"""
    Minv=sparse.diags(1./measure)
    M=sparse.diags(measure)
    return Minv*A.transpose()*M

(还要注意,*代表矩阵乘法,A.multiple(M)代表分量乘法)

相关问题 更多 >