Skip to content

[Inference] PosDefException: matrix is not positive definite during band structure calculation (Cholesky factorization failed) #97

Description

I am encountering a PosDefException when running the band structure inference (step 5) on the MoS2 system using the official dataset provided in the DeepH Nature Computational Science paper. My training process was successful, and I have verified that the Hamiltonian prediction ($H_{pred}$) is highly accurate (Global MAE < 0.003 eV). However, the Cholesky factorization in sparse_calc.jl fails with the error "matrix is not positive definite."

ERROR: LoadError: PosDefException: matrix is not positive definite; Cholesky factorization failed.
Stacktrace:
[1] chkposdef
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lapack.jl:50 [inlined]
[2] sygvd!(itype::Int64, jobz::Char, uplo::Char, A::Matrix{ComplexF64}, B::Matrix{ComplexF64})
@ LinearAlgebra.LAPACK /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lapack.jl:5337
[3] #eigen!#102
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/symmetric.jl:832 [inlined]
[4] eigen!
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/symmetric.jl:832 [inlined]
[5] eigen(A::Hermitian{ComplexF64, Matrix{ComplexF64}}, B::Hermitian{ComplexF64, Matrix{ComplexF64}}; kws::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ LinearAlgebra /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/eigen.jl:501
[6] eigen(A::Hermitian{ComplexF64, Matrix{ComplexF64}}, B::Hermitian{ComplexF64, Matrix{ComplexF64}})
@ LinearAlgebra /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/eigen.jl:500
[7] main()
@ Main ~/miniconda3/envs/deeph/lib/python3.9/site-packages/deeph/inference/sparse_calc.jl:270
[8] top-level scope
@ ~/miniconda3/envs/deeph/lib/python3.9/site-packages/deeph/inference/sparse_calc.jl:412
in expression starting at /home/hnu/miniconda3/envs/deeph/lib/python3.9/site-packages/deeph/inference/sparse_calc.jl:412
Traceback (most recent call last):
File "/home/hnu/miniconda3/envs/deeph/bin/deeph-inference", line 6, in
sys.exit(main())
File "/home/hnu/miniconda3/envs/deeph/lib/python3.9/site-packages/deeph/scripts/inference.py", line 150, in main
assert capture_output.returncode == 0
AssertionError

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions