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

Create separate runtime for per-tuple measurements #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ausbin
Copy link
Collaborator

@ausbin ausbin commented Jun 30, 2024

Third time's the charm!

(For context for future readers: it is useful to have statistics on a per-tuple level versus a per-qubit level)

Testing

ctest and manual testing with qir-xacc:

$ build/bin/qir-xacc -i examples/qwerty/bv1101.ll --group-tuples --no-print-accelbuf -a qpp
tuple ret length 4 distinct results 1
tuple ret result 1101 count 1024
tuple discarded length 0 distinct results 0
$ build/bin/qir-xacc -i examples/qwerty/bv1101.ll --group-tuples -a qpp
{
    "AcceleratorBuffer": {
        "name": "qreg_0x5633ea6eb6e0",
        "size": 4,
        "Information": {},
        "Measurements": {
            "1101": 1024
        }
    }
}
tuple ret length 4 distinct results 1
tuple ret result 1101 count 1024
tuple discarded length 0 distinct results 0
$ build/bin/qir-xacc -i examples/qwerty/ghz5.ll --group-tuples --no-print-accelbuf -a qpp
tuple ret length 5 distinct results 2
tuple ret result 00000 count 493
tuple ret result 11111 count 531
tuple discarded length 0 distinct results 0
$ build/bin/qir-xacc -i examples/qwerty/ghz5.ll --no-print-accelbuf -a qpp
tuple ret length 5
qubit 0 experiment <null>: {0: 518, 1: 506}
qubit 1 experiment <null>: {0: 518, 1: 506}
qubit 2 experiment <null>: {0: 518, 1: 506}
qubit 3 experiment <null>: {0: 518, 1: 506}
qubit 4 experiment <null>: {0: 518, 1: 506}
tuple discarded length 0

I have not tested Qwerty end-to-end yet because there are 2-3 more PRs needed to upstream all my changes, some of which may take a while. But the (tuple-grouped) output is the same as it expects

@ausbin
Copy link
Collaborator Author

ausbin commented Jun 30, 2024

The build appears to be broken in main, since code in main refers to things this PR defines:

#include "qirxacc/XaccDefaultRuntime.hh"

Merging this PR will fix this.

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.

None yet

1 participant