Learn R Programming

BosonSampling (version 0.1.5)

randomUnitary: Random unitary

Description

Returns a square complex matrix sampled from the Haar random unitary distribution.

Usage

randomUnitary(size)

Value

A square complex matrix.

Arguments

size

dimension of matrix

Examples

Run this code
m <- 25 # size of matrix (m x m)
set.seed(7)
U <- randomUnitary(m)
#  
n <- 5 # First n columns
A <- U[,1:n]

Run the code above in your browser using DataLab