QuantumBFS / YaoBlocksQASM.jl

YaoBlocks interface for OpenQASM
MIT License
2 stars 3 forks source link

use expression compare instead of print as string #11

Open Roger-luo opened 3 years ago

Roger-luo commented 3 years ago

use the isapprox implemented here: https://github.com/QuantumBFS/OpenQASM.jl/blob/master/test/runtests.jl#L325

the printing doesn't guarantee equivalence

https://github.com/QuantumBFS/YaoBlocksQASM.jl/blob/6854da5f8a68b501ea03e07bd408d76997c5088a/test/runtests.jl#L53

Sov-trotter commented 3 years ago

Sure. There seems to be one minor issue with using that. eg: image

So isapprox fails here. We might need to increase the tolerance values. Other way is figure out a way to ensure proper generation of RBNF.Token. But I don't think we can account for parameters like colno, lineno . Eg: Currently I just create it using constructors which leaves out other parameters(the zeros) image