This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
QCTraceSimulator errors with "Sequence contains no elements." #542
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When creating a new QCTraceSimulator I get Unhandled exception. System.InvalidOperationException: Sequence contains no elements.
To Reproduce
I started a new project with the commands:
dotnet new classlib -lang Q# -o quantum
dotnet new console -lang C# -o host
cd host
dotnet add reference ../quantum/quantum.csproj
Then change host/Program.cs to the following and run.
using System;
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
using Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators;
namespace host
{
class Program
{
static void Main(string[] args)
{
var sim = new QCTraceSimulator();
}
}
}
Expected behavior
I expect this code to not error and terminate quietly.
Actual behavior
The code errors with:
Unhandled exception. System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators.Implementation.QCTraceSimulatorImpl.RegisterPrimitiveOperationsGivenAsCircuits(Assembly coreAssembly)
at Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators.Implementation.QCTraceSimulatorImpl..ctor(QCTraceSimulatorConfiguration config, Assembly coreAssembly)
at Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators.QCTraceSimulator..ctor(QCTraceSimulatorConfiguration config, Assembly coreAssembly)
at Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators.QCTraceSimulator..ctor()
at host.Program.Main(String[] args) in /path/to/host/Program.cs:line 12
System information
-
OS: Ubuntu 18.04
-
.NET Core Version: 5.0.103
-
IQ# Version
iqsharp: 0.15.2102129448
Jupyter Core: 1.5.0.0
.NET Runtime: .NETCoreApp,Version=v3.1
- Python Version (if applicable) NA
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working