Skip to content

Commit

Permalink
build based on b15b82e
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Feb 7, 2024
1 parent 01e8f85 commit 22648e9
Show file tree
Hide file tree
Showing 21 changed files with 1,425 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!--This file is automatically generated by Documenter.jl-->
<meta http-equiv="refresh" content="0; url=./dev/"/>
<meta http-equiv="refresh" content="0; url=./stable/"/>
1 change: 1 addition & 0 deletions stable
1 change: 1 addition & 0 deletions v0.1
1 change: 1 addition & 0 deletions v0.1.0/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documenter":{"julia_version":"1.8.5","generation_timestamp":"2024-02-07T16:40:36","documenter_version":"1.2.1"}}
13 changes: 13 additions & 0 deletions v0.1.0/Getting_Started/Bases/Basis_Construction/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>SubModel Construction · ACEhamiltonians.jl Documentation</title><meta name="title" content="SubModel Construction · ACEhamiltonians.jl Documentation"/><meta property="og:title" content="SubModel Construction · ACEhamiltonians.jl Documentation"/><meta property="twitter:title" content="SubModel Construction · ACEhamiltonians.jl Documentation"/><meta name="description" content="Documentation for ACEhamiltonians.jl Documentation."/><meta property="og:description" content="Documentation for ACEhamiltonians.jl Documentation."/><meta property="twitter:description" content="Documentation for ACEhamiltonians.jl Documentation."/><script data-outdated-warner src="../../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../../assets/documenter.js"></script><script src="../../../search_index.js"></script><script src="../../../siteinfo.js"></script><script src="../../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../../">ACEhamiltonians.jl Documentation</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../../">Home</a></li><li><a class="tocitem" href="../../Quick_Start/">Getting Started</a></li><li><a class="tocitem" href="../../Data/Database_Structure/">Database Structure</a></li><li><span class="tocitem">Models</span><ul><li><a class="tocitem" href="../../Model/Model_Construction/">Model Construction</a></li><li><a class="tocitem" href="../../Model/Model_Fitting/">Model Fitting</a></li><li><a class="tocitem" href="../../Model/Model_Predicting/">Model Predicting</a></li></ul></li><li><span class="tocitem">Bases</span><ul><li class="is-active"><a class="tocitem" href>SubModel Construction</a></li><li><a class="tocitem" href="../Basis_Fitting/">SubModel Fitting</a></li><li><a class="tocitem" href="../Basis_Predicting/">SubModel Predicting</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Bases</a></li><li class="is-active"><a href>SubModel Construction</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>SubModel Construction</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/ACEsuit/ACEhamiltonians.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/ACEsuit/ACEhamiltonians.jl/blob/main/docs/src/Getting_Started/Bases/Basis_Construction.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="SubModel-Construction"><a class="docs-heading-anchor" href="#SubModel-Construction">SubModel Construction</a><a id="SubModel-Construction-1"></a><a class="docs-heading-anchor-permalink" href="#SubModel-Construction" title="Permalink"></a></h1><p>Individual on and off site bases may be constructed via calls to the <code>on_site_ace_basis</code> and <code>off_site_ace_basis</code> functions respectively. For on-site bases, one must specify six arguments:</p><ul><li>The azimuthal quantum numbers of the associated shells, <code>ℓ₁</code> and <code>ℓ₂</code>. For example, <code>ℓ₁, ℓ₂= 0, 1</code> would correspond to a s-p interaction.</li><li>The correlation order <code>ν</code>. For on-site interactions the body-order is equivalent to one greater than the correlation order; i.e. a correlation order of one would equate to a body-order of two. </li><li>The maximum polynomial degree <code>deg</code> commonly a value between 2 and 20. This should be chosen via hyperparmeter optimisation.</li><li>The environmental cutoff distance <code>e_cut</code>. Only atoms within the specified cutoff radius will contribute to the local environment. A r_cut value of zero would result in predictions being treated as independent of their environment.</li><li>The scaling parameter <code>r0</code>; this is commonly set to the nearest neighbour distance.</li></ul><pre><code class="language-julia hljs">ℓ₁, ℓ₂ = 0, 0
ν, deg = 2, 4
e_cut, r0 = 12.0, 2.5

