New answers tagged

0

You're qiskit information shows 'qiskit': None. This should be 0.11 or smaller. Furthermore qiskit-ibmq-provider : 0.2.2 should be 0.3 for the latest version.


1

The devices are imperfect and also are periodically recalibrated. Any textual examples characterizing decoherence will probably never match exactly what you encounter in running the same code live.


1

It might be worth mentioning the physical motivation for these definitions and the concept of fidelity itself. Unlike the classical computers we all know and love, quantum computers are fundamentally analog machines. what that means practically is that the gates you apply when you run code on a real quantum computer are going to be parameterized by a real ...


0

You may want to try this tutorial: https://github.com/Qiskit/qiskit-tutorials/blob/master/qiskit/ignis/relaxation_and_decoherence.ipynb


1

For pure states is the square of the overlap $|\langle \psi_1 | \psi_2 \rangle |^2$, for mixed state is the evaluation of the density matrix $\langle \psi_1 | \rho_1 |\psi_1 \rangle$


1

This is occurring because you declare your definition rule on two registers, but the way nodes are added to the DAG, only one register will be added. It is defined over both the QuantumRegister "q" you define in the method, and also the register passed in to self.params. To fix this therefore you need to update your definition to work on only one register. ...


2

You can't edit using python in the circuit composer. You can edit the OpenQASM which can be found on the left-hand side of the composer. If you would like to use Qiskit, this is also available through the Q Experience, you need to click on the Jupyter Notebooks. Here you can create circuits of your own, or modify the given examples.


2

AHusain's answer is absolutely correct, but perhaps lacks some detail. The circuit that you want to implement is Basically, the key is to realise that you want to apply phase $e^{i\alpha}$ to the basis elements $|00\rangle$ and $|11\rangle$, and $e^{-i\alpha}$ otherwise. In other words, you care about the parity of the two bits. If you can compute that ...


0

You dont have to reset classical registers they store the current measurment result of the quantum bits. I.e. the value of the classical register is not the matter what it matter is that the value they hold after the measurment.


0

Conjugate by a CNOT, you'll see a controlled unitary of multiplying by $e^{\pm 2i a}$ depending on which CNOT you do and an overall phase of $e^{\mp i a}$.


0

I guess what you may need is the Pauli's operators https://qiskit.org/documentation/autodoc/qiskit.quantum_info.operators.pauli.html?highlight=pauli%20operator#module-qiskit.quantum_info.operators.pauli https://www.sciencedirect.com/topics/engineering/pauli-operator B.R Parfait


0

I find two answers: (code tested and working) Answer (1) (read the register value before the execute command) from qiskit import * qiskit.IBMQ.disable_accounts() IBMQ.enable_account('change to your api','change to your url') #backend = qiskit.IBMQ.get_backend('ibmq_16_melbourne') backend = qiskit.IBMQ.get_backend('ibmq_qasm_simulator') qr = ...


0

The c_if in Qiskit only operates on a full classical register, following the OpenQASM spec. If you would like to condition on individual bits, you have to create a new ClassicalRegister for each bit. Then you can condition on each bit separately.


1

