Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 26-refactoring-the-infrastructure
  • MPGCQM_workshop
  • app
  • backup-05-08
  • develop
  • kappa_sigma_notebook
  • master
  • staging
8 results

Target

Select target project
  • nomad-lab/analytics
1 result
Select Git revision
  • 26-refactoring-the-infrastructure
  • MPGCQM_workshop
  • app
  • backup-05-08
  • develop
  • kappa_sigma_notebook
  • master
  • staging
8 results
Show changes
Showing
with 2 additions and 12642 deletions
.. HQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.. HQ X
.. HQ X quippy: Python interface to QUIP atomistic simulation library
.. HQ X
.. HQ X Copyright James Kermode 2010
.. HQ X
.. HQ X These portions of the source code are released under the GNU General
.. HQ X Public License, version 2, http://www.gnu.org/copyleft/gpl.html
.. HQ X
.. HQ X If you would like to license the source code under different terms,
.. HQ X please contact James Kermode, james.kermode@gmail.com
.. HQ X
.. HQ X When using this software, please cite the following reference:
.. HQ X
.. HQ X http://www.jrkermode.co.uk/quippy
.. HQ X
.. HQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The gap_fit program
=====================================================
Main options
------------
.. autofunction:: quippy.gap_fit_parse_command_line
GAP options
-----------
.. autofunction:: quippy.gap_fit_parse_gap_str
`sparse_method` options are:
- RANDOM: default, chooses n_sparse random datapoints
- PIVOT: based on the full covariance matrix finds the n_sparse "pivoting" points
- CLUSTER: based on the full covariance matrix performs a k-medoid clustering into n_sparse clusters, returning the medoids
- UNIFORM: makes a histogram of the data based on n_sparse and returns a data point from each bin
- KMEANS: k-means clustering based on the data points
- COVARIANCE: greedy data point selection based on the sparse covariance matrix, to minimise the GP variance of all datapoints
- UNIQ: selects unique datapoints from the dataset
- FUZZY: fuzzy k-means clustering
- FILE: reads sparse points from a file
- INDEX_FILE: reads indices of sparse points from a file
- CUR_COVARIANCE: CUR, based on the full covariance matrix
- CUR_POINTS: CUR, based on the datapoints
Source diff could not be displayed: it is too large. Options to address this: view the blob.
.. HQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.. HQ X
.. HQ X GAP: Gaussian Approximation Potential
.. HQ X
.. HQ X Copyright Albert Bartok-Partay, Gabor Csanyi 2010-2019
.. HQ X
.. HQ X gc121@cam.ac.uk
.. HQ X
.. HQ X
.. HQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.. gap documentation master file
GAP and SOAP documentation
=============================
.. module:: gap
These are the documentation pages for Gaussian Approximation Potential
(GAP) code. GAP is a plugin for QUIP, which itself can be used as a
plugin to LAMMPS or called from ASE. For installation, see the QUIP
documentation pages. The information below is on the usage of GAP.
The purpose of the GAP code is to fit interatomic potentials and then
use them for molecular simulation.
Contents
========
.. toctree::
:maxdepth: 1
gap_fit.rst
tutorials.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
* `Module Source Code <_modules/index.html>`_
import sphinx
if sphinx.__version__ < '1.0.1':
raise RuntimeError("Sphinx 1.0.1 or newer is required")
import inspect
import pydoc
def process_docstring(app, what, name, obj, options, lines):
if what == 'module':
print 'Adding contents listing for module %s' % name
title = 'Module contents for :mod:`%s`:' % name
lines.append(title)
classes = module_classes(obj)
if classes:
lines.append("""
.. rubric:: Classes
.. autosummary::
%s
""" % '\n'.join([' %s' % cls for cls in classes]))
funcs = module_functions(obj)
if funcs:
lines.append("""
.. rubric:: Functions
.. autosummary::
%s
""" % '\n'.join([' %s' % func for func in funcs]))
# FIXME add documentation for module attributes
attributes = module_attributes(obj)
if attributes:
lines.append("""
.. rubric:: Attributes
%s
""" % attributes_table(obj, attributes))
def attributes_table(mod, attributes):
MAX_LEN=100
lines = ['']
values = [ str(getattr(mod, attr)) for attr in attributes ]
for i, value in enumerate(values):
if len(value) > MAX_LEN:
values[i] = '---'
attributes = [':attr:`%s`' % attr for attr in attributes ]
col1 = max(len(attr) for attr in attributes)
col2 = max(len(value) for value in values)
fmt = '%%-%ds %%-%ds' % (col1, col2)
head = fmt % ('='*col1, '='*col2)
lines.append(head)
lines.append(fmt % ('Name', 'Value'))
lines.append(head)
for attr, value in zip(attributes, values):
lines.append(fmt % (attr, value))
lines.append(head)
lines.append('')
return '\n'.join(lines)
def module_functions(mod):
if hasattr(mod, '__alldoc__'):
allsymbols = mod.__alldoc__
elif hasattr(mod, '__all__'):
allsymbols = mod.__all__
else:
allsymbols = [name for (name, obj) in inspect.getmembers(mod)]
return [name for name in allsymbols if
not name.startswith('_') and
inspect.isfunction(getattr(mod, name)) and
pydoc.getdoc(getattr(mod, name))]
def module_classes(mod):
if hasattr(mod, '__alldoc__'):
allsymbols = mod.__alldoc__
elif hasattr(mod, '__all__'):
allsymbols = mod.__all__
else:
allsymbols = [name for (name, obj) in inspect.getmembers(mod)]
return [name for name in allsymbols if
not name.startswith('_') and
inspect.isclass(getattr(mod, name)) and
pydoc.getdoc(getattr(mod, name))]
def module_attributes(mod):
if hasattr(mod, '__alldoc__'):
allsymbols = mod.__alldoc__
elif hasattr(mod, '__all__'):
allsymbols = mod.__all__
else:
allsymbols = [name for (name, obj) in inspect.getmembers(mod)]
return [name for name in allsymbols if
not name.startswith('_') and
not callable(getattr(mod, name)) and
pydoc.getdoc(getattr(mod, name))]
def setup(app):
print('modcontents extension loading')
app.connect('autodoc-process-docstring', process_docstring)
This diff is collapsed.
Tutorials
=========
The following tutorials are currently available:
.. toctree::
:maxdepth: 1
gap_fitting_tutorial.ipynb
quippy-descriptor-tutorial.ipynb
! H0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
! H0 X
! H0 X libAtoms+QUIP: atomistic simulation library
! H0 X
! H0 X Portions of this code were written by
! H0 X Albert Bartok-Partay, Silvia Cereda, Gabor Csanyi, James Kermode,
! H0 X Ivan Solt, Wojciech Szlachta, Csilla Varnai, Steven Winfield.
! H0 X
! H0 X Copyright 2006-2010.
! H0 X
! H0 X These portions of the source code are released under the GNU General
! H0 X Public License, version 2, http://www.gnu.org/copyleft/gpl.html
! H0 X
! H0 X If you would like to license the source code under different terms,
! H0 X please contact Gabor Csanyi, gabor@csanyi.net
! H0 X
! H0 X Portions of this code were written by Noam Bernstein as part of
! H0 X his employment for the U.S. Government, and are not subject
! H0 X to copyright in the USA.
! H0 X
! H0 X
! H0 X When using this software, please cite the following reference:
! H0 X
! H0 X http://www.libatoms.org
! H0 X
! H0 X Additional contributions by
! H0 X Alessio Comisso, Chiara Gattinoni, and Gianpietro Moras
! H0 X
! H0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
!X
!X Error handling, see error.f95 for the functions called in these macros.
!X
!X Error passing works as follows:
!X - *error* needs to be intent(out) and optional
!X - all functions that receive *error* as an argument must call INIT_ERROR(error)
!X - RAISE_ERROR is used whenever an error occurs. If *error* is not present,
!X the program execution will be terminated immediately. If *error* is
!X present it will be set to some value not equal ERROR_NONE and the execution
!X of the subroutine will be stopped.
!X - PASS_ERROR is used after a function or subroutine that returns error, i.e.
!X call sub(..., error=error)
!X PASS_ERROR(error)
!X If no error occurs (i.e. error==ERROR_NONE), execution will proceed as
!X usual. If an error occured, the current function will be terminated after
!X the location of the error is passed to the error module.
!X If the calling routine handles the error itself, rather than passing
!X it up with PASS_ERROR(), CLEAR_ERROR() should be used to clear the error
!X info stack
!X - PASS_ERROR_WITH_INFO is like PASS_ERROR, just an additional string can be
!X provided describing the error, or parameters.
!X - HANDLE_ERROR will print the error history and stop execution of the program
!X after an error occured.
!X
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#define INIT_ERROR(error) if (present(error)) then ; error = ERROR_NONE ; endif
#define ASSERT(condition, message, error) if (.not. (condition)) then ; RAISE_ERROR(message, error) ; endif
#define RAISE_ERROR(message, error) if (.true.) then ; call push_error_with_info(message, __FILE__, __LINE__) ; if (present(error)) then ; error = ERROR_UNSPECIFIED ; return ; else ; call error_abort(error) ; endif ; endif
#define RAISE_ERROR_WITH_KIND(kind, message, error) if (.true.) then ; call push_error_with_info(message, __FILE__, __LINE__, kind) ; if (present(error)) then ; error = kind ; return ; else ; call error_abort(error) ; endif ; endif
#define PASS_ERROR(error) if (present(error)) then ; if (error /= ERROR_NONE) then ; call push_error(__FILE__, __LINE__) ; return ; endif ; endif
#define PASS_ERROR_WITH_INFO(message, error) if (present(error)) then ; if (error /= ERROR_NONE) then ; call push_error_with_info(message, __FILE__, __LINE__) ; return ; endif ; endif
#define HANDLE_ERROR(error) if (error /= ERROR_NONE) then ; call push_error(__FILE__, __LINE__) ; call error_abort(error) ; endif
#define CLEAR_ERROR(error) call error_clear_stack()
#define PRINT_LINE_NUMBER if(.true.) then; print "('LINE ' i0)",__LINE__; endif
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
!X
!X MPI errors
!X
!X MPI error string are obtained using mpi_error_string and then pushed
!X onto the error stack.
!X
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#define PASS_MPI_ERROR(mperror, error) if (mperror /= MPI_SUCCESS) then ; call push_MPI_error(mperror, __FILE__, __LINE__) ; if (present(error)) then ; error = ERROR_MPI ; return ; else ; call error_abort(error) ; endif ; endif
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
!X
!X MPI BCAST errors
!X
!X Extension of error handling macros to MPI cases where processes
!X perform different tasks. If an error occurs on one process it will
!X be broadcast to all others before the error is propagated
!X upwards. Replace RAISE_ERROR with BCAST_RAISE_ERROR and PASS_ERROR
!X with BCAST_PASS_ERROR. Additionally, BCAST_CHECK_ERROR must be
!X called on the processes in which no error has occured. See
!X CInOutput read() for an example usage of these macros.
!X
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#define BCAST_ASSERT(condition, message, error, mpi) if (.not. (condition)) then ; BCAST_RAISE_ERROR(message, error, mpi) ; endif
#define BCAST_RAISE_ERROR(message, error, mpi) if (present(error)) call bcast(mpi, error); RAISE_ERROR(message, error)
#define BCAST_RAISE_ERROR_WITH_KIND(kind, message, error, mpi) if (present(error)) then; error = kind; call bcast(mpi, error); end if; RAISE_ERROR_WITH_KIND(kind, message, error)
#define BCAST_PASS_ERROR(error, mpi) if (present(error)) then; if (error /= ERROR_NONE) call bcast(mpi, error); endif; PASS_ERROR(error)
#define BCAST_CHECK_ERROR(error, mpi) if (present(error)) then; call bcast(mpi, error); if (error /= ERROR_NONE) then; RAISE_ERROR_WITH_KIND(error, "An error occured on another MPI process", error); endif; endif
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
!X
!X Delayed errors - for OpenMP loops
!X
!X A subroutine currently in an OpenMP section cannot be quit using
!X the *return* statement. Hence, the error flag is set using
!X RAISE_DELAYED_ERROR and TRACE_DELAYED_ERROR. After the OpenMP section
!X has finished, INVOKE_DELAYED_ERROR will raise the error and exit
!X the current subroutine if an error occured in the OpenMP section.
!X
!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#define RAISE_DELAYED_ERROR(message, error_loc) if (error_loc == ERROR_NONE) then ; call push_error_with_info(message, __FILE__, __LINE__) ; error_loc = ERROR_UNSPECIFIED ; endif
#define TRACE_DELAYED_ERROR(error_loc) if (error_loc /= ERROR_NONE) then ; call push_error(__FILE__, __LINE__) ; endif
#define TRACE_DELAYED_ERROR_WITH_INFO(message, error_loc) if (error_loc /= ERROR_NONE) then ; call push_error_with_info(message, __FILE__, __LINE__) ; endif
#define INVOKE_DELAYED_ERROR(error_loc, error) if (error_loc /= ERROR_NONE) then ; call push_error(__FILE__, __LINE__) ; if (present(error)) then ; error = error_loc ; else ; call error_abort(error) ; endif ; endif
! HND XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
! HND X
! HND X libAtoms+QUIP: atomistic simulation library
! HND X
! HND X Portions of this code were written by
! HND X Albert Bartok-Partay, Silvia Cereda, Gabor Csanyi, James Kermode,
! HND X Ivan Solt, Wojciech Szlachta, Csilla Varnai, Steven Winfield.
! HND X
! HND X Copyright 2006-2010.
! HND X
! HND X Not for distribution
! HND X
! HND X Portions of this code were written by Noam Bernstein as part of
! HND X his employment for the U.S. Government, and are not subject
! HND X to copyright in the USA.
! HND X
! HND X When using this software, please cite the following reference:
! HND X
! HND X http://www.libatoms.org
! HND X
! HND X Additional contributions by
! HND X Alessio Comisso, Chiara Gattinoni, and Gianpietro Moras
! HND X
! HND XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
program gap_fit_program
use libatoms_module
use descriptors_module
use gp_predict_module
use gp_fit_module
use clustering_module
use gap_fit_module
implicit none
type(gap_fit) :: main_gap_fit
call system_initialise(verbosity=PRINT_NORMAL, enable_timing=.false.)
call gap_fit_parse_command_line(main_gap_fit)
call gap_fit_parse_gap_str(main_gap_fit)
if(main_gap_fit%do_core) call read(main_gap_fit%quip_string, trim(main_gap_fit%core_param_file), keep_lf=.true.)
call add_template_string(main_gap_fit) ! if descriptor requires a template xyz file and this is provided, write to a string and add to descriptor_str
call read_descriptors(main_gap_fit) ! initialises descriptors from the descriptor_str and sets max_cutoff according to that.
call read_fit_xyz(main_gap_fit) ! reads in xyz into an array of atoms objects. sets cutoff and does calc_connect on each frame
call print('XYZ file read')
call get_species_xyz(main_gap_fit) ! counts the number of species present in the xyz file.
call add_multispecies_gaps(main_gap_fit)
call parse_config_type_sigma(main_gap_fit)
call parse_config_type_n_sparseX(main_gap_fit)
if(any(main_gap_fit%add_species)) then ! descriptor_str might have changed. reinitialises descriptors from the descriptor_str and sets max_cutoff according to that.
call read_descriptors(main_gap_fit)
endif
call print('Multispecies support added where requested')
call fit_n_from_xyz(main_gap_fit) ! counts number of energies, forces, virials. computes number of descriptors and gradients.
call set_baselines(main_gap_fit) ! sets e0 etc.
call fit_data_from_xyz(main_gap_fit) ! converts atomic neighbourhoods (bond neighbourhoods etc.) do descriptors, and feeds those to the GP
call print('Cartesian coordinates transformed to descriptors')
if(main_gap_fit%sparsify_only_no_fit) then
call system_finalise()
stop
end if
call enable_timing()
call system_timer('GP sparsify')
call gp_covariance_sparse(main_gap_fit%my_gp)
call initialise(main_gap_fit%gp_sp,main_gap_fit%my_gp)
call gap_fit_print_xml(main_gap_fit,main_gap_fit%gp_file,main_gap_fit%sparseX_separate_file)
call system_timer('GP sparsify')
call system_finalise()
end program gap_fit_program
This diff is collapsed.
#!/bin/bash
#
# Determine the gap version from the git reported last changed date
# of file (or the file GAP_VERSION if it exists). The gapversion
# is the UNIX timestap of the most recently changed file.
GAP_FILES="descriptors.f95 descriptors_wrapper.f95 \
make_permutations_v2.f95 gp_predict.f95 \
clustering.f95 gp_fit.f95 \
gap_fit_module.f95 gap_fit.f95"
GAP_ROOT=$(dirname "$0")
# By default only show the date
VERBOSE=false
# Options for interactive use
while getopts 'v' opt; do
case $opt in
v)
VERBOSE=true
;;
\?)
echo "Usage: $0"
echo "'-v' to output name of newest file to stderr"
exit 1
;;
esac
done
function git_date
{
if [ -e "$1" ]
then
DATE=$(git log -n1 --format="%at" "$1")
[[ $? -eq 0 && ! -z $DATE ]] && echo "$DATE" || echo 0
else
echo 0
fi
}
if [ -s "${GAP_ROOT}/GAP_VERSION" ]; then
echo -ne "$(cat "${GAP_ROOT}/GAP_VERSION")"
exit 0
elif [ -d "${GAP_ROOT}/.git" ] || [ -s "${GAP_ROOT}/.git" ]; then
# Sort everything as "DATE filename" list and take the last one
GAP_VERSION=$(
for I in $GAP_FILES
do
if [ -d "${GAP_ROOT}/$(dirname "$I")" ]
then
cd "${GAP_ROOT}/$(dirname "$I")"
echo $(git_date $(basename "$I")) "$I"
cd - >/dev/null
fi
done | sort -n | tail -1 )
# filename to stderr if requested;
# split string with parameter expansion
if [ $VERBOSE == "true" ]; then
echo "${GAP_VERSION##* }" >&2
fi
echo "${GAP_VERSION%% *}"
else
echo "0"
exit 0
fi
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
echo
echo The teach-sparse program is now called gap_fit
echo
Subproject commit d9b72a06689bc850f46b30e96ad3224f2d761e3a
Subproject commit b7d59496c970679531a4a22c9c6dc6968aeb69ed
build
doc/_build
*~
*.pyc
.ipynb_checkpoints
.idea/
GitStatistics
src/GAP
src/ThirdParty
src/libAtoms/*.mod
src/Potentials/*.mod
src/Potentials/*.mod.save
quippy/quippy.f90doc
quippy/quippy.spec
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.