Official repository for design of the quantum programming language Q# and its core libraries
233
stars
54
forks
source link
Allow qubit in `if` expression, meaning "use this as a control for all operations in the block" #130
Open
Strilanc opened 2 years ago
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.