<jupyter_start><jupyter_text>Random matrix and its process___<jupyter_code>import numpy as np
from scipy import linalg
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()


%matplotlib inline
%load_ext autoreload
%autoreload 1
%config InlineBackend.figure_formats = {'png', 'retina'}<jupyter_output><empty_output><jupyter_text>Dyson model___Hermitan matrix:$$ \begin{pmatrix}B_{11}(t) & \cdots & B_{1i}(t) & \cdots & B_{1n}(t)\\\vdots & \ddots &        &        & \vdots \\\overline{B_{1i}(t)} &        & B_{ii}(t) &        & B_{in}(t) \\\vdots &        &        & \ddots & \vdots \\\overline{B_{1n}(t)} & \cdots & \overline{B_{in}(t)} & \cdots & B_{nn}(t)\end{pmatrix},$$where $B_{ii}(t)$ is a Brownian motion on $\mathbb{R}$ and $B_{ij}\,(i \neq j)$ is a Brownian motion on $\mathbb{C}$.Eigen Value process rarely conflicts.<jupyter_code>%%time

N = 10
step = 10000
time_delta = 0.01

matrix = np.zeros((N, N))
for i in range(N):
    matrix[i, i] = (i - N//2) * 1

eigs = [linalg.eigh(matrix, eigvals_only=True)]

for _ in range(step):
    for i in range(N):
        for j in range(N):
            if i == j:
                matrix[i, j] += np.random.randn(1) * np.sqrt(time_delta)
            elif i < j:
                matrix[i, j] += (np.random.randn(1) + np.random.randn(1) * j) / np.sqrt(2) * np.sqrt(time_delta)
            else:
                matrix[i, j] = matrix[j, i].conj()
    eigs.append(linalg.eigh(matrix, eigvals_only=True))

plt.figure(figsize=(15, 8))
t = np.arange(0, (step+1)*time_delta, time_delta)
plt.plot(t, eigs, color='blue')
plt.title('Eigen value process')
plt.show()<jupyter_output><empty_output><jupyter_text>Compare: Brownian motion  Many paths conflict many times.<jupyter_code>N = 10
step = 10000
time_delta = 0.01

r = np.random.randn(step+1, N) * np.sqrt(time_delta)
r[0] = [(i - N//2) * 1 for i in range(N)]

b = np.cumsum(r, axis=0)

plt.figure(figsize=(15, 8))
t = np.arange(0, (step+1)*time_delta, time_delta)
plt.plot(t, b, color='b')
plt.title('Brownian motions')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18040737148399613, 'fraction_numerical': 0.023278370514064017, 'mean_word_length': 3.504366812227074, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '359580', 'license': 'MIT', 'n_tokens_mistral': 866, 'n_tokens_neox': 815, 'n_words': 180, 'path': 'processes/random-matrix.ipynb', 'repo_name': 'mo-mo-666/stochastic-processes', 'size': '2062'}