5

Q# is an interesting new language from Microsoft dedicted to performing quantum computation.

Does it compile to a .net library that can be referenced from c# or any other .net language .Net Framework and/or .Net Core Framework (.Net standard maybe)?

If not then how can it be incorporated into classic applications?

If it can be then what will a quantum computer be like? Will it allow to run full .net architecture plus quantum as a coprocessor (somehow like a GPU programming) or how else will it look work like?

jjaskulowski
  • 2,524
  • 3
  • 26
  • 36

2 Answers2

3

Yes, Q# is even transpiled to C# and then compiled as a regular .Net assembly.

You can verify this by (after installing the development kit) running through this tutorial: https://learn.microsoft.com/en-us/quantum/quantum-writeaquantumprogram. Q# and C# code can co-exist in the same project (at the moment). Q# files are converted to .qs.cs files (found under the obj\qsharp\src folder).

jeroenh
  • 26,362
  • 10
  • 73
  • 104
1

Yes, Q# is completely compatible with the .NET framework.

Currently, Q# operations ( analogous to classical functions ) runs inside Microsoft Quantum Simulator whose API is only available for C# and maybe also for F#. At present, Q# is very dependent on C#, because you need a C# driver to execute Q# operations. There is no API for the Quantum Simulator in other languages.

dotnet new console -lang Q# --output Bell

.NET CLI tool also has this option to generate a project from Q# template, and a Q# project looks same as any other typical .NET project, but with some extra ".qs" files.

Though Q# is not tightly coupled with Simulator, Microsoft states that aim of Q# is to be high-level language and actual implementation details are not concerned in Q#. So other Simulators can pop up which can run Q#.

Jay Joshi
  • 61
  • 1
  • 2