microsoft / QuantumLibraries

Q# libraries for the Quantum Development Kit
https://docs.microsoft.com/quantum
MIT License
543 stars 179 forks source link

Details or example lacking for ResultArrayAsInt function #635

Open ezander opened 2 years ago

ezander commented 2 years ago

How exactly is the mapping done? At least an example would be nice like ResultArrayAsInt([One,Zero])==1 or ResultArrayAsInt([One,Zero])==2 or something (I guess the first one, but this shouldn't be guesswork).

[Enter feedback here]


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

msoeken commented 2 years ago

Thanks @ezander for filing this issue. This is little endian formatting, so the result would be 1. But indeed an example would be very helpful here. Would you be interested and available to create a PR for this? I'd be happy to assist.

kinkeadian25 commented 2 years ago

Thanks @ezander for filing this issue. This is little endian formatting, so the result would be 1. But indeed an example would be very helpful here. Would you be interested and available to create a PR for this? I'd be happy to assist.

I'd love to try to fix this if you are willing to help!

msoeken commented 2 years ago

Thanks @ezander, that's great. You can find an example on how to embed an example into the documentation here:

https://github.com/microsoft/QuantumLibraries/blob/60bc2f9376024912cce9cae5f8ade459dd5538e9/Standard/src/Convert/Convert.qs#L203-L217

This is in the same file where ResultArrayAsInt is implemented.

General documentation on how to get started with a pull request is here:

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request

ezander commented 2 years ago

Okay, thanks! I'll give it a shot...

kinkeadian25 commented 2 years ago

Hi @msoeken, I was wondering what you thought about the PR I submitted. I am currently going through the Microsoft Software and Systems Academy, and I am new to open source! Trying to get started though.