10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-06-26 07:02:06 +02:00
QCaml/common/constants.org

80 lines
2.4 KiB
Org Mode
Raw Normal View History

2020-12-27 17:38:04 +01:00
#+begin_src elisp tangle: no :results none :exports none
2020-12-27 16:55:53 +01:00
(setq pwd (file-name-directory buffer-file-name))
(setq name (file-name-nondirectory (substring buffer-file-name 0 -4)))
(setq lib (concat pwd "lib/"))
(setq testdir (concat pwd "test/"))
(setq mli (concat lib name ".mli"))
(setq ml (concat lib name ".ml"))
(setq test-ml (concat testdir name ".ml"))
(org-babel-tangle)
#+end_src
* Constants
:PROPERTIES:
:header-args: :noweb yes :comments both
:END:
All constants used in the program.
** Thresholds
2020-12-27 23:08:12 +01:00
#+begin_src ocaml :tangle (eval mli)
val epsilon : float
2020-12-27 16:55:53 +01:00
val integrals_cutoff : float
2020-12-27 23:08:12 +01:00
#+end_src
2020-12-27 16:55:53 +01:00
2020-12-27 23:08:12 +01:00
| ~epsilon~ | Value below which a float is considered null. Default is \epsilon = 2.10^{-15} |
| ~integrals_cutoff~ | Cutoff value for integrals. Default is \epsilon |
2020-12-27 17:38:04 +01:00
2020-12-27 23:08:12 +01:00
#+begin_src ocaml :tangle (eval ml) :exports none
let epsilon = 2.e-15
2020-12-27 16:55:53 +01:00
let integrals_cutoff = epsilon
2020-12-27 23:08:12 +01:00
#+end_src
2020-12-27 16:55:53 +01:00
** Mathematical constants
#+begin_src ocaml :tangle (eval mli)
val pi : float
val two_pi : float
val sq_pi : float
val sq_pi_over_two : float
val pi_inv : float
val two_over_sq_pi : float
#+end_src
2020-12-27 23:08:12 +01:00
| ~pi~ | $\pi = 3.141~592~653~589~793~12$ |
| ~two_pi~ | $2 \pi$ |
| ~sq_pi~ | $\sqrt{\pi}$ |
| ~sq_pi_over_two~ | $\sqrt{\pi} / 2$ |
| ~pi_inv~ | $1 / \pi$ |
| ~two_over_sq_pi~ | $2 / \sqrt{\pi}$ |
2020-12-27 16:55:53 +01:00
#+begin_src ocaml :tangle (eval ml) :exports none
let pi = acos (-1.)
let two_pi = 2. *. pi
let sq_pi = sqrt pi
let sq_pi_over_two = sq_pi *. 0.5
let pi_inv = 1. /. pi
let two_over_sq_pi = 2. /. sq_pi
#+end_src
** Physical constants
#+begin_src ocaml :tangle (eval mli)
val a0 : float
val a0_inv : float
val ha_to_ev : float
val ev_to_ha : float
#+end_src
2020-12-27 23:08:12 +01:00
| ~a0~ | Bohr's radius : $a_0 = 0.529~177~210~67(23)$ angstrom |
| ~a0_inv~ | $1 / a_0$ |
| ~ha_to_ev~ | Hartree to eV conversion factor : $27.211~386~02(17)$ |
| ~ev_to_ha~ | eV to Hartree conversion factor : 1 / ~ha_to_ev~ |
2020-12-27 16:55:53 +01:00
#+begin_src ocaml :tangle (eval ml) :exports none
let a0 = 0.529_177_210_67
let a0_inv = 1. /. a0
let ha_to_ev = 27.211_386_02
let ev_to_ha = 1. /. ha_to_ev
#+end_src