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: Generate random orthonormal basis #435

Closed
vprusso opened this issue Jan 27, 2024 · 0 comments · Fixed by #821
Closed

Feature: Generate random orthonormal basis #435

vprusso opened this issue Jan 27, 2024 · 0 comments · Fixed by #821
Assignees
Labels
Milestone

Comments

@vprusso
Copy link
Owner

vprusso commented Jan 27, 2024

This particular feature may be of use if we wish to generate a collection of quantum states (basis of vectors) that have the property of being orthonormal. The columns of a randomly generated unitary matrix can be used to generate an orthonormal basis

Something like this could be used:

def random_orthonormal_basis(dim: int) -> list[np.ndarray]:
    # Generate a random unitary matrix
    U = unitary_group.rvs(dim)

    # The columns of U form an orthonormal basis
    basis = [U[:, i] for i in range(dim)]
    return basis

This feature should live in rand/random_orthonormal_basis.py and would need to have the requisite coverage and testing in tests/test_random_orthonormal_basis.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants