Skip to content

Commit

Permalink
Release 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
reiher-research-group committed Jun 23, 2022
1 parent 387e56e commit cf249d7
Show file tree
Hide file tree
Showing 19 changed files with 99 additions and 46 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

Release 3.0.1
-------------

- Various bugfixes and improvements

Release 3.0.0
-------------

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.9)
# tree must then provide a properly namespaced target with the same name as
# your project.
project(Sparrow
VERSION 3.0.0
VERSION 3.0.1
DESCRIPTION "Library for fast and agile quantum chemical calculations with semiempirical methods."
)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ from members of the Reiher research group.
Further Contributors
--------------------

So far, no one else has contributed to this repository.
- Sebastian Ehlert (`@awvwgk <https://github.com/awvwgk>`_), University of Bonn (various bug reports)
13 changes: 9 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import sys
from dev.conan.base import ScineConan


class ScineSparrowConan(ScineConan):
name = "scine_sparrow"
version = "3.0.0"
version = "3.0.1"
url = "https://github.com/qcscine/sparrow"
description = """Sparrow is a code for fast semiemprical quantum chemical calculations.
It provides the methods such as MNDO, AM1, RM1, PM3, PM6, DFTB0, DFTB2, and DFTB3.
Expand All @@ -12,20 +13,24 @@ class ScineSparrowConan(ScineConan):
"python": [True, False],
"tests": [True, False],
"coverage": [True, False],
"microarch": ["detect", "none"]
"microarch": ["detect", "none"],
"python_version": "ANY"
}
python_version_string = str(sys.version_info.major) + \
"." + str(sys.version_info.minor)
default_options = {
"python": False,
"tests": False,
"coverage": False,
"microarch": "none"
"microarch": "none",
"python_version": python_version_string
}
exports = "dev/conan/*.py"
exports_sources = ["dev/cmake/*", "src/*", "CMakeLists.txt",
"README.rst", "LICENSE.txt", "dev/conan/hook.cmake",
"dev/conan/glue/*"]
build_requires = "cereal/1.3.0"
requires = "scine_utilities/[~=4.0.0]"
requires = "scine_utilities/[=5.0.0]"
cmake_name = "Sparrow"

def package_info(self):
Expand Down
12 changes: 6 additions & 6 deletions manual/sparrow_manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
%\savebox{\scineimage}{\includegraphics[height=5\baselineskip]{scine_darkblue.png}}


\title[SCINE Sparrow manual]{User Manual \vskip 0.5em {\setlength{\parindent}{0pt} \Huge SCINE Sparrow 3.0.0}}
\title[SCINE Sparrow manual]{User Manual \vskip 0.5em {\setlength{\parindent}{0pt} \Huge SCINE Sparrow 3.0.1}}
\author[The SCINE Sparrow Developers]{The SCINE Sparrow Developers: \newline \noindent Francesco Bosia, Tamara Husch, Charlotte H.~M\"uller, Severin Polonius, Jan-Grimo Sobez, Miguel Steiner, Jan P.~Unsleber, Alain C.~Vaucher, Thomas Weymuth, and Markus Reiher}
\publisher{ETH Z\"urich}

Expand Down Expand Up @@ -235,7 +235,7 @@ \chapter{Introduction}
\textsc{Interactive}, SCINE \textsc{ReaDuct}, and SCINE \textsc{Chemoton}. However, as with all SCINE modules it is also
a stand-alone program which can be applied on its own or easily interfaced to other programs.

SCINE \textsc{Sparrow} is a command-line tool that implements many popular semiempirical models. SCINE \textsc{Sparrow} 3.0.0
SCINE \textsc{Sparrow} is a command-line tool that implements many popular semiempirical models. SCINE \textsc{Sparrow} 3.0.1
provides the \texttt{MNDO}, \texttt{AM1}, \texttt{RM1}, \texttt{PM3}, \texttt{PM6}, non-SCC DFTB (\texttt{DFTB0}), \texttt{DFTB2}, and \texttt{DFTB3} methods
(open- and closed-shell formalisms are implemented).
The application of semiempirical models usually allows for rapid calculation of electronic energies and energy gradients
Expand Down Expand Up @@ -266,7 +266,7 @@ \section{System Requirements}

\textsc{Sparrow} is distributed as an open source code. In order to compile \textsc{Sparrow} from this source code, you need
\begin{itemize}
\item A C++ compiler supporting the C++14 standard,
\item A C++ compiler supporting the C++17 standard,
\item cmake (at least version 3.9),
\item the Boost library (at least version 1.65.0), and
\item the Eigen3 library (at least version 3.3.2).
Expand Down Expand Up @@ -356,7 +356,7 @@ \section{Command Line Arguments}
modes and the vibrational frequencies. This option has no effect if the Hessian is not calculated (see above).
\item \texttt{-{}-bond\_orders}, \texttt{-B}: If given, the bond order matrix will be calculated.
\item \texttt{-{}-method}, \texttt{-M}: With this option, the desired calculation method can be set. Options in
\textsc{Sparrow} 3.0.0 are \texttt{MNDO}, \texttt{AM1}, \texttt{RM1}, \texttt{PM3}, \texttt{PM6}, \texttt{DFTB0}, \texttt{DFTB2}, and
\textsc{Sparrow} 3.0.1 are \texttt{MNDO}, \texttt{AM1}, \texttt{RM1}, \texttt{PM3}, \texttt{PM6}, \texttt{DFTB0}, \texttt{DFTB2}, and
\texttt{DFTB3}. By default, \texttt{PM6} is selected.
\item \texttt{-{}-output\_to\_file}, \texttt{-o}: If this option is given, the output will not only be printed to the screen,
but also to files. By default, the energy is stored in a file named ``energy.dat'', the nuclear gradients in a file named
Expand Down Expand Up @@ -705,8 +705,8 @@ \chapter{References}
\vspace{1.0cm}

\begin{itemize}
\item Primary reference for Sparrow 3.0.0:
F.~Bosia, T.~Husch, C.~H.~M\"uller, S.~Polonius, J.-G.~Sobez, M.~Steiner, J.~P.~Unsleber, A.~C.~Vaucher, T.~Weymuth, M.~Reiher, \href{https://doi.org/10.5281/zenodo.3244105}{"qcscine/sparrow: Release 3.0.0 (Version 3.0.0)"}, Zenodo, 2021.
\item Primary reference for Sparrow 3.0.1:
F.~Bosia, T.~Husch, C.~H.~M\"uller, S.~Polonius, J.-G.~Sobez, M.~Steiner, J.~P.~Unsleber, A.~C.~Vaucher, T.~Weymuth, M.~Reiher, \href{https://doi.org/10.5281/zenodo.3244105}{"qcscine/sparrow: Release 3.0.1 (Version 3.0.1)"}, Zenodo, 2022.
\item Presentation of the formalism of MNDO-type and OMx models: \newline
T.~Husch, A.~C.~Vaucher, M.~Reiher \href{https://doi.org/10.1002/qua.25799}{"Semiempirical Molecular Orbital Models Based on the Neglect of Diatomic Differential Overlap Approximation"}, \textit{Int.~J.~Quantum Chem.}, \textbf{2018}, \textit{118}, e25799.
\item Presentation of DFTB approaches: \newline
Expand Down
3 changes: 2 additions & 1 deletion src/Sparrow/App/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ int main(int argc, char* argv[]) {
CalculationHandler calculationHandler(commandLineParser);
calculationHandler.calculate(std::cout);
}
catch (MethodNotAvailableException& e) {
catch (const std::exception& e) {
std::cout << e.what() << std::endl;
return 1;
}

return 0;
Expand Down
26 changes: 0 additions & 26 deletions src/Sparrow/App/parser.cpp

This file was deleted.

12 changes: 8 additions & 4 deletions src/Sparrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ scine_install_component_cmake_files(
EXPORT_NAME sparrowTargets
)

if(SCINE_BUILD_TESTS OR SCINE_BUILD_PYTHON_BINDINGS)
find_package(PythonInterp REQUIRED)
endif()

# Tests
if(SCINE_BUILD_TESTS)
include(ImportGTest)
Expand All @@ -87,7 +91,6 @@ if(SCINE_BUILD_TESTS)
${CMAKE_DL_LIBS}
)
add_test(NAME Sparrow COMMAND Sparrow_tests)
find_package(PythonInterp REQUIRED)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(TEST_SELECTION "::TestSparrowFast")
else()
Expand All @@ -103,7 +106,7 @@ if(SCINE_BUILD_TESTS)
set_tests_properties(Sparrow_App PROPERTIES
ENVIRONMENT SCINE_MODULE_PATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{SCINE_MODULE_PATH}
ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{PYTHONPATH}
ENVIRONMENT PATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{PATH}
ENVIRONMENT PATH=${CMAKE_CURRENT_BINARY_DIR}:${PROJECT_BINARY_DIR}:$ENV{PATH}
)
endif()

Expand All @@ -120,6 +123,9 @@ add_executable(SparrowApp ${SPARROW_APP_FILES})
add_executable(Scine::SparrowApp ALIAS SparrowApp)

set_target_properties(SparrowApp PROPERTIES OUTPUT_NAME sparrow)
if(APPLE)
set_target_properties(SparrowApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
endif()

target_link_libraries(SparrowApp PRIVATE
Boost::program_options
Expand Down Expand Up @@ -240,8 +246,6 @@ if(SCINE_BUILD_PYTHON_BINDINGS)
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Python/sphinx
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doc-py
LINK UtilsPythonDoc
DOCTEST
DOCTEST_REQUIRES scine_utilities
)
endif()

Expand Down
3 changes: 2 additions & 1 deletion src/Sparrow/Python/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ User Manual

The user manuals are available for download as PDF files:

- :download:`Download Latest User Manual PDF <https://scine.ethz.ch/static/download/manuals/v3.0.0/sparrow_manual.pdf>`
- :download:`Download Latest User Manual PDF <https://scine.ethz.ch/static/download/manuals/v3.0.1/sparrow_manual.pdf>`
- :download:`Download User Manual PDF v3.0.1 <https://scine.ethz.ch/static/download/manuals/v3.0.1/sparrow_manual.pdf>`
- :download:`Download User Manual PDF v3.0.0 <https://scine.ethz.ch/static/download/manuals/v3.0.0/sparrow_manual.pdf>`
- :download:`Download User Manual PDF v2.0.1 <https://scine.ethz.ch/static/download/manuals/v2.0.1/sparrow_manual.pdf>`
- :download:`Download User Manual PDF v2.0.0 <https://scine.ethz.ch/static/download/manuals/v2.0.0/sparrow_manual.pdf>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class DFTB0Settings : public Scine::Utils::Settings {
Utils::UniversalSettings::SettingPopulator::populateLcaoSettings(_fields);
Utils::UniversalSettings::SettingPopulator::populateSemiEmpiricalSettings(_fields, "3ob-3-1");

// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("dftb0");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class DFTB2Settings : public Scine::Utils::Settings {
Utils::UniversalSettings::SettingPopulator::populateScfSettings(_fields);
Utils::UniversalSettings::SettingPopulator::populateSemiEmpiricalSettings(_fields, "mio-1-1");

// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("dftb2");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class DFTB3Settings : public Scine::Utils::Settings {
Utils::UniversalSettings::SettingPopulator::populateScfSettings(_fields);
Utils::UniversalSettings::SettingPopulator::populateSemiEmpiricalSettings(_fields, "3ob-3-1");

// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("dftb3");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ namespace Sparrow {
* Right now the data needed to perform TD-SCC-DFTB are present. In order to implement
* TD-DFTB3 other data might be needed.
*/
struct TDDFTBData : public LinearResponseData {
class TDDFTBData : public LinearResponseData {
public:
/// @brief Gamma parameters size: nAtoms x nAtoms
std::shared_ptr<Eigen::MatrixXd> gammaMatrix;
/// @brief Magnetic Hubbard parameters (spin constants) size: nAtoms
Expand Down
17 changes: 17 additions & 0 deletions src/Sparrow/Sparrow/Implementations/GenericMethodWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const Utils::Results& GenericMethodWrapper::calculate(std::string description) {
if (dipoleMatrixCalculator_)
dipoleMatrixCalculator_->invalidate();
applySettings();
// Check method and basis set fields
checkBasicSettings();
calculateImpl(requiredDerivative);

// If you want the Hessian, but cannot calculate it analytically,
Expand Down Expand Up @@ -152,6 +154,21 @@ Utils::Derivative GenericMethodWrapper::highestDerivativeRequired() const {
return requiredDerivative;
}

void GenericMethodWrapper::checkBasicSettings() {
Utils::Settings settingsCopy(*(this->settings_));
settingsCopy.resetToDefaults();
auto methodDefault = settingsCopy.getString(Utils::SettingsNames::method);
auto currentMethod = this->settings_->getString(Utils::SettingsNames::method);

// Check selected method
std::transform(currentMethod.begin(), currentMethod.end(), currentMethod.begin(),
[](unsigned char c) { return std::tolower(c); });
if (currentMethod != methodDefault && currentMethod != "any") {
throw std::runtime_error("This calculator does not provide the requested method.");
}
settings_->modifyString(Utils::SettingsNames::method, methodDefault);
}

void GenericMethodWrapper::assembleResults(const std::string& description) {
results_.set<Utils::Property::Description>(description);
results_.set<Utils::Property::Energy>(getLcaoMethod().getEnergy());
Expand Down
2 changes: 2 additions & 0 deletions src/Sparrow/Sparrow/Implementations/GenericMethodWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class GenericMethodWrapper : public Utils::CloneInterface<Utils::Abstract<Generi
virtual bool successfulCalculation() const = 0;
virtual bool canCalculateAnalyticalHessian() const;

void checkBasicSettings();

/**
* @brief Function to apply the settings to the actual calculation method.
* This method is needed in every calculator as the modification of the
Expand Down
18 changes: 18 additions & 0 deletions src/Sparrow/Sparrow/Implementations/Nddo/Am1/Wrapper/AM1Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,38 @@ class AM1Settings : public AM1TypeSettings {
public:
static constexpr const char* settingsDescription = "AM1Settings";
AM1Settings() : AM1TypeSettings(settingsDescription) {
// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("am1");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
}
};

class RM1Settings : public AM1TypeSettings {
public:
static constexpr const char* settingsDescription = "RM1Settings";
RM1Settings() : AM1TypeSettings(settingsDescription) {
// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("rm1");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
}
};

class PM3Settings : public AM1TypeSettings {
public:
static constexpr const char* settingsDescription = "PM3Settings";
PM3Settings() : AM1TypeSettings(settingsDescription) {
// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("pm3");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class MNDOSettings : public Scine::Utils::Settings {
useNDDODipoleApprox.setDefaultValue(true);
_fields.push_back(Utils::SettingsNames::NDDODipoleApproximation, std::move(useNDDODipoleApprox));

// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("mndo");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class PM6Settings : public Scine::Utils::Settings {
useNDDODipoleApprox.setDefaultValue(true);
_fields.push_back(Utils::SettingsNames::NDDODipoleApproximation, std::move(useNDDODipoleApprox));

// Method
Utils::UniversalSettings::StringDescriptor method("The method to be used.");
method.setDefaultValue("pm6");
_fields.push_back(Utils::SettingsNames::method, method);

resetToDefaults();
};
};
Expand Down

0 comments on commit cf249d7

Please sign in to comment.