Unable to load DLL 'Microsoft.Quantum.Simulator.Runtime.dll'

0

Getting Unable to load DLL 'Microsoft.Quantum.Simulator.Runtime.dll' error while trying to validate my Q# environment by running the teleport sample program.

dotnet build
dotnet run

platform windows 7 64 bit with AVX enabled. vscode with .NET Core SDK 2.0


Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'Microsoft.Quantum.Simulator.Runtime.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Microsoft.Quantum.Simulation.Simulators.QuantumSimulator.Init()
   at Microsoft.Quantum.Simulation.Simulators.QuantumSimulator..ctor(Boolean throwOnReleasingQubitsNotInZeroState, Nullable`1 randomNumberGeneratorSeed, Boolean disableBorrowing)
   at Microsoft.Quantum.Examples.Teleportation.Program.Main(String[] args) in C:\opt\workspace\quantum\Quantum\Samples\Teleportation\Program.cs:line 13
c#
.net
visual-studio-code
quantum-computing
q#
asked on Stack Overflow Mar 30, 2018 by Vikram Palakurthi • edited Mar 30, 2018 by Vikram Palakurthi

3 Answers

4

Under Ubuntu bionic, I had to install libgomp1 because Microsoft.Quantum.Simulator.Runtime.dll depends on libgomp.so.1.

sudo apt install libgomp1

The dependency can be seen here.

ldd -r ~/.nuget/packages/microsoft.quantum.development.kit/0.2.1802.2202-preview/runtimes/linux-x64/native/Microsoft.Quantum.Simulator.Runtime.dll

linux-vdso.so.1 (0x00007ffcbb4f4000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd537237000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd536e99000)
libgomp.so.1 => not found
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd536aa8000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd537832000)
answered on Stack Overflow Apr 2, 2018 by klaus se
1

copy the Microsoft.Quantum.Simulator.Runtime.dll from C:\Users\{user}\.nuget\packages\microsoft.quantum.development.kit\0.2.1802.2202-preview\runtimes\win10-x64 to C:\Users\{user}\.nuget\packages\microsoft.quantum.development.kit\0.2.1802.2202-preview\lib\netstandard2.0. Although I have not tested this with the older Microsoft Quantum Development Kit version, there seems to be problem with the 0.2.1802.2202 version. Make sure to check if AVX is avaialble, you can use CPU-Z tool to check that in instructions section.

then run dotnet run which should result in the

Round 0:        Sent False,     got False.
Teleportation successful!!

Round 1:        Sent True,      got True.
Teleportation successful!!

Round 2:        Sent False,     got False.
Teleportation successful!!

Round 3:        Sent False,     got False.
Teleportation successful!!

Round 4:        Sent False,     got False.
Teleportation successful!!

Round 5:        Sent False,     got False.
Teleportation successful!!

Round 6:        Sent False,     got False.
Teleportation successful!!

Round 7:        Sent True,      got True.
Teleportation successful!!



Press Enter to continue...
answered on Stack Overflow Mar 30, 2018 by Vikram Palakurthi
-2

The Simulator is only tested/supported in Windows 10. I would highly recommend upgrading your system.

answered on Stack Overflow Apr 2, 2018 by El capi

User contributions licensed under CC BY-SA 3.0