35

Wikipedia list of Quantum Computer programming languages (This answer is not a copy of that webpage, it's more updated and with verified links. In some cases the author's paper or website link is added.) Quantum instruction sets Quil - An instruction set architecture for quantum computing that first introduced a shared quantum/classical memory model. See ...


29

Gate model hardware vendors have built out their own low level languages: Rigetti: Quil IBM: QASM These have higher level python sdk's available: Rigetti: Pyquil IBM: Qiskit Rigetti is also wrapping their language in a higher level library for calling pre-built applications called Grove. Microsoft has developed Q# to run against their existing ...


24

The 'Hello World' equivalent in the D-Wave world is the 2D checkerboard example. In this example, you are given the following square graph with 4 nodes:                                   &...


22

You could start with an introduction to quantum computers such as this one from Voxxed Days Vienna 2018 - it's intended for people with a programming background but little to no prior knowledge in quantum mechanics. After that you can check out the guides in the IBM Quantum Experience or those for the Microsoft Quantum Development Kit. In addition to that, ...


19

A simple way to do this is illustrated in Figure 4.10 of Nielsen & Chuang. Where U can be any single-qubit rotation (in this case, an X gate). This circuit works like this: We want to apply U to the target qubit only if the AND of all control qubits is 1. A normal Toffoli gives us the AND of 2 qubits. So by chaining a few Toffolis, we can get c1.c2....


17

I think that quantum programmers won’t necessarily need to know about quantum physics and linear algebra. These are certainly things that will help broaden a quantum programmers knowledge, but they should not be regarded as prerequisites. Even so, most resources to help a budding quantum programmer start with an assumption of linear algebra. The ones that ...


14

There is a really long list of quantum software projects on Quantiki. It's mostly about quantum simulators, quantum compilers and QC programming environments. But you inspired me to start a curated list of open-source quantum software projects on GitHub here. It should not be exclusive to the aforementioned categories but list ANY (reasonable) open-source ...


14

One way of writing quantum programs is with QISKit. This can be used to run the programs on IBM's devices. The QISKit website suggests the following code snippet to get you going, which is an entangled circuit as you want. It is also the same process as in the answer by datell. I'll comment on it line-by-line. # import and initialize the method used to ...


12

Assuming you are considering a gate-based quantum computer, the most easy way to produce an entagled state is to produce one of the Bell states. The following circuit shows the Bell state $\left| \Phi^+ \right>$. By examining $\left| \psi_0 \right>$, $\left| \psi_1 \right>$ and $\left| \psi_2 \right>$ we can determine the entagled state after ...


12

The question is about how many logical qubits it takes to implement Shor's algorithm for factoring an integer $N$ of bit-size $n$, i.e., a non-negative integer $N$ such that $1 \leq N \leq 2^n{-}1$. The question is a poignant one and not easy to answer as there are various tradeoffs possible (e.g., between number of qubits and circuit size). Executive ...


11

I don't think there is a single golden resource which can you provide you all the necessary knowledge. But I could suggest a pathway (or schematic study guide in your words): If your aim is to create a new quantum programming language I'd rather say you should thoroughly learn an existing quantum programming language first along with the basic concepts of ...


11

You can implement the phase shift gate $$P_h(\theta) = \begin{pmatrix}e^{i\theta} & 0\\0 & e^{i\theta}\end{pmatrix}$$ with the X and u1 gate from the IBM Q chips: $$ \begin{align} P_h(\theta) &= U_1(\theta)\ X\ U_1(\theta)\ X \\ &= \begin{pmatrix}1 & 0\\0 & e^{i\theta}\end{pmatrix} \begin{pmatrix}0 & 1\\1 & 0\end{pmatrix} \...


9

