Home > manopt > manifolds > rotations > randskewh.m

# randskewh

## PURPOSE Generates random skew Hermitian matrices with normal entries.

## SYNOPSIS function S = randskewh(n, N)

## DESCRIPTION ``` Generates random skew Hermitian matrices with normal entries.

function S = randskewh(n)
function S = randskewh(n, N)

S is an n-by-n-by-N array where each slice S(:, :, i) for i = 1..N is a
random skew-Hermitian matrix formed by

S = (randskew(n, N) + 1i*randsym(n, N))/sqrt(2);

By default, N = 1.

## CROSS-REFERENCE INFORMATION This function calls:
• randskew Generates random skew symmetric matrices with normal entries.
• randsym Generates random symmetric matrices with normal entries.
This function is called by:
• unitaryfactory Returns a manifold structure to optimize over unitary matrices.

## SOURCE CODE ```0001 function S = randskewh(n, N)
0002 % Generates random skew Hermitian matrices with normal entries.
0003 %
0004 % function S = randskewh(n)
0005 % function S = randskewh(n, N)
0006 %
0007 % S is an n-by-n-by-N array where each slice S(:, :, i) for i = 1..N is a
0008 % random skew-Hermitian matrix formed by
0009 %
0010 %   S = (randskew(n, N) + 1i*randsym(n, N))/sqrt(2);
0011 %
0012 % By default, N = 1.
0013 %
0015
0016 % This file is part of Manopt: www.manopt.org.
0017 % Original author: Nicolas Boumal, June 18, 2019.
0018 % Contributors:
0019 % Change log:
0020
0021     if nargin < 2
0022         N = 1;
0023     end
0024
0025     S = (randskew(n, N) + 1i*randsym(n, N))/sqrt(2);
0026
0027 end```

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005