Skip to content

Commit

Permalink
Merge pull request #681 from FabienGhd/rename-random-circulant-gram
Browse files Browse the repository at this point in the history
Rename Random Circulant Gram to Random Circulant Gram Matrix
  • Loading branch information
vprusso authored Jul 15, 2024
2 parents 3135c7b + 114d4fb commit 25a340c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion toqito/rand/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from toqito.rand.random_povm import random_povm
from toqito.rand.random_state_vector import random_state_vector
from toqito.rand.random_states import random_states
from toqito.rand.random_circulant_gram import random_circulant_gram
from toqito.rand.random_circulant_gram_matrix import random_circulant_gram_matrix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np


def random_circulant_gram(dim: int) -> np.ndarray:
def random_circulant_gram_matrix(dim: int) -> np.ndarray:
r"""Generate a random circulant Gram matrix of specified dimension.
A circulant matrix is a square matrix where the elements of each row are identical to the elements of the
Expand All @@ -26,8 +26,8 @@ def random_circulant_gram(dim: int) -> np.ndarray:
Generate a random circulant Gram matrix of dimension 4.
>>> import numpy as np
>>> from toqito.rand import random_circulant_gram
>>> circulant_matrix = random_circulant_gram(4)
>>> from toqito.rand import random_circulant_gram_matrix
>>> circulant_matrix = random_circulant_gram_matrix(4)
>>> circulant_matrix.shape
(4, 4)
>>> np.allclose(circulant_matrix, circulant_matrix.T)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Test random_circulant_gram."""
"""Test random_circulant_gram_matrix."""

import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal, assert_equal

from toqito.rand.random_circulant_gram import random_circulant_gram
from toqito.rand.random_circulant_gram_matrix import random_circulant_gram_matrix


@pytest.mark.parametrize(
Expand All @@ -20,10 +20,10 @@
10,
],
)
def test_random_circulant_gram(dim):
"""Test for random_circulant_gram function."""
def test_random_circulant_gram_matrix(dim):
"""Test for random_circulant_gram_matrix function."""
# Generate a random circulant Gram matrix.
circulant_matrix = random_circulant_gram(dim)
circulant_matrix = random_circulant_gram_matrix(dim)

# Ensure the matrix has the correct shape.
assert_equal(circulant_matrix.shape, (dim, dim))
Expand Down

0 comments on commit 25a340c

Please sign in to comment.