deuteron

We use Variational Artificial Neural Networks to solve the nuclear bound state

https://github.com/javier-rozalen/deuteron

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: springer.com
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary

Keywords

machine-learning nuclear-physics
Last synced: 6 months ago · JSON representation ·

Repository

We use Variational Artificial Neural Networks to solve the nuclear bound state

Basic Info
  • Host: GitHub
  • Owner: javier-rozalen
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 584 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Topics
machine-learning nuclear-physics
Created almost 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Solving the deuteron

This repository contains the code used to generate the results in this article (published in EPJ Plus).

Requirements

The machine learning part of the code in the files above is written in PyTorch. It does not come with the default Python 3 installation; to install it, go to Official PyTorch page or type:

pip3 install torch

Also, the progress bar tqdm is used. To install it:

pip3 install tqdm

Model training guide


The steps below are intended to provide guidance through the code files in this repository. These cover the whole training process of the Artificial Neural Networks as well as the generation of the figures that appear in the article. Every file has command-line help detailing the available flags to use when running the file. This help menu can be accessed by running the file with the -h flag, for example: python3 file.py -h.

Step 1. Pretraining.

The file pretraining.py trains an ANN to match two wave function-like functions. We set command-line arguments to our preference and run the file. This will store the models and the plots in saved_models/pretraining/.../, where the dots are a proxy for a set of subdirectories named after the hyperparameter combinations of our choice.

plot

Step 2. Training.

We now run the script deuteron.py. This file trains the ANN to minimize the energy. A loop is already programmed that will sequentially load the pretrained models (Step 1). The code allows to split the total list of pretrained models into batches so as to seize parallelized computing (clusters). The models thusly trained are automatically stored (if desired) in saved_models/n3lo/.... By the end of this step we already have a fully trained model.

plot

Note: the steps below are dedicated to error analysis and plotting.

Step 3. Error analysis.

We run the script error_analysis/error_measure.py with the desired arguments. This file can automatically compute the errors of the trained models. A loop is already programmed that will sequentially load the trained models (Step 2). This will save E, Ks, Kd, Pd with their corresponding errors under the error_data/ folder.

In order to generate FIG. 3 in the article, we can run the script error_analysis/oscillation_error_plot.py, and this will generate the figure and store it in saved_plots/oscillation_error_plot.pdf.

plot

Step 4. Filtering the good runs.

We run the script error_analysis/filter.py with the desired arguments. This program filters the trained models and selects the ones that match our criteria (defined via the initial parameters). The selected runs are copied in a folder named filtered_runs/ found under the error_analysis/error_data/ folder.

Step 5. Convergence rates.

We run the script error_analysis/convergence_rate/convergence_rate.py with the desired arguments. This file will compute the energy errors and convergence rate of the specified models and store this data under the error_analysis/error_data/... folder. This step generates the data needed for FIG. 2 of the paper and Tables II and III.

In order to generate FIG. 2 in the article, we can run the script error_analysis/convergence_rate/convergence_rate_plot.py, and this will generate the figure and store it in saved_plots/convergence_rate.pdf.

plot

Step 6. Plotting energy and fidelity.

In order to generate FIG. 4 in the article, we run the script energy_fidelity_plot/energy_fidelity_plot.py with the desired arguments. Text files under the folder energy_fidelity_plot/plotting_data/ with further errors will be generated in the process. Once the program is done, the resulting plot will be stored in saved_plots/master_plot.pdf.

plot

Step 7. Plotting wave functions and their variances.

We run the script error_analysis/wf_variance/wf_var.py with the desired arguments. This file will generate data in the same folder where it is located, which is necessary to generate FIGs. 5 and 6 of the paper.

In order to generate FIG. 5 in the article we run the script error_analysis/wf_variance/var_plot_wf.py with the desired arguments. This will generate the figure and store it in saved_plots/wf_variance_wf.pdf.

plot

In order to generate FIG. 6 in the article we run the script error_analysis/wf_variance/var_plot_stdev.py with the desired arguments. This will generate the figure and store it in saved_plots/wf_variance_var.pdf.

plot

Step 8. Overfitting quantification

We run the script error_analysis/wf_variance/overfitting_quantification.py with the desired arguments. This action will cause a print out to the console with the values found in TABLE I of the paper.


Owner

  • Name: Javi Rozalén Sarmiento
  • Login: javier-rozalen
  • Kind: user
  • Company: Universitat de Barcelona

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Rozalén Sarmiento
    given-names: Javier
    orcid: https://orcid.org/0000-0002-0660-1216
title: "Machine learning the deuteron: new architectures and uncertainty quantification"
version: 1.0
date-released: 2023-03-08
url: https://github.com/javier-rozalen/deuteron

GitHub Events

Total
Last Year