Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [quantum-programming]

For questions relating to the process of assembling quantum programs that can be executed on a quantum computer.

-5
votes
0answers
35 views

Web server on a quantum computer [on hold]

After installing a Web server on a quantum computer which website language should I use to build the web pages? For example PHP, Python or HTML.
1
vote
2answers
44 views

Is it possible to create controlled gates with an exponent in Cirq?

Is it possible to create controlled gates with an exponent in Cirq? For example, a controlled $\sqrt Z$ gate.
3
votes
1answer
71 views

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 ...
3
votes
2answers
60 views

Why do $n$ inputs to a ket give a vector of dimension $(2^n,1)$?

NB - notation from Octave. I understand that ket([0]) is the $(1,0)$ in a $(x,y)$ plane. But when I try a ket with three numbers I get a column vector of dimension $(8,1)$. I assume that comes ...
3
votes
1answer
75 views

Are there any test examples of Octave and Quantum Entanglement?

I read this research paper. I have octave and the package running. This is an example of what I did so far - octave:3> s1 = state(normalize(ket([1,0])+ket([0,1]))) s1 = 0.00000 0.00000 0....
7
votes
0answers
69 views

Is it better to use fewer gates or fewer working qubits? [closed]

I have a script that takes a while to simulate. I can modify it in such a way where I can use fewer qubits at a time, but it will require more iterations of manipulation. I believe this will cut down ...
1
vote
0answers
65 views

How to observe quantum entanglement? [closed]

I am using MS Vcode for development along with Google Cirq framework for Quantum programming. How can I observe the quantum entanglement using classical computing? I manage to create Circuit, append ...
1
vote
0answers
18 views

How to compute the tensor product in QCL?

When I look at QCL (the documentation of the language begins in chapter 3) I don't see a way to compute the tensor product between two q-bits. Is the programming operator ...
2
votes
1answer
55 views

How to make “random U3” in QASM?

I want to make an operator: $\mathrm{U3}(\arccos(\sqrt p),0,0)$, when $p$ is a random value between $0$ and $1$ How do I write code in QASM language of this "random $\mathrm{U3}$" operator?
2
votes
2answers
237 views

How do I construct a Density Matrix corresponding to a Hamiltonian?

I have a Hamiltonian and I want to know the corresponding density matrix. The matrix I'm interested in is the one in this question.
5
votes
1answer
58 views

Flying qubits compared with stationary qubits

In a previous question I asked how stationary bits could be processed by logic gates. I casually mentioned that I could visualize qubits traversing stationary logic gates, and @DaftWullie said “It ...
3
votes
1answer
46 views

How can I resolve the error QISkit Error: The same provider has already been registered!

I am writing a small algorithm to multiply two numbers using IBM's QISkit. The code is below: times_shell.py ...
3
votes
2answers
63 views

Where is the problem stored in a quantum computer?

I am trying to develop a more intuitive understanding of quantum computing -- I suppose Feynman would tell me that’s impossible! Let’s try: if we are trying to find the minimum of a surface or ...
3
votes
1answer
71 views

Confusion over tensor products in sympy.physics.quantum.qubit (in Python)

I am working with sympy.physics.quantum.qubit to help teach myself more about quantum computing. I'm confused about how best to simplify two ket expressions that ...
1
vote
1answer
111 views

How to add two integers in Q#?

I have programmed in C++, but I am interested in writing quantum programs. I have some experience with Microsoft's Q#, and I know about the canonical Shor's and Grover's algorithms. Can anyone tell ...
11
votes
3answers
207 views

Which programming language is suitable for a beginner?

