##// END OF EJS Templates
new completer for qtconsole....
new completer for qtconsole. add a completer to the qtconsole that is navigable by arraow keys and tab. One need to call it twice to get it on focus and be able to select completion with Return. looks like zsh completer, not the gui drop down list of --gui-completer. This also try to split the completion logic from console_widget, and try to keep the old completer qui around. The plain completer that never takes focus back, and the QlistWidget completer. to switch between the 3, the --gui-completion flag as been changed to take an argument (plain, droplist, ncurses).

File last commit:

r4910:0dc49390
r7389:1422d277
Show More
rmtkernel.py
42 lines | 1.2 KiB | text/x-python | PythonLexer
#-------------------------------------------------------------------------------
# Core routines for computing properties of symmetric random matrices.
#-------------------------------------------------------------------------------
import numpy as np
ra = np.random
la = np.linalg
def GOE(N):
"""Creates an NxN element of the Gaussian Orthogonal Ensemble"""
m = ra.standard_normal((N,N))
m += m.T
return m/2
def center_eigenvalue_diff(mat):
"""Compute the eigvals of mat and then find the center eigval difference."""
N = len(mat)
evals = np.sort(la.eigvals(mat))
diff = np.abs(evals[N/2] - evals[N/2-1])
return diff
def ensemble_diffs(num, N):
"""Return num eigenvalue diffs for the NxN GOE ensemble."""
diffs = np.empty(num)
for i in xrange(num):
mat = GOE(N)
diffs[i] = center_eigenvalue_diff(mat)
return diffs
def normalize_diffs(diffs):
"""Normalize an array of eigenvalue diffs."""
return diffs/diffs.mean()
def normalized_ensemble_diffs(num, N):
"""Return num *normalized* eigenvalue diffs for the NxN GOE ensemble."""
diffs = ensemble_diffs(num, N)
return normalize_diffs(diffs)