linalg._interpolative_backend

Direct wrappers for Fortran id_dist backend.

Module Contents

Functions

id_srand(n) Generate standard uniform pseudorandom numbers via a very efficient lagged
id_srandi(t) Initialize seed values for id_srand() (any appropriately random
id_srando() Reset seed values to their original values.
idd_frm(n,w,x) Transform real vector via a composition of Rokhlin’s random transform,
idd_sfrm(l,n,w,x) Transform real vector via a composition of Rokhlin’s random transform,
idd_frmi(m) Initialize data for idd_frm().
idd_sfrmi(l,m) Initialize data for idd_sfrm().
iddp_id(eps,A) Compute ID of a real matrix to a specified relative precision.
iddr_id(A,k) Compute ID of a real matrix to a specified rank.
idd_reconid(B,idx,proj) Reconstruct matrix from real ID.
idd_reconint(idx,proj) Reconstruct interpolation matrix from real ID.
idd_copycols(A,k,idx) Reconstruct skeleton matrix from real ID.
idd_id2svd(B,idx,proj) Convert real ID to SVD.
idd_snorm(m,n,matvect,matvec,its=20) Estimate spectral norm of a real matrix by the randomized power method.
idd_diffsnorm(m,n,matvect,matvect2,matvec,matvec2,its=20) Estimate spectral norm of the difference of two real matrices by the
iddr_svd(A,k) Compute SVD of a real matrix to a specified rank.
iddp_svd(eps,A) Compute SVD of a real matrix to a specified relative precision.
iddp_aid(eps,A) Compute ID of a real matrix to a specified relative precision using random
idd_estrank(eps,A) Estimate rank of a real matrix to a specified relative precision using
iddp_asvd(eps,A) Compute SVD of a real matrix to a specified relative precision using random
iddp_rid(eps,m,n,matvect) Compute ID of a real matrix to a specified relative precision using random
idd_findrank(eps,m,n,matvect) Estimate rank of a real matrix to a specified relative precision using
iddp_rsvd(eps,m,n,matvect,matvec) Compute SVD of a real matrix to a specified relative precision using random
iddr_aid(A,k) Compute ID of a real matrix to a specified rank using random sampling.
iddr_aidi(m,n,k) Initialize array for iddr_aid().
iddr_asvd(A,k) Compute SVD of a real matrix to a specified rank using random sampling.
iddr_rid(m,n,matvect,k) Compute ID of a real matrix to a specified rank using random matrix-vector
iddr_rsvd(m,n,matvect,matvec,k) Compute SVD of a real matrix to a specified rank using random matrix-vector
idz_frm(n,w,x) Transform complex vector via a composition of Rokhlin’s random transform,
idz_sfrm(l,n,w,x) Transform complex vector via a composition of Rokhlin’s random transform,
idz_frmi(m) Initialize data for idz_frm().
idz_sfrmi(l,m) Initialize data for idz_sfrm().
idzp_id(eps,A) Compute ID of a complex matrix to a specified relative precision.
idzr_id(A,k) Compute ID of a complex matrix to a specified rank.
idz_reconid(B,idx,proj) Reconstruct matrix from complex ID.
idz_reconint(idx,proj) Reconstruct interpolation matrix from complex ID.
idz_copycols(A,k,idx) Reconstruct skeleton matrix from complex ID.
idz_id2svd(B,idx,proj) Convert complex ID to SVD.
idz_snorm(m,n,matveca,matvec,its=20) Estimate spectral norm of a complex matrix by the randomized power method.
idz_diffsnorm(m,n,matveca,matveca2,matvec,matvec2,its=20) Estimate spectral norm of the difference of two complex matrices by the
idzr_svd(A,k) Compute SVD of a complex matrix to a specified rank.
idzp_svd(eps,A) Compute SVD of a complex matrix to a specified relative precision.
idzp_aid(eps,A) Compute ID of a complex matrix to a specified relative precision using
idz_estrank(eps,A) Estimate rank of a complex matrix to a specified relative precision using
idzp_asvd(eps,A) Compute SVD of a complex matrix to a specified relative precision using
idzp_rid(eps,m,n,matveca) Compute ID of a complex matrix to a specified relative precision using
idz_findrank(eps,m,n,matveca) Estimate rank of a complex matrix to a specified relative precision using
idzp_rsvd(eps,m,n,matveca,matvec) Compute SVD of a complex matrix to a specified relative precision using
idzr_aid(A,k) Compute ID of a complex matrix to a specified rank using random sampling.
idzr_aidi(m,n,k) Initialize array for idzr_aid().
idzr_asvd(A,k) Compute SVD of a complex matrix to a specified rank using random sampling.
idzr_rid(m,n,matveca,k) Compute ID of a complex matrix to a specified rank using random
idzr_rsvd(m,n,matveca,matvec,k) Compute SVD of a complex matrix to a specified rank using random
id_srand(n)

Generate standard uniform pseudorandom numbers via a very efficient lagged Fibonacci method.

Parameters:n (int) – Number of pseudorandom numbers to generate.
Returns:Pseudorandom numbers.
Return type:numpy.ndarray
id_srandi(t)

Initialize seed values for id_srand() (any appropriately random numbers will do).

Parameters:t (numpy.ndarray) – Array of 55 seed values.
id_srando()

Reset seed values to their original values.

idd_frm(n, w, x)

Transform real vector via a composition of Rokhlin’s random transform, random subselection, and an FFT.

In contrast to idd_sfrm(), this routine works best when the length of the transformed vector is the power-of-two integer output by idd_frmi(), or when the length is not specified but instead determined a posteriori from the output. The returned transformed vector is randomly permuted.

Parameters:
  • n (int) – Greatest power-of-two integer satisfying n <= x.size as obtained from idd_frmi(); n is also the length of the output vector.
  • w (numpy.ndarray) – Initialization array constructed by idd_frmi().
  • x (numpy.ndarray) – Vector to be transformed.
Returns:

Transformed vector.

Return type:

numpy.ndarray

idd_sfrm(l, n, w, x)

Transform real vector via a composition of Rokhlin’s random transform, random subselection, and an FFT.

In contrast to idd_frm(), this routine works best when the length of the transformed vector is known a priori.

Parameters:
  • l (int) – Length of transformed vector, satisfying l <= n.
  • n (int) – Greatest power-of-two integer satisfying n <= x.size as obtained from idd_sfrmi().
  • w (numpy.ndarray) – Initialization array constructed by idd_sfrmi().
  • x (numpy.ndarray) – Vector to be transformed.
Returns:

Transformed vector.

Return type:

numpy.ndarray

idd_frmi(m)

Initialize data for idd_frm().

Parameters:m (int) – Length of vector to be transformed.
Returns:Greatest power-of-two integer n satisfying n <= m.
Return type:int
Returns:Initialization array to be used by idd_frm().
Return type:numpy.ndarray
idd_sfrmi(l, m)

Initialize data for idd_sfrm().

Parameters:
  • l (int) – Length of output transformed vector.
  • m (int) – Length of the vector to be transformed.
Returns:

Greatest power-of-two integer n satisfying n <= m.

Return type:

int

Returns:

Initialization array to be used by idd_sfrm().

Return type:

numpy.ndarray

iddp_id(eps, A)

Compute ID of a real matrix to a specified relative precision.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Rank of ID.

Return type:

int

Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

iddr_id(A, k)

Compute ID of a real matrix to a specified rank.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of ID.
Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idd_reconid(B, idx, proj)

Reconstruct matrix from real ID.

Parameters:
  • B (numpy.ndarray) – Skeleton matrix.
  • idx (numpy.ndarray) – Column index array.
  • proj (numpy.ndarray) – Interpolation coefficients.
Returns:

Reconstructed matrix.

Return type:

numpy.ndarray

idd_reconint(idx, proj)

Reconstruct interpolation matrix from real ID.

Parameters:
  • idx (numpy.ndarray) – Column index array.
  • proj (numpy.ndarray) – Interpolation coefficients.
Returns:

Interpolation matrix.

Return type:

numpy.ndarray

idd_copycols(A, k, idx)

Reconstruct skeleton matrix from real ID.

Parameters:
  • A (numpy.ndarray) – Original matrix.
  • k (int) – Rank of ID.
  • idx (numpy.ndarray) – Column index array.
Returns:

Skeleton matrix.

Return type:

numpy.ndarray

idd_id2svd(B, idx, proj)

Convert real ID to SVD.

Parameters:
  • B (numpy.ndarray) – Skeleton matrix.
  • idx (numpy.ndarray) – Column index array.
  • proj (numpy.ndarray) – Interpolation coefficients.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idd_snorm(m, n, matvect, matvec, its=20)

Estimate spectral norm of a real matrix by the randomized power method.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matvect (function) – Function to apply the matrix transpose to a vector, with call signature y = matvect(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
  • its (int) – Number of power method iterations.
Returns:

Spectral norm estimate.

Return type:

float

idd_diffsnorm(m, n, matvect, matvect2, matvec, matvec2, its=20)

Estimate spectral norm of the difference of two real matrices by the randomized power method.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matvect (function) – Function to apply the transpose of the first matrix to a vector, with call signature y = matvect(x), where x and y are the input and output vectors, respectively.
  • matvect2 (function) – Function to apply the transpose of the second matrix to a vector, with call signature y = matvect2(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the first matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
  • matvec2 (function) – Function to apply the second matrix to a vector, with call signature y = matvec2(x), where x and y are the input and output vectors, respectively.
  • its (int) – Number of power method iterations.
Returns:

Spectral norm estimate of matrix difference.

Return type:

float

iddr_svd(A, k)

Compute SVD of a real matrix to a specified rank.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of SVD.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

iddp_svd(eps, A)

Compute SVD of a real matrix to a specified relative precision.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

iddp_aid(eps, A)

Compute ID of a real matrix to a specified relative precision using random sampling.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Rank of ID.

Return type:

int

Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idd_estrank(eps, A)

Estimate rank of a real matrix to a specified relative precision using random sampling.

The output rank is typically about 8 higher than the actual rank.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Rank estimate.

Return type:

int

iddp_asvd(eps, A)

Compute SVD of a real matrix to a specified relative precision using random sampling.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

iddp_rid(eps, m, n, matvect)

Compute ID of a real matrix to a specified relative precision using random matrix-vector multiplication.

Parameters:
  • eps (float) – Relative precision.
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matvect (function) – Function to apply the matrix transpose to a vector, with call signature y = matvect(x), where x and y are the input and output vectors, respectively.
Returns:

Rank of ID.

Return type:

int

Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idd_findrank(eps, m, n, matvect)

Estimate rank of a real matrix to a specified relative precision using random matrix-vector multiplication.

Parameters:
  • eps (float) – Relative precision.
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matvect (function) – Function to apply the matrix transpose to a vector, with call signature y = matvect(x), where x and y are the input and output vectors, respectively.
Returns:

Rank estimate.

Return type:

int

iddp_rsvd(eps, m, n, matvect, matvec)

Compute SVD of a real matrix to a specified relative precision using random matrix-vector multiplication.

Parameters:
  • eps (float) – Relative precision.
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matvect (function) – Function to apply the matrix transpose to a vector, with call signature y = matvect(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

iddr_aid(A, k)

Compute ID of a real matrix to a specified rank using random sampling.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of ID.
Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

iddr_aidi(m, n, k)

Initialize array for iddr_aid().

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • k (int) – Rank of ID.
Returns:

Initialization array to be used by iddr_aid().

Return type:

numpy.ndarray

iddr_asvd(A, k)

Compute SVD of a real matrix to a specified rank using random sampling.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of SVD.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

iddr_rid(m, n, matvect, k)

Compute ID of a real matrix to a specified rank using random matrix-vector multiplication.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matvect (function) – Function to apply the matrix transpose to a vector, with call signature y = matvect(x), where x and y are the input and output vectors, respectively.
  • k (int) – Rank of ID.
Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

iddr_rsvd(m, n, matvect, matvec, k)

Compute SVD of a real matrix to a specified rank using random matrix-vector multiplication.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matvect (function) – Function to apply the matrix transpose to a vector, with call signature y = matvect(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
  • k (int) – Rank of SVD.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idz_frm(n, w, x)

Transform complex vector via a composition of Rokhlin’s random transform, random subselection, and an FFT.

In contrast to idz_sfrm(), this routine works best when the length of the transformed vector is the power-of-two integer output by idz_frmi(), or when the length is not specified but instead determined a posteriori from the output. The returned transformed vector is randomly permuted.

Parameters:
  • n (int) – Greatest power-of-two integer satisfying n <= x.size as obtained from idz_frmi(); n is also the length of the output vector.
  • w (numpy.ndarray) – Initialization array constructed by idz_frmi().
  • x (numpy.ndarray) – Vector to be transformed.
Returns:

Transformed vector.

Return type:

numpy.ndarray

idz_sfrm(l, n, w, x)

Transform complex vector via a composition of Rokhlin’s random transform, random subselection, and an FFT.

In contrast to idz_frm(), this routine works best when the length of the transformed vector is known a priori.

Parameters:
  • l (int) – Length of transformed vector, satisfying l <= n.
  • n (int) – Greatest power-of-two integer satisfying n <= x.size as obtained from idz_sfrmi().
  • w (numpy.ndarray) – Initialization array constructed by idd_sfrmi().
  • x (numpy.ndarray) – Vector to be transformed.
Returns:

Transformed vector.

Return type:

numpy.ndarray

idz_frmi(m)

Initialize data for idz_frm().

Parameters:m (int) – Length of vector to be transformed.
Returns:Greatest power-of-two integer n satisfying n <= m.
Return type:int
Returns:Initialization array to be used by idz_frm().
Return type:numpy.ndarray
idz_sfrmi(l, m)

Initialize data for idz_sfrm().

Parameters:
  • l (int) – Length of output transformed vector.
  • m (int) – Length of the vector to be transformed.
Returns:

Greatest power-of-two integer n satisfying n <= m.

Return type:

int

Returns:

Initialization array to be used by idz_sfrm().

Return type:

numpy.ndarray

idzp_id(eps, A)

Compute ID of a complex matrix to a specified relative precision.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Rank of ID.

Return type:

int

Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idzr_id(A, k)

Compute ID of a complex matrix to a specified rank.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of ID.
Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idz_reconid(B, idx, proj)

Reconstruct matrix from complex ID.

Parameters:
  • B (numpy.ndarray) – Skeleton matrix.
  • idx (numpy.ndarray) – Column index array.
  • proj (numpy.ndarray) – Interpolation coefficients.
Returns:

Reconstructed matrix.

Return type:

numpy.ndarray

idz_reconint(idx, proj)

Reconstruct interpolation matrix from complex ID.

Parameters:
  • idx (numpy.ndarray) – Column index array.
  • proj (numpy.ndarray) – Interpolation coefficients.
Returns:

Interpolation matrix.

Return type:

numpy.ndarray

idz_copycols(A, k, idx)

Reconstruct skeleton matrix from complex ID.

Parameters:
  • A (numpy.ndarray) – Original matrix.
  • k (int) – Rank of ID.
  • idx (numpy.ndarray) – Column index array.
Returns:

Skeleton matrix.

Return type:

numpy.ndarray

idz_id2svd(B, idx, proj)

Convert complex ID to SVD.

Parameters:
  • B (numpy.ndarray) – Skeleton matrix.
  • idx (numpy.ndarray) – Column index array.
  • proj (numpy.ndarray) – Interpolation coefficients.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idz_snorm(m, n, matveca, matvec, its=20)

Estimate spectral norm of a complex matrix by the randomized power method.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matveca (function) – Function to apply the matrix adjoint to a vector, with call signature y = matveca(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
  • its (int) – Number of power method iterations.
Returns:

Spectral norm estimate.

Return type:

float

idz_diffsnorm(m, n, matveca, matveca2, matvec, matvec2, its=20)

Estimate spectral norm of the difference of two complex matrices by the randomized power method.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matveca (function) – Function to apply the adjoint of the first matrix to a vector, with call signature y = matveca(x), where x and y are the input and output vectors, respectively.
  • matveca2 (function) – Function to apply the adjoint of the second matrix to a vector, with call signature y = matveca2(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the first matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
  • matvec2 (function) – Function to apply the second matrix to a vector, with call signature y = matvec2(x), where x and y are the input and output vectors, respectively.
  • its (int) – Number of power method iterations.
Returns:

Spectral norm estimate of matrix difference.

Return type:

float

idzr_svd(A, k)

Compute SVD of a complex matrix to a specified rank.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of SVD.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idzp_svd(eps, A)

Compute SVD of a complex matrix to a specified relative precision.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idzp_aid(eps, A)

Compute ID of a complex matrix to a specified relative precision using random sampling.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Rank of ID.

Return type:

int

Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idz_estrank(eps, A)

Estimate rank of a complex matrix to a specified relative precision using random sampling.

The output rank is typically about 8 higher than the actual rank.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Rank estimate.

Return type:

int

idzp_asvd(eps, A)

Compute SVD of a complex matrix to a specified relative precision using random sampling.

Parameters:
  • eps (float) – Relative precision.
  • A (numpy.ndarray) – Matrix.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idzp_rid(eps, m, n, matveca)

Compute ID of a complex matrix to a specified relative precision using random matrix-vector multiplication.

Parameters:
  • eps (float) – Relative precision.
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matveca (function) – Function to apply the matrix adjoint to a vector, with call signature y = matveca(x), where x and y are the input and output vectors, respectively.
Returns:

Rank of ID.

Return type:

int

Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idz_findrank(eps, m, n, matveca)

Estimate rank of a complex matrix to a specified relative precision using random matrix-vector multiplication.

Parameters:
  • eps (float) – Relative precision.
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matveca (function) – Function to apply the matrix adjoint to a vector, with call signature y = matveca(x), where x and y are the input and output vectors, respectively.
Returns:

Rank estimate.

Return type:

int

idzp_rsvd(eps, m, n, matveca, matvec)

Compute SVD of a complex matrix to a specified relative precision using random matrix-vector multiplication.

Parameters:
  • eps (float) – Relative precision.
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matveca (function) – Function to apply the matrix adjoint to a vector, with call signature y = matveca(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idzr_aid(A, k)

Compute ID of a complex matrix to a specified rank using random sampling.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of ID.
Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idzr_aidi(m, n, k)

Initialize array for idzr_aid().

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • k (int) – Rank of ID.
Returns:

Initialization array to be used by idzr_aid().

Return type:

numpy.ndarray

idzr_asvd(A, k)

Compute SVD of a complex matrix to a specified rank using random sampling.

Parameters:
  • A (numpy.ndarray) – Matrix.
  • k (int) – Rank of SVD.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray

idzr_rid(m, n, matveca, k)

Compute ID of a complex matrix to a specified rank using random matrix-vector multiplication.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matveca (function) – Function to apply the matrix adjoint to a vector, with call signature y = matveca(x), where x and y are the input and output vectors, respectively.
  • k (int) – Rank of ID.
Returns:

Column index array.

Return type:

numpy.ndarray

Returns:

Interpolation coefficients.

Return type:

numpy.ndarray

idzr_rsvd(m, n, matveca, matvec, k)

Compute SVD of a complex matrix to a specified rank using random matrix-vector multiplication.

Parameters:
  • m (int) – Matrix row dimension.
  • n (int) – Matrix column dimension.
  • matveca (function) – Function to apply the matrix adjoint to a vector, with call signature y = matveca(x), where x and y are the input and output vectors, respectively.
  • matvec (function) – Function to apply the matrix to a vector, with call signature y = matvec(x), where x and y are the input and output vectors, respectively.
  • k (int) – Rank of SVD.
Returns:

Left singular vectors.

Return type:

numpy.ndarray

Returns:

Right singular vectors.

Return type:

numpy.ndarray

Returns:

Singular values.

Return type:

numpy.ndarray