on_site_ss_basis = on_site_ace_basis(ℓ₁, ℓ₂, ν, deg, e_cut, r0)</code></pre><p>The call to the off-site basis constructor is identical to its on-site counterpart. With the exception that a bond distance cutoff is provided in-place of <code>r0</code>. Which, as it name suggests, specifies the maximum distance up to which such interactions will be considered. That is to say only interactions between pairs of atoms separated by a distance less than or equal to <code>b_cut</code> will be evaluated. For off-site interactions the body-order is two greater than the correlation order. </p><pre><code class="language-julia hljs">ℓ₁, ℓ₂ = 0, 1
ν, deg = 1, 4
b_cut, e_cut = 12.0, 5.0

off_site_sp_basis = off_site_ace_basis(ℓ₁, ℓ₂, ν, deg, b_cut, e_cut)</code></pre><p>To predict a subblock of the Hamiltonian, one may need the above basis, and fit the coefficients of it from data. This can be done by wrapping them in a <code>SubModel</code> instance like so:</p><pre><code class="language-julia hljs">id_on = (6, 1, 1)
id_off = (6, 6, 1, 2)
on_site_ss_basis = SubModel(on_site_ss_basis, id_on)
off_site_sp_basis = SubModel(off_site_sp_basis, id_off)</code></pre><p>The first argument is always the <code>SymmetricBasis</code> object returned by the on/off-site ACE basis constructor functions. The second argument is the basis <code>id</code>, this is used to identify what interaction the basis is associated with. An <code>id</code> of the form <code>(z, i, j)</code> indicates a basis represent the on-site interaction between the <code>i</code>ᵗʰ and <code>j</code>ᵗʰ shells of species <code>z</code>. Whereas an <code>id</code> of the form <code>(z₁, z₂, i, j)</code> indicates the basis represents an off-site interaction between the <code>i</code>ᵗʰ shell of species <code>z₁</code> and the <code>j</code>ᵗʰ shell of species <code>z₂</code>. Shell indices are used in place of azimuthal quantum numbers to avoid ambiguities arising from the use of non-minimal basis sets.</p><p>Like all other models do, these <code>SubModel</code> structures contain four members, <code>basis</code>, <code>id</code>, <code>coefficients</code> and <code>mean</code>. With the first two already having been discussed. The latter two <code>coefficients</code> and <code>mean</code> are set during the fitting process and are used only when making predictions.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../Model/Model_Predicting/">« Model Predicting</a><a class="docs-footer-nextpage" href="../Basis_Fitting/">SubModel Fitting »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 7 February 2024 16:40">Wednesday 7 February 2024</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
36 changes: 36 additions & 0 deletions v0.1.0/Getting_Started/Bases/Basis_Fitting/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>SubModel Fitting · ACEhamiltonians.jl Documentation</title><meta name="title" content="SubModel Fitting · ACEhamiltonians.jl Documentation"/><meta property="og:title" content="SubModel Fitting · ACEhamiltonians.jl Documentation"/><meta property="twitter:title" content="SubModel Fitting · ACEhamiltonians.jl Documentation"/><meta name="description" content="Documentation for ACEhamiltonians.jl Documentation."/><meta property="og:description" content="Documentation for ACEhamiltonians.jl Documentation."/><meta property="twitter:description" content="Documentation for ACEhamiltonians.jl Documentation."/><script data-outdated-warner src="../../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../../assets/documenter.js"></script><script src="../../../search_index.js"></script><script src="../../../siteinfo.js"></script><script src="../../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../../">ACEhamiltonians.jl Documentation</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../../">Home</a></li><li><a class="tocitem" href="../../Quick_Start/">Getting Started</a></li><li><a class="tocitem" href="../../Data/Database_Structure/">Database Structure</a></li><li><span class="tocitem">Models</span><ul><li><a class="tocitem" href="../../Model/Model_Construction/">Model Construction</a></li><li><a class="tocitem" href="../../Model/Model_Fitting/">Model Fitting</a></li><li><a class="tocitem" href="../../Model/Model_Predicting/">Model Predicting</a></li></ul></li><li><span class="tocitem">Bases</span><ul><li><a class="tocitem" href="../Basis_Construction/">SubModel Construction</a></li><li class="is-active"><a class="tocitem" href>SubModel Fitting</a></li><li><a class="tocitem" href="../Basis_Predicting/">SubModel Predicting</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Bases</a></li><li class="is-active"><a href>SubModel Fitting</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>SubModel Fitting</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/ACEsuit/ACEhamiltonians.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/ACEsuit/ACEhamiltonians.jl/blob/main/docs/src/Getting_Started/Bases/Basis_Fitting.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="SubModel-Fitting"><a class="docs-heading-anchor" href="#SubModel-Fitting">SubModel Fitting</a><a id="SubModel-Fitting-1"></a><a class="docs-heading-anchor-permalink" href="#SubModel-Fitting" title="Permalink"></a></h1><p>Individual <code>SubModel</code> instances may be fitted by supplying the <code>SubModel</code> and fitting <code>data</code> to the <code>fit!</code> function. This single basis <code>fit!</code> function takes the two aforementioned positional arguments along with three optional keyword arguments: <code>solver</code> which specifies the solver to use during fitting which defaults to <code>LSQR</code>, <code>λ</code> is the degree of regularisation to be applied which defaults to <code>1E-7</code>, and <code>enable_mean</code> with permits a mean offset to be applied while this defaults to <code>false</code> it is advised to enable it when fitting on-site bases.</p><pre><code class="language-julia hljs">
# Path to the database within which the fitting data is stored
database_path = &quot;example_data.h5&quot;

