Closed DevelopDaily closed 3 years ago
Agreed! The argument of the rz
gate is definitely not ideal.
For the purposes of some optimizations in staq
it's better to keep the arguments here symbolic rather than to outright evaluate them, but definitely it would be nice and possible to simplify these symbolic expressions. I'll put that on the to do list --- it's been something that we wanted to do for a long time anyway.
@DevelopDaily We've added parameter expression simplification
Here is a test file
input.qasm
:I run this:
./staq -S -O3 -o output.qasm input.qasm
The output will be:
The argument of the
rz
gate does not look nice. Its length will grow with the number of thecu1
gates. It also happens on other gates. Would it be nice if thestaq
could evaluate the arguments of gates? Is it too difficult for thestaq
to achieve that? Any pros and cons?By the way, the problem is considered minor because the argument expression is evaluated by the
qpp
correctly. When thestaq
API is used to traverse the circuit, it also correctly evaluates that torz(-1.57)
.