Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Check if matrix is an equilangular tight frame #562

Closed
vprusso opened this issue Apr 20, 2024 · 1 comment
Closed

Feature: Check if matrix is an equilangular tight frame #562

vprusso opened this issue Apr 20, 2024 · 1 comment
Assignees
Labels
feature request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@vprusso
Copy link
Owner

vprusso commented Apr 20, 2024

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:

import numpy as np


def is_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]
    for col in range(ncols):
        if not np.isclose(np.linalg.norm(mat[:][col]), 1):
            return False
    
    # Columns are equilangular.
    vals = []
    for i in range(ncols):
        for j in range(ncols):
            if i != j:                
                vals.append(np.abs(inner_product(mat[:][i], mat[:][j])))
    if len(set(vals)) > 1:
        return False
    
    # Matrix forms a tight frame.
    return np.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.

@purva-thakre
Copy link
Collaborator

Closing this in favor of adding this method in #561. Will update the description of the open issue.

@purva-thakre purva-thakre closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants