Introducing Silq annotations
The Silq language provides various kinds of annotations that help to perform quantum computation and classical operations in an intuitive manner. There are a total of five Silq annotations; let's see them one by one.
Introducing classical type annotations – !
We have discussed this annotation type when differentiating quantum variables or operations from classical ones. As soon as you put !
before a variable or a function, it becomes classical in nature.
A few properties of classical types that are worth mentioning are as follows:
- If we use two
!
symbols before a variable or a function, it means the same as putting one, for example,!!N = !N
. - Classical types can commute with tuples in Silq, for example, , and therefore we have
.
- Classical types can commute with dynamic length arrays, such as .
- Classical types can also commute with fixed-length arrays, for example, .
An important thing to note about classical...