How can I change the format of the Qubit IDs of the Q# DumpMachine?

Viewed 64

In Q#, the DumpMachine function gives an overview of the state of the quantum system. Its output (in a Q# Jupyter Notebook) looks like this:

output of DumpMachine with basis states in little endian state

Is there a way for me to change the way the basis states are represented? For example, in big endian, or even better, as a sequence of bits? (So: |00>, |01>, |10>, |11> instead of what I have above.)

1 Answers

You can use the %config magic command to change this setting.

For example, to configure DumpMachine to represent basis states as bit strings, you can use:

%config dump.basisStateLabelingConvention="Bitstring"

Supported options are "LittleEndian", "BigEndian", and "Bitstring".

Related