The title and question body seem to ask two different questions. In the title you ask "How do you write a simple program for a D-Wave device?", while in the question body you ask how to find the ground states of a simple 2D Ising model using the underlying hardware of the D-Wave device, and what the corresponding code would be (which is a more specific ...


9

Here is a quick list of notable differences between analog and quantum computers: Analog computers can't pass Bell tests. The state space of an analog computer with N sliders is N dimensional. The state space of a quantum computer with N qubits is $2^N$ dimensional. Error correct an analog computer and what you've got is a digital computer (i.e. not ...


9

A conventional Hamiltonian is Hermitian. Hence, if it contains a non-Hermitian term, it must either also contain its Hermitian conjuagte as another term, or have 0 weight. In this particular case, since $Z\otimes X\otimes Y$ is Hermitian itself, the coefficient would have to be 0. So, if you're talking about conventional Hamiltonians, you've probably made a ...


9

Yes, it is possible to obtain this information, but only for troubleshooting purposes, not for using it in the code. Dump functions dump the status of the target machine into a file or to the console output. If the program is executed on the full-state simulator, this status will include the wave function of the whole system (for DumpMachine) or of the ...


8

There are lots of startups, many of which have no hardware efforts. Here is a selection, distinguished only by the fact that I have heard of them at least once. artiste.qb Cambridge Quantum Computing Horizon Q-Ctrl Quantum Benchmark Q$^x$ Branch Strangeworks Zapata There are also QISKit and ProjectQ. Though not startups, they also deserve a mention as ...


8

I want to add a method that does not use ancilla qubits, but does require gates more complicated than just controlled-not. I believe this method was first presented by Barenco et. al. in this paper, Lemma 7.5: Where $V^2=U$. In this case, one wants that $V^2=X$, and hence $$ V = \frac{1}{2} \begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i \\ \end{pmatrix} \ ....


8

QuantumProgram was removed in Qiskit 0.6.0. (Release Notes) Your example code is likely for an older version. You can either install Qiskit 0.5.7, or find an updated Shor's Algorithm example.


7

Rigetti is not just a hardware company. It also builds quite a bit of software -- check out Forest, which gives access to both a simulator and a quantum computer via the cloud PyQuil, a Python library for programming quantum computers Grove, a Python library of quantum algorithmic primitives Forest OpenFermion, a library to interface OpenFermion with ...


7

GridQubit has comparison methods defined, so sorted will give you a list of the qubits in row-major order: >>> sorted(cirq.google.Foxtail.qubits) [GridQubit(0, 0), GridQubit(0, 1), [...] GridQubit(1, 9), GridQubit(1, 10)] Once you have that, you're one list comprehension away: >>> [(q.row, q.col) for q in sorted(cirq.google.Foxtail....


7

The languages themselves are all essentially the same for a new user. They all implement the same basic set of quantum operations, which are the ones that have been used by researchers for the last few decades. If you’ve just started programming, the most relevant factor for you might be the language that the quantum SDK that is written in. They are mostly ...


7

Your question remains very unclear as to what it actually is that you want to calculate. There is no direct correspondence between a system Hamiltonian and the quantum state of the system. No matter what the Hamiltonian, any quantum state is a valid state of the system. Where a Hamiltonian comes in useful is, if you know the state at some time (say, $t=0$),...


7

1) While defining a circuit on QISkit, does q[0] always correspond to the same qubit on a device (e.g. the qubit labeled q0 on the device manual)? If so, how can I only use for example qubit 12 and 13 of ibmq_16_melbourne (just as an example)? Quick answer: not always. The way Qiskit works with quantum circuit and backends is: Generate the quantum ...


7

Unfortunately, there is indeed currently no way to generate circuit diagrams from a Q# program. Since this is a feature request, consider making it here: https://quantum.uservoice.com/forums/906940-debugging-and-simulation. To give a little bit of context, Q# makes a conscious effort to encourage reasoning about quantum algorithms in terms of control flow ...


7

I will try answering this way but I have not tried it myself. Just reverse engineering reading the code with a few notions of HTML request. Let us assume in the language of your choice, you have the ability to send HTTP requests via GET and POST methods. The api_url is https://quantumexperience.ng.bluemix.net/api/. To submit a job, you will send a POST ...


7

Yes, that notation means the Hadamard on the second qubit depends on the first qubit and the Hadamard on the third qubit depends on the first qubit. The gates aren't connected to each other in any way.


6

I’d suggest you reflect upon whether goal of "making a new quantum programming language" is suitable at this point in the development of quantum computation. It is not the most common approach, since mostly we are still at the stage of thinking in terms of what is essentially machine language. When we create algorithms, the level at which this is done is ...


6

I think you can use the initialize function as detailed at the section "Arbitrary Initialization" at this tutorial. As an example, this tutorial explicitly shows how to initialize the three qubit state $$ \frac{i}{\sqrt{16}} | 000 \rangle + \frac{1}{\sqrt{8}} | 001 \rangle + \frac{1+i}{\sqrt{16}} | 010 \rangle + \frac{1+2i}{\sqrt{8}} | 101 \rangle + \frac{...


Only top voted, non community-wiki answers of a minimum length are eligible