microsoft / iqsharp

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

Allow configuration of DumpMachine output format from IQ# and Python #126

Closed tcNickolas closed 4 years ago

tcNickolas commented 4 years ago

Is your feature request related to a problem? Please describe. The new DumpMachine outputs (visual version in Q# Notebooks and different text version in Python-driven invocations) look really neat, but the difference of formats across different mediums can be confusing. It can also cause issues if any automated tools or any educational content rely on the specific output format.

Describe the solution you'd like

  1. It would be great to document the different available formats of the output at https://docs.microsoft.com/quantum.
  2. If would be great to make different formats configurable from the user interface (for example, so that a Q# Notebook user can choose whether they want a visual format, a neat text format or an old-style text format). I believe some parts of the output are already configurable (such as little endian vs big endian vs bit string), but it's really hard to discover that without documentation.
  3. It would also be helpful to keep numeric representation of state phase (possibly also configurable) - arrows look nice but without the base information about which direction corresponds to what phase they are less informative than I'd like them to be.
cgranade commented 4 years ago
  1. If would be great to make different formats configurable from the user interface (for example, so that a Q# Notebook user can choose whether they want a visual format, a neat text format or an old-style text format). I believe some parts of the output are already configurable (such as little endian vs big endian vs bit string), but it's really hard to discover that without documentation.

Just a quick tangential point about documentation, we're in the process of expanding documentation of IQ# magic commands to help make that more discoverable. It's definitely not great at the moment, though, agreed.

rmshaffer commented 4 years ago

Note that existing DumpMachine output configuration settings are now documented at https://docs.microsoft.com/en-us/qsharp/api/iqsharp-magic/config.

tcNickolas commented 4 years ago

From the documentation, it looks like dump.phaseDisplayStyle addresses my 3rd question, so the only open question is the 2nd one?

rmshaffer commented 4 years ago

@tcNickolas yes, I believe the remaining open item here would be to provide a configuration setting to choose between HTML/fancy-text/plain-text outputs and the corresponding documentation explaining these choices.

tcNickolas commented 4 years ago

I think it might also have referred to Python-driven Q# invocations, though right now I can't find a thread that inspired this. Does the same docs refer to output of Q# called from Python?

rmshaffer commented 4 years ago

I think it might also have referred to Python-driven Q# invocations, though right now I can't find a thread that inspired this. Does the same docs refer to output of Q# called from Python?

That's a good point. The %config magic is not exposed through the Python API at the moment, so those settings are not easily configurable from Python.