Skip to content

Instantly share code, notes, and snippets.

View ellisonbg's full-sized avatar

Brian E. Granger ellisonbg

View GitHub Profile
@thider
thider / crank3D
Created June 6, 2011 19:11
crank3D
"""Solve the 3D diffusion equation using CN and finite differences."""
from time import sleep
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from pylab import *
# The total number of nodes
nodx = 3
@shoke
shoke / colorgraph.py
Created May 16, 2011 07:20
Graphene
import networkx as nx
import matplotlib as mat
import matplotlib.pyplot as plt
import numpy as np
# Colors each node in the given graph based on the data
# Set provided
def color_graph(graph, d, cmap):
col_graph = nx.Graph()
"""Solve the 1D diffusion equation using CN and finite differences."""
from time import sleep
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
# The total number of nodes
nodx = 3
nody = 3
@thider
thider / gist:956525
Created May 5, 2011 04:10
cranck nicholson stuck on BCs
from numpy import *
from matplotlib.pyplot import *
from time import sleep
import numpy as np
import networkx as nx
dim = [3,2]
@ellisonbg
ellisonbg / quantum_demo.py
Created October 27, 2010 05:05
Simple Demos for sympy.physics.quantum and friends
from sympy.physics.quantum import *
from sympy.physics.cartesian import *
from sympy.physics.piab import *
from sympy.physics.spin import *
# Basic manipulations with operators, bras, kets and commutators
psi, phi = Ket('psi'), Ket('phi')
psi, phi
A, B, C = Operator('A'), Operator('B'), Operator('C')