Closed andrew-koren closed 7 months ago
Thanks for noticing.
I think I know the underlying issue, it's basically because the open-qasm import module uses calls to low-level functions to initialize gates: Example:
gates.impl.QGateImpl(....)
instead of
gates.Z(....)
In principle all gates.impl.XYimpl(name=NAME,....)
calls in the function parse_command
in the file src/tequila/circuit/qasm.py
need to be replaced by the corresponding gates.NAME(...)
call.
All initialization routines in tq.gates
will set generators correctly.
(generators for all gates where introduced after the open-qasm module)
In principle not hard to fix, but will need a bit of time due to other things.
Feel free to do a PR if you are interested in fixing it yourself :-) Otherwise I try to get it done by the end of march
Should work now. Please let me know if not. Tanks for reporting!
Success! I was able to verify this works, along with import S gate
Describe the bug After importing openqasm circuit to tequila using tq.import_open_qasm(), the hermitian conjugate of the circuit containing the gate Z(target=(1,), control=(0,)) could not be found. The hermeitian conjugate of this gate could not be calculated using .dagger(). In addition, this gate has no generator.
To Reproduce
Expected behavior Imported circuit hermetian conjugate should be returned
Computer (please complete the following information): tequila version: 1.9.4 python version: 3.10.13 (main, Feb 6 2024, 19:53:26) [GCC 9.4.0] platform: https://github.com/tequilahub/tequila/issues/19~22.04.1-Ubuntu SMP Wed Jan 10 22:57:03 UTC 2024