You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a function that takes in as input a matrix (as a numpy array) and returns True if the matrix constitutes an equilangular tight frame and False otherwise.
A function like the following could be written:
importnumpyasnpdefis_etf(mat: np.ndarray) ->bool:
"""Determine if matrix forms an equilangular tight frame (ETF). Definition taken from the condition of: http://users.cms.caltech.edu/~jtropp/conf/Tro05-Complex-Equiangular-SPIE-preprint.pdf """# Each column has unit norm.nrows, ncols=mat.shape[0], mat.shape[1]
forcolinrange(ncols):
ifnotnp.isclose(np.linalg.norm(mat[:][col]), 1):
returnFalse# Columns are equilangular.vals= []
foriinrange(ncols):
forjinrange(ncols):
ifi!=j:
vals.append(np.abs(inner_product(mat[:][i], mat[:][j])))
iflen(set(vals)) >1:
returnFalse# Matrix forms a tight frame.returnnp.allclose(mat @ mat.conj().T, (ncols/nrows) *np.identity(nrows*ncols))
One would also need to provide proper documentation, examples, and unit tests for this function.
Additional Option
Provide a function that takes in as input a matrix (as a numpy array) and returns True if the set of vectors constitute as a tight frame and False otherwise.
A function like the following could be written:
importnumpyasnpdefis_tight_frame(vectors: list[np.ndarray]) ->bool:
"""Check if list of vectors constitutes a tight frame."""n, d=len(vectors), vectors[0].shape[0]
col_sum=0foriinrange(n):
col_sum+=np.linalg.norm(vectors[i])
returnnp.isclose(sum(overlaps(vectors)), 1/np.sqrt(d) *col_sum**2)
One would also need to provide proper documentation, examples, and unit tests for this function.
Note that this requires the overlaps function to be defined from: #556
The text was updated successfully, but these errors were encountered:
Provide a function that takes in as input a matrix (as a numpy array) and returns
True
if the matrix constitutes an equilangular tight frame andFalse
otherwise.A function like the following could be written:
One would also need to provide proper documentation, examples, and unit tests for this function.
Additional Option
Provide a function that takes in as input a matrix (as a numpy array) and returns
True
if the set of vectors constitute as a tight frame andFalse
otherwise.A function like the following could be written:
One would also need to provide proper documentation, examples, and unit tests for this function.
Note that this requires the
overlaps
function to be defined from:#556
The text was updated successfully, but these errors were encountered: