IQ# Magic Commands

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.

Magic Command Summary
%azure.connect Connects to an Azure Quantum workspace or displays current connection status.
%azure.execute Submits a job to an Azure Quantum workspace and waits for completion.
%azure.jobs Displays a list of jobs in the current Azure Quantum workspace.
%azure.output Displays results for a job in the current Azure Quantum workspace.
%azure.quotas Displays a list of quotas for the current Azure Quantum workspace.
%azure.status Displays status for a job in the current Azure Quantum workspace.
%azure.submit Submits a job to an Azure Quantum workspace.
%azure.target Sets or displays the active execution target for Q# job submission in an Azure Quantum workspace.
%azure.target-capability Sets or displays the active target capability level for compiling Q# functions and operations.
%check_kata Checks the reference implementation for a single kata's test.
%chemistry.broombridge Loads and returns Broombridge electronic structure problem representation from a given .yaml file.
%chemistry.encode Encodes a fermion Hamiltonian to a format consumable by Q#.
%chemistry.fh.add_terms Adds terms to a fermion Hamiltonian.
%chemistry.fh.load Loads the fermion Hamiltonian for an electronic structure problem. The problem is loaded from a file or passed as an argument.
%chemistry.inputstate.load Loads Broombridge electronic structure problem and returns selected input state.
%config Allows setting or querying configuration options.
%debug Steps through the execution of a given Q# operation or function.
%experimental.build_info Reports build info for the experimental simulators.
%kata Executes a single test.
%lsmagic Returns a list of all currently available magic commands.
%lsopen Lists currently opened namespaces and their aliases.
%noise_model Gets, sets, saves, or loads a noise model used in simulating quantum operations.
%package Provides the ability to load a NuGet package.
%performance Reports current performance metrics for this kernel.
%project Provides the ability to view or add Q# project references.
%qir Compiles a given Q# entry point to QIR, saving the resulting QIR to a given file.
%simulate Runs a given function or operation on the QuantumSimulator target machine.
%simulate_noise Runs a given function or operation on the OpenSystemsSimulator target machine.
%simulate_sparse Runs a given function or operation on the sparse simulator.
%toffoli Runs a given function or operation on the ToffoliSimulator target machine.
%trace Visualizes the execution path of the given operation.
%who Lists the Q# operations available in the current session.
%workspace Provides actions related to the current workspace.