Skip to content

Commit

Permalink
Merge pull request #67 from tovrstra/fix_hartree_splines
Browse files Browse the repository at this point in the history
Fix asymptotics of Poisson solver for small r (final)
  • Loading branch information
Matthew Chan committed Jun 3, 2016
2 parents e10bc50 + 76acd46 commit 9918e33
Show file tree
Hide file tree
Showing 91 changed files with 523 additions and 203 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ python:

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc
- g++
- gfortran
- gcc-6
- g++-6
- gfortran-6
- libatlas-base-dev
- libhdf5-serial-dev
# libtool is needed by libint
Expand All @@ -24,6 +26,9 @@ env:
- PIP_WHEEL_DIR=$CACHED/wheels
- PIP_FIND_LINKS=file://$CACHED/wheels
- PIP_NO_CACHE_DIR=no
- CXX="g++-6"
- CC="gcc-6"
- FC="gfortran-6"

cache:
directories:
Expand Down
4 changes: 2 additions & 2 deletions dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[{
"name": "gcc",
"title": "GCC, G++ and GFortran",
"version_requirement": ">= 4.5",
"version_requirement": ">= 4.9",
"homepage": "http://gcc.gnu.org",
"comment": "In principle the Intel compilers or any other of your favorite compilers should work. The GNU compilers are used for development and testing.",
"comment": "In principle the Intel compilers or any other combination of C++11 and Fortran compiler should work. The GNU compilers are used for development and testing.",
"fedora_24_rpm": "gcc gcc-c++ gcc-gfortran redhat-rpm-config",
"fedora_22_rpm": "gcc gcc-c++ gcc-gfortran redhat-rpm-config",
"fedora_21_rpm": "gcc gcc-c++ gcc-gfortran",
Expand Down
13 changes: 9 additions & 4 deletions doc/tech_dev_checklist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -986,17 +986,22 @@ CPPCheck

See http://cppcheck.sourceforge.net/

CPPCheck is executed with all checks enabled and with the C++11 flag. The only exception
is ``missingIncludeSystem`` due to the large number of false positives. All other errors
must be fixed.
CPPCheck is executed with all checks enabled and with the C++11 flag. The following
exceptions are added due to false positives:

- ``missingIncludeSystem``
- ``unusedFunction``

All other errors must be fixed.


CPPLint
~~~~~~~

See https://github.com/google/styleguide/tree/gh-pages/cpplint

CPPLint is executed with the default settings. All errors must be fixed.
CPPLint is executed with the default settings, except that the maximum line length is set
to 100. All errors must be fixed.


Manual checks
Expand Down
3 changes: 2 additions & 1 deletion horton/correlatedwfn/test/test_1dm_ap1rog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import numpy as np
from nose.plugins.attrib import attr

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import

from horton.test.common import check_delta, numpy_seed


Expand Down
3 changes: 2 additions & 1 deletion horton/correlatedwfn/test/test_geminals.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import numpy as np
from nose.plugins.attrib import attr

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import

from horton.test.common import tmpdir


Expand Down
3 changes: 2 additions & 1 deletion horton/correlatedwfn/test/test_lagrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
from nose.tools import assert_raises
from nose.plugins.attrib import attr

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import

from horton.test.common import numpy_seed


Expand Down
3 changes: 2 additions & 1 deletion horton/espfit/test/test_cext.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import numpy as np
from nose.plugins.attrib import attr

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import

from horton.test.common import get_random_cell


Expand Down
3 changes: 2 additions & 1 deletion horton/espfit/test/test_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import numpy as np, h5py as h5
from nose.plugins.attrib import attr

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import

from horton.test.common import check_delta


Expand Down
3 changes: 2 additions & 1 deletion horton/espfit/test/test_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@


import numpy as np
from horton import *

from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def get_fake_system():
Expand Down
3 changes: 2 additions & 1 deletion horton/gbasis/test/test_boys.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

import numpy as np
from nose.tools import assert_raises
from horton import *

from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def test_boys_functions():
Expand Down
2 changes: 1 addition & 1 deletion horton/gbasis/test/test_cartpure.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from nose.tools import assert_raises
from nose.plugins.attrib import attr

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


tfs = {
Expand Down
3 changes: 2 additions & 1 deletion horton/gbasis/test/test_cholesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import numpy as np
from nose.tools import assert_raises

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def get_h2o_er(linalg_factory=DenseLinalgFactory):
fn = context.get_fn('test/water.xyz')
Expand Down
2 changes: 1 addition & 1 deletion horton/gbasis/test/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#--


from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def test_fac():
Expand Down
2 changes: 1 addition & 1 deletion horton/gbasis/test/test_fns.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from nose.plugins.attrib import attr
from nose.tools import assert_raises

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def test_exceptions():
Expand Down
3 changes: 2 additions & 1 deletion horton/gbasis/test/test_gbw.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import numpy as np
from nose.tools import assert_raises

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def get_h2o_er():
fn = context.get_fn('test/water.xyz')
Expand Down
3 changes: 2 additions & 1 deletion horton/gbasis/test/test_gobasis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
from nose.tools import assert_raises
from nose.plugins.attrib import attr

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import

from horton.test.common import compare_operators


Expand Down
2 changes: 1 addition & 1 deletion horton/gbasis/test/test_ints.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import numpy as np
from nose.tools import assert_raises

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def test_gpt_coeff():
Expand Down
2 changes: 1 addition & 1 deletion horton/gbasis/test/test_iobas.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import numpy as np

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def test_str_to_shell_types_cart():
Expand Down
2 changes: 1 addition & 1 deletion horton/gbasis/test/test_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import numpy as np
from nose.tools import assert_raises

from horton import *
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import


def test_iter_pow1_inc_l0():
Expand Down
33 changes: 31 additions & 2 deletions horton/grid/cext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ __all__ = [
'becke_helper_atom',
# cubic_spline
'Extrapolation', 'ZeroExtrapolation', 'CuspExtrapolation',
'PowerExtrapolation', 'tridiagsym_solve', 'CubicSpline',
'PowerExtrapolation', 'PotentialExtrapolation', 'tridiagsym_solve', 'CubicSpline',
'compute_cubic_spline_int_weights',
# evaluate
'index_wrap', 'eval_spline_cube', 'eval_spline_grid',
Expand Down Expand Up @@ -246,6 +246,11 @@ cdef class Extrapolation(object):
raise ValueError('PowerExtrapolation takes one argument.')
power = float(words[1])
return PowerExtrapolation(power)
elif words[0] == 'PotentialExtrapolation':
if len(words) != 2:
raise ValueError('PotentialExtrapolation takes one argument.')
l = int(words[1])
return PotentialExtrapolation(l)
else:
raise NotImplementedError

Expand All @@ -268,14 +273,38 @@ cdef class PowerExtrapolation(Extrapolation):
self._this = <cubic_spline.Extrapolation*>(new cubic_spline.PowerExtrapolation(power))

property power:
'''The power parameters'''
'''The power parameter'''
def __get__(self):
return (<cubic_spline.PowerExtrapolation*>self._this).get_power()

def to_string(self):
return 'PowerExtrapolation %s' % repr(self.power)


cdef class PotentialExtrapolation(Extrapolation):
"""Zero at the right side, power law at the left side"""
def __cinit__(self, long l):
self._this = <cubic_spline.Extrapolation*>(new cubic_spline.PotentialExtrapolation(l))

property l:
"""The angular momentum parameter"""
def __get__(self):
return (<cubic_spline.PotentialExtrapolation*>self._this).get_l()

property amp_left:
"""The amplitude of the polynomial on the left side"""
def __get__(self):
return (<cubic_spline.PotentialExtrapolation*>self._this).get_amp_left()

property amp_right:
"""The amplitude of the polynomial on the right side"""
def __get__(self):
return (<cubic_spline.PotentialExtrapolation*>self._this).get_amp_right()

def to_string(self):
return 'PotentialExtrapolation %s' % repr(self.l)


cdef class CubicSpline(object):
'''A cubic spline object
Expand Down
Loading

0 comments on commit 9918e33

Please sign in to comment.