microsoft / QuantumLibraries

Q# libraries for the Quantum Development Kit

Home Page:https://docs.microsoft.com/quantum

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Details or example lacking for ResultArrayAsInt function

ezander opened this issue · comments

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.

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.

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!

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

/// # Summary
/// Creates an array `arr` of integers enumerated by start..step..end.
///
/// # Input
/// ## range
/// A `Range` of values `start..step..end` to be converted to an array.
///
/// # Output
/// A new array of integers corresponding to values iterated over by `range`.
///
/// # Example
/// ```qsharp
/// // The following returns [1,3,5,7];
/// let array = RangeAsIntArray(1..2..8);
/// ```

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

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

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.