Add sugar to the language so that this:
if qubit {
swap(a, b);
other_thing(b, c);
}
becomes this:
Controlled swap([qubit], (a, b));
Controlled other_thing([qubit], (b, c));
If the sugar produces bad results (e.g. attempting to control an operation that has no controlled variant), that's a compile error.
Note that if b { f(c, d); } is fewer characters than Controlled f([b], (c, d)), is easier to type, and IMO is easier to read.
Add sugar to the language so that this:
becomes this:
If the sugar produces bad results (e.g. attempting to control an operation that has no controlled variant), that's a compile error.
Note that
if b { f(c, d); }is fewer characters thanControlled f([b], (c, d)), is easier to type, and IMO is easier to read.