Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^(docs|graphics|utils)/
Expand All @@ -12,26 +12,26 @@ repos:
- id: detect-private-key

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
rev: v0.11.8
hooks:
- id: ruff
exclude: ^(docs|graphics|utils)/

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.1
hooks:
- id: isort
args: ["--profile", "black"]
exclude: ^(docs|graphics|utils)/

- repo: https://github.com/psf/black
rev: 24.4.2
rev: 25.1.0
hooks:
- id: black
exclude: ^(docs|graphics|utils)/

- repo: https://github.com/PyCQA/pylint
rev: v3.3.1
rev: v3.3.6
hooks:
- id: pylint
args: [--disable=import-error]
Expand Down
24 changes: 24 additions & 0 deletions tests/embeddings/image_embeddings/test_mcrqi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Unit test for MCRQI class"""

from __future__ import annotations

import math
from unittest import mock

import numpy as np
import pytest
from pytest import raises
from qiskit.circuit import QuantumCircuit

from piqture.embeddings.image_embeddings.mcrqi import MCRQI


class TestMCRQI:
"""Tests for MCRQI image representation class"""

@pytest.mark.parametrize("img_dims, pixel_vals", [((2, 2), [list(range(4))])])
def test_circuit_init(self, img_dims, pixel_vals):
"""Tests MCRQI circuit initialization."""
feature_dim = int(np.ceil(np.sqrt(math.prod(img_dims))))
test_circuit = QuantumCircuit(feature_dim + 3)
assert MCRQI(img_dims, pixel_vals).circuit == test_circuit
Loading