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

Incorrect shots length after submitting QIR #510

Closed
cqc-alec opened this issue Oct 11, 2024 · 4 comments
Closed

Incorrect shots length after submitting QIR #510

cqc-alec opened this issue Oct 11, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@cqc-alec
Copy link
Collaborator

When running the CI tests after switching the default submission language to QIR:

FAILED integration/backend_test.py::test_scratch_removal[H1-1SC] - assert False
 +  where False = all(<generator object test_scratch_removal.<locals>.<genexpr> at 0x7f7fec9bb5a0>)

See #508 .

@cqc-alec cqc-alec added the bug Something isn't working label Oct 11, 2024
@cqc-melf
Copy link
Collaborator

I don't see a reason why this should only be tested with the default language, any objections on updating this?

@cqc-melf
Copy link
Collaborator

The circuit has the following bits:
[cb0[0], cb0[1], cb1[0], cb1[1], cb1[2], tk_SCRATCH_BIT[0], tk_SCRATCH_BIT[1], tk_SCRATCH_BIT[2]]
We get all 8 of them back, I would assume that we want to exclude the tk_SCRATCH_BIT at some point. Do we want to do this when generating the qir or later when we get the results?

@cqc-melf
Copy link
Collaborator

So I think we are missing the part here which is only done for qasm:

                    used_scratch_regs = _used_scratch_registers(quantinuum_circ)
                    for name, count in Counter(
                        bit.reg_name
                        for bit in c0.bits
                        if not _is_scratch(bit) or bit.reg_name in used_scratch_regs
                    ).items():
                        for i in range(count):
                            results_selection.append((name, i))

I will make a PR to add this

@cqc-melf cqc-melf self-assigned this Oct 11, 2024
@cqc-alec
Copy link
Collaborator Author

I don't see a reason why this should only be tested with the default language, any objections on updating this?

Agree we should test it with both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants