Skip to content

Commit

Permalink
removing commented
Browse files Browse the repository at this point in the history
  • Loading branch information
nealerickson-qtm committed Oct 4, 2023
1 parent 4af6e36 commit 4cfd423
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 61 deletions.
15 changes: 0 additions & 15 deletions pytket/phir/sharding/shard.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ class Shard:
# A set of the identifiers of other shards this particular shard depends upon
depends_upon: set[int]

# def __post_init__(self) -> None:
# self.qubits_used = set(self.primary_command.qubits)
# self.bits_written = set(self.primary_command.bits)
# self.bits_read = set()

# all_sub_commands: list[Command] = []
# for sub_commands in self.sub_commands.values():
# all_sub_commands.extend(sub_commands)

# for sub_command in all_sub_commands:
# self.bits_written.update(sub_command.bits)
# self.bits_read.update(
# set(filter(lambda x: isinstance(x, Bit), sub_command.args)), # type: ignore [misc,arg-type] # noqa: E501
# )

def pretty_print(self) -> str:
output = io.StringIO()
output.write(f"Shard {self.ID}:")
Expand Down
44 changes: 0 additions & 44 deletions tests/test_shard.py

This file was deleted.

3 changes: 1 addition & 2 deletions tests/test_sharder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def test_should_op_create_shard(self) -> None:
Op.create(OpType.Reset), # type: ignore # noqa: PGH003
Op.create(OpType.CX), # type: ignore # noqa: PGH003
Op.create(OpType.Barrier), # type: ignore # noqa: PGH003
# Op.create(OpType.SetBits, [3, 1]),
]
expected_false: list[Op] = [
Op.create(OpType.U1, 0.32), # type: ignore # noqa: PGH003
Expand Down Expand Up @@ -113,7 +112,7 @@ def test_simple_conditional(self) -> None:
assert len(shards[2].sub_commands.keys()) == 0
assert shards[2].qubits_used == set()
assert shards[2].bits_written == {circuit.bits[1]}
# assert shards[2].bits_read == {circuit.bits[0]}
assert shards[2].bits_read == {circuit.bits[0], circuit.bits[1]}
assert shards[2].depends_upon == {shards[0].ID}

# shard 3: [if (c==1) h q;] measure q->c;
Expand Down

0 comments on commit 4cfd423

Please sign in to comment.