Giter VIP home page Giter VIP logo

hartreefock's Introduction

HartreeFock

A program implementing the Hartree–Fock/self-consistent field method

Description is available here: http://compphys.go.ro/the-hartree-fock-program/

Some Hartree-Fock theory here: http://compphys.go.ro/the-hartree-fock-method/

Some things more general (Schrödinger equation, Born-Oppenheimer approximation, variational principle), here: http://compphys.go.ro/how-to-solve-a-quantum-many-body-problem/

PROGRAM IN ACTION

Program video

HOW TO COMPUTE

Here are some things about usage:

Using the classes should be easy. Here is how to grab some atoms from the 'basis':

	Systems::AtomWithShells H1, H2, O, N, C, He, Li, Ne, Ar;

	for (auto &atom : basis.atoms)
	{
		if (atom.Z == 1) H1 = H2 = atom;
		else if (atom.Z == 2) He = atom;
		else if (atom.Z == 3) Li = atom;
		else if (atom.Z == 8) O = atom;
		else if (atom.Z == 6) C = atom;
		else if (atom.Z == 7) N = atom;
		else if (atom.Z == 10) Ne = atom;
		else if (atom.Z == 18) Ar = atom;
	}

Here is how to set the H2O molecule with the coordinates from the 'Mathematica Journal' (referenced in the code):

	H1.position.X = H2.position.X = O.position.X = 0;

	H1.position.Y = 1.43233673;
	H1.position.Z = -0.96104039;
	H2.position.Y = -1.43233673;
	H2.position.Z = -0.96104039;

	O.position.Y = 0;
	O.position.Z = 0.24026010;

	Systems::Molecule H2O;

	H2O.atoms.push_back(H1);
	H2O.atoms.push_back(H2);
	H2O.atoms.push_back(O);

	H2O.Init();

And here is how you calculate:

HartreeFock::RestrictedHartreeFock HartreeFockAlgorithm;
HartreeFockAlgorithm.alpha = 0.5;
HartreeFockAlgorithm.initGuess = 0;

HartreeFockAlgorithm.Init(&H2O);
double result = HartreeFockAlgorithm.Calculate();

You can do computation for a single atom, too, for now by putting it into a dummy molecule with a single atom in it. For example for He:

  Systems::Molecule Heatom;
  Heatom.atoms.push_back(He);
  Heatom.Init();

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.