Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/numpy-2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
purva-thakre committed Jul 15, 2024
2 parents b475b60 + 9550f8d commit fd4e297
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 52 deletions.
72 changes: 36 additions & 36 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ flake8-docstrings = "1.7.0"
isort = "5.13.2"
myst-parser = "3.0.1"
pep8 = "1.7.1"
ruff = "0.5.1"
ruff = "0.5.2"
mypy = "1.10.1"
black = "*"

[tool.poetry.group.docs.dependencies]
readthedocs-sphinx-ext = "*"
sphinx = "7.3.7"
sphinx = "7.4.0"
sphinx-wagtail-theme = "6.3.0"
sphinxcontrib-bibtex = "2.6.2"
sphinx-autoapi = "3.1.2"
Expand Down
2 changes: 1 addition & 1 deletion toqito/matrices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
from toqito.matrices.hadamard import hadamard
from toqito.matrices.pauli import pauli
from toqito.matrices.standard_basis import standard_basis
from toqito.matrices.cyclic_permutation import cyclic_permutation_matrix
from toqito.matrices.cyclic_permutation_matrix import cyclic_permutation_matrix
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"""Test cyclic_permutation."""
"""Test cyclic_permutation_matrix."""

import numpy as np

from toqito.matrices import cyclic_permutation_matrix


def test_cyclic_permutation_fixed():
def test_cyclic_permutation_matrix_fixed():
"""Test cyclic permuation matrix."""
n = 10
res = cyclic_permutation_matrix(n)
assert np.allclose(np.linalg.matrix_power(res, n), np.eye(n))


def test_cyclic_permutation_successive():
def test_cyclic_permutation_matrix_successive():
"""Test a successive cyclic permuation matrix."""
n = 4
# Test for k from 1 to n - 1
Expand All @@ -21,7 +21,7 @@ def test_cyclic_permutation_successive():
assert np.allclose(np.linalg.matrix_power(res, n), np.eye(n))


def test_cyclic_permutation_checks():
def test_cyclic_permutation_matrix_checks():
"""Run checks to confrim a proper cyclic permutation."""
for n in (2, 4, 6, 8, 10):
res = cyclic_permutation_matrix(n)
Expand Down
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 fd4e297

Please sign in to comment.