Skip to content

Instantly share code, notes, and snippets.

#include <libplugin/plugin.h>
#include "psi4-dec.h"
#include <libparallel/parallel.h>
#include <liboptions/liboptions.h>
#include <libmints/mints.h>
#include <libpsio/psio.h>
#include <hdf5.h>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
@wpoely86
wpoely86 / input.dat
Last active August 29, 2015 14:05
mointegrals for PSI4
molecule BH {
B 0 0 0.0
H 0 0 2.328898308325
# symmetry c1
units au
}
set {
# exact ERI
SCF_TYPE PK
@wpoely86
wpoely86 / Clebsch-Gordan.py
Created July 18, 2014 09:23
Generates Clebsch-Gordan coefficients and outputs it to html
#!/usr/bin/env python3
"""
Generates all Clebsh Gordan coefficients starting from a given j1 and j2 and
outputs a html file. How to use:
./Clebsch-Gordan.py 0.5 0.5 > output.html
Ward Poelmans <wpoely86@gmail.com> (2014)
"""
import sys
import numpy as np
@wpoely86
wpoely86 / diagonalize.cpp
Created June 20, 2014 08:50
use dsyevd to diagonalize
/**
* Helper for exact diagonalization: diagonalize the matrix given in mat with dimension dim, stores
* the eigenvalues in eigs and optionally the eigenvectors in mat
* @param dim the dimension of the matrix
* @param mat the actual matrix (size: dim*dim)
* @param eigs array of size dim to store eigenvalues
* @param calc_eigenvectors whether or not the calculate the eigenvectors
*/
void Diagonalize(int dim, double *mat, double *eigs, bool calc_eigenvectors)
{
@wpoely86
wpoely86 / arpack.cpp
Created June 18, 2014 10:22
arpack usage example
double arpackDiagonalize()
{
// dimension of the matrix
int n = dim;
// number of eigenvalues to calculate
int nev = 1;
// reverse communication parameter, must be zero on first iteration
int ido = 0;
@wpoely86
wpoely86 / libspatialite patch
Created April 2, 2014 09:51
Fix small bug in configure.ac of libspatialite. You need to run `autoreconf` after applying this patch.
diff -urN libspatialite-4.1.1.orig/configure.ac libspatialite-4.1.1/configure.ac
--- libspatialite-4.1.1.orig/configure.ac 2013-06-29 08:53:15.000000000 +0200
+++ libspatialite-4.1.1/configure.ac 2014-04-02 11:37:56.484423000 +0200
@@ -263,7 +263,7 @@
LIBS="$GEOS_LDFLAGS"
AC_SEARCH_LIBS(GEOSTopologyPreserveSimplify,geos_c,,AC_MSG_ERROR([could not find libgeos_c - you may need to specify the directory of a geos-config file using --with-geosconfig]))
LIBS="$LIBS_SAVE"
- LIBS=$LIBS$GEOS_LDFLAGS' -lgeos_c'
+ LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c"
@wpoely86
wpoely86 / analyse-x86
Created March 13, 2014 08:58
Counts vectors instructions in binary
#!/usr/bin/perl -w
use strict;
### Identify instruction sets used in a binary file. ###
# Tavis Ormandy <taviso@gentoo.org> 2003
# Improvments by Will Woods <wwoods@gentoo.org>
# Perl convertion by Georgi Georgiev <chutz@gg3.net>
# Updated by Ryan Hill <dirtyepic.sk@gmail.com>
# Updated by Ward Poelmans <wpoely86@gmail.com> 2009