Hot answers tagged

5

Try replacing the last three lines of the code you posted with IBMQ.load_account() backend = IBMQ.get_provider(hub='ibm-q').get_backend('ibmq_16_melbourne') new_circ_lv0 = transpile(qc, backend=backend, optimization_level=0) plot_circuit_layout(new_circ_lv0, backend) and add the necessary import statements (plot_circuit_layout is in qiskit.visualization). ...


5

Readout error: do a bunch (1000's) of experiments preparing the qubit in either the 0 state or the 1 state and then immediately measuring the qubit state after each preparation. Two types of readout errors can occur: prepared 1 --> measured 0, and prepared 0 --> measured 1. The reported readout error is the average of the rate of those two errors (e.g. if ...


4

There is no specific paper for this, though information on the model can be found in the Qiskit Aer API documentation and is based on the research of IBMQ quantum computing group. As examples you can read some of the following papers for more information about errors in IBMQ devices: arXiv:1410.6419 -- The Methods section at the end has a summary of gate ...


4

You can draw the circuit using construct_circuit().draw(). In the tutorial you are talking about, if you scroll down to the 4x4 randomly generated section that uses params5 you can run print(hhl.construct_circuit()), after the line hhl = HHL.init_params(params5, algo_input). This may take a little while to complete but it should eventually print out ASCII ...


4

Your circuit does not measure $q_2$ qubit after teleportation; I guess that is why teleportation of $|1\rangle$ qubit is shown incorrectly.


4

Hadamard Gates together with Quantum Bloom Filters and a Verifiable Random Functions can prove to be a simple but elegant implementation of Quantum Algorithmic Randomness. This technique can be seen as a way to reduce the dimensionality of high-dimensional data; high-dimensional input items can be reduced to low-dimensional versions while preserving ...


3

This can be done by passing a style to the drawer, setting the cregbundle to be False as the default is True. For example, given the circuit qc we can draw all the classical registers as follows : qc.draw(output='mpl', filename='no_bundle.png', style={'cregbundle': False}) However, it is worth noting that only the mpl drawer supports setting things using a ...


3

I still run into this issue too. If you consider $|q0\rangle$ to be the most significant bit (MSB) you have to map it to the most significant classical bit as well, which is in your case a bit no. 2. Or you can flip your quatnum circuit upside down and then $|q0\rangle$ become the least significant bit (LSB) and the measurement will meet your expectation. A ...


3

I tried to implement your transformation on IBM Q. Here is the result: Input is $|00\rangle$ in this case. You can set input values by application of $X$ gates on q-bits $|q0\rangle$ and $|q1\rangle$. Please note that this circuit run on a simulator only as reset gate has not been implemented on real IBM Q quantum hardware. But it is possible to simply ...


2

You can found some interesting approaches to decomposing gates also here: https://arxiv.org/abs/quant-ph/9503016 (Elementary gates for quantum computation).


2

I found paper Quantum Circuits for Isometries to be a useful reference on the topic. It describes several methods for decomposing multi-qubit unitaries into CNOT gates and qubit unitaries and also gives several references to earlier related works. There is also a Mathematica package that implements algorithms described in the mentioned paper. If you don't ...


2

qiskit.tools.visualization has been moved to qiskit.visualization and matplotlib_circuit_drawer has been removed. Instead of using it, try using qiskit.visualization.circuit_drawer() with the appropriate arguments. So in this case it should be qiskit.visualization.circuit_drawer(my_circuit, output='mpl', filename='my_circuit.png')


2

Properties of the DAG are simply accessed using dot notation. For example, if you would like to get all the two qubit gates you would do dag.twoQ_gates() which returns a list of the two qubit gates present in the dag. The code you have linked to is a transpiler pass. This is a method that looks over the dag to identify some property or to perform some ...


2

The credit for this answer goes to met927 in the previous post. So please upvote that answer instead of this one. met927's response answered my question. Not setting up some of the parameters to make system draw faster was my error. So thank you met927 for responding quickly and answering my question! Below is a snippet that one can run quite quickly (...


2

If you're just trying to figure out which specific versions a released version of qiskit works with we document that in the trove classifiers in the package metadata for that release, see: https://pypi.org/project/qiskit/ on the bottom left under "Programming Language". The meta-package there and all the individual elements have the same metadata in the ...


2

This is likely because the Melbourne device is currently offline for upgrades, it should be back up in around 2 weeks. If you join the Slack workspace, linked from the qiskit website and then join the #ibm-q-systems channel you can get updates about all the devices and when they will be taken offline.


2

What you are asking here is a valid question, but it does depend on what backend you are using. The CNOT gate, when implemented on real hardware, is generally only implementable in one direction betweem any two pair of qubits, especially for transmon qubits (i.e. the types of qubits IBM uses). However, simulators and emulators generally do not hold this ...


2

You can convert a qiskit circuit to QASM using circuit.qasm(). You can copy this and then there's an "Import OpenQASM" button on the initial circuit composer page: and you can paste the QASM into a tab of the composer itself:


2

You added an "s" in the final. IBMQ.load_accounts() The right way is: IBMQ.load_account() I hope I could have helped.


1

Please check you have qiskit-ibmq-provider installed. You can do this by running pip show qiskit-ibmq-provider in a terminal. If this returns a warning that it isn't installed, you can then install it using the command pip install qiskit-ibmq-provider. Then go back to your code and make sure you have the statement from qiskit import IBMQ before this line of ...


1

I believe you can implement it a similar way you implemented the pauli_error, just with different parameter input. You need to pass in a (list[matrix]): Kraus matrices. The kraus_error method is defined here. You should be able to import it from the same module you import pauli_error from: qiskit.providers.aer.noise.errors.standard_errors


1

This feature is now available using the snapshot function of Qiskit Aer. Snapshots can be added to the circuit and the values are then returned in the results object. This is an example of how you can create a circuit, add a snapshot to it and then get the result: from qiskit import * qc = QuantumCircuit(2) qc.h(0) qc.snapshot('1') # add a ...


1

You should be able to do this by simply creating an instance of the class. This can be done as follows from qiskit.validation import base raw_counts = {'0x0': 4, '0x2': 10} data = models.ExperimentResultData(counts=base.Obj(**raw_counts)) There are lot of examples of how to do this in the testing file for these classes.


1

The point of the transplier is not only to map circuits to backends, but also to optimize the circuit to reduce the number of gates it contains so that the results you receive will (hopefully) be better. This is done through a series of optimizations, provided by things called transpiler passes. There is more information about them here. A unitary in this ...


1

This issue is within the pyscf package that is required by qiskit. It says here that this error may occur with certain versions of python, and I have seen it commonly coming up with python 3.8. There are some workarounds in that link, but if you have nothing forcing you to use python 3.8, I would suggest downgrading to the next newest version before that. ...


1

There are tutorials for a lot of the Qiskit Aqua functions kept in the tutorials repository, and I think this talks about the finance problem you are interested in. All of these tutorials are also available on the IBM Q Experience where you can run them in a browser.


1

To give you an example, at the last Qiskit Camp I was part of a team that implemented some Groverian Iterations in an Algorithm which as an input took positions on a complete graph. The repository is here. So if we want to encode for example two walkers on the graph below, since it has 4 vertices we require 2 qubits to encode the position of each walker. ...


1

It would be helpful to get a code sample, but from how you've phrased the question, the circuit assumes that the register is originally initialized to the ${|00..0\rangle }$ state. You'll need to initialize the register into the uniform superposition of all states, and then your Grover's algorithm should work. *full disclosure - it would be super helpful to ...


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