%qir

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

The Modern QDK only supports the '%%qsharp' magic command.

Summary

Compiles a given Q# entry point to QIR, saving the resulting QIR to a given file.

Description

This command takes the full name of a Q# entry point, and compiles the Q# from that entry point into QIR. The resulting program is then executed, and the output of the program is displayed.

Required parameters

  • __operationName__=<string>: Q# operation or function name. This must be the first parameter, and must be a valid Q# operation or function name that has been defined either in the notebook or in a Q# file in the same folder.

Examples for %qir

Example 1

Compiles a Q# program to QIR starting at the entry point defined as operation RunMain() : Result and display the resulting LLVM IR:

In []: %qir RunMain