# Tag Info

### Reducing circuit initialization complexity

I think that the QuantumCircuit.initialize() method isn't always providing the most efficient state preparations. I have tried to initialize some very simple states,...
• 119

### Reducing circuit initialization complexity

Try using isometry instead of initialize: ...
• 4,888
Accepted

### Computational cost of a circuit in Qiskit

I think what you are looking for is the notion of circuit depth - which is basically the amount of steps being done by the quantum computer that runs the circuit. Some gate operations can be executed ...
• 119

### QiskitError: 'Sum of amplitudes-squared does not equal one.'

A quantum statevector must posses a norm (magnitude) of 1. This is called the normalization condition. Anyway in the code above I don't see that you have done something to any of the circuits/...
• 119

### What's the paper referenced by qiskit.compiler.transpile? My tranpile solution is wrong from the perspective of fidelity

The Qiskit transpilation process does not currently preserve the unitary equivalence, because it is oriented to real hardware that uses measurements. Here is your circuit with the only addition of <...
• 4,040
1 vote
Accepted

### Qiskit - MultiCX gate mcxgate

You circuit is correct. The result is not matched with what you expect because Qiskit uses little endian bit ordering. If you want to get the result in big endian convention, use ...
• 4,888
1 vote
Accepted

### Qiskit: how to ensure binded parameters in circuit?

Qiskit is complaining because apparently self.theta is not present in the circuit. There's two solutions to this: Ensure that ...
• 2,288
1 vote

### How can I save IBM Quantum API token to local environment?

I personally utilize python Keyring package for storing and retrieving the secrets on local OS. It leverages the OS provided security and supports mac, windows and linux os backends. This prevents the ...

### How to design a RF-SQUID qubit by Qiskit Metal?

This is a great question for the #metal Slack channel where we have active developer support You can find the Slack channel #metal in the qiskit workspace.

### Qiskit implementation for projecting a hermitian operator and finding its eigenvalues

I'm not super experienced with quantum either, but I'm not sure that what your looking for is doable with in the circuit using a matrix representation. I think if you vectorize the matrices you should ...
Accepted

### Qiskit textbook: mod 15 multiplication circuit

It turns out that this is indeed an issue and has been reported to the qiskit-textbook project on GitHub.
Accepted

### Qiskit UGate - which angles corresponds to which axes

You can find the documentation page for UGate which shows the matrix representation of the gate with different angles. https://qiskit.org/documentation/stubs/qiskit.circuit.library.UGate.html
• 402
1 vote
Accepted

### Qiskit textbook: Shor's algorithm

I believe you're correct and this is an inconsistency in the textbook. Since they initialize the state backwards but also do the modular multiplication backwards (as you also pointed out), it seems ...
1 vote

### Qiskit - MissingOptionalLibraryError pdflatex library is required to use LaTeX circuit drawing

It seems the executable pdflatex is not in path. You might need to restart your Windows or extend the PATH variable with the <...
• 4,040
1 vote

### Long execution time to create controlled version of custom unitary gate in Qiskit

I have the same problem although I just use a one-qubit unitary! I attempted to implement a multiple qubit unitary myself with Gray codes and two-level matrices(acting on one qubit) as explained in ...
1 vote
Accepted

### Qiskit - CircuitError Index 1 out of range for size 1

You are applying X to two qubits, [0,1]. However, your circuit has only one. You can change your code to: ...
• 4,040
Accepted

### CCCRY gate creation

Here is how to create and append $CCCRY(\theta)$: ...
• 4,040

### Qiskit Runtime: What are the units of job.result().time_taken? Seconds, milli-seconds, micro-seconds?

As @3yakuya has said, this is missing from the documentation. The best I could find is a Qiskit tutorial (version 0.37.1) which uses the parameter. According to this tutorial (see the 3rd code cell), ...
• 174
1 vote

### How well different featuremap encode the data？

Maybe this article can help you: 'Automatic design of quantum feature maps', Sergio Altares-López, Angela Ribeiro and Juan José García-Ripoll, 19 August 2021 - https://doi.org/10.1088/2058-9565/ac1ab1....
• 11

### Which protocol does the Qiskit textbook use for Quantum Key Distribution?

Looking into it, there are two main categories for implementations of Quantum Key Distribution. One of them is the protocol where you prepare and measure random quantum bits, and the other protocol ...
• 409
Accepted

### What makes oracle algorithms difficult to design and implement?

From my experience in building oracles, this question is answered by the following statement: The complexity of constructing a specific quantum oracle is inversely proportional to the amount of ...
• 4,542
Accepted

### Ansatz printing in Qiskit draws a single block

You can break all the blocks in a circuit in smaller blocks by using the decompose method. ...
• 4,040
1 vote
Accepted

• 14.3k
1 vote

### Using machine learning to determine a good initial mapping for a quantum circuit

There are some serious issues in the choice of model architecture that will make learning almost impossible. Below I'll comment on why this specific architecture and implementation is not going to ...
• 4,867
1 vote
Accepted

### Rigetti "Timeout on client tcp://127.0.0.1:5555, method name quil_to_native_quil" error

It seems indeed related with the size of circuit. If I interpret qiskit_rigetti.RigettiQCSProvider documentation correctly, you should be able to extend the timeout ...
• 4,040
1 vote
Accepted

### Append a controlled Initialize in Qiskit

The way to append gate instances to a QuantumCircuit is with the append method. ...
• 4,040
1 vote

• 47.5k
1 vote
Accepted

### Can you find how many one qubit and 2 qubit gates are in a circuit in Qiskit?

The easiest way to find the number of gates is to use QuantumCircuit.count_ops() which will return a dictionary with the name of the operations present in the ...
• 1,247
1 vote
Accepted

### how to go from matrix to tableau to circuit in qiskit or stim

How would I generate a corresponding tableau? You can create an empty stim.PauliString of the right size and then use indexing to set its entries (...
• 23.1k
1 vote
Accepted

### Why is HF Initial point seems to be better than MP2 initial point in qiskit?

The reason that you are not observing the expected MP2 energy after that first energy evaluation is due to the fact that you are combining it with the unitary coupled cluster ansatz. Compared to the ...
• 126
1 vote

### What's wrong with this simplified Bell experiment?

One issue could be that you are not taking very many samples. You have 1000 random circuits, but you seem to only simulate one shot from each of them. Since there are 9 possible settings, this means ...
• 655

Top 50 recent answers are included