Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Module « scipy.stats »

Fonction unitary_group - module scipy.stats

Signature de la fonction unitary_group

def unitary_group(dim=None, seed=None) 

Description

help(scipy.stats.unitary_group)

A matrix-valued U(N) random variable.

Return a random unitary matrix.

The `dim` keyword specifies the dimension N.

Methods
-------
rvs(dim=None, size=1, random_state=None)
    Draw random samples from U(N).

Parameters
----------
dim : scalar
    Dimension of matrices, must be greater than 1.
seed : {None, int, np.random.RandomState, np.random.Generator}, optional
    Used for drawing random variates.
    If `seed` is `None`, the `~np.random.RandomState` singleton is used.
    If `seed` is an int, a new ``RandomState`` instance is used, seeded
    with seed.
    If `seed` is already a ``RandomState`` or ``Generator`` instance,
    then that object is used.
    Default is `None`.

Notes
-----
This class is similar to `ortho_group`.

References
----------
.. [1] F. Mezzadri, "How to generate random matrices from the classical
       compact groups", :arXiv:`math-ph/0609050v2`.

Examples
--------
>>> import numpy as np
>>> from scipy.stats import unitary_group
>>> x = unitary_group.rvs(3)

>>> np.dot(x, x.conj().T)
array([[  1.00000000e+00,   1.13231364e-17,  -2.86852790e-16],
       [  1.13231364e-17,   1.00000000e+00,  -1.46845020e-16],
       [ -2.86852790e-16,  -1.46845020e-16,   1.00000000e+00]])  # may vary

This generates one random matrix from U(3). The dot product confirms that
it is unitary up to machine precision.

Alternatively, the object may be called (as a function) to fix the `dim`
parameter, return a "frozen" unitary_group random variable:

>>> rv = unitary_group(5)

See Also
--------
ortho_group



Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé