/qm_2019_sss_4

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

qm_project_sss

AppVeyor Build status codecov

The qm_project_sss package implements semi-empirical quantum mechanical (SCF+MP2) simulation parameterized to reproduce first-principles QM data using a minimal model. The package serves three main classes:

  • NobleGasModel (in Noble_Gas_Model module)
  • HartreeFock (in hartree_fock module)
  • MP2 (in mp2 module)

You can learn more about attributes and methods in three classes in the documentation. However, you can also keep reading below to get started.

Installation

git clone https://github.com/MolSSI-Education/qm_2019_sss_4.git
cd qm_2019_sss_4
pip install -e .

You can run tests to make sure the package is installed successfully

pytest -v

Getting Started

In just a few lines, we can compute the Hartree-Fock energy and the MP2 energy correction of a system of two Argon atoms.

from qm_project_sss import NobleGasModel, HartreeFock, MP2
import numpy as np

# Initilize a NobleGasModel object
Ar = NobleGasModel('ar')
atomic_coordinates = np.array([[0.0,0.0,0.0], [3.0,4.0,5.0]])


# Initilize a HartreeFock object
# 1. default 'slow' algorithm for fock matrix calculation
hf = HartreeFock(atomic_coordinates, Ar)

# Alternatively, 2. 'fast' algorithm (python) for fock matrix calculation
hf_fast = HartreeFock(atomic_coordinates, Ar, fock_mode = 'fast', use_cpp_module = False)

# Alternatively, 3. 'fast' algorithm (cpp) for fock matrix calculation
hf_fast_cpp = HartreeFock(atomic_coordinates, Ar, fock_mode = 'fast', use_cpp_module = True)


# Start SCF iterations
hf.scf_cycle()
hf_energy = hf.calculate_energy_ion() + hf.calculate_energy_scf()

# Compute MP2 correction to HF energy
mp2 = MP2(atomic_coordinates, Ar)
mp2_correction = mp2.mp2_energy

Copyright

Copyright (c) 2019, sss_2019_qm_4

Acknowledgements

Project based on the Computational Molecular Science Python Cookiecutter version 1.0.