The 2024 Developer Survey results are live! See the results

# Tag Info

### What is the name of the algorithm used in the qc.unitary API?

The unitary method in Qiskit does not necessarily use CCD. This implementation in Qiskit is made taking parts of algorithms such as Solovay-Kitaev algorithm for approximate synthesis, KAK ...

### What is the name of the algorithm used in the qc.unitary API?

The algorithm which is used in qc.unitary decomposition is the Quantum Shannon Decomposition (QSD) based on [1]. This algorithm yields circuits with about half the ...
1 vote
Accepted

### eigenstate is missing in the solution of vqe.compute_minimum_eigenvalue API in qiskit==1.0

If you think about it, it doesn't really make sense to give the eigenvector back: the whole point of VQE is that the vectors are too large to directly be dealt with. However, if you want to build it, ...
• 7,152
Accepted

### Getting negative probabilities in the count result

Here's an explanation on negative values you mentioned. Closest probability distribution The results of M3 mitigation are quasi-probabilities that nominally contain small negative values. This is ...
Accepted

Thank you @Egretta.Thula for answering my question. Here I give my code to solve this problem. I hope it will help someone who meet the same problem. ''' ...
Accepted

### Substitute for QuantumInstance in latest qiskit==1.0

I strongly encourage you to read the Qiskit 1.0 migration guide, in which you can find most of the info you need to update your code. I'll give you that the Aer and Algorithms docs are not very ...
• 7,152
1 vote
Accepted

### qiskit.providers.basic_provider.exceptions.BasicProviderError: 'basic_simulator encountered unrecognized operation "ucry"'

Qiskit (and also Aer if I'm not mistaken) requires you to transpile your circuit before passing it to a backend. This can now be done using the pass manager like so: ...
• 7,152
1 vote
Accepted

### AttributeError: Options field max_parallel_threads is not valid for this backend

As mentioned in the comments, if your goal is to efficiently simulate a quantum computation, then you should use qiskit-aer, rather than ...
• 7,152
Accepted

### qiskit.exceptions.QiskitError: 'Invalid input data for Pauli.'

You can construct a SparsePauliOp from an array using from_operator method as follows: ...
• 11.3k
1 vote

### qiskit.exceptions.QiskitError: 'Invalid input data for Pauli.'

The Hamiltonian should be an iterable collection of tuples of Pauli's strings and the coefficients, like H= [('II', 2),('XX',3),('XZ',9)] for the Hamiltonian 2II + 3XX + 9XZ. To get the coefficients ...
• 181
1 vote
Accepted

You can use save_statevector() to save a statevector. Here's a related post here ...
Accepted

### AttributeError: 'QuantumCircuit' object has no attribute 'ucry'. Did you mean: 'cry'?

The methods ucrx(), ucry(), and ucrz() have been removed from ...
• 11.3k

### Solving Poisson's equation with Quantum Fourier Transform

Actually it depends on the boundary conditions of the problem. QFT is relevant for periodic boundary conditions (it will diagonialized the discretized laplacian matrix). In other types of boundary ...
• 119
1 vote

### Solving mathematical physics equations with Quantum Fourier Transform

Actually it depends on the boundary conditions of the problem. QFT is relevant for periodic boundary conditions (it will diagonialized the discretized laplacian matrix). In other types of boundary ...
• 119

### issues with running code on IBM QPU

You can run from Classiq on IBM hardwares easily and it takes care of the execution process for you. ...

By default, DraperQFTAdder performs addition modulo $2^n$ where $n$ is the number of state qubits (in your case $n = 3$.) It stores the summation in the qubits used ...
• 11.3k
Accepted

### ModuleNotFoundError: No module named 'qiskit_algorithms'

The algorithms were moved out of qiskit into their own separate repository, and their use deprecated from qiskit and removed in 1.0 release. There is a migration ...
• 1,563
1 vote

You're trying to build an oracle, which appears in Deustch-Jorza and Simon's Algorithm. Am I right? I'm not sure whether any linear function can be expressed in quantum circuit. But bijective ...
Accepted

### What exacly is passManager and passes in qiskit?

passManager allows us to manage and schedule the execution of transpiler passes on quantum circuits. Transpiler passes are transformations or optimizations applied ...
• 2,989

### Computing expectation of a SparsePauliOp using StateVector

You can use Statevector.expectation_value() method as follows: ...
• 11.3k
1 vote

### How to implement Pauli Twirling error mitigation technique in qiskit?

Pauli twirling is one of error mitigation techniques supported by Qiskit runtime. You can use it with Qiskit primitives as follows: ...
• 11.3k
Accepted

### generate_preset_pass_manager and Sampler API usage in IBM-Qiskit

As far as I can tell, your code is the correct way to run a Qiskit >= 1.0 program. The philosophy Qiskit wants to enforce is that of Qiskit patterns: So, this part of your code corresponds to the ...
• 7,152
1 vote
Accepted

### How to save and retrieve results of m3_mitigator.cals_from_system API

First, run h/w calibration then save it to a file. ...

### Transpiling qiskit quantum circuits on IonQ Native Gates

When benchmarking IonQ's devices I ran into the same problem. According to their website they are doing a pre-optimisation and a post-processing step by default. The pre-optimisation is a black-box ...
• 21

### How do you import the name ‘Aer’ from qiskit?

Qiskit Aer is now a separate package. You need to first install it by, for example, running on a notebook cell: !pip install qiskit-aer Then you can import ...
• 952
1 vote
Accepted

### Unitary Transformation for QFT with 2 base states is giving the columns in the wrong order

This is a common issue with Qiskit. Qiskit uses little endian encoding by default, that is, it considers the left most bit as the least significant bit, where as people usually subconsciously default ...
• 585
1 vote

### Expressibility and Entanglement Capability of the Parameterized Quantum Circuits

Use StateVector class to get the state vector. Then convert the Statevector into array to do matrix operations. ...
• 11

### How to use Zero Noise Extrapolation (ZNE) with qiskit circuit?

The main confusion seems to lie in the application of ZNE to expectation values rather than to single shot measurements. Let $O$ be an observable and $\langle O \rangle$ an expectation value on some ...
1 vote

### How to calculate Quantum Discord for two qubit system using Qutip?

I'm surprised this hasn't been answered. QuTip does appear to have the components for computing discord already in place in terms of the mutual and conditional entropies. But, the conditional entropy ...