You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched exisisting GitHub issues to make sure the issue does not already exist.
Expected behavior
When creating a linked copy of a program (e.g., when calling the compiler), the register references are retained. Gate parameters may contains MeasuredParameter objects, which are used as placeholders for mid-circuit measurements. They contain register references to the registers that are measured, and thus have to be kept in the linked copy.
Currently, the circuits are referenced in the linked copy, rather than copied. Expected behaviour would be that only the register references are retained, while the rest of the circuit (parameters, etc.) should be copied.
>>> cprog = prog._linked_copy()
>>> cprog.circuit is prog.circuit
False
Above: the program circuit should be equal but not the same.
Actual behavior
>>> cprog = prog._linked_copy()
>>> cprog.circuit is prog.circuit
True
Before posting a bug report
Expected behavior
When creating a linked copy of a program (e.g., when calling the compiler), the register references are retained. Gate parameters may contains
MeasuredParameter
objects, which are used as placeholders for mid-circuit measurements. They contain register references to the registers that are measured, and thus have to be kept in the linked copy.Currently, the circuits are referenced in the linked copy, rather than copied. Expected behaviour would be that only the register references are retained, while the rest of the circuit (parameters, etc.) should be copied.
Above: the program circuit should be equal but not the same.
Actual behavior
Reproduces how often
Every time a program is copied.
System information
Strawberry Fields: a Python library for continuous-variable quantum circuits. Copyright 2018-2020 Xanadu Quantum Technologies Inc. Python version: 3.9.6 Platform info: macOS-12.2.1-arm64-arm-64bit Installation path: /Users/theodor/Repos/strawberryfields/strawberryfields Strawberry Fields version: 0.22.0-dev Numpy version: 1.21.3 Scipy version: 1.7.0 SymPy version: 1.8 NetworkX version: 2.6.1 The Walrus version: 0.19.0-dev Blackbird version: 0.5.0-dev XCC version: 0.2.0-dev TensorFlow version: 2.4.1
Source code
No response
Tracebacks
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: