2021-01-01 16:39:33 +01:00
<?xml version="1.0" encoding="utf-8"?>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml:lang = "en" >
< head >
2021-01-28 00:34:26 +01:00
<!-- 2021 - 01 - 27 Wed 23:44 -->
2021-01-01 16:39:33 +01:00
< meta http-equiv = "Content-Type" content = "text/html;charset=utf-8" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > Common< / title >
< meta name = "generator" content = "Org mode" / >
< meta name = "author" content = "Anthony Scemama" / >
< style type = "text/css" >
<!-- /* --> <![CDATA[/*> <!-- */
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: auto;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
< / style >
2021-01-28 00:34:26 +01:00
< link rel = "stylesheet" title = "Standard" href = "qcaml.css" type = "text/css" / >
< script type = "text/javascript" src = "org-info.js" >
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050& dn=gpl-3.0.txt GPL-v3-or-Later
// @license-end
< / script >
< script type = "text/javascript" >
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050& dn=gpl-3.0.txt GPL-v3-or-Later
<!-- /* --> <![CDATA[/*> <!-- */
org_html_manager.set("TOC_DEPTH", "4");
org_html_manager.set("LINK_HOME", "index.html");
org_html_manager.set("LINK_UP", "");
org_html_manager.set("LOCAL_TOC", "1");
org_html_manager.set("VIEW_BUTTONS", "0");
org_html_manager.set("MOUSE_HINT", "underline");
org_html_manager.set("FIXED_TOC", "0");
org_html_manager.set("TOC", "1");
org_html_manager.set("VIEW", "info");
org_html_manager.setup(); // activate after the parameters are set
/*]]>*///-->
// @license-end
< / script >
2021-01-01 16:39:33 +01:00
< script type = "text/javascript" >
// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a& dn=public-domain.txt Public Domain
<!-- /* --> <![CDATA[/*> <!-- */
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.add("code-highlighted");
target.classList.add("code-highlighted");
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.remove("code-highlighted");
target.classList.remove("code-highlighted");
}
}
/*]]>*///-->
// @license-end
< / script >
< script type = "text/x-mathjax-config" >
MathJax.Hub.Config({
displayAlign: "center",
displayIndent: "0em",
"HTML-CSS": { scale: 100,
linebreaks: { automatic: "false" },
webFont: "TeX"
},
SVG: {scale: 100,
linebreaks: { automatic: "false" },
font: "TeX"},
NativeMML: {scale: 100},
TeX: { equationNumbers: {autoNumber: "AMS"},
MultLineWidth: "85%",
TagSide: "right",
TagIndent: ".8em"
}
});
< / script >
< script type = "text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML">< / script >
< / head >
< body >
2021-01-20 23:55:34 +01:00
< div id = "org-div-home-and-up" >
< a accesskey = "h" href = "" > UP < / a >
|
< a accesskey = "H" href = "index.html" > HOME < / a >
< / div > < div id = "content" >
2021-01-01 16:39:33 +01:00
< h1 class = "title" > Common< / h1 >
< div id = "table-of-contents" >
< h2 > Table of Contents< / h2 >
< div id = "text-table-of-contents" >
< ul >
2021-01-28 00:34:26 +01:00
< li > < a href = "#orgc3aa2b1" > 1. Summmary< / a > < / li >
< li > < a href = "#orgf4a663e" > 2. Electrons< / a >
2021-01-01 16:39:33 +01:00
< ul >
2021-01-28 00:34:26 +01:00
< li > < a href = "#org88e7967" > 2.1. Type< / a > < / li >
< li > < a href = "#org376ca80" > 2.2. Creation< / a > < / li >
< li > < a href = "#orgd1d110c" > 2.3. Access< / a > < / li >
< li > < a href = "#org1d2a3d7" > 2.4. Printers< / a > < / li >
< li > < a href = "#org7b61e24" > 2.5. Tests< / a > < / li >
2021-01-01 16:39:33 +01:00
< / ul >
< / li >
2021-01-28 00:34:26 +01:00
< li > < a href = "#org918ae65" > 3. Element< / a >
2021-01-01 16:39:33 +01:00
< ul >
2021-01-28 00:34:26 +01:00
< li > < a href = "#org8889a68" > 3.1. Type< / a > < / li >
< li > < a href = "#orgc639e8c" > 3.2. Conversion< / a > < / li >
< li > < a href = "#org8706da1" > 3.3. Database information< / a > < / li >
< li > < a href = "#org95418b5" > 3.4. Printers< / a > < / li >
2021-01-01 16:39:33 +01:00
< / ul >
< / li >
2021-01-28 00:34:26 +01:00
< li > < a href = "#orgc544cb3" > 4. Atomic mass< / a > < / li >
< li > < a href = "#org0dcc52f" > 5. Nuclei< / a >
2021-01-01 16:39:33 +01:00
< ul >
2021-01-28 00:34:26 +01:00
< li > < a href = "#org83b7fcb" > 5.1. Type< / a > < / li >
< li > < a href = "#orgcba845a" > 5.2. xyz file lexer/parser< / a >
2021-01-01 16:39:33 +01:00
< ul >
2021-01-28 00:34:26 +01:00
< li > < a href = "#org196ee2a" > 5.2.1. Lexer< / a > < / li >
< li > < a href = "#orgda1a58a" > 5.2.2. Parser< / a > < / li >
2021-01-01 16:39:33 +01:00
< / ul >
< / li >
2021-01-28 00:34:26 +01:00
< li > < a href = "#org4bc334a" > 5.3. Conversion< / a > < / li >
< li > < a href = "#org259e4f9" > 5.4. < span class = "todo TODO" > TODO< / span > Query< / a > < / li >
< li > < a href = "#org606af7e" > 5.5. Printers< / a > < / li >
< li > < a href = "#orgcd3169c" > 5.6. Tests< / a > < / li >
2021-01-01 16:39:33 +01:00
< / ul >
< / li >
2021-01-28 00:34:26 +01:00
< li > < a href = "#orgf9d75ec" > 6. Z-matrix< / a >
2021-01-01 16:39:33 +01:00
< ul >
2021-01-28 00:34:26 +01:00
< li > < a href = "#org2ee988d" > 6.1. Type< / a > < / li >
< li > < a href = "#org0a2b5eb" > 6.2. Conversion< / a > < / li >
< li > < a href = "#org36acab9" > 6.3. Printers< / a > < / li >
2021-01-01 16:39:33 +01:00
< / ul >
< / li >
< / ul >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgc3aa2b1" class = "outline-2" >
< h2 id = "orgc3aa2b1" > < span class = "section-number-2" > 1< / span > Summmary< / h2 >
< / div >
2021-01-01 16:39:33 +01:00
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgf4a663e" class = "outline-2" >
< h2 id = "orgf4a663e" > < span class = "section-number-2" > 2< / span > Electrons< / h2 >
< div class = "outline-text-2" id = "text-2" >
2021-01-01 16:39:33 +01:00
< p >
Data structure which contains the number of α and β electrons.
< / p >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org88e7967" class = "outline-3" >
< h3 id = "org88e7967" > < span class = "section-number-3" > 2.1< / span > Type< / h3 >
< div class = "outline-text-3" id = "text-2-1" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
2021-01-28 00:34:26 +01:00
< pre class = "src src-ocaml" id = "org380f263" > < span class = "org-tuareg-font-lock-governing" > type< / span > < span class = "org-type" > t< / span >
2021-01-01 16:39:33 +01:00
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org376ca80" class = "outline-3" >
< h3 id = "org376ca80" > < span class = "section-number-3" > 2.2< / span > Creation< / h3 >
< div class = "outline-text-3" id = "text-2-2" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > open < / span > < span class = "org-tuareg-font-lock-module" > Common< / span >
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > make< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > int < span class = "org-tuareg-font-lock-operator" > -> < / span > int < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_atoms< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-label" > ?multiplicity< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > int < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-label" > ?charge< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > int < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-module" > Nuclei.< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-comment-delimiter" > (* < / span > < span class = "org-comment" > @param multiplicity default is 1< / span >
< span class = "org-comment" > @param charge default is 0< / span >
< span class = "org-comment" > @raise Invalid_argument if the spin multiplicity is not compatible with< / span >
< span class = "org-comment" > the molecule and the total charge.< / span >
< span class = "org-comment-delimiter" > *)< / span >
< / pre >
< / div >
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-left" > < code > make< / code > < / td >
< td class = "org-left" > < code > make n_alfa n_beta< / code > < / td >
< / tr >
< tr >
< td class = "org-left" > < code > of_atoms< / code > < / td >
2021-01-28 00:34:26 +01:00
< td class = "org-left" > Creates the data relative to electrons for a molecular system described by < a href = "#org117d80f" > < code > Nuclei.t< / code > < / a > for a given total charge and spin multiplicity.< / td >
2021-01-01 16:39:33 +01:00
< / tr >
< / tbody >
< / table >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgd1d110c" class = "outline-3" >
< h3 id = "orgd1d110c" > < span class = "section-number-3" > 2.3< / span > Access< / h3 >
< div class = "outline-text-3" id = "text-2-3" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > charge< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-module" > Charge.< / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > n_elec< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > n_alfa< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > n_beta< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > multiplicity< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< / pre >
< / div >
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-left" > < code > charge< / code > < / td >
< td class = "org-left" > Sum of the charges of the electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > n_elec< / code > < / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > n_alfa< / code > < / td >
< td class = "org-left" > Number of alpha electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > n_beta< / code > < / td >
< td class = "org-left" > Number of beta electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > multiplicity< / code > < / td >
< td class = "org-left" > Spin multiplicity: \(2S+1\)< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org1d2a3d7" class = "outline-3" >
< h3 id = "org1d2a3d7" > < span class = "section-number-3" > 2.4< / span > Printers< / h3 >
< div class = "outline-text-3" id = "text-2-4" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > pp< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Format.< / span > formatter < span class = "org-tuareg-font-lock-operator" > -> < / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > unit
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org7b61e24" class = "outline-3" >
< h3 id = "org7b61e24" > < span class = "section-number-3" > 2.5< / span > Tests< / h3 >
2021-01-01 16:39:33 +01:00
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org918ae65" class = "outline-2" >
< h2 id = "org918ae65" > < span class = "section-number-2" > 3< / span > Element< / h2 >
< div class = "outline-text-2" id = "text-3" >
2021-01-01 16:39:33 +01:00
< p >
Chemical elements.
< / p >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org8889a68" class = "outline-3" >
< h3 id = "org8889a68" > < span class = "section-number-3" > 3.1< / span > Type< / h3 >
< div class = "outline-text-3" id = "text-3-1" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
2021-01-28 00:34:26 +01:00
< pre class = "src src-ocaml" id = "org2343857" > < span class = "org-tuareg-font-lock-governing" > type< / span > < span class = "org-type" > t< / span > < span class = "org-tuareg-font-lock-operator" > =< / span >
2021-01-01 16:39:33 +01:00
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > X< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > H< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > He< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Li< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Be< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > B< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > C< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > N< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > O< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > F< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ne< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Na< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Mg< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Al< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Si< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > P< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > S< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Cl< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ar< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > K< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ca< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Sc< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ti< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > V< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Cr< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Mn< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Fe< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Co< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ni< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Cu< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Zn< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ga< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ge< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > As< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Se< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Br< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Kr< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Rb< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Sr< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Y< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Zr< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Nb< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Mo< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Tc< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ru< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Rh< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Pd< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Ag< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Cd< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > In< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Sn< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Sb< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Te< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > I< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Xe< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > Pt< / span >
< span class = "org-keyword" > exception< / span > < span class = "org-tuareg-font-lock-constructor" > ElementError< / span > < span class = "org-keyword" > of< / span > string
< span class = "org-tuareg-font-lock-governing" > open < / span > < span class = "org-tuareg-font-lock-module" > Common< / span >
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgc639e8c" class = "outline-3" >
< h3 id = "orgc639e8c" > < span class = "section-number-3" > 3.2< / span > Conversion< / h3 >
< div class = "outline-text-3" id = "text-3-2" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > string
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_long_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > string
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_int< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_int< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > int < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_charge< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-module" > Charge.< / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_charge< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Charge.< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< / pre >
< / div >
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-left" > < code > of_string< / code > < / td >
< td class = "org-left" > Creates an < code > Element.t< / code > from a chemical symbol or from the full name of the element (case insensitive)< / td >
< / tr >
< tr >
< td class = "org-left" > < code > to_string< / code > < / td >
< td class = "org-left" > Gets the chemical symbol of the < code > Element.t< / code > in a string< / td >
< / tr >
< tr >
< td class = "org-left" > < code > to_long_string< / code > < / td >
< td class = "org-left" > Gets the full name of the < code > Element.t< / code > in a string< / td >
< / tr >
< tr >
< td class = "org-left" > < code > to_int< / code > < / td >
< td class = "org-left" > Convert to the atomic charge, with < code > int< / code > type< / td >
< / tr >
< tr >
< td class = "org-left" > < code > of_int< / code > < / td >
< td class = "org-left" > Create from the atomic charge, with < code > int< / code > type< / td >
< / tr >
< tr >
< td class = "org-left" > < code > to_charge< / code > < / td >
< td class = "org-left" > Convert to the atomic charge, with < code > Charge.t< / code > type< / td >
< / tr >
< tr >
< td class = "org-left" > < code > of_charge< / code > < / td >
< td class = "org-left" > Create from the atomic charge, with < code > Charge.t< / code > type< / td >
< / tr >
< / tbody >
< / table >
2021-01-28 00:34:26 +01:00
< pre class = "example" id = "orgce999ba" >
2021-01-01 16:39:33 +01:00
Element.of_string "Fe" ;;
- : Element.t = Particles.Element.Fe
Element.of_string "hydrogen" ;;
- : Element.t = Particles.Element.H
Element.of_string "Kryptonite" ;;
Exception: Particles.Element.ElementError "Element Kryptonite unknown".
Element.(to_long_string Fe) ;;
- : string = "Iron"
Element.(to_string Fe);;
- : string = "Fe"
< / pre >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org8706da1" class = "outline-3" >
< h3 id = "org8706da1" > < span class = "section-number-3" > 3.3< / span > Database information< / h3 >
< div class = "outline-text-3" id = "text-3-3" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > covalent_radius< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-module" > Non_negative_float.< / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > vdw_radius< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-module" > Non_negative_float.< / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > mass< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-module" > Mass.< / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > small_core< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > large_core< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< / pre >
< / div >
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-left" > < code > covalent_radius< / code > < / td >
< td class = "org-left" > Covalent radii of the elements, in atomic units< / td >
< / tr >
< tr >
< td class = "org-left" > < code > vdw_radius< / code > < / td >
< td class = "org-left" > Van der Waals radii of the elements, in atomic units< / td >
< / tr >
< tr >
< td class = "org-left" > < code > mass< / code > < / td >
< td class = "org-left" > Atomic mass of the elements, in atomic units)< / td >
< / tr >
< tr >
< td class = "org-left" > < code > small_core< / code > < / td >
< td class = "org-left" > Number of electrons in the small core model (all except the outermost two shells)< / td >
< / tr >
< tr >
< td class = "org-left" > < code > large_core< / code > < / td >
< td class = "org-left" > Number of electrons in the large core model (all except the outermost shell)< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org95418b5" class = "outline-3" >
< h3 id = "org95418b5" > < span class = "section-number-3" > 3.4< / span > Printers< / h3 >
< div class = "outline-text-3" id = "text-3-4" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > pp< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Format.< / span > formatter < span class = "org-tuareg-font-lock-operator" > -> < / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > unit
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > pp_long< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Format.< / span > formatter < span class = "org-tuareg-font-lock-operator" > -> < / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > unit
< / pre >
< / div >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgc544cb3" class = "outline-2" >
< h2 id = "orgc544cb3" > < span class = "section-number-2" > 4< / span > Atomic mass< / h2 >
< div class = "outline-text-2" id = "text-4" >
2021-01-01 16:39:33 +01:00
< p >
Atomic mass, a non-negative float.
< / p >
< div class = "org-src-container" >
2021-01-28 00:34:26 +01:00
< pre class = "src src-ocaml" id = "orgb21935a" > < span class = "org-tuareg-font-lock-governing" > include< / span > < span class = "org-tuareg-font-lock-governing" > module type of< / span > < span class = "org-tuareg-font-lock-module" > Common.Non_negative_float< / span >
2021-01-01 16:39:33 +01:00
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org0dcc52f" class = "outline-2" >
< h2 id = "org0dcc52f" > < span class = "section-number-2" > 5< / span > Nuclei< / h2 >
< div class = "outline-text-2" id = "text-5" >
2021-01-01 16:39:33 +01:00
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org83b7fcb" class = "outline-3" >
< h3 id = "org83b7fcb" > < span class = "section-number-3" > 5.1< / span > Type< / h3 >
< div class = "outline-text-3" id = "text-5-1" >
2021-01-20 23:55:34 +01:00
< p >
2021-01-28 00:34:26 +01:00
< a id = "org117d80f" > < code > Nuclei.t< / code > < / a >
2021-01-20 23:55:34 +01:00
< / p >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
2021-01-28 00:34:26 +01:00
< pre class = "src src-ocaml" id = "org9b85d6c" > < span class = "org-tuareg-font-lock-governing" > open < / span > < span class = "org-tuareg-font-lock-module" > Common< / span >
2021-01-01 16:39:33 +01:00
< span class = "org-tuareg-font-lock-governing" > type< / span > < span class = "org-type" > t< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > < span class = "org-tuareg-font-lock-module" > Element.< / span > t < span class = "org-tuareg-font-lock-operator" > *< / span > < span class = "org-tuareg-font-lock-module" > Coordinate.< / span > t< span class = "org-tuareg-font-lock-operator" > )< / span > array
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgcba845a" class = "outline-3" >
< h3 id = "orgcba845a" > < span class = "section-number-3" > 5.2< / span > xyz file lexer/parser< / h3 >
< div class = "outline-text-3" id = "text-5-2" >
2021-01-01 16:39:33 +01:00
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org196ee2a" class = "outline-4" >
< h4 id = "org196ee2a" > < span class = "section-number-4" > 5.2.1< / span > Lexer< / h4 >
< div class = "outline-text-4" id = "text-5-2-1" >
2021-01-01 16:39:33 +01:00
< p >
< code > nuclei_lexer.mll< / code > contains the description of the lexemes used in
an xyz file.
< / p >
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-operator" > {< / span >
< span class = "org-tuareg-font-lock-governing" > open < / span > < span class = "org-tuareg-font-lock-module" > Xyz_parser< / span >
< span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > eol< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > < span class = "org-tuareg-font-lock-operator" > [< / span > < span class = "org-string" > '\n'< / span > < span class = "org-tuareg-font-lock-operator" > ]< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > white< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > < span class = "org-tuareg-font-lock-operator" > [< / span > < span class = "org-string" > ' '< / span > < span class = "org-string" > '\t'< / span > < span class = "org-tuareg-font-lock-operator" > ]+< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > word< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > < span class = "org-tuareg-font-lock-operator" > [^< / span > < span class = "org-string" > ' '< / span > < span class = "org-string" > '\t'< / span > < span class = "org-string" > '\n'< / span > < span class = "org-tuareg-font-lock-operator" > ]+< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > letter< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > < span class = "org-tuareg-font-lock-operator" > [< / span > < span class = "org-string" > 'A'< / span > < span class = "org-tuareg-font-lock-operator" > -< / span > < span class = "org-string" > 'Z'< / span > < span class = "org-string" > 'a'< / span > < span class = "org-tuareg-font-lock-operator" > -< / span > < span class = "org-string" > 'z'< / span > < span class = "org-tuareg-font-lock-operator" > ]< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > integer< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > < span class = "org-tuareg-font-lock-operator" > [< / span > < span class = "org-string" > '0'< / span > < span class = "org-tuareg-font-lock-operator" > -< / span > < span class = "org-string" > '9'< / span > < span class = "org-tuareg-font-lock-operator" > ]+< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > real< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > < span class = "org-string" > '-'< / span > < span class = "org-tuareg-font-lock-operator" > ?< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > integer < span class = "org-string" > '.'< / span > integer < span class = "org-tuareg-font-lock-operator" > |< / span > integer < span class = "org-string" > '.'< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-string" > '.'< / span > integer< span class = "org-tuareg-font-lock-operator" > )< / span > < span class = "org-tuareg-font-lock-operator" > ([< / span > < span class = "org-string" > 'e'< / span > < span class = "org-string" > 'E'< / span > < span class = "org-tuareg-font-lock-operator" > ]< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > < span class = "org-string" > '+'< / span > < span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-string" > '-'< / span > < span class = "org-tuareg-font-lock-operator" > )?< / span > integer< span class = "org-tuareg-font-lock-operator" > )?< / span >
rule read_all < span class = "org-tuareg-font-lock-operator" > =< / span > parse
< span class = "org-tuareg-font-lock-operator" > |< / span > eof < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-constructor" > EOF< / span > < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > eol < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > white < span class = "org-keyword" > as< / span > w < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > w < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > integer < span class = "org-keyword" > as< / span > i < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > int_of_string i< span class = "org-tuareg-font-lock-operator" > )< / span > < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > real < span class = "org-keyword" > as< / span > f < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > float_of_string f< span class = "org-tuareg-font-lock-operator" > )< / span > < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > word < span class = "org-keyword" > as< / span > w < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-constructor" > WORD< / span > w < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > {< / span >
< span class = "org-comment-delimiter" > (* < / span > < span class = "org-comment" > DEBUG< / span >
< span class = "org-comment" > let () =< / span >
< span class = "org-comment" > let ic = open_in "h2o.xyz" in< / span >
< span class = "org-comment" > let lexbuf = Lexing.from_channel ic in< / span >
< span class = "org-comment" > while true do< / span >
< span class = "org-comment" > let s =< / span >
< span class = "org-comment" > match read_all lexbuf with< / span >
< span class = "org-comment" > | EOL -> "EOL"< / span >
< span class = "org-comment" > | SPACE w -> "SPACE("^w^")"< / span >
< span class = "org-comment" > | INTEGER i -> "INTEGER("^(string_of_int i)^")"< / span >
< span class = "org-comment" > | FLOAT f -> "FLOAT("^(string_of_float f)^")"< / span >
< span class = "org-comment" > | WORD w -> "WORD("^w^")"< / span >
< span class = "org-comment" > | EOF -> "EOF"< / span >
< span class = "org-comment" > in< / span >
< span class = "org-comment" > print_endline s< / span >
< span class = "org-comment" > done;< / span >
< span class = "org-comment-delimiter" > *)< / span >
< span class = "org-tuareg-font-lock-operator" > }< / span >
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgda1a58a" class = "outline-4" >
< h4 id = "orgda1a58a" > < span class = "section-number-4" > 5.2.2< / span > Parser< / h4 >
< div class = "outline-text-4" id = "text-5-2-2" >
2021-01-01 16:39:33 +01:00
< p >
< code > xyz_parser.mly< / code > parses nuclear coordinates in xyz format.
< / p >
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-operator" > %{< / span >
< span class = "org-tuareg-font-lock-governing" > open < / span > < span class = "org-tuareg-font-lock-module" > Common< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-function-name" > make_angstrom< / span > < span class = "org-variable-name" > x y z< / span > < span class = "org-tuareg-font-lock-operator" > =< / span >
< span class = "org-tuareg-font-lock-module" > Coordinate.< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > make_angstrom < span class = "org-tuareg-font-lock-operator" > {< / span >
x < span class = "org-tuareg-font-lock-operator" > ;< / span > y < span class = "org-tuareg-font-lock-operator" > ;< / span > z
< span class = "org-tuareg-font-lock-operator" > })< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-function-name" > output_of< / span > < span class = "org-variable-name" > f x y z< / span > < span class = "org-tuareg-font-lock-operator" > =< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > a< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > make_angstrom x y z < span class = "org-tuareg-font-lock-governing" > in< / span >
< span class = "org-keyword" > fun< / span > < span class = "org-variable-name" > e< / span > < span class = "org-tuareg-font-lock-operator" > -> < / span >
< span class = "org-tuareg-font-lock-operator" > {< / span >
< span class = "org-tuareg-font-lock-module" > Xyz_ast.< / span >
element < span class = "org-tuareg-font-lock-operator" > =< / span > f e< span class = "org-tuareg-font-lock-operator" > ;< / span >
coord < span class = "org-tuareg-font-lock-operator" > =< / span > a < span class = "org-tuareg-font-lock-operator" > ;< / span >
< span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > output_of_string< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > output_of < span class = "org-tuareg-font-lock-module" > Element.< / span > of_string
< span class = "org-tuareg-font-lock-governing" > let< / span > < span class = "org-variable-name" > output_of_int< / span > < span class = "org-tuareg-font-lock-operator" > =< / span > output_of < span class = "org-tuareg-font-lock-module" > Element.< / span > of_int
< span class = "org-tuareg-font-lock-operator" > %}< / span >
< span class = "org-tuareg-font-lock-operator" > %< / span > token < span class = "org-tuareg-font-lock-constructor" > EOL< / span >
< span class = "org-tuareg-font-lock-operator" > %< / span > token < span class = "org-tuareg-font-lock-operator" > < < / span > string< span class = "org-tuareg-font-lock-operator" > > < / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span >
< span class = "org-tuareg-font-lock-operator" > %< / span > token < span class = "org-tuareg-font-lock-operator" > < < / span > string< span class = "org-tuareg-font-lock-operator" > > < / span > < span class = "org-tuareg-font-lock-constructor" > WORD< / span >
< span class = "org-tuareg-font-lock-operator" > %< / span > token < span class = "org-tuareg-font-lock-operator" > < < / span > int< span class = "org-tuareg-font-lock-operator" > > < / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span >
< span class = "org-tuareg-font-lock-operator" > %< / span > token < span class = "org-tuareg-font-lock-operator" > < < / span > float< span class = "org-tuareg-font-lock-operator" > > < / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span >
< span class = "org-tuareg-font-lock-operator" > %< / span > token < span class = "org-tuareg-font-lock-constructor" > EOF< / span >
< span class = "org-tuareg-font-lock-operator" > %< / span > start input
< span class = "org-tuareg-font-lock-operator" > %< / span > < span class = "org-tuareg-font-lock-governing" > type< / span > < span class = "org-tuareg-font-lock-operator" > < < / span > < span class = "org-tuareg-font-lock-module" > Xyz_ast.< / span > xyz_file< span class = "org-tuareg-font-lock-operator" > > < / span > input
< span class = "org-tuareg-font-lock-operator" > %%< / span > < span class = "org-tuareg-font-lock-operator" > /*< / span > < span class = "org-tuareg-font-lock-constructor" > Grammar< / span > rules < span class = "org-tuareg-font-lock-governing" > and< / span > < span class = "org-function-name" > actions< / span > < span class = "org-variable-name" > follow< / span > < span class = "org-tuareg-font-lock-operator" > */< / span >
input< span class = "org-tuareg-font-lock-operator" > :< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > integer title atoms_xyz < span class = "org-tuareg-font-lock-operator" > {< / span >
< span class = "org-tuareg-font-lock-operator" > {< / span >
number_of_atoms < span class = "org-tuareg-font-lock-operator" > =< / span > $1< span class = "org-tuareg-font-lock-operator" > ;< / span >
file_title < span class = "org-tuareg-font-lock-operator" > =< / span > $2< span class = "org-tuareg-font-lock-operator" > ;< / span >
nuclei < span class = "org-tuareg-font-lock-operator" > =< / span > $3< span class = "org-tuareg-font-lock-operator" > ;< / span >
< span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > ;< / span >
integer< span class = "org-tuareg-font-lock-operator" > :< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > $2 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > $2 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > ;< / span >
title< span class = "org-tuareg-font-lock-operator" > :< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > title_list < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > ;< / span >
text< span class = "org-tuareg-font-lock-operator" > :< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > WORD< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > string_of_float $1< span class = "org-tuareg-font-lock-operator" > )}< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > string_of_int $1< span class = "org-tuareg-font-lock-operator" > )}< / span >
< span class = "org-tuareg-font-lock-operator" > ;< / span >
title_list< span class = "org-tuareg-font-lock-operator" > :< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-string" > ""< / span > < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > title_list text < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-operator" > (< / span > $1 < span class = "org-tuareg-font-lock-operator" > ^< / span > $2< span class = "org-tuareg-font-lock-operator" > )< / span > < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > ;< / span >
atoms_xyz< span class = "org-tuareg-font-lock-operator" > :< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-module" > List.< / span > rev $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > EOF< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-module" > List.< / span > rev $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > ;< / span >
atoms_list< span class = "org-tuareg-font-lock-operator" > :< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > < span class = "org-tuareg-font-lock-operator" > []< / span > < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > WORD< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_string $4 $6 $8 $2 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > WORD< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_string $4 $6 $8 $2 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_int $4 $6 $8 $2 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_int $4 $6 $8 $2 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > WORD< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_string $5 $7 $9 $3 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > WORD< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_string $5 $7 $9 $3 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_int $5 $7 $9 $3 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > |< / span > atoms_list < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > INTEGER< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > FLOAT< / span > < span class = "org-tuareg-font-lock-constructor" > SPACE< / span > < span class = "org-tuareg-font-lock-constructor" > EOL< / span > < span class = "org-tuareg-font-lock-operator" > {< / span > output_of_int $5 $7 $9 $3 < span class = "org-tuareg-font-lock-operator" > ::< / span > $1 < span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-operator" > ;< / span >
< / pre >
< / div >
< p >
When an xyz file is read by < code > xyz_parser.mly< / code > , it is converted into
an < code > xyz_file< / code > data structure.
< / p >
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > open < / span > < span class = "org-tuareg-font-lock-module" > Common< / span >
< span class = "org-tuareg-font-lock-governing" > type< / span > < span class = "org-type" > nucleus< / span > < span class = "org-tuareg-font-lock-operator" > =< / span >
< span class = "org-tuareg-font-lock-operator" > {< / span >
element< span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Element.< / span > t < span class = "org-tuareg-font-lock-operator" > ;< / span >
coord < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Coordinate.< / span > angstrom < span class = "org-tuareg-font-lock-module" > Coordinate.< / span > point< span class = "org-tuareg-font-lock-operator" > ;< / span >
< span class = "org-tuareg-font-lock-operator" > }< / span >
< span class = "org-tuareg-font-lock-governing" > type< / span > < span class = "org-type" > xyz_file< / span > < span class = "org-tuareg-font-lock-operator" > =< / span >
< span class = "org-tuareg-font-lock-operator" > {< / span >
number_of_atoms < span class = "org-tuareg-font-lock-operator" > :< / span > int < span class = "org-tuareg-font-lock-operator" > ;< / span >
file_title < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > ;< / span >
nuclei < span class = "org-tuareg-font-lock-operator" > :< / span > nucleus list < span class = "org-tuareg-font-lock-operator" > ;< / span >
< span class = "org-tuareg-font-lock-operator" > }< / span >
< / pre >
< / div >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org4bc334a" class = "outline-3" >
< h3 id = "org4bc334a" > < span class = "section-number-3" > 5.3< / span > Conversion< / h3 >
< div class = "outline-text-3" id = "text-5-3" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_xyz_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_xyz_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > string
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_xyz_file< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_zmt_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_zmt_file< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > string
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_filename< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< / pre >
< / div >
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-left" > < code > of_xyz_string< / code > < / td >
< td class = "org-left" > Create from a string, in xyz format< / td >
< / tr >
< tr >
< td class = "org-left" > < code > of_xyz_file< / code > < / td >
< td class = "org-left" > Create from a file, in xyz format< / td >
< / tr >
< tr >
< td class = "org-left" > < code > of_zmt_string< / code > < / td >
< td class = "org-left" > Create from a string, in z-matrix format< / td >
< / tr >
< tr >
< td class = "org-left" > < code > of_zmt_file< / code > < / td >
< td class = "org-left" > Create from a file, in z-matrix format< / td >
< / tr >
< tr >
< td class = "org-left" > < code > to_string< / code > < / td >
< td class = "org-left" > Transform to a string, for printing< / td >
< / tr >
< tr >
< td class = "org-left" > < code > of_filename< / code > < / td >
< td class = "org-left" > Detects the type of file (xyz, z-matrix) and reads the file< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org259e4f9" class = "outline-3" >
< h3 id = "org259e4f9" > < span class = "section-number-3" > 5.4< / span > < span class = "todo TODO" > TODO< / span > Query< / h3 >
< div class = "outline-text-3" id = "text-5-4" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > formula< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > string
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > repulsion< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > float
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > charge< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-module" > Charge.< / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > small_core< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > large_core< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > int
< / pre >
< / div >
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-left" > < code > formula< / code > < / td >
< td class = "org-left" > Returns the chemical formula< / td >
< / tr >
< tr >
< td class = "org-left" > < code > repulsion< / code > < / td >
< td class = "org-left" > Nuclear repulsion energy, in atomic units< / td >
< / tr >
< tr >
< td class = "org-left" > < code > charge< / code > < / td >
< td class = "org-left" > Sum of the charges of the nuclei< / td >
< / tr >
< tr >
< td class = "org-left" > < code > small_core< / code > < / td >
< td class = "org-left" > Number of core electrons in the small core model< / td >
< / tr >
< tr >
< td class = "org-left" > < code > large_core< / code > < / td >
< td class = "org-left" > Number of core electrons in the large core model< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org606af7e" class = "outline-3" >
< h3 id = "org606af7e" > < span class = "section-number-3" > 5.5< / span > Printers< / h3 >
< div class = "outline-text-3" id = "text-5-5" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > pp< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Format.< / span > formatter < span class = "org-tuareg-font-lock-operator" > -> < / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > unit
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgcd3169c" class = "outline-3" >
< h3 id = "orgcd3169c" > < span class = "section-number-3" > 5.6< / span > Tests< / h3 >
2021-01-01 16:39:33 +01:00
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-orgf9d75ec" class = "outline-2" >
< h2 id = "orgf9d75ec" > < span class = "section-number-2" > 6< / span > Z-matrix< / h2 >
< div class = "outline-text-2" id = "text-6" >
2021-01-01 16:39:33 +01:00
< p >
Z-matrix representation of nuclear coordinates.
< / p >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org2ee988d" class = "outline-3" >
< h3 id = "org2ee988d" > < span class = "section-number-3" > 6.1< / span > Type< / h3 >
< div class = "outline-text-3" id = "text-6-1" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
2021-01-28 00:34:26 +01:00
< pre class = "src src-ocaml" id = "org2500b30" > < span class = "org-tuareg-font-lock-governing" > type< / span > < span class = "org-type" > t< / span >
2021-01-01 16:39:33 +01:00
< / pre >
< / div >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org0a2b5eb" class = "outline-3" >
< h3 id = "org0a2b5eb" > < span class = "section-number-3" > 6.2< / span > Conversion< / h3 >
< div class = "outline-text-3" id = "text-6-2" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > of_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > string < span class = "org-tuareg-font-lock-operator" > -> < / span > t
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_xyz< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > < span class = "org-tuareg-font-lock-operator" > (< / span > < span class = "org-tuareg-font-lock-module" > Element.< / span > t < span class = "org-tuareg-font-lock-operator" > *< / span > float < span class = "org-tuareg-font-lock-operator" > *< / span > float < span class = "org-tuareg-font-lock-operator" > *< / span > float< span class = "org-tuareg-font-lock-operator" > )< / span > array
< span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > to_xyz_string< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > string
< / pre >
< / div >
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-left" > < code > of_string< / code > < / td >
< td class = "org-left" > Reads a z-matrix from a string< / td >
< / tr >
< tr >
< td class = "org-left" > < code > to_xyz< / code > < / td >
< td class = "org-left" > Converts to xyz format, as in the < code > Nuclei< / code > module< / td >
< / tr >
< tr >
< td class = "org-left" > < code > to_xyz_string< / code > < / td >
< td class = "org-left" > Converts to xyz format, as a string< / td >
< / tr >
< / tbody >
< / table >
2021-01-28 00:34:26 +01:00
< pre class = "example" id = "org4442d9d" >
2021-01-01 16:39:33 +01:00
let zmt = Zmatrix.of_string "
n
n 1 nn
h 1 hn 2 hnn
h 2 hn 1 hnn 3 dih4
h 1 hn 2 hnn 4 dih5
h 2 hn 1 hnn 3 dih5
nn 1.446
hn 1.016
hnn 106.0
dih4 -54.38
dih5 54.38
" ;;
- : Zmatrix.t = N
N 1 1.446000
H 1 1.016000 2 106.000000
H 2 1.016000 1 106.000000 3 -54.380000
H 1 1.016000 2 106.000000 4 54.380000
H 2 1.016000 1 106.000000 3 54.380000
Zmatrix.to_xyz zmt ;;
- : (Element.t * float * float * float) array =
[|(N, 0., 0., 0.); (N, 0., 0., 1.446);
(H, -0.976641883073332107, 0., -0.280047553510071046);
(H, -0.568802835186988709, 0.793909757123734683, 1.726047553510071);
(H, 0.314092649983635563, 0.924756819385119, -0.280047553510071101);
(H, -0.568802835186988709, -0.793909757123734683, 1.726047553510071)|]
Zmatrix.to_xyz_string zmt ;;
- : string =
"N 0.000000 0.000000 0.000000
N 0.000000 0.000000 1.446000
H -0.976642 0.000000 -0.280048
H -0.568803 0.793910 1.726048
H 0.314093 0.924757 -0.280048
H -0.568803 -0.793910 1.726048"
< / pre >
< / div >
< / div >
2021-01-28 00:34:26 +01:00
< div id = "outline-container-org36acab9" class = "outline-3" >
< h3 id = "org36acab9" > < span class = "section-number-3" > 6.3< / span > Printers< / h3 >
< div class = "outline-text-3" id = "text-6-3" >
2021-01-01 16:39:33 +01:00
< div class = "org-src-container" >
< pre class = "src src-ocaml" > < span class = "org-tuareg-font-lock-governing" > val< / span > < span class = "org-function-name" > pp< / span > < span class = "org-tuareg-font-lock-operator" > :< / span > < span class = "org-tuareg-font-lock-module" > Format.< / span > formatter < span class = "org-tuareg-font-lock-operator" > -> < / span > t < span class = "org-tuareg-font-lock-operator" > -> < / span > unit
< / pre >
< / div >
< / div >
< / div >
< / div >
< / div >
< div id = "postamble" class = "status" >
< p class = "author" > Author: Anthony Scemama< / p >
2021-01-28 00:34:26 +01:00
< p class = "date" > Created: 2021-01-27 Wed 23:44< / p >
2021-01-01 16:39:33 +01:00
< p class = "validation" > < a href = "https://validator.w3.org/check?uri=referer" > Validate< / a > < / p >
< / div >
< / body >
< / html >