Skip to content

Commit

Permalink
feat: start V matrix computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Panadestein committed Jul 11, 2024
1 parent 0c02f8d commit fc203d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
11 changes: 6 additions & 5 deletions src/bqn/hf.bqn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ system ← {
r1.4632
}

STO3G ← {
STO ← {
e0.1098180.4057712.22766 ×ט 𝕩
c0.4446350.5353280.154329
ec×(2×e÷π)3÷4
Expand All @@ -23,9 +23,10 @@ ERI ← {a‿b‿c‿d𝕊r‿s‿t:
}

I ← {𝕊e1e2z1z2r:
ad⍉>STO3G¨ e1e2
r1r2<˘> (r-˜×r÷+)⌜´ ad
asds× {(˜/33) 𝕎⌜˜𝕩}¨ <˘ad
smtm ← {+´¨ds×as 𝕏¨¨ ≍∾0 טr}¨ ST
bsnb ← (⊢⋈≠)⍉>STO¨ e1e2
r1r2<˘> (r-˜×r÷+)⌜´ bs
ad× {(˜/nbnb) 𝕎⌜˜𝕩}¨ <˘bs
smtm ← {+´¨ d×a𝕏¨¨ ≍∾0 טr}¨ ST
vm ← {𝕩}¨ z1z2
}
I system
19 changes: 7 additions & 12 deletions src/hf.org
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Slater type orbitals[fn:4] should be a good choice for our Hamiltonian. However,
is a lot easier if we approximate them with Gaussian functions[fn:5]. We define the approximating function:

#+begin_src bqn :tangle ./bqn/hf.bqn
STO3G ← {
STO ← {
e ← 0.109818‿0.405771‿2.22766 ×ט 𝕩
c ← 0.444635‿0.535328‿0.154329
e⋈c×(2×e÷π)⋆3÷4
Expand Down Expand Up @@ -84,28 +84,23 @@ the delta distribution arises and simplifies the problem to this integration by

#+begin_export html
</details>
</br>
#+end_export

The following function constructs the Fock matrix:

#+begin_src bqn :tangle ./bqn/hf.bqn
I ← {𝕊e1‿e2‿z1‿z2‿r:
ad ← ⍉>STO3G¨ e1‿e2
r1‿r2 ← <˘⍉⁼> (r⊸-⊸⋈˜×⟜r÷+)⌜´ ⊏ad
as‿ds ← ⋈‿× {(⋈˜/3‿3) ⊔ 𝕎⌜˜𝕩}¨ <∘∾˘ad
sm‿tm ← {+´∘⥊¨ds×as 𝕏¨¨ ⌽⊸≍∾⟜0 טr}¨ S‿T
bs‿nb ← (⊢⋈≠∘⊑)⍉>STO¨ e1‿e2
r1‿r2 ← <˘⍉⁼> (r⊸-⊸⋈˜×⟜r÷+)⌜´ ⊏bs
a‿d ← ⋈‿× {(⋈˜/nb‿nb) ⊔ 𝕎⌜˜𝕩}¨ <∘∾˘bs
sm‿tm ← {+´∘⥊¨ d×a𝕏¨¨ ⌽⊸≍∾⟜0 טr}¨ S‿T
vm ← {𝕩}¨ z1‿z2
}
I system
#+end_src

#+RESULTS:
: ┌─
: · ┌─ ┌─
: ╵ 1.000001425997864 0.4507704116477877 ╵ 2.164312561949012 0.167012865864049
: 0.4507704116477877 1.0000014259978642 0.167012865864049 0.7600329435650854
: ┘ ┘
: ┘
: ⟨ 2 1 ⟩

** SCF

Expand Down

0 comments on commit fc203d0

Please sign in to comment.