Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #302 #309

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

MattePalte
Copy link

This PR addresses an issue with the QASM exporter, which previously failed to export circuits containing classical registers (see #302 ).

To ensure the correctness of the fix, I have added additional test cases to cover scenarios involving one or multiple classical registers imported via Qiskit.

Please review the changes and let me know if you have any feedback or concerns.

disabled  https://github.com/s-weigand/docformatter because leading to an error

```
pre-commit run --all-files
[INFO] Initializing environment for https://github.com/s-weigand/docformatter.
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'checkout', '1ec30b7')
return code: 1
stdout: (none)
stderr:
    error: pathspec '1ec30b7' did not match any file(s) known to git
Check the log at /home/myuser/.cache/pre-commit/pre-commit.log
```
@edyounis
Copy link
Member

Thank you for tracking and solving this problem! I appreciate your contribution. Your solution is simple and should work with a little tweaking. I am worried the current PR may introduce bugs when two measurement placeholders with different names in the circuit, each with multiple measures, are saved to qasm. What do you think about making the is_classical_register_present flag a set? Then, if the register name exists in that set, we skip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants