Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

Multi controlled X (in general multi controlled Unitary) in QSharp

qiskit provide a way to apply a multicontrolled X gate (or in general any multicontrlled unitary) for exmaple the below code snippet apply the X gate on qubit dif , controlled on qubits present in ...
razeen shuja's user avatar
0 votes
1 answer
47 views

Q-sharp syntax error in quantum HHL algorithm

Here is a snippet of a code I am writing in Q#(QDK by Microsoft) trying to program the HHL algorithm. operation PrepareBState(register: Qubit[], coefficients: Double[]): Unit is Adj + Ctl { ...
Mark Noel's user avatar
0 votes
1 answer
91 views

Microsoft.Quantum.Oracles not found in VS Code in Azure Quantum SDK

My problem is that in Visual Studio Code, using Azure Quantum QDK (Q#) when I try to use Microsoft.Quantum.Oracles, it is not found. I have a Windows 11 machine: Edition Windows 11 Pro Version 22H2 ...
Peti's user avatar
  • 37
0 votes
1 answer
65 views

why is the output of Message and return result different in this Q# example?

I hope this is not a duplicate question or something I could have answered on my own. I was not able to find any answer to my question. I asked Microsoft copilot to explain the difference and it ...
tatmanblue's user avatar
  • 1,217
0 votes
1 answer
22 views

MeasureAllZ result comparison

use (qn, q2) = (Qubit[n], Qubit()); ..... let result = MeasureAllZ(qn); if (result != Zero) { set isConstant = false; } I have this very simple q# snippet. When I try to run it on Azure using ...
Steve's user avatar
  • 11.9k
0 votes
2 answers
104 views

Syntax for creating immutable array in Q#

I'm trying to run this example from https://learn.microsoft.com/en-us/azure/quantum/user-guide/language/statements/variabledeclarationsandreassignments.The compiler tells me that syntax for the array ...
Fourben's user avatar
-1 votes
1 answer
253 views

Install Quantum Development Kit (QDK) in Ubuntu, without conda

I mean to use QDK in Ubuntu 22.04LTS. I have a virtualenv, but no conda. I installed qsharp in my venv with $ pip3 install qsharp but then $ python -c "import qsharp" IQ# is not installed. ...
sancho.s ReinstateMonicaCellio's user avatar
0 votes
1 answer
51 views

QS5026 - The variable cannot be reassigned here

I'm following tutorial from the official Microsoft learning page (https://learn.microsoft.com/en-us/azure/quantum/tutorial-qdk-explore-entanglement?pivots=ide-azure-portal) about quantum entanglement. ...
Sabriael's user avatar
  • 382
0 votes
0 answers
121 views

%debug magic command not working in the Q# Jupyter Notebook environment

As per the documentation provided by Microsoft Azure Quantum at this link , I followed the steps given and installed Q# with Jupyter Notebook, using Anaconda. I then wrote the following Q# program in ...
NotTheRealV's user avatar
0 votes
1 answer
202 views

Get a sequence of numbers in Q#

I would like to get a list of a mathematical sequence in Q#, but I have an error that I can't solve. I use Azure Quantum to deploy the code in a Notebook. Here is what I do: First I connect to Azure ...
cypolo's user avatar
  • 37
2 votes
0 answers
569 views

VS Code installing a specific .NET SDK version

Is there anyway you can get VS Code to install a specific .NET SDK version that you have used in an old application? I have an old Q# app that uses SDK version 3.1.416 with netcoreapp 3.1 but I don't ...
Dina M.'s user avatar
  • 329
1 vote
1 answer
1k views

Why Pauli Z can be used to measure a single qubit ?

According to the Q# documentation, a single qubit can be measured by M.The method uses Pauli-Z. But why Pauli Z can be used to measure a single qubit? I have known the matrix of Pauli-Z like below: ...
W.xueshan's user avatar
0 votes
1 answer
50 views

What's the meaning of type 'd in q#

As shown in the picture above. What's the meaning of type 'd? What's type the return value of "Zipped" should be?
W.xueshan's user avatar
0 votes
1 answer
103 views

where can I get the detailed tutorial or document for Q# machine learning

Recently, I'm learning the Q# language for machine learning. The sample of half-moons has been run correctly. Now I want to learn the detail of the code. But there is too little explanation to find. ...
W.xueshan's user avatar
1 vote
1 answer
36 views

Result and IQArray could not be found

I am following this MS tutorial to add functionality to my Q#/C#host project. However, I get two errors on my operations: The type or namespace name 'Result' could not be found (are you missing a ...
Muhy's user avatar
  • 708

15 30 50 per page
1
2 3 4 5
9