Skip to content

Commit

Permalink
nit test change
Browse files Browse the repository at this point in the history
  • Loading branch information
perlinm committed Jan 23, 2024
1 parent e622a22 commit 0a1ee45
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions qldpc/codes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,13 @@ def test_CSS_code() -> None:

def test_logical_ops() -> None:
"""Logical operator construction."""
code = codes.HGPCode(codes.ClassicalCode.random(3, 2, field=3))
code = codes.HGPCode(codes.ClassicalCode.random(4, 2, field=3))
code.get_random_logical_op(codes.Pauli.X, ensure_nontrivial=False)
code.get_random_logical_op(codes.Pauli.X, ensure_nontrivial=True)
ops = code.get_logical_ops()
for qudit in range(code.dimension):
op_x = ops[0, qudit, :]
op_z = ops[1, qudit, :]
assert op_x @ op_z == 1
for qq in range(code.dimension):
for rr in range(qq + 1):
assert ops[0, qq, :] @ ops[1, rr, :] == int(qq == rr)


def test_deformations(num_qudits: int = 5, num_checks: int = 3, field: int = 3) -> None:
Expand Down

0 comments on commit 0a1ee45

Please sign in to comment.