I understand there are a lot of programming languages (e.g Q#, Qiskit, etc.) Which one is suitable for someone that just started learning programming and don't know anything about quantum mechanics?
4
votes
2answers
61 views

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: ...
9
votes
2answers
239 views

Automatic compilation of quantum circuits

A recent question here asked how to compile the 4-qubit gate CCCZ (controlled-controlled-controlled-Z) into simple 1-qubit and 2-qubit gates, and the only answer given so far requires 63 gates! The ...
6
votes
2answers
344 views

Possibility of a “reset” quantum gate

I wish to have a "reset" gate. This gate would have an effect to bring a qubit to the $\mid0\rangle$ state. Clearly, such a gate is not unitary (and so I'm unable to find any reliable implementation ...
5
votes
1answer
312 views

List of qubit locations with cirq

As far I understand, qubits in cirq are labelled by their positions on chip. For example print( cirq.google.Foxtail.qubits ) yields ...
12
votes
4answers
313 views

Are quantum computers just a variant on Analog computers of the 50's & 60's that many have never seen nor used?

In the recent Question "Is Quantum Computing just Pie in the Sky" there are many responses regarding the improvements in quantum capabilities, however all are focussed on the current 'digital' ...
5
votes
3answers
128 views

Checking value of variable using quantum approach

A beginner question after watching few videos. Say, var=a; var can be either of two values, ...
3
votes
2answers
144 views

Components for realizing a photonic CNOT gate

In Realization of a photonic CNOT gate sufficient for quantum computation FIG. 1 there is a "scheme to obtain a photonic realization of a CNOT gate with two independent qubits." What components are ...
7
votes
1answer
197 views

Changing indices of qubits in QISKit

I was wondering if something like this is possible in QISKit: let's say we have two registers containing target and ancilla qubits: $a_0$ ------------------- $a_1$-------------------- $\vdots$ $...
6
votes
1answer
384 views

Resources for quantum algorithm basics

I have just started to learn about quantum computing, and I know a little bit about qubits. What is a resource where I can learn a basic quantum algorithm and the concepts behind how it works?
5
votes
1answer
313 views

What is Qconfig in QISKit and how do I set it up?

To use certain things in QISKIt, such as acessing the real quantum processors, it seems that there is a file 'Qconfig.py'. That needs to be set up. How do I do this?
6
votes
0answers
40 views

Gradient boosting akin to XGBoost using a quantum device

I am currently trying to implement a boosting algorithm akin to XGBoost with a quantum device. The reason is that I want to make use of a quantum device to train weak classifiers. However, as far as I ...
6
votes
1answer
78 views

Why does job.running in QISKit output False, even if the job is still running?

I submitted a job in the 0.5.0 version of QISKit using job = execute(qc, 'ibmqx5', shots=shots) This just submits the job, and does not wait for a result. I ...
11
votes
3answers
338 views

Are there any quantum software startups?

I am aware of the quantum hardware startup Rigetti and I wonder if there are any quantum startups that build software on top of current quantum computer hardware for commercial applications? Related ...
8
votes
2answers
337 views

Does a study guide exist that starts from a “purely CS background” and advances towards “making a new quantum programming language”?

I am from a computer science background and I find it difficult to decide on the resources I should focus on while learning quantum computing, since there is so much to read/watch. My ultimate goal is ...
12
votes
1answer
341 views

Does a complete list of open quantum software projects exist?

An answer to Is there any source which tabulates quantum computing algorithms for simulating physical systems? mentions the Quantum Algorithm Zoo, a list of quantum algorithms. Several answers to ...
9
votes
3answers
392 views

A sample quantum algorithm, useful for demonstrating languages

I'm looking for a quantum algorithm which I can use to demonstrate the syntax of different quantum-languages. My question is similar to this, however, for me, "good" means: What it does could be ...
9
votes
2answers
267 views

What real Quantum Computers are available for students to use?

I am aware that IBM, Rigetti, and Google have built some small-scale devices. Which of them are available for access by an undergraduate student? For how long? With how many qubits?
5
votes
0answers
77 views

Does the Curry-Howard correspondence have a quantum-specific type system?

In Wikipedia we can read that the Curry–Howard correspondence is a correspondence between formal proof calculi and type systems for models of computation. In particular, it splits into two ...
6
votes
1answer
92 views

How does the Curry-Howard correspondence apply to quantum programs?

In words of Wikipedia, The Curry–Howard correspondence is the observation that two families of seemingly unrelated formalisms—namely, the proof systems on one hand, and the models of computation ...
42
votes
5answers
3k views

What programming languages are available for quantum computers?

From this question, I gathered that the main quantum computing programming languages are Q# and QISKit. What other programming languages are available for programming quantum computers? Are there ...
21
votes
3answers
1k views

How do you write a simple program for a D-Wave device?

I would like to know how a job for a D-Wave device is written in code and submitted to the device. In the answer it would be best to see a specific example of this for a simple problem. I guess that ...
13
votes
3answers
573 views

What would a very simple quantum program look like?

After reading the "first programmable quantum photonic chip". I was wondering just what software for a computer that uses quantum entanglement would be like. Is there any example of code for specific ...
35
votes
6answers
965 views

Programming quantum computers for non-physics majors

I come from a non-physics background and I am very much interested in pursuing Quantum Computing - especially how to program them. Any guidance on how to get started will be very helpful.