Skip to content

Commit 43fecce

Browse files
Document that memories arg is intentionally unused in swapping set_others
The memories parameter in EntanglementSwappingA/B.set_others is part of the shared EntanglementProtocol.set_others() interface (called positionally by ResourceManager, and used by the generation protocols), so it cannot be removed without breaking that interface. Add a short comment in both swapping overrides clarifying it is intentionally unused there. Refs #170.
1 parent c3e2bb6 commit 43fecce

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sequence/entanglement_management/swapping/swapping_base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ def set_others(self, protocol: str, node: str, memories: list[str]) -> None:
201201
node (str): other node name.
202202
memories (list[str]): the list of memories name used on other node.
203203
"""
204+
# `memories` is intentionally unused here: the swapping protocol keys off the
205+
# left/right memos it already holds. It is kept to match the shared
206+
# EntanglementProtocol.set_others() interface (ResourceManager calls it
207+
# positionally, and the generation protocols do use it). See issue #170.
204208
if node == self.left_memo.entangled_memory["node_id"]:
205209
self.left_protocol_name = protocol
206210
elif node == self.right_memo.entangled_memory["node_id"]:
@@ -359,6 +363,8 @@ def set_others(self, protocol: str, node: str, memories: list[str]) -> None:
359363
node (str): other node name.
360364
memories (list[str]): the list of memory names used on other node.
361365
"""
366+
# `memories` is intentionally unused here (as in EntanglementSwappingA): kept to
367+
# match the shared EntanglementProtocol.set_others() interface. See issue #170.
362368
self.remote_node_name = node
363369
self.remote_protocol_name = protocol
364370

0 commit comments

Comments
 (0)