The following code is accepted by analog grammar:
r = qreg[2]
q0 = r[0]
H_single = 0.5 %* %X %+ 0.5 %* %Z
evolve(H_single, 1.0, q0)
Note that evolve is applied on the target q0. However, the following code raises an error:
r = qreg[2]
H_single = 0.5 %* %X %+ 0.5 %* %Z
evolve(H_single, 1.0, r[0])
This is because the register r[0] is defined in-line by the program.
The following code is accepted by analog grammar:
Note that
evolveis applied on the targetq0. However, the following code raises an error:This is because the register
r[0]is defined in-line by the program.