Skip to content

Instantly share code, notes, and snippets.

View berquist's full-sized avatar

Eric Berquist berquist

View GitHub Profile
@berquist
berquist / random.cpp
Created August 19, 2012 22:55
C++ compilation error
#include "random.hpp"
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <ctime>
namespace cpl {
enum {
@berquist
berquist / gist:9062967
Created February 18, 2014 01:41
ChemAxon CNMR Prediction
[espeon@osmium]$ cat ~/Desktop/indole.inchi /home/espeon/opt/apps/ChemAxon/MarvinBeans/bin
InChI=1S/C8H7N/c1-2-4-8-7(3-1)5-6-9-8/h1-6,9H
[espeon@osmium]$ obabel -iinchi ~/Desktop/indole.inchi -omol -O ~/Desktop/indole.mol --gen3d
1 molecule converted
[espeon@osmium]$ cat ~/Desktop/indole.mol /home/espeon/opt/apps/ChemAxon/MarvinBeans/bin
OpenBabel02171420403D
16 17 0 0 0 0 0 0 0 0999 V2000
2.1639 -0.6827 -0.0733 C 0 0 0 0 0 0 0 0 0 0 0 0
#p hf/gen
gold external basis test (ADZP)
0 2
Au 0.000000 0.000000 0.000000
Au 0
S 8 1.00
14703222.86676416 0.0000848
$comment
Test of wB97X functional (long-range corrected hybrid functional)
Geometry optimization of N2, followed by freqency calculations
(using finite difference methods).
Ref: J.-D. Chai and M. Head-Gordon, J. Chem. Phys. 128, 084106 (2008).
$end
$molecule
0 1
N1
from cclib.parser import ccopen
from cclib.writer import ccwrite
job = ccopen('phenol.out')
data = job.parse()
# file is None by default, but can take either a filename as a string or a file handle object,
phenol_cjson_string = ccwrite(data, 'cjson', file=None)
ccwrite(data, 'cjson', file='phenol.cjson')
with open('phenol.cjson', 'w') as phenol_cjsonfile:
#include <algorithm>
#include <chrono>
#include <functional>
#include <future>
#include <iomanip>
#include <iostream>
#include <random>
#include "pcg_random.hpp" // Random number generator
@berquist
berquist / workflows_and_plans.md
Created April 29, 2015 02:12
EMSL BSEL examples

Database foundation

  • Download the EMSL BSE database. How is is stored remotely?
  • Save the contents locally. By default, it should use sqlite3 (I think it does already) but optionally try:
    • JSON
    • HDF5
  • The contents save locally must be in a sensible format and layout for calling from Python, so that formatting basis sets can be done on-the-fly by calling the "database". There shouldn't be any additional databases, like the ones currently present (one for each format).

Working with the database

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@berquist
berquist / dipole.py
Last active September 12, 2015 21:15
#!/usr/bin/env python2
from __future__ import print_function
import numpy as np
import numpy.linalg as npl
import pyquante2
from pyquante2.geo.molecule import molecule
from pyints.one import makeM
#!/usr/bin/env python3
from sympy import conjugate, integrate, pi, sin, symbols
from sympy.functions.special.spherical_harmonics import Ynm
theta, phi = symbols("theta, phi", real=True)
l_max = 1
for l in range(l_max + 1):