Skip to content

Commit

Permalink
🐛 Fix for older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
EarlMilktea committed Oct 19, 2024
1 parent 2d15149 commit 0f65f53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion graphix/fundamentals.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __rmul__(self, other: complex) -> complex: ...

def __rmul__(self, other: complex) -> int | float | complex:
"""Multiply the sign with a number."""
if isinstance(other, int | float | complex):
if isinstance(other, (int, float, complex)):
return self.__mul__(other)
return NotImplemented

Expand Down
2 changes: 2 additions & 0 deletions tests/test_db.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import itertools
import sys

import numpy as np
import pytest
Expand Down Expand Up @@ -34,6 +35,7 @@ def test_conjugation(self, i: int) -> None:
op = CLIFFORD[i].conjugate().T
assert Clifford.try_from_matrix(op) == Clifford(CLIFFORD_CONJ[i])

@pytest.mark.skipif(sys.version_info <= (3, 8), reason="@= not upported.")
@pytest.mark.parametrize("i", range(24))
def test_decomposition(self, i: int) -> None:
op = np.eye(2, dtype=np.complex128)
Expand Down

0 comments on commit 0f65f53

Please sign in to comment.