Answering based off of the extra clarity from your comments: Wanting to calculate the decimal value of all cr as opposed to the binary This can be done by using the Python built in function int(). This function will return the integer value of the input in base 10 (decimal). So you can retrieve the counts from the job by calling job.result().get_counts(<...


3

Simply it is the distance (similarity measure) between two quantum states, for example the fidelity between $|0\rangle$ and $|1\rangle$ is less than the fidelity between $|0\rangle$ and $\frac{1}{\sqrt{2}}\big(|0\rangle + |1\rangle\big)$. or you can say it is the cosine of the smallest angle between two states, also called the cosine similarity


0

if you want to excute the whole quantum algorithm again and again bases on the previous result then use while loop.


0

First you will need a IBM Q experience account if you do not have one. Using the token listed under your profile you will import the IBMQ package, save your account, and execute the program on an available backend. from qiskit import IBMQ IBMQ.save_account('MY_TOKEN', 'URL') IBMQ.load_accounts(hub=None) #Run everytime to load your account info saved locally ...


3

A density matrix $\rho$ on two qubits has 16 complex amplitudes (although not all are free variables due to constraints from normalization and Hermeticity), so the City plot is showing those amplitudes as well. The $|00\rangle\langle 11|$ and $|11\rangle\langle 00|$ amplitudes shown are not going to directly impact your measurement if you were to measure in ...


3

There is a way, though it is pretty hacky. Going off of the code you provided: qc.initialize(desired_vector, [q[0],q[1]]).gates_to_uncompute().draw() qc.decompose().decompose().decompose().decompose().draw() The first line will provide gates that uncompute intialize. However it will only show up as Multiplex gates. The second line is what decomposes the ...


2

Yes, compile is deprecated in favor of transpile and assemble. For your code, using these two new functions would look something like this: # Add to your import statements from qiskit.compiler import transpile, assemble # After creating qc_list backend = Aer.get_backend('qasm_simulator') transpiled_circs = transpile(qc_list, backend=backend) qobjs = ...


3

The Q-Object not valid error you received is caused by the amount of shots you set. The max shots allowed is 8192. Since the amount of shots you set (16384) is greater than the max amount of shots allowed, you get that error. The TranspilerError is caused by the second format for layout. When I tested your code with the second layout, I received this error ...


0

You are correct that IBMQuantumExperience is a deprecated library. Anything you wanted to use IBMQuantumExperience to do you can now do through qiskit-ibmq-provider. To answer your main question, the credit system is being removed in the future, so there is currently no way to check your remaining credits. The feature used to be in the old IBM Q Experience ...


1

When you measure, you choose a bit where the result should go. If you measure to the same bit multiple times, then the results of all but the last will not be recorded. To get the results you want, you'll need to declare more bits. For example, you could use a couple of two-bit classical registers: one for the first pair of bits, and the other for the ...


2

Unfortunately this is not currently possible on the IBM devices. What you should really do is only have four classical channels and send your first two measurements to the first two classical channels, and the second two measurements to the second two classical channels. You then only execute the circuit once. However, you can try this and it still won't ...


1

Quantum algorithms provide a computational speedup by orchestrating constructive and destructive interference of the amplitudes. It is as if there must be a "minus" sign somewhere in the matrices - otherwise we merely work in the classical world, and would not see a computational speedup. Let's consider the following gates as controlled Pauli matrices: \...


1

The file editor only uploads, downloads and displays .ipynb files. However, you can create additional files using notebooks. To see that they are there, you can use the sys package. You won't be able to import from local .py files, but you can open them as a text file and do something like eval their contents as a workaround.


0

With the information you provided in your question, I recommand you to try to reinstall qiskit from scratch. To do so, just execute python -m pip install -U qiskit I tried to execute your import statements after running this line, and it worked. If you do not use the default python, replace python with the python executable you are using (e.g. python3). ...


0

It appears that you are asking for details about the following circuit from the paper of Cherkas and Chivilikhin, that they describe as implementing the addition of two $2$-bit numbers. Although they don't say it, I believe this is (mod 4). The first application of $R_1$ is controlled on the basis of $a_1$, the second $R_2$ is controlled on the basis of $...


0

Quite simply: it's on the to-do list. Here is a sneak peak of how it will be done.


4

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


1

Simply implement the gate $$ \left(\begin{array}{cc} 1 & 0 \\ 0 & e^{i\theta} \end{array}\right) $$ on the control qubit.


2

The 403 error is a http error - Forbidden. It's comming from the server that is giving you access to the quantum computer, not from the quantum computer its self. If you are using IBM Q Experience you shuld check out the FAQ page. Regarding to credits it states: A User has a maximum of 15 credits, and these credits are replenished upon the greater of 24 ...


Top 50 recent answers are included