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

Unclear type of result for QIR #501

Open
cqc-melf opened this issue Oct 2, 2024 · 0 comments
Open

Unclear type of result for QIR #501

cqc-melf opened this issue Oct 2, 2024 · 0 comments
Assignees

Comments

@cqc-melf
Copy link
Collaborator

cqc-melf commented Oct 2, 2024

Currently the type of the result is depended on the QIR submitted. For QIR with the register functions the result type is a bit list (as a string), for QIR without them the result type is a integer (as a string).

Example:
When I record an integer that has been generated by a call of get_int_from_creg I get a result back as a bit string.
%9 = call i64 @get_int_from_creg(i1* %2)
call void @__quantum__rt__int_record_output(i64 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0))
Result:

{'a': ['00111001', '10011100', '00101010', '00001100', '10101100', '10110000', '00001001', '10110001', '01111010', '10100110'], 'b': ['0100', '0100', '0011', '0010', '0100', '0011', '0010', '0100', '0101', '0100'], 's': ['0', '1', '0', '0', '1', '1', '0', '1', '0', '1']}

When I record an integer that has been generated in a different way, I the results as an int.
%136 = call i64 @get_c()
call void @__quantum__rt__int_record_output(i64 %136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0))
Result:

{'b': ['4', '4', '4', '6', '5', '5', '4', '4', '6', '5'], 'a': ['92', '232', '178', '231', '122', '203', '114', '149', '125', '110'], 's': ['0', '1', '1', '1', '0', '1', '0', '1', '0', '0']}

Currently discussing on how to solve this.

@cqc-melf cqc-melf self-assigned this Oct 2, 2024
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

No branches or pull requests

1 participant