Q# is a domain-specific programming language used to express quantum algorithms. This tag should be used for questions related to creating/programming quantum algorithms using the 'Q#' language. If the question is unrelated to, or arising from some non-quantum aspect of Q#, it might be better to ask on StackOverflow. If appropriate, also use the [programming] tag.
Questions tagged [q#]
163 questions
15
votes
1 answer
How many logical qubits are needed to run Shor's algorithm efficiently on large integers ($n > 2^{1024}$)?
First, I know there are differences in logical qubits and physical qubits. It takes more physical qubits for each logical qubit due to quantum error.
Wikipedia states that it takes quantum gates of order $\mathcal{O}((\log N)^2(\log \log N)(\log…
LeWoody
- 924
- 1
- 8
- 14
12
votes
3 answers
Big Endian vs. Little Endian in Qiskit
I've noticed that Q# favors Little Endian. Meaning that most operations are designed for this type of encoding.
Is is it the same with Qiskit?
Sorin Bolos
- 621
- 5
- 11
10
votes
1 answer
Ground state energy estimation - VQE vs. Ising vs. Trotter–Suzuki
Disclaimer: I am a software engineer who is curious about quantum computing. Although I understand some basic concepts, theory and math behind it, I am by no means experienced in this domain.
I am doing some preliminary research on the state of…
Anurag Bhandari
- 203
- 1
- 6
9
votes
2 answers
Can we perform quantum mechanical simulations using a quantum computer?
I'm a computer science major who's really keen on physics and quantum mechanics. I have started learning about Q# and D-Wave, but I just wanted to know if it's possible to test quantum mechanical theories using quantum computers.
If so, then what…
Yashank
- 263
- 1
- 4
8
votes
2 answers
How does one obtain amplitude information in Q#?
Is it possible to obtain amplitude information (in lexicographic ordering) for a particular qubit register in Q#?
For example, in the following code:
operation GetProbabilityAmplitude() : Double[]
{
body
{
mutable result = new…
jman
- 453
- 2
- 9
7
votes
2 answers
How to construct the "Inversion About the Mean" operator?
It seems like it should be simple, based on how Nielsen and Chuang talk about it, but I cannot seem to correctly implement the Inversion About the Mean operator ($2|\psi\rangle \langle\psi| - \mathcal{I}$) that is used in the Grover search…
nikojpapa
- 501
- 3
- 9
7
votes
3 answers
How do you send an array of qubits to an operation in Q#?
I have the following operation in my .qs files:
operation myOp(qubits: Qubit[]) : () {
// uses elements from the qubit array
}
How do I send an array of qubits to this in the driver file?
The following did not work:
Qubit[] qubits =…
Mahathi Vempati
- 1,731
- 10
- 21
7
votes
2 answers
From Q# measurements to Bloch sphere
I would like to represent the state of a qubit on a Bloch sphere from the measurements made with Q#.
According the documentation, it is possible to measure a qubit in the different Pauli bases (PauliX, PauliY, PauliZ). This returns Zero if the +1…
JRial95
- 93
- 7
7
votes
1 answer
Q# Simulation Behavior
I am attempting to run a series of tests on a Q# program I'm running on the local simulator, but I'm not seeing any way to use >1 shot and collect the results of those shots at once, as in essentially every other quantum language/system I've seen.…
Xavier McCaig
- 153
- 5
6
votes
2 answers
Quantum counting in Q#
I cannot seem to get an estimate for the number of solutions using the quantum counting algorithm described in Nielsen and Chuang, i.e. phase estimation with the Grover iteration acting as $U$.
I try doing the following with control and target as…
nikojpapa
- 501
- 3
- 9
6
votes
3 answers
Simulator-dependent implementations in Q#
I have a Q# operation:
operation init_and(a: Qubit, b: Qubit, target: Qubit) : Unit is Adj {
// Uncomment this when using Toffoli simulator.
// CCNOT(a, b, target);
// Uncomment this when doing resource estimates.
…
Craig Gidney
- 44,299
- 1
- 41
- 116
5
votes
3 answers
Overview of Cirq, qiskit, q#, ibmq(circuit board), other
What is the difference between these frameworks or languages? What are the pros and cons of each of these? Do you know any similar framework/platform/language that gives some more advantages?
Rishwi binnu
- 173
- 2
- 10
5
votes
1 answer
How to see the QASM code corresponding to compiled Q# function?
I'm learning Q#. Is there any way to see the QASM code of a Q# function I write, the same way I can see the disassembly of a C# function?
GideonMax
- 153
- 3
5
votes
2 answers
How do I produce circuit diagrams from a Q# program?
If I implement an adder operation in Q#, I'd like to see a quantum circuit diagram of what that adder is doing in order to check that it looks right. Is there a built-in way to do this?
Craig Gidney
- 44,299
- 1
- 41
- 116
5
votes
2 answers
Finding the maximum number of Q# simulatable qubits
I'm new to Q# and I was curious on how one would find the number of Q# simulatable qubits for a specific machine. I know Microsoft has an approximation of 16GB ~ 30 qubits but I wanted a better estimation for my own machines.
I wrote this quick…
jman
- 453
- 2
- 9