Skip to content

Commit

Permalink
rename of method in sharder
Browse files Browse the repository at this point in the history
  • Loading branch information
nealerickson-qtm committed Sep 27, 2023
1 parent f759167 commit 34f045c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pytket/phir/sharding/sharder.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def _process_command(self, command: Command) -> None:
msg = f"OpType {command.op.type} not supported!"
raise NotImplementedError(msg)

if self.is_op_schedulable(command.op):
print(f"Scheduling command: {command}")
if self.should_op_create_shard(command.op):
print(f"Building shard for command: {command}")
self._build_shard(command)
else:
self._add_pending_command(command)
Expand All @@ -79,11 +79,10 @@ def _add_pending_command(self, command: Command) -> None:
self._pending_commands[command.args[0]].append(command)

@staticmethod
def is_op_schedulable(op: Op) -> bool:
def should_op_create_shard(op: Op) -> bool:
"""
Returns `True` if the operation is one that should be scheduled, that is,
that will have a shard created for it. This includes non-gate operations
like measure/reset as well as 2-qubit gates.
Returns `True` if the operation is one that should result in shard creation.
This includes non-gate operations like measure/reset as well as 2-qubit gates.
"""
# TODO: This is almost certainly inadequate right now
return (
Expand Down

0 comments on commit 34f045c

Please sign in to comment.