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
It is possible to apply Controlled Ry and Rz gates with 2 controls and target that is the same as one of the controls, and have no exception happen.
To Reproduce
The smallest repro I could find was:
operation BugDemo() : Unit {
use qs = Qubit[2];
ApplyToEach(H, qs);
ControlledRy(qs, (0.5, qs[1]));
ResetAll(qs);
}
BugDemo()
Using only one control doesn't trigger the bug (the exception is thrown correctly), and using X instead of Ry also doesn't trigger it.
Expected behavior
Controlled gates are not defined for targets that are the same as controls, so I expect an exception for any combination of gates and control/targets that have overlapping controls and targets. (This was the case in Classic QDK too.)
System information
qsharp 1.3.1
The text was updated successfully, but these errors were encountered:
@saram-aman This one has some subtlety related to the way that decompositions use qubits that makes it far from easy to resolve. We might need to do some refactoring to actually accomplish this, if it's possible at all.
Describe the bug
It is possible to apply Controlled Ry and Rz gates with 2 controls and target that is the same as one of the controls, and have no exception happen.
To Reproduce
The smallest repro I could find was:
Using only one control doesn't trigger the bug (the exception is thrown correctly), and using X instead of Ry also doesn't trigger it.
Expected behavior
Controlled gates are not defined for targets that are the same as controls, so I expect an exception for any combination of gates and control/targets that have overlapping controls and targets. (This was the case in Classic QDK too.)
System information
The text was updated successfully, but these errors were encountered: