Skip to content

Commit

Permalink
Fix: the shallow copy() method needs to copy the declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
mhodson-rigetti committed Jul 6, 2023
1 parent 1e74d82 commit 4d9a234
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyquil/quil.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ def copy(self) -> "Program":
:return: a new Program
"""
new_prog = self.copy_everything_except_instructions()
new_prog = self.copy_everything_except_instructions() # and declarations, which is a view
new_prog._instructions = self._instructions.copy()
new_prog._declarations = self._declarations.copy()
return new_prog

@property
Expand Down

0 comments on commit 4d9a234

Please sign in to comment.