Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lanczos_ER doesn't work for type f, cf, cd vector #31

Closed
j9263178 opened this issue Jul 11, 2021 · 1 comment
Closed

Lanczos_ER doesn't work for type f, cf, cd vector #31

j9263178 opened this issue Jul 11, 2021 · 1 comment

Comments

@j9263178
Copy link
Collaborator

An example in python (cd type LinOp and input vector):

class Htest(cytnx.LinOp):

    def __init__(self, psidim):
        cytnx.LinOp.__init__(self,"mv", psidim, cytnx.Type.ComplexDouble, cytnx.Device.cpu)

    def matvec(self, v):
        v_ = v.clone()
        return 1.02*v_

if __name__ == '__main__':
  vec = cytnx.arange(1,5,1, cytnx.Type.ComplexDouble, cytnx.Device.cpu)
  _,_ = cytnx.linalg.Lanczos_ER(Htest(len(vec)), maxiter = 4, CvgCrit = 9999999999, Tin = vec, max_krydim = krydim)

Result:

.....

File "/home/j9263178/cytnx_test/cytnx/linalg_conti.py", line 7, in Lanczos_ER
    return linalg.c_Lanczos_ER(Hop,k,is_V,maxiter,CvgCrit,is_row,Tin,max_krydim,verbose);
RuntimeError: 
# Cytnx error occur at void cytnx::Tensor_impl::Init(const std::vector<long unsigned int>&, const unsigned int&, int)
# error: [ERROR] invalid argument: dtype
# file : /home/j9263178/github/Cytnx/src/Tensor.cpp (314)

Result for cf type:

程式記憶體區段錯誤 (core dumped)

Result for f type:

.....

 File "/home/j9263178/cytnx_test/cytnx/linalg_conti.py", line 7, in Lanczos_ER
    return linalg.c_Lanczos_ER(Hop,k,is_V,maxiter,CvgCrit,is_row,Tin,max_krydim,verbose);
RuntimeError: 
# Cytnx error occur at T& cytnx::Storage_base::at(const cytnx_uint64&) const [with T = float; cytnx::cytnx_uint64 = long unsigned int]
# error: [ERROR] type mismatch. try to get <float> type from raw data of type Double (Float64)
# file : /home/j9263178/github/Cytnx/src/Storage_base.cpp (625)
kaihsin added a commit that referenced this issue Jul 13, 2021
@kaihsin
Copy link
Member

kaihsin commented Jul 13, 2021

please refer the full fix on 76cf976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants