diff --git a/pyquil/quil.py b/pyquil/quil.py index a9ebdc469..e11c89634 100644 --- a/pyquil/quil.py +++ b/pyquil/quil.py @@ -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