I figured it out (-:
In a cell before matic command is used, one have to do this:
import qsharp
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I try to run a quantum notebook in Azure Quantum Workspace.
The note bokk is Python 3.
I would like to run a single cell in Q# mode, e.g. I type "%%qsharp"
But I'm getting:
UsageError: Cell magic %%qsharp
not found.
??
shouldn't it be possible to switch between Python and Q# back and forth in same notebook?
BR
Bjorn
I figured it out (-:
In a cell before matic command is used, one have to do this:
import qsharp
Hello, @BjornD Jensen !
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others (Opens in new window or tab)", I'll repost your solution in case you'd like to "Accept (Opens in new window or tab)" the answer.
Issue:
I'm running a quantum Python 3 notebook in Azure Quantum Workspace, but I'm getting a UsageError: Cell magic %%qsharp
not found when trying to run a single cell in Q# mode, (e.g. I type "%%qsharp"). Shouldn't it be possible to switch between Python and Q# back and forth in same notebook?
Solution (by BjornD Jensen):
I figured it out (-: In a cell before matic command is used, one have to do this:
import qsharp