iqsharp icon indicating copy to clipboard operation
iqsharp copied to clipboard

Support passing Range as a parameter to magics

Open tcNickolas opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. Magic commands don't support passing a Range literal as a parameter. This is inconsistent with passing parameters to standalone Q# applications via command line.

Describe the solution you'd like Magic commands should support passing a Range literal as a parameter, using a syntax consistent with the command line passing Range parameter: r=1..10 or r=10..-1..1.

tcNickolas avatar Jul 12 '21 17:07 tcNickolas

To add Range as a parameter option for magics that run locally (i.e. %simulate, %debug, etc), a converter will need to be added to TupleConversion for the type QRange. These converters are used for deserialization in OperationInfo.

Adding Range as a parameter option for the Azure magic commands (i.e. %azure.execute and %azure.submit) will require different changes. These magic commands call for deserialization in EntryPoint, using the extension method DecodeParameter. This extension method currently does not use any JsonConverters

anjbur avatar Oct 01 '21 00:10 anjbur