We’re rewarding the question askers & reputations are being recalculated! Read more.
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 ...


11

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


10

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

Here is a SQRT(SWAP) construction which only requires CNOTs in one direction, Hadamards, S gates ($Z^{\frac{1}{2}}$), inverse S gates ($Z^{-\frac{1}{2}}$), T gates ($Z^{\frac{1}{4}}$) and inverse T gates ($Z^{-\frac{1}{4}}$): You should be able to encode it directly into the composer.


8

You won't find the barrier in quantum computing textbooks because it isn't a standard primitive of quantum information theory like unitary gates and quantum circuits. The barrier as a directive for circuit compilation to separate pieces of a circuit so that any optimizations or re-writes are constrained to only act between barriers (and if there a no ...


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


6

Cancel Job is only available for the IBM Q Network, not for IBM Q Experience: https://github.com/QISKit/qiskit-api-py/blob/master/IBMQuantumExperience/IBMQuantumExperience.py#L795 In the next weeks, we hope that it is available for IBM Q Experience too. Regarding to the credits... we are analyzing the problem. We have refilled your credits. If you have ...


6

According to the QISKit documentation, tdg(q) applies the Tdg gate to a qubit. $T$ is the basically the $\pi/8$ phase shift gate whose matrix representation considering standard (computational) basis is: $$\left(\begin{matrix}1 & 0 \\ 0 & e^{i\pi/4}\end{matrix}\right)$$ Tdg is simply the conjugate transpose of the matrix $T$ i.e. $T^{\dagger}$, ...


6

There isn't much of a difference. If you read the labels, the values are roughly the same but for some reason are presented in a different order. Any differences for a given value are due to noise and decoherence.


5

When mapping a circuit to a quantum device using Qiskit, the choice of which virtual qubits (the ones in your circuit) get mapped onto which physical (device) qubits depends on whether you let qiskit decide or you implement your own initial_layout. By default, qiskit will pick the most connected subset of the device graph that fits your circuit. These ...


5

There are several ways that you could realise the depolarising map $ \mathcal N_p(\rho) = (1\!-\!p)\:\!\rho + p \!\!\:\cdot\!\tfrac{1}{2}\mathbf 1$ map on a quantum computer — including an idealised quantum computer, in which waiting around for the noise to do the work for you would not be an available method.$\def\ket#1{\lvert#1\rangle}$ We start ...


5

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


5

You can make controlled $R_y$ gates from cnots and $R_y$ rotations, so they can be be done on any pair of qubits that allows a cnot. Two examples of controlled-Ys are shown in the image below. They are on the same circuit, one after the other. The first has qubit 1 as control and qubit 0 as target, which is easy because the cnots can be directly ...


5

For the first question, you can use qc.add(ancillas) Note that this will change to add_registers in Qiskit Terra 0.7.0. Some more guidance on how to combine and extend circuits, you can see this guide. Note that this is for the upcoming 0.7.0 release, but you can already get the functionality with pip install git+https://github.com/Qiskit/qiskit-terra....


5

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


5

It depends on what you mean by "able to handle". You mention a circuit depth of 99, which might be possible, but what will be the fidelity of the final state with respect to the one it's supposed to be (assuming no decoherence)? If your fidelity requirement is close to 100%, the maximum circuit depth that the IBM machines can handle, is zero (try just ...


5

I'm afraid it is not possible to remove states from a superposition that you do not want. At least, not easily. If it were, a lot of computationally hard problems would become much easier, since you could just create a huge superposition and then weed out all the non-solutions to your problem. There are ways to do it, however. But they always come with a ...


5

The function that handles this is transpile(), which could be found in qiskit.compiler. When you call transpile(circuit, backend) it goes through the compilation process for the input circuit based on the backend you provide. It returns a new circuit that will be valid to run on the provided backend. You can then view this new circuit just like you would ...


5

Qiskit implements a transpiler which optimizes the circuits that you provide. This means it modifies the circuit so that it can be run on the backend and also optimizes it so that anything that can possibly be run in parallel is done so. To run with the maximum level of optimization you can run execute(circuit, optimization_level=3). There is more ...


5

The issue is that you are applying operations after measurement gates and this is currently not available on the real hardware. I think the hardware also does not support reset operations mid-way through a circuit at the moment. The best way forward is to keep running this on the simulator or try to find a different way of expressing the circuit such that ...


4

The simplest quantum program I can think of is a (1-bit) true random number generator. As a quantum circuit, it looks like this: You first prepare a qubit in the state $|0 \rangle$, then apply a Hadamard gate to produce the superposition $\frac{\sqrt{2}}{2} ( \left| 0 \right> + \left| 1 \right> )$ which you then measure in the computational basis. The ...


4

I am answering my question. After some google search, I found this image showing CCZ gate by CNOT, T dagger, and T gate. I tried this on IBM Q and it worked. I want to explore why it works but that's another story. For someone who is interested, here is my quantum circuit of Grover's algorithm finding |111> with one iteration.


4

The publicly available IBM devices don't yet have the connectivity to realize quantum error correcting codes that both detect and correct a full set of quantum errors. But we can certainly do proof-of-principle experiments on the tools and techniques required. Here are the experiments I know of Error correction experiments done (or doable) on a 5 qubit ...


4

The pure quantum state that satisfies your conditions is the W state in three qubits, $$ \frac{1}{\sqrt{3}} \left(|001\rangle + |010\rangle + |100\rangle \right) $$ You can look at this answer for a high level circuit to construct this. The first gate in that circuit is a single qubit gate that effects the transformation, $$ |0 \rangle \rightarrow \frac{...


4

I was able to reproduce your issue by changing the key a few times... seems to be a bug. Either way, I was able to resolve my issue by removing the qiskitrc file. rm ~/.qiskit/qiskitrc (your location may vary) After that, set the key again and you should be good.


4

We should generally think of QASM as agnostic to timing. Time is not represented anywhere in a quantum circuit diagram. The wires between circuit operations simply represent a quantum state. I could move the CNOTs as far to the right as I want in your diagram, or generally modify any spacing between any operations however I like, and the circuits would be ...


4

There is not anything that you cant do with U3 so ideally there is no reason for U1 and U2. Eventually, as the transpilers gets better we may remove them and just have U3 and CNOT. So why did we make U1 and U2? It is because of the hardware. The U1 is done using a frame change (see https://arxiv.org/abs/1612.00858) which means they are done in software (...


3

The kinds of people that use these devices are affiliated with companies, quantum startups, or the IBMQ Hubs (in Oxford, Keio, Melbourne, ... ). The process is more involved than a simple web sign-up. If you are a company and want to get the process started, you can use this web form, or try to ping someone important on the Qiskit Slack. If you are neither ...


3

For amplitude damping, $\gamma$ is something like $e^{-\Delta t/T_1}$ where $\Delta t$ is how long the Kraus operator is supposed to act. But be very careful, Kraus evolution assumes your system has no initial correlations, that every qubit interacts with identical baths and that every qubit is identical. All the assumptions are most likely violated and so ...


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