Q# Holiday Calendar 2022 – Peeking into Santa’s gifts with Q#

🎄 This post is part of the Q# Holiday Calendar 2022. 🎅🏻

In 1993, Avshalom Elitzur and Lev Vaidman from Tel-Aviv University wrote a paper in which they proposed a fascinating thought experiment. They described bombs equipped with a very sensitive triggering mechanism - through interaction with a single photon only - and then proceeded to show that using quantum effects, in a procedure they called “interaction-free measurement”, such bombs can be safely (without triggering the explosion) tested to determine whether a given bomb is armed or not.

We will explore this concept in this post using Q#, but since we do not want to have anything to do with the bombs, we will replace the original thought experiment with something much better - Santa’s gifts! 🎁

dotnet-script 1.4 is out with .NET 7.0 support

This week we released version 1.4 of dotnet-script. The latest release introduces support for .NET 7.0 and C# 11 and is available, as usually, through Github releases and on Nuget. You will need to have at least the .NET SDK 7.0.100 installed.

Making VS Code more accessible (and productive) with custom keybindings

Being involved in the OmniSharp project, I had the pleasure of working a lot with VS Code extension development over the past several years. Given that background, a coworker asked me recently if I had any ideas for improving his user experience with VS Code. In particular, being a screen reader user, he relies heavily on keyboard navigation and being able to quickly move focus between UI elements is critical for his productivity.

VS Code defines a very rich set of commands, to which custom key bindings can be attached, and which can be very helpful in such situations. In fact, through those commands, pretty much any task can be executed exclusively from the keyboard, which can be viewed as very positive from both accessibility and productivity standpoints.

Initiating User Registration via OpenID Connect with Duende Identity Server

There is a new proposal for an extension to OpenID Connect Authentication Framework, called Initiating User Registration via OpenID Connect. It went into public review just last week, which is expected to close later this year.

This very useful extension defines how a client application can indicate to the OpenID Provider that a new user account should be created, rather than triggering the typical login procedure.

In this post we will look at how to support it with Duende Identity Server.

Problem Details responses everywhere with ASP.NET Core and .NET 7

The Problem Details for HTTP APIs RFC provides a unified, machine-readable and standardized recipe for exposing error information out of your HTTP APIs - which is of course beneficial both for the API authors, as well as the integrating parties.

ASP.NET Core has supported problem details since version 2.1, however it was not been uniformly used across all ASP.NET Core components. It was possible to return the Problem Details response manually, or the framework could generate it automatically in several specific cases. Even the official documentation referred to a third-party middleware in order to get a better Problem Details experience.

This is finally changing in .NET 7.

Running Q# and QDK on arm64 Mac

Due to a combination of issues, the current Microsoft.Quantum.Sdk (at the time of writing, version 0.25.222597) does not support arm64 Macs, which of course are the flagship Apple silicon processors from the M1 and M2 family.

Hopefully these issues get resolved soon, but until then, this post will chronicle the necessary workarounds to be able to write Q#/QDK code on arm64 Macs.

Subtle breaking change when adding DbContextPool Entity Framework Core 6

During the upgrade process of one of our applications from .NET Core 3.1 to .NET 6.0, I stumbled across a very subtle breaking changing when using the AddDbContextPool() feature of EF Core. I thought it might be worthwhile to document this, in case someone else is troubled by it too.

Announcing TextMate grammar community project for Q#

I have recently started a new Q# community repo, aimed at bringing a holistic and structured approach for building up Q# TextMate grammar. TextMate grammars are based on regular expressions from the Oniguruma regex engine and are a de-facto standard for syntax highlighting and tokenization for programming languages. Popular editors such as Visual Studio Code or Sublime Text base their syntax highlighting on such grammars. At the moment, the Q# LSP extension ships with a very basic TextMate grammar only, focused on a handful of keywords and specially designated symbol names only.

Announcing my new Q# and quantum computing book

I am extremely happy to announce that on 7 May 2022, my new book, “Introduction to Quantum Computing with Q# and QDK” has been published by Springer, as part of the excellent Quantum Science and Technology series. From now on, you can also see the book in the sidebar of this website. I am extremely proud of this moment - it is the result of almost 2 years of hard work and countless long nights.

Running .NET 7 apps on WASI on arm64 Mac

WASI stands for WebAssembly System Interface, and allows to run WebAssembly code independently of the browsers, as it provides access to operating system features such as file system access or networking. It is highly experimental, but at the same time a tremendously interesting project, and one that has the potential of contributing to a massive paradigm-shift in the industry, making WebAssembly truly ubiquitous.

The great mad scientist of web things at Microsoft, Steve Sanderson, recently published the first version of an experiemental WASI SDK for .NET, which allows building .NET 7 and ASP.NET Core applications into standalone WASI compliant apps, and running them from WASI hosts. Steve’s repo provides the easy to follow steps to get going on Windows and Linux, in this post I will walk through some additional hoops that one may need to jump on arm64 Macs.

About


Hi! I'm Filip W., a software architect from Zürich 🇨🇭. I like Toronto Maple Leafs 🇨🇦, Rancid and quantum computing. Oh, and I love the Lowlands 🏴󠁧󠁢󠁳󠁣󠁴󠁿.

You can find me on Github, on Mastodon and on Bluesky.

My Introduction to Quantum Computing with Q# and QDK book
Microsoft MVP