39

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 ...


31

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 ...


25

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:                                   &...


24

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, ...


20

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 ...


15

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 ...


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

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 ...


13

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

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} \...


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

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 ...


11

You can build your gate with Operator and unitary function e.g: from qiskit import QuantumCircuit, QuantumRegister from qiskit.quantum_info.operators import Operator controls = QuantumRegister(2) circuit = QuantumCircuit(controls) cx = Operator([ [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0] ]) circuit.unitary(cx, [0, 1], label='cx'...


10

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

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

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} \ ....


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 ...


9

I don't think you need to know quantum physics to understand quantum computing - similarly to how you don't think about the hardware implementation of the classical computers when you write high-level code for them. The field of quantum computing has grown to the point where one cannot really teach all of it in one course, so different approaches to ...


8

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 ...


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

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 ...


8

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$),...


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

Most textbooks and lecture courses start with solving the Deutsch problem using quantum computing. Parts 1 to 4 of John Watrous's lecture notes will describe the concepts, starting from basics. By the end of lecture 4, you will have learned how a quantum computer can solve the Deutsch problem with fewer operations than a classical computer would need: ...


7

What work has been done on the mapping of quantum phenomena to analog computing, and learning from that analogy? A starting place (with a lot of good references) to learn about analog quantum computing (also known as "quantum analogue computing" and "continuous variable quantum computing") is here. Note that analog classical computing is not as powerful as ...


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 time that you see in the result data structure is recorded by the device itself, so it is the running time of your experiment. It does not include the time spent processing your circuit in Qiskit, or the time spent by your job in the queue. That being said, here is a rough breakdown of this time (ballpark durations): 1) Loading the experiment into the ...


7

Let $g_1 \cdots g_M$ be the basic gates that you are allowed to use. For the purposes of this $\operatorname{CNOT}_{12}$ and $\operatorname{CNOT}_{13}$ etc are treated as separate. So $M$ is polynomially dependent on $n$, the number of qubits. The precise dependence involves details of the sorts of gates you use and how $k$-local they are. For example, if ...


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