microsoft / iqsharp

Microsoft's IQ# Server.
https://docs.microsoft.com/quantum
MIT License
126 stars 58 forks source link

Support passing Range as a parameter to magics #472

Open tcNickolas opened 3 years ago

tcNickolas commented 3 years ago

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.

anjbur commented 2 years ago

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