It's not a bug, if you don't give concrete names to the registers then Qiskit will number them increasingly. If you want them to have the same name, you can do that like
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
qr = QuantumRegister(2, 'q')
cr = ClassicalRegister(2, 'c')
circuit = QuantumCircuit(qr, cr)
Here is a circuit that can create the desired state (similar ideas were discussed in this answer), if all mentioned measurements yield $|0\rangle$ state:
or in a more compact form (the circuits are constructed via quirk). The first three qubits are ancillary qubits and the rest are the qubits where $|0_L\rangle$ will be created if after the measurements all ...
Yes, if we have fixed backend, number of qubits, and noise model (e.g., Basic device noise model in https://qiskit.org/documentation/stubs/qiskit.providers.aer.noise.NoiseModel.html#qiskit.providers.aer.noise.NoiseModel), we would have a fixed calibration matrix. I think the advantage is that once we have this calibration matrix, we can use it to perform ...
I tried to run your code with the same backend as you, ibmq_ourense, and also got the same kind of bad results. Although, I also tried on other backends, first the ibmq_qasm_simulator and I got the exact expectation value, so I assume there is no bug on your code since it is right with the ideal machine. I also tried with ibmq_vigo, which has a better ...
As mentionned by Michele, with qiskit Aqua algorithms you can easily implement Grover or BV. Here below an example of BV algorithm. Note that the number of qubits is directly related to the size of the hidden number (and so the size of the Oracle).
You can easily create Oracle from a thruthtable or logical expression.
from qiskit import *
I think in this case you can split the experiments into multiple jobs. The idea is that you split measurement calibration circuits generated by complete_meas_cal into a number of batches, execute the first batch and use the corresponding results to initialize a measurement correction fitter with CompleteMeasFitter. Then you can use the CompleteMeasFitter....
Yes it is possible!
However you need to make some small changes to the circuit. In the paper An Experimental Study of Shor's Factoring Algorithm on IBM Q
They have factored 12,21 and 35 using something called the Kitaev approach. In Shor's algorithm, you perform the QFT in such a manner that the entire answer is given to you at once. However if you instead ...
I would suggest you use the code from the tutorial about quantum state tomography, adapting it to a real device of your choice. You can find the updated tutorial here
Caveat: as state tomography requires 3^n circuits, you will need probably to find a method of batch processing of these circuits if they exceed the job circuit limit of your real device. See ...
c_if must be used on an entire ClassicalRegister. However, it is still possible to use it on a single classical bit. You would need to create a ClassicalRegister of size 1, and attach that to your circuit. This would be the register that you input into the c_if call.
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
c1 = ...
The Qiskit documentation is included in the Qiskit Github repositories, so if you clone the Qiskit repositories locally, you'll have full access to the documentation offline. Alternatively, you could use something like HTTrack to download and access the documentation website offline.
The Qiskit textbook is probably the best resource for learning Qiskit. ...
"what are the advantages and disadvantages in the determination of the
calibration matrix each time that we do an experiment and mitigate its
Advantage: The noise matrix will be a more accurate description of the current noise situation. My understanding is that each day, the qubtis are cooled from 300K all the way down to about 15mK, and ...
You can also create a Statevector, that can be directly initialized as follows:
from qiskit.quantum_info import Statevector
sv = Statevector.from_label('11')
You can use sv.evolve(qc) to apply an operator/circuit to the state, where qc is the operator/circuit. sv.data gives you the numpy array, containing the actual implementation of the state.
Check this ...
@Cryoris answer is perfectly valid, but a more "Pythonic" way of doing this is with the help of the with keyword:
# Run VQE here, respect the identation.
# /!\ At this level of identation, warnings are no longer ignored....
You can add the following before running the VQE to suppress the deprecation warning
# run VQE here
That turns all the deprecation warnings off, if you want to turn them on again you can add
I don't think there is a ...
Several quantum circuit representations for common distributions are given in uncertainty models.
For generic probability distributions, you can train a quantum circuit representation using quantum generative adversarial networks. For a respective tutorial, please see here.
I believe there are several developments about this on Qiskit to make the use of Pulse easier. Try to check the PR or the issues regarding Pulse, maybe you'll find what you are looking for.
I also found an issue about a QASM 3.0, I think this will interest you! :)
I have found the solution! The problem is that each time you use the transpile function, it generates a different transpiled circuit and the order of the outcome is not necessary the same as the order of the input, so you have to use swap gates to obtain the correct one. In order to always obtain the same circuit you have to fit the seed_transpiler (as with ...