# Name/path of/to the system to which fitting data should be drawn
target_system = &quot;0224&quot;

# Load the real-space Hamiltonian matrix, atoms object, cell translation vectors, and basis set definition
H, atoms, images, basis_definition = h5open(database_path) do database
target = database[target_system]
load_hamiltonian(target), load_atoms(target; recentre=true), load_cell_translations(target), load_basis_set_definition(target)
end

# Get the species of the system - it can be done in several ways and here just comes one
# This step can be skipped if all atoms in this system are of the same type
species = unique(atoms.Z)
# Alternatively, one can use
# using JuLIP
# species = AtomicNumber.([ keys(basis_definition)... ])

# Construct a pair of on and off-site model
on_site_sp_model = SubModel(on_site_ace_basis(0, 1, 2, 4, 6.0; species = (try species catch nothing end)), (14, 3, 4))
off_site_pp_model = SubModel(off_site_ace_basis(1, 1, 1, 4, 8.0, 4.0; species = (try species catch nothing end)), (14, 14, 6, 6))

# Gather all relevant data for fitting
on_site_sp_data = get_dataset(H, atoms, on_site_sp_model, basis_definition, images)
off_site_pp_data = get_dataset(H, atoms, off_site_pp_model, basis_definition, images)

# Perform the fitting operation
# Here, solver is an optional field with default &quot;LSQR&quot; which
# specifies the solver used to solve the least squares in fitting
# Other possible choice are &quot;QR&quot;, &quot;ARD&quot;, &quot;BRR&quot;, &quot;RRQR&quot; etc.
fit!(on_site_sp_model, on_site_sp_data; solver = &quot;LSQR&quot;)
fit!(off_site_pp_model, off_site_pp_data; solver = &quot;LSQR&quot;)
</code></pre><p>The fitting data must be provided as a <code>DataSet</code> instance. These structures contain all of the data required to carry out the fitting process; specifically the target sub-blocks and state objects required to perform a fitting operation. The <code>get_dataset</code> convenience function auto-collects all relevant data, which can be filtered as and when needed by the user. This avoids users having to manually collect and construct <code>DataSet</code> instances themselves.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../Basis_Construction/">« SubModel Construction</a><a class="docs-footer-nextpage" href="../Basis_Predicting/">SubModel Predicting »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 7 February 2024 16:40">Wednesday 7 February 2024</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 22648e9

Please sign in to comment.