physicskit.rmt#

physicskit.rmt – a random matrix theory library organized around Dyson’s threefold way, validated against exact theory and seminal-paper results.

class physicskit.rmt.Spectrum(eigenvalues, n, beta, ensemble, scale=1.0, eigenvectors=None)[source]#

Bases: object

Eigenvalues drawn from a MatrixEnsemble.

Parameters:
beta: float | None#

Dyson index of the ensemble that produced this spectrum, or None for ensembles outside Dyson’s threefold way (e.g. BuresHallEnsemble, GraphLaplacianEnsemble).

Type:

float or None

eigenvalues: ndarray#

Raw (unnormalized) eigenvalues, one row per independent draw.

Type:

numpy.ndarray, shape (n_samples, n)

eigenvectors: ndarray | None = None#

Eigenvectors as columns, matching eigenvalues column-for-column (eigenvectors[s][:, i] is the eigenvector for eigenvalues[s, i]). Only present when the ensemble was sampled with sample(return_eigenvectors=True); None otherwise. m is usually n but can differ for ensembles whose eigenvalue count isn’t exactly n (see n_samples elsewhere in this package for the analogous eigenvalue-count caveat).

Type:

numpy.ndarray, shape (n_samples, m, n), or None

ensemble: str#

Name of the ensemble class, for provenance/repr purposes.

Type:

str

property flat: ndarray#

All eigenvalues from all samples, raveled into one 1-D array.

Returns:

numpy.ndarray – 1-D array of all eigenvalues, shape (n_samples * eigenvalues.shape[1],).

n: int#

Matrix dimension used to generate this spectrum.

Type:

int

property n_samples: int#

Number of independent realizations drawn.

Returns:

int

property rescaled: ndarray#

Eigenvalues divided by scale.

This is the array to compare against a theoretical limiting distribution.

Returns:

numpy.ndarray – Same shape as eigenvalues.

scale: float = 1.0#

Factor by which eigenvalues should be divided to reach the ensemble’s standard asymptotic normalization (e.g. semicircle support [-2, 2] for the Gaussian ensembles). Set by the ensemble via natural_scale().

Type:

float