GTorlai / PastaQ.jl

Package for Simulation, Tomography and Analysis of Quantum Computers
Apache License 2.0
142 stars 23 forks source link

Fix bug when multiplying gates and applying function #250

Closed GTorlai closed 2 years ago

GTorlai commented 2 years ago

This PR provides a bug fix for the gate combination system. The bug originated from the fact that when a function f was passed, it was applied to each "sub-gate" operation, rather than to the final output of the combination. For example, if one passes g = ("a† * a", 1, (f = myfunction)), the output was actually f(a†) * f(a), instead of f(a†a).