Giter VIP home page Giter VIP logo

Comments (7)

gustavojra avatar gustavojra commented on August 30, 2024 1

Okay, great. It's a good reminder to add numerical checks for these extrapolations schemes. They should be well behaved for larger systems though.

from fermi.jl.

gustavojra avatar gustavojra commented on August 30, 2024

Hi Matt,

It is a problem with DIIS not dealing well with small systems. It does need fixing, but I have been procrastinating on it. You can simply disable DIIS if the system is small (~5 electrons or so)

@set diis false

from fermi.jl.

mtfishman avatar mtfishman commented on August 30, 2024

Ok, thanks. Glad to know it's not just me doing something silly. Unfortunately that doesn't seem to help. When I run:

using Fermi

@molecule {
  H  0.0 0.0 0.0
  H  0.76 0.0 0.0
}
@set basis sto-3g
@set diis false
wfn = @energy rhf

I get what looks like the same error.

from fermi.jl.

gustavojra avatar gustavojra commented on August 30, 2024

Oh, interesting. If you use a larger basis such as cc-pvdz does the error persist?

from fermi.jl.

mtfishman avatar mtfishman commented on August 30, 2024

Looks like cc-pvdz works with our without DIIS.

from fermi.jl.

gustavojra avatar gustavojra commented on August 30, 2024

Can you try @set oda false for the sto-3g case? That damp NaN on the first iteration does not appear for me.

from fermi.jl.

mtfishman avatar mtfishman commented on August 30, 2024

Ok, that's seems to work:

using Fermi

@molecule {
  H  0.0 0.0 0.0
  H  0.76 0.0 0.0
}
@set basis sto-3g
@set diis false
@set oda false
wfn = @energy rhf

outputs:

================================================================================
|                                 Hartree-Fock                                 |
|                                  Module  by                                  |
|                         G.J.R Aroeira and M.M. Davis                         |
================================================================================
Collecting necessary integrals...
Done in    0.00009 s
Using GWH Guess
Molecule:

H    0.000000000000    0.000000000000    0.000000000000
H    0.760000000000    0.000000000000    0.000000000000


Charge: 0   Multiplicity: 1   
Nuclear repulsion:    0.6962858038
 Number of AOs:                            2
 Number of Doubly Occupied Orbitals:       1
 Number of Virtual Spatial Orbitals:       1
 Guess Energy    -1.81166646326759

 Iter.            E[RHF]         ΔE       Dᵣₘₛ        t     DIIS     damp
--------------------------------------------------------------------------------
    1     -1.1153806594  -1.115e+00   0.000e+00     0.00    false     0.00
    2     -1.1153806594   0.000e+00   0.000e+00     0.00    false     0.00
    3     -1.1153806594   0.000e+00   0.000e+00     0.00    false     0.00
    4     -1.1153806594   0.000e+00   0.000e+00     0.00    false     0.00
    5     -1.1153806594   0.000e+00   0.000e+00     0.00    false     0.00
--------------------------------------------------------------------------------
    RHF done in  0.00s
    @Final RHF Energy          -1.115380659448 Eₕ

   • Orbitals Summary

    Orbital            Energy    Occupancy
          1     -0.5703627667       ↿⇂
          2      0.6508750828         

   ✔  SCF Equations converged 😄
--------------------------------------------------------------------------------
  Fermi Restricted Hartree--Fock Wave function
  Basis:                  sto-3g
  Energy:                 -1.1153806594478526
  Occ. Spatial Orbitals:  1
  Vir. Spatial Orbitals:  1
Convergence: ΔE => 0.00e+00 Dᵣₘₛ => 0.00e+00

With diis true it errors with:

================================================================================
|                                 Hartree-Fock                                 |
|                                  Module  by                                  |
|                         G.J.R Aroeira and M.M. Davis                         |
================================================================================
Collecting necessary integrals...
Done in    0.00009 s
Using GWH Guess
Molecule:

H    0.000000000000    0.000000000000    0.000000000000
H    0.760000000000    0.000000000000    0.000000000000


