message: added test for multispecies in derivatives
diff: @@ -364,7 +364,7 @@ class SoapDerivativeComparisonTests(unittest.TestCase):
  derivatives_cpp, d_num = soap.derivatives(H2, positions=positions, method="numerical")
  derivatives_anal, d_anal = soap.derivatives(H2, positions=positions, method="analytical")
  - _print_diff(derivatives_cpp, derivatives_anal)
  + #_print_diff(derivatives_cpp, derivatives_anal)
  self.assertTrue(np.allclose(derivatives_cpp, derivatives_anal))
  def test_analytical_vs_numerical_L9(self):
  @@ -401,9 +401,28 @@ class SoapDerivativeComparisonTests(unittest.TestCase):
  derivatives_cpp, d_num = soap.derivatives(H2, positions=positions, method="numerical")
  derivatives_anal, d_anal = soap.derivatives(H2, positions=positions, method="analytical")
  print("compare descriptors")
  - _print_diff(d_num, d_anal)
  + #_print_diff(d_num, d_anal)
  self.assertTrue(np.allclose(d_num, d_anal))
  + def test_analytical_vs_numerical_multispecies(self):
  + """Tests the analytical soap derivatives implementation against the numerical cpp implementation
  + """
  + soap = SOAP(
  + species=[1, 8],
  + rcut=3,
  + nmax=2,
  + lmax=0,
  + sparse=False,
  + )
  + positions = [[0.0, 0.0, 0.0],]
  + # Calculate with central finite difference implemented in C++
  + derivatives_cpp, d_num = soap.derivatives(H2O, positions=positions, method="numerical")
  + derivatives_anal, d_anal = soap.derivatives(H2O, positions=positions, method="analytical")
  + diff = derivatives_cpp - derivatives_anal
  +
  + _print_diff(derivatives_cpp, derivatives_anal)
  + self.assertTrue(np.allclose(derivatives_cpp, derivatives_anal))
  +
  @@ -415,6 +434,6 @@ if __name__ == '__main__':
  #SoapDerivativeComparisonTests().test_analytical_vs_numerical_L9()
  #SoapDerivativeComparisonTests().test_analytical_crossover()
  #SoapDerivativeComparisonTests().test_analytical_vs_numerical()
  - SoapDerivativeComparisonTests().test_descriptor_output()
  + #SoapDerivativeComparisonTests().test_descriptor_output()
  alltests = unittest.TestSuite(suites)
  result = unittest.TextTestRunner(verbosity=0).run(alltests)
  