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
@@ -57,6 +70,14 @@ one argument (`0.1`), and two targets (`5` and `6`).
57
70
An instruction *name* starts with a letter and then contains a series of letters, digits, and underscores.
58
71
Names are case-insensitive.
59
72
73
+
An instruction *tag* is an arbitrary string enclosed by square brackets.
74
+
Certain characters cannot appear directly in the tag, and must instead be included using escape sequences.
75
+
The closing square bracket character `]` cannot appear directly, and is instead encoded using the escape sequence `\C`.
76
+
The carriage return character cannot appear directly, and is instead encoded using the escape sequence `\r`.
77
+
The line feed character cannot appear directly, and is instead encoded using the escape sequence `\n`.
78
+
The backslash character `\` cannot appear directly, and is instead encoded using the escape sequence `\B`.
79
+
(This backslash escape sequence differs from the common escape sequence `\\` because that sequence causes exponential explosions when escaping multiple times.)
80
+
60
81
An *argument* is a double precision floating point number.
61
82
62
83
A *target* can either be a qubit target (a non-negative integer),
@@ -124,6 +145,17 @@ Currently, control flow is limited to *repetition*.
124
145
A circuit can contain `REPEAT K { ... }` blocks,
125
146
which indicate that the block's instructions should be iterated over `K` times instead of just once.
126
147
148
+
### Tags
149
+
150
+
Instruction tags have no effect on the function of a circuit.
151
+
In general, tools should attempt to propagate tags through circuit transformations and otherwise ignore them.
152
+
The intent is that users and tools can use tags to specify custom behavior that stim is not aware of.
153
+
For example, consider the tagged instruction `TICK[100ns]`.
154
+
In most situations, the `100ns` tag does nothing.
155
+
But if you are using a tool that adds noise to circuits, and it's programmed to look at tags to get hints about what
156
+
noise to add, then the `100ns` tag could be a message to that tool (specifying a duration, which the tool could use when
157
+
computing the probability argument of an inserted `DEPOLARIZE1` instruction).
158
+
127
159
### Target Types
128
160
129
161
There are four types of targets that can be given to instructions:
0 commit comments