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
# We do not allow adding gates in an executed circuit
self.is_executed=False
but it seems like it is not accessed nor modified anywhere in the source code of Qibo.
Indeed, it always returns False. The "add" method ignores it and simply checks for "_final_state"
@mlazzarin thank you for checking the code. Indeed you may find some attributes around the code that are not used anymore because we forgot to remove them during a cleanup or refactoring. This particular attribute seems redundant to me as any if self.is_executed could be replaced by if self._final_state is not None since, if I am not mistaken, the final state attribute is assigned after a circuit execution.
I don't think such attributes would cause problems in every day usage but may confuse people that look at the code and should be removed. @mlazzarin you can remove this if you like.
The "is_executed" flag in the AbstractCircuit class is defined here
qibo/src/qibo/abstractions/circuit.py
Lines 91 to 93 in 14bb454
but it seems like it is not accessed nor modified anywhere in the source code of Qibo.
Indeed, it always returns False. The "add" method ignores it and simply checks for "_final_state"
qibo/src/qibo/abstractions/circuit.py
Lines 390 to 392 in 4073ce9
This is a minor bug but it may cause issues if such flag is used by unaware users.
Should we implement it properly (or simply remove it)?
The text was updated successfully, but these errors were encountered: