This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

The Modern QDK only supports the '%%qsharp' magic command.


Allows setting or querying configuration options.


This magic command allows for setting or querying configuration options used to control the behavior of the IQ# kernel (such as state visualization options). It also allows for saving those options to a JSON file in the current working directory (using the --save option).

Configuration settings


Value: "LittleEndian" (default), "BigEndian", or "Bitstring"

The convention to be used when labeling computational basis states in output from callables such as DumpMachine or DumpRegister.


Value: true or false (default)

Hides basis states of a state vector whose measurement probabilities (i.e., squared amplitudes) are smaller than a particular threshold, as determined by the dump.truncationThreshold setting.


Value: floating point number such as 0.001 or 1E-8 (default 1E-10)

If dump.truncateSmallAmplitudes is set to true, determines the threshold for measurement probabilities (i.e., squared amplitudes) below which to hide the display of basis states of a state vector.


Value: "ArrowOnly" (default), "NumberOnly", "ArrowAndNumber", or "None"

Configures the phase visualization style in output from callables such as DumpMachine or DumpRegister. Supports displaying phase as arrows, numbers (in radians), both, or neither.


Value: "NumberOnly", "BarOnly", "BarAndNumber" (default), or "None"

Configures the measurement probability visualization style in output of callables such as DumpMachine or DumpRegister. Supports displaying measurement probability as progress bars, numbers, both, or neither.


Value: non-negative integer (default 4)

Sets the precision of the measurement probability displayed as a percentage when dump.measurementDisplayStyle is set to "NumberOnly" or "BarAndNumber".


Value: true or false (default)

If dump.measurementDisplayHistogram is set to true, displays an interactive histogram representation of the state of the simulator underneath the static state visualization.


Value: true or false (default)

Forces plain-text output from callables such as DumpMachine and DumpRegister, even when using an HTML-enabled client such as Jupyter Notebook.


Value: positive integer (default 1)

Configures the default depth used in the %trace command for visualizing Q# operations.


Value: "Default" (default), "BlackAndWhite", or "Inverted"

Configures the default style used in generating the visualization of Q# operations with the %trace command.

Examples for %config

Example 1

Print a list of all currently set configuration options:

In []: %config
Out[]: Configuration key                 Value
       --------------------------------- -----------
       dump.basisStateLabelingConvention "BigEndian"
       dump.truncateSmallAmplitudes      true

Example 2

Configure the DumpMachine and DumpRegister callables to use big-endian convention:

In []: %config dump.basisStateLabelingConvention="BigEndian"
Out[]: "BigEndian"

Example 3

Save current configuration options to .iqsharp-config.json in the current working directory:

In []: %config --save

Note that options saved this way will be applied automatically the next time a notebook in the current working directory is loaded.