我想用scipy.sparse.linalg.eigsh使用shift-invert模式找到複雜矩陣的特徵值和特徵向量。在矩陣中只有實數,我可以得到與spicy.linalg.eigh求解器相同的結果,但是在添加虛部時,特徵值會發散。一個微小的例子: import numpy as np
from scipy.linalg import eigh
from scipy.sparse.linal
我試圖在Python中實現複數的矩陣。但是我被困在程序的某個特定點上。我有兩個模塊Matrix.py,Complex.py和一個測試程序test.py.該模塊實現在Github上在https://github.com/Soumya1234/Math_Repository/tree/dev_branch主辦,我test.py下面 from Matrix import *
from Complex
我使用帶有複數的向量類,我必須乘複數的矢量與複數,如: vector< complex<double> > vec;
complex<double> z;
// some initialization of vec and z ...
vector< complex<double> > res;
res = vec*z; // here is the error
error: no m