Coder Social home page Coder Social logo

dilkins / tensoap Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 11.0 7.63 MB

Public repository for symmetry-adapted Gaussian Process Regression (SA-GPR)

License: GNU Lesser General Public License v3.0

Python 41.41% Shell 2.83% Makefile 0.32% C 47.26% Fortran 4.39% Cython 3.79%

tensoap's People

Contributors

andreagrisafi avatar dilkins avatar tamaswells avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tensoap's Issues

Zundel Cation Example Fails

When executing the following line in example 2. Zundel Cation:
sagpr_get_kernel -z 2 -ps PS1.npy -ps0 PS0.npy -s PS1_natoms.npy -o kernel1

I get this error

Traceback (most recent call last):
  File "/home/harpera/work/code/TENSOAP/bin/sagpr_get_kernel", line 109, in <module>
    main()
  File "/home/harpera/work/code/TENSOAP/bin/sagpr_get_kernel", line 103, in main
    [power,scalefac,power0,zt,use_hermiticity] = parsing.set_variable_values_kernel(args)
  File "/work/code/TENSOAP/soapfast/utils/parsing.py", line 339, in set_variable_values_kernel
    scale.append(np.load(scaling[i]))
  File "/work/code/miniconda3/envs/tensoap/lib/python3.9/site-packages/numpy/lib/npyio.py", line 417, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: 'PS1_natoms.npy'

I tried changing the input to:
sagpr_get_kernel -z 2 -ps PS1.npy -ps0 PS0.npy -s PS0_natoms.npy -o kernel1
which calculated the kernel, but I'm not sure if this is just a typo error or an error above in the tutorial.

Parallel PS script fails for too large nrun (or too few structures)

This error usually happens when I ask sagpr_parallel_get_PS to try to split a trajectory into too many parallel calculations, thereby ending up with an empty slice which throws a spanner in the works. But I have an automated workflow that sometimes spits out very short trajectories, so it would be nice if the parallel PS script could handle these cases gracefully (basically, if -nrun < len(traj), only run the first len(traj) calculations in parallel and don't try to run more).

For reference, a typical error backtrace is below:

...skipping...
IOError: [Errno 2] No such file or directory: 'cubic_tetra_transition/PS0v_seg015.npy'
Traceback (most recent call last):
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 276, in <module>
    main()
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 270, in main
    get_power_spectrum(lam,frames,nmax=nmax,lmax=lmax,rc=rcut,sg=sig,ncut=ncut,periodic=periodic,outfile=outfile,cw=cweight,subset=subset,initial=initial,sparsefile=sparsefile,sparse_options=sparse_options,cen=cen,spec=spec,atomic=atomic,all_radial=all_radial,useall=useall,xyz_slice=xyz_slice,get_imag=get_imag)
    natmax    = len(max(all_names, key=len))
ValueError: max() arg is an empty sequence
Traceback (most recent call last):
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 276, in <module>
    main()
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 270, in main
    get_power_spectrum(lam,frames,nmax=nmax,lmax=lmax,rc=rcut,sg=sig,ncut=ncut,periodic=periodic,outfile=outfile,cw=cweight,subset=subset,initial=initial,sparsefile=sparsefile,sparse_options=sparse_options,cen=cen,spec=spec,atomic=atomic,all_radial=all_radial,useall=useall,xyz_slice=xyz_slice,get_imag=get_imag)
    natmax    = len(max(all_names, key=len))
ValueError: max() arg is an empty sequence
Traceback (most recent call last):
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 276, in <module>
    main()
  File "/home/veit/SOAPFAST//bin/sagpr_get_PS", line 270, in main
    get_power_spectrum(lam,frames,nmax=nmax,lmax=lmax,rc=rcut,sg=sig,ncut=ncut,periodic=periodic,outfile=outfile,cw=cweight,subset=subset,initial=initial,sparsefile=sparsefile,sparse_options=sparse_options,cen=cen,spec=spec,atomic=atomic,all_radial=all_radial,useall=useall,xyz_slice=xyz_slice,get_imag=get_imag)
    natmax    = len(max(all_names, key=len))
ValueError: max() arg is an empty sequence

(this happens when using -nrun 4 on a trajectory of length 1)

Problem determining nnmax for slabs

Line 73 of get_power_spectrum.py determines the maximum atomic density (number of atoms / cell volume) in the series of frames in order to estimate a safe maximum number of possible nearest neighbours in periodic structures.

However, for slabs with a large vacuum region this fails, as the maximum atomic density is artificially lowered by the vacuum region, making it hard to define a "safe" upper bound for n. This leads to segmentation faults in initsoap.pyx, due to out-of-bounds access to arrays with an upper bound of nnmax on some axis (e.g. "length", "efact", "harmonic").

I'm afraid it's not obvious to me what the best solution to this is, given that the size of a vacuum region is largely arbitrary - possibly simply a 'slab' flag which can be set at runtime which sets nnmax = 100?

nat vs ncen

This may simply be me not understanding the code properly, but it appears to me that "nat" when "ncen" should be used in many places throughout "compute_power_spectrum" in PS_utils.py and the subroutines called from there.

For example, comparing lines 173 and 182-184: the array omegaconj is created using nat[i] as the first dimension, but the first index iterated over runs to ncen[i].

The simplest solution is calling compute_power_spectrum with nat=ncen, which does not produce any errors, I can see even when ncen is a subset of nat. However, this leads of course to very confusing code...

Finally, the output power spectrum has an entry full of zeros for every atom which is not a centre, potentially significantly increasing the size of the files produced. This does make it easier to map the power spectrum onto its corresponding atom though.

sagpr_get_PS: error: unrecognized arguments: -ele

When I was runnnig example 12. Application of LODE to the prediction of binding energies , I got this error. What should I do? I just pasete the code in example 12 .I have run example 1 correctly.

Nonlinear tensor kernels

When calculating nonlinear tensor kernels, if an L=0 power spectrum is not provided the code doesn't "fail gracefully" but instead crashes. e.g. in sagpr_get_kernel -z 2 -ps PS1.npy -s PS1_natoms.npy -o K1, with -ps0 PS0.npy not specified, this crashes rather than warning the user that no L=0 power spectrum has been given.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.