New answers tagged

0

Lets start with measuring circuits. With link to user245427 answer, you should construct following circuits in composer followingly: T1 (relaxation time) T1 is constant connected with spontaneous relaxation from state $|1\rangle$ to state $|0\rangle$. So firstly apply $X$ gate on a qubit to change its state from $|0\rangle$ to $|1\rangle$, then apply a few ...


1

In addition to backend.properties() described above, you can go to https://quantum-computing.ibm.com, click a machine, then click "Download Calibrations".


3

The length of all backend basis gates is available from backend.properties().gate_length. For example properties = backend.properties() id_gate_length_qo = properties.gate_length('id', 0)


2

I cannot give you a complete answer(I am not too familiar with the IBM quantum tools) however I might be able to give you a few hints from a NMR/EPR perspective. In magnetic resonance T2 is commonly measured by generating a spin coherence, and refocusing at progressively longer times then measuring a spin echo. In quantum gate language that would be: ...


2

The 53 qubit Rochester machine is available to members of the IBM Q Network only. Currently there are eight systems available to the public via the IBM Quantum Experience and by extension the Qiskit framework. The largest of these systems is currently 15 qubits.


0

An open question is whether IBM has created a single 53-qubit chip, or if they are mass-producing the 53-qubit chip. Based on press accounts, it appears that there is only a single chip, and that is a research machine. MIT Technology Review reports that the new computer will be made available for researchers and companies through the Internet (which TR ...


0

I think this snippet from Cirq's Deutsch's algorithm example (disclosure: I am its author) should be fairly easy to understand: def make_oracle(q0, q1, secret_function): """ Gates implementing the secret function f(x).""" # coverage: ignore if secret_function[0]: yield [CNOT(q0, q1), X(q1)] if secret_function[1]: yield CNOT(...


1

I implemented them as a "subcircuit" so it looks "hidden" from the "outside". constant 0: input = QuantumRegister(1, name='input') temp = QuantumRegister(1, name='temp') constant0 = QuantumCircuit(input, temp, name='oracle') oracle = constant0.to_instruction() identity: input = QuantumRegister(1, name='input') temp = QuantumRegister(1, name='temp') ...


1

@cgranade and I have a chapter on the Deutsch-Jozsa algorithm (Chapter 7) as well as implementations of the oracles for Q# in our book Learn Quantum Computing with Python and Q#. You can find the code samples for the book in the repo here. In particular, the oracles look like this: namespace DeutschJozsa { open Microsoft.Quantum.Intrinsic; ...


1

An oracle $U_f$ is actually $\mathrm{X}$ gate (or a negation). The circuit implementing the oracle is following Qubit $q_0$ is input and qubit $q_{1}$ is output. Firstly $\mathrm{X}$ is applied on $q_{0}$. This negate the qubit, however, we want to have an output on $q_1$. Therefore, we apply $\mathrm{CNOT}$ which in this setting "copy" the $q_{0}$ to ...


2

Maybe this paper can help you, that's what the implementation in Qiskit is based on. Otherwise looking at the implementation of Shor's algorithm in Qiskit itself might be insightful. The circuit for the algorithm is constructed in the method construct_circuit and can be visualized with this snippet. from qiskit.aqua.algorithms import Shor a, N = 2, 3 ...


1

One thing that I noticed. If cu3 gate from $q[2]$ to $q[0]$ is some $U$, then the cu3 from $q[2]$ to $q[0]$ should be $U^2$ in the phase estimation algorithm, but the comparisons of operators with the help of numpy.array showed me that it's not true here. I tried to implement by replacing cu3 part of the QASM code with the following: cu3(1.6, -1.12, 2.03) q[...


-1

The QFT is wrong, you can check it. And I have a question, what are the matrix parameters in the controlled unitary in the figure 4(in the article) quantum circuit implementation for the 4×4 matrix?


2

According to the openqasm spec the include statement will insert the contents of the files with the name relative to the current working directory: https://github.com/Qiskit/openqasm/blob/master/spec/qasm2.rst#language If you're using qiskit-terra as your parser this should work unless you name the local file "qelib1.inc". The parser included in the qiskit-...


2

A brute force solution :). You can also obtain CCH via qiskit's basic gates with help of get_controlled_circuit method. from qiskit import * from qiskit.aqua.utils.controlled_circuit import get_controlled_circuit q_reg = QuantumRegister(3, 'q') qc_h = QuantumCircuit(q_reg) qc_ch = QuantumCircuit(q_reg) qc_cch = QuantumCircuit(q_reg) qc_h.h(q_reg[0]) ...


2

According to comment provided by user gIS, there was no progress in implementing qRAM as proposed in the paper. However, some additional information on qRAM physical implementation can be found on this forum here.


2

Summarization based on discussion with user met927: Transpiled circuit form depends on used backend - it is different for simulator and real quantum processor: On simulator, the $\mathrm{CH}$ gate is transpiled to the circuit shown above On real quantum processor, the gate is implemented with two $\mathrm{U2}$ gates and $\mathrm{CNOT}$ (i.e. like in the ...


4

Assuming you've got Toffoli and single-qubit rotations, you can implement the following: This basically works because if either of the controls is not $|1\rangle$, the Toffoli does nothing and the two single-qubit unitaries cancel each other. Whereas, if both controls are $|1\rangle$, then the net gate on the target qubit is $$ (\cos\frac{\pi}{8}I+i\sin\...


1

So Qiskit (qiskit.org) already does everything you are looking for. If you need to access the API directly then the IBMQ account connector (https://github.com/Qiskit/qiskit-ibmq-provider) is a good starting point in lieu of formal documentation.


0

You should put measurement after all quantum gates. According to the theory, there is no difference whether gates (in this case CNOTs) are controlled by qubits or classical bits. I encountered the same problem, see solution here.


1

The error is caused by appending gates onto qubits following a measurement. On qubit 1 and qubit 0, you attach a cx gate after a measurementhas already been placed. This will compile on the simulator, but it is not something that is supported on the real hardware.


12

Thanks for pointing this out! It turns out that this device was mis-calibrated in a way that was leading to that behavior. We just fixed the calibrations, so the problem should be gone now. I apologize for the trouble, and we will try to update our routine calibrations to detect and prevent this problem from coming up in the future :-).


6

This was a readout crosstalk error that has now been resolved.


3

Your expectation here is correct. c[0] should be 0 (well, modulo some small readout errors). The difference between backends is just due to a software bug on some of them. This will get fixed, thanks for reporting. As an aside, it is important to note that on current IBM devices, there is a constraint that all measurements are done simultaneously. So both ...


Top 50 recent answers are included