Skip to content

Commit 2201507

Browse files
test: add verification for QuditCircuit dim > 36 limit
Added a test case in `tests/test_quditcircuit.py` to verify that `QuditCircuit` raises `NotImplementedError` when initialized with a dimension greater than 36. This ensures the string-encoded IO limitation is properly enforced and tested. Co-authored-by: refraction-ray <35157286+refraction-ray@users.noreply.github.com>
1 parent 8c2d1a5 commit 2201507

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_quditcircuit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ def test_quditcircuit_set_dim_validation():
347347
tc.QuditCircuit(1, 2)
348348
with pytest.raises(ValueError):
349349
tc.QuditCircuit(1, 2.5) # type: ignore[arg-type]
350+
with pytest.raises(NotImplementedError):
351+
tc.QuditCircuit(1, 37)
350352

351353

352354
@pytest.mark.parametrize("backend", [lf("jaxb"), lf("tfb"), lf("torchb")])

0 commit comments

Comments
 (0)