qsharp-runtime icon indicating copy to clipboard operation
qsharp-runtime copied to clipboard

DumpMachine() raise Unhandled exception

Open lmarangio opened this issue 2 years ago • 0 comments

Describe the bug

I am trying to run the code reported here: https://learn.microsoft.com/en-gb/training/modules/qsharp-explore-key-concepts-quantum-computing/3-explore-superposition-qsharp

When I run it, I see this in the terminal: Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Quantum.Simulation.Extensions.Reverse(String s) at Microsoft.Quantum.Simulation.Simulators.CommonNativeSimulator.DisplayableState.BasisStateLabelToBigInt(String str) at Microsoft.Quantum.Simulation.Simulators.CommonNativeSimulator.DisplayableStateDumper.Callback(String idx, Double real, Double img)

To Reproduce

Just copy and paste the code from here: https://learn.microsoft.com/en-gb/training/modules/qsharp-explore-key-concepts-quantum-computing/3-explore-superposition-qsharp

I tried to use DumpMachine() in other scripts, but I received the same error.

Expected behavior

We expect DumpMachine() to work fine.

System information

Remark: to run Q# and QDK on ARM64, I am using this workaround: https://www.strathweb.com/2022/07/running-q-and-qdk-on-arm64-mac/

  • OS: macOS Ventura 13.4

  • .NET Core Version: 6.0.408

lmarangio avatar May 29 '23 07:05 lmarangio