qdk icon indicating copy to clipboard operation
qdk copied to clipboard

BigIntAsBoolArray function to work for negative inputs and unknown number of bits in the input

Open tcNickolas opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. In the classic QDK, BigIntAsBoolArray function used to take one argument, the BigInt to be converted to the bit string, and decided on the necessary length of the bit string itself, depending on the value and the sign of the input. The version in the modern QDK works only for non-negative numbers and takes the number of bits as the second input, requiring the caller to figure it out themselves.

Describe the solution you'd like A BigIntAsBoolArray function that would work for negative numbers and take care of computing the length of the bit string itself.

Describe alternatives you've considered For now, I've copy-pasted the classic QDK implementation from https://github.com/microsoft/qsharp-runtime/blob/da1872db685826861313ef078acab615e04f1334/src/Simulation/QSharpFoundation/Convert/Convert.qs#L87, but I'd like to be able to use this functionality out of the box.

tcNickolas avatar Feb 02 '24 19:02 tcNickolas

@DmitryVasilevsky could you follow up on this and clarify if this was an intentional library change?

sezna avatar Mar 04 '24 21:03 sezna