Charge: 0   Multiplicity: 1   
Nuclear repulsion:    0.6962858038
 Number of AOs:                            2
 Number of Doubly Occupied Orbitals:       1
 Number of Virtual Spatial Orbitals:       1
 Guess Energy    -1.81166646326759

 Iter.            E[RHF]         ΔE       Dᵣₘₛ        t     DIIS     damp
--------------------------------------------------------------------------------
    1     -1.1153806594  -1.115e+00   0.000e+00     0.00    false     0.00
    2     -1.1153806594   0.000e+00   0.000e+00     0.00    false     0.00
    3     -1.1153806594   0.000e+00   0.000e+00     0.00    false     0.00
ERROR: LoadError: LinearAlgebra.SingularException(2)
Stacktrace:
  [1] checknonsingular
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/factorization.jl:19 [inlined]
  [2] checknonsingular
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/factorization.jl:21 [inlined]
  [3] #lu!#146
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/lu.jl:82 [inlined]
  [4] #lu#153
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/lu.jl:279 [inlined]
  [5] lu (repeats 2 times)
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/lu.jl:278 [inlined]
  [6] \(A::Matrix{Float64}, B::Vector{Float64})
    @ LinearAlgebra /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/generic.jl:1142
  [7] extrapolate(M::Fermi.DIIS.DIISManager{Float64, Float64}; add_res::Bool)
    @ Fermi.DIIS ~/.julia/packages/Fermi/phTqJ/src/Core/DIIS.jl:83
  [8] extrapolate
    @ ~/.julia/packages/Fermi/phTqJ/src/Core/DIIS.jl:61 [inlined]
  [9] macro expansion
    @ ~/.julia/packages/Fermi/phTqJ/src/Methods/HartreeFock/RHF/RHFa.jl:182 [inlined]
 [10] macro expansion
    @ ./timing.jl:299 [inlined]
 [11] macro expansion
    @ ~/.julia/packages/Fermi/phTqJ/src/Methods/HartreeFock/RHF/RHFa.jl:133 [inlined]
 [12] macro expansion
    @ ./timing.jl:299 [inlined]
 [13] Fermi.HartreeFock.RHF(ints::Fermi.Integrals.IntegralHelper{Float64, Fermi.Integrals.SparseERI, Fermi.Orbitals.AtomicOrbitals}, C::FermiMDArray{Float64, 2}, Λ::FermiMDArray{Float64, 2}, Alg::Fermi.HartreeFock.RHFa)
    @ Fermi.HartreeFock ~/.julia/packages/Fermi/phTqJ/src/Methods/HartreeFock/RHF/RHFa.jl:132
 [14] Fermi.HartreeFock.RHF(ints::Fermi.Integrals.IntegralHelper{Float64, Fermi.Integrals.SparseERI, Fermi.Orbitals.AtomicOrbitals}, Alg::Fermi.HartreeFock.RHFa)
    @ Fermi.HartreeFock ~/.julia/packages/Fermi/phTqJ/src/Methods/HartreeFock/RHF/RHFa.jl:32
 [15] Fermi.HartreeFock.RHF(Alg::Fermi.HartreeFock.RHFa)
    @ Fermi.HartreeFock ~/.julia/packages/Fermi/phTqJ/src/Methods/HartreeFock/RHF/RHFa.jl:5
 [16] Fermi.HartreeFock.RHF()
    @ Fermi.HartreeFock ~/.julia/packages/Fermi/phTqJ/src/Methods/HartreeFock/RHF/RHF.jl:81
 [17] top-level scope
    @ ~/Dropbox (Simons Foundation)/workdir/Fermi.jl/hartree_fock_H2.jl:10
 [18] include(fname::String)
    @ Base.MainInclude ./client.jl:451
 [19] top-level scope
    @ REPL[6]:1
in expression starting at /home/mfishman/Dropbox (Simons Foundation)/workdir/Fermi.jl/hartree_fock_H2.jl:10

from